import inspect


def is_rest_api_method(obj):
    """Determines if function or method object is an HTTP method handler object"""
    return (inspect.isfunction(obj) or inspect.ismethod(obj)) and \
            obj.__name__ in ('get', 'post', 'put', 'delete', 'patch')