def hasattr(attr):
    """Verifies that the object has an attribute with the given name."""
    def has_attr(value):
        return _hasattr(value, attr)

    return has_attr
Verifies that the object has an attribute with the given name.
src/livestreamer/plugin/api/validate.py