def name(obj):
    """Try to find some reasonable name for the object."""
    return getattr(obj, 'name', 0) or getattr(obj, '__name__', 0) or getattr(
        getattr(obj, '__class__', 0), '__name__', 0) or str(obj)
