import inspect


def is_method(name, attr):
    """
    Return true if the given attribute is a method or property.
    """
    return any([
        inspect.isfunction(attr),
        inspect.ismethoddescriptor(attr),
    ])