def get_function_name(func):
    try:
        return func.im_func.func_name
    except AttributeError:
        return func.__name__
def get_function_name(func):
    try:
        return func.im_func.func_name
    except AttributeError:
        return func.__name__