def set_simple_func(self, func, args=()):
        """Set the model function to use a simple but somewhat inefficient calling
        convention.

        The function should obey the following convention::

            def func(param0, param1, ..., paramN, *args):
                modeled_data = { do something using the parameters }
                return modeled_data

        Returns *self*.

        """
        code = get_function_code(func)
        npar = code.co_argcount - len(args)
        pnames = code.co_varnames[:npar]

        def wrapper(params, *args):
            return func(*(tuple(params) + args))

        return self.set_func(wrapper, pnames, args)
def set_simple_func ( self , func , args = ( ) ) : code = get_function_code ( func ) npar = code . co_argcount - len ( args ) pnames = code . co_varnames [ : npar ] def wrapper ( params , * args ) : return func ( * ( tuple ( params ) + args ) ) return self . set_func ( wrapper , pnames , args )
Set the model function to use a simple but somewhat inefficient calling
        convention.

        The function should obey the following convention::

            def func(param0, param1, ..., paramN, *args):
                modeled_data = { do something using the parameters }
                return modeled_data

        Returns *self*.