def isSimpleFunction(x):
    if not isinstance(x, type(lambda:0)):
        return False, ()
    c = x.func_code.co_code
    vals = [ord(op) for op in c]
    if x.func_code.co_argcount != 1:
        return False, ()

    if not vals:
        return False, ()

    if vals[0] != LOAD_FAST:
        return False, ()
    if vals[1] != 0 or vals[2] != 0:
        return False, ()
    if vals[-1] != RETURN_VALUE:
        return False, ()

    if (len(vals) - 1) % 3 != 0:
        return False, ()

    loads = (len(vals) - 1)/3
    if vals[3:-1:3] != [LOAD_ATTR] * (loads-1):
        return False, ()
    if vals[2::3] != [0] * loads:
        return False, ()

    lookups = []
    varnames = x.func_code.co_names
    lookups = [varnames[l] for l in vals[4::3]]
    return True, lookups
if a function looks like lambda self: self.a.b.c...,
dataset/ETHPy150Open ufora/ufora/ufora/util/PythonCodeUtils.py/isSimpleFunction