def _func_name(func):
    if isinstance(func, (type, ClassType)):
        name = func.__name__
        if func.__module__ not in ('__main__', '__builtin__'):
            name = '%s.%s' % (func.__module__, name)
        return name
    name = getattr(func, 'func_name', None)
    if name is None:
        name = repr(func)
    else:
        name_self = getattr(func, 'im_self', None)
        if name_self is not None:
            name = '%r.%s' % (name_self, name)
        else:
            name_class = getattr(func, 'im_class', None)
            if name_class is not None:
                name = '%s.%s' % (name_class.__name__, name)
        module = getattr(func, 'func_globals', {}).get('__name__')
        if module and module != '__main__':
            name = '%s.%s' % (module, name)
    return name
Returns the string name of a function, or method, as best it can
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webob-1.1.1/webob/dec.py/_func_name