def call(self, obj, name, method, args, kwargs):
        """Trigger a method along with its beforebacks and afterbacks.

        Parameters
        ----------
        name: str
            The name of the method that will be called
        args: tuple
            The arguments that will be passed to the base method
        kwargs: dict
            The keyword args that will be passed to the base method
        """
        if name in self._callback_registry:
            beforebacks, afterbacks = zip(*self._callback_registry.get(name, []))

            hold = []
            for b in beforebacks:
                if b is not None:
                    call = Data(name=name, kwargs=kwargs.copy(), args=args)
                    v = b(obj, call)
                else:
                    v = None
                hold.append(v)

            out = method(*args, **kwargs)

            for a, bval in zip(afterbacks, hold):
                if a is not None:
                    a(obj, Data(before=bval, name=name, value=out))
                elif callable(bval):
                    # the beforeback's return value was an
                    # afterback that expects to be called
                    bval(out)
            return out
        else:
            return method(*args, **kwargs)
def call ( self , obj , name , method , args , kwargs ) : if name in self . _callback_registry : beforebacks , afterbacks = zip ( * self . _callback_registry . get ( name , [ ] ) ) hold = [ ] for b in beforebacks : if b is not None : call = Data ( name = name , kwargs = kwargs . copy ( ) , args = args ) v = b ( obj , call ) else : v = None hold . append ( v ) out = method ( * args , ** kwargs ) for a , bval in zip ( afterbacks , hold ) : if a is not None : a ( obj , Data ( before = bval , name = name , value = out ) ) elif callable ( bval ) : bval ( out ) return out else : return method ( * args , ** kwargs )
Trigger a method along with its beforebacks and afterbacks.

        Parameters
        ----------
        name: str
            The name of the method that will be called
        args: tuple
            The arguments that will be passed to the base method
        kwargs: dict
            The keyword args that will be passed to the base method