def get_name(obj, attribs=('__name__', 'func_name')):
    """Try to get the name of an function or a class.

    :param obj:
    :return:
    """
    for a in attribs:
        if hasattr(obj, a):
            return getattr(obj, a)
