def decorator(caller, _func=None):
if _func is not None:  <EOL><INDENT>return decorate(_func, caller)<EOL><DEDENT>defaultargs, defaults = '<STR_LIT>', ()<EOL>if inspect.isclass(caller):<EOL><INDENT>name = caller.__name__.lower()<EOL>doc = '<STR_LIT>''<STR_LIT>' % (caller.__name__, caller.__name__)<EOL><DEDENT>elif inspect.isfunction(caller):<EOL><INDENT>if caller.__name__ == '<STR_LIT>':<EOL><INDENT>name = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>name = caller.__name__<EOL><DEDENT>doc = caller.__doc__<EOL>nargs = caller.__code__.co_argcount<EOL>ndefs = len(caller.__defaults__ or ())<EOL>defaultargs = '<STR_LIT:U+002CU+0020>'.join(caller.__code__.co_varnames[nargs-ndefs:nargs])<EOL>if defaultargs:<EOL><INDENT>defaultargs += '<STR_LIT:U+002C>'<EOL><DEDENT>defaults = caller.__defaults__<EOL><DEDENT>else:  <EOL><INDENT>name = caller.__class__.__name__.lower()<EOL>doc = caller.__call__.__doc__<EOL><DEDENT>evaldict = dict(_call=caller, _decorate_=decorate)<EOL>dec = FunctionMaker.create(<EOL>'<STR_LIT>' % (name, defaultargs),<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % (defaultargs, defaultargs),<EOL>evaldict, doc=doc, module=caller.__module__, __wrapped__=caller)<EOL>if defaults:<EOL><INDENT>dec.__defaults__ = defaults + (None,)<EOL><DEDENT>return dec<EOL>
decorator(caller) converts a caller function into a decorator