def _bind_function(self, func, owner):
        if owner is None:
            return func

        if isinstance(func, types.FunctionType):
            if func.__code__.co_argcount == 0:
                return staticmethod(func).__get__(None, owner)

            if func.__code__.co_argcount == 1:
                return classmethod(func).__get__(None, owner)

            raise Exception("Node functions aren't expected to have parameters")

        if isinstance(func, (classmethod, staticmethod, MDFCallable)):
            return func.__get__(None, owner)

        if isinstance(func, (types.MethodType,
                             MDFIteratorFactory,
                             types.BuiltinFunctionType,
                             MethodWrapperType)):
            return func

        if isinstance(func, types.TypeType) and issubclass(func, MDFIterator):
            return MDFIteratorFactory(func, owner)

        raise Exception("MDFEvalNode._bind_function called with unexpected type %s" % type(func))

    # MDFEvalNode is also a descriptor and can be bound to classes
    # to produce new nodes with the target function bound to the class
Enable or disable note editing controls.
dataset/ETHPy150Open manahl/mdf/mdf/nodes.py/MDFEvalNode._bind_function--crossover with--dataset/ETHPy150Open cpbotha/nvpy/nvpy/view.py/View.set_note_editing