def _resolve_funcitem_from_decorator(dec: nodes.OverloadPart) -> Optional[nodes.FuncItem]:
    "Returns a FuncItem that corresponds to the output of the decorator.\n\n    Returns None if we can't figure out what that would be. For convenience, this function also\n    accepts FuncItems.\n\n    "
    if isinstance(dec, nodes.FuncItem):
        return dec
    if dec.func.is_property:
        return None

    def apply_decorator_to_funcitem(decorator: nodes.Expression, func: nodes.FuncItem) -> Optional[nodes.FuncItem]:
        if (not isinstance(decorator, nodes.RefExpr)):
            return None
        if (decorator.fullname is None):
            return None
        if (decorator.fullname in ('builtins.staticmethod', 'typing.overload', 'abc.abstractmethod')):
            return func
        if (decorator.fullname == 'builtins.classmethod'):
            assert (func.arguments[0].variable.name in ('cls', 'metacls'))
            ret = copy.copy(func)
            ret.arguments = ret.arguments[1:]
            return ret
        return None
    func = dec.func
    for decorator in dec.original_decorators:
        resulting_func = apply_decorator_to_funcitem(decorator, func)
        if (resulting_func is None):
            return None
        func = resulting_func
    return func
Returns a FuncItem that corresponds to the output of the decorator.

Returns None if we can't figure out what that would be. For convenience, this function also
accepts FuncItems.
def _resolve_funcitem_from_decorator(dec: nodes.OverloadPart) -> Optional[nodes.FuncItem]:
    "Returns a FuncItem that corresponds to the output of the decorator.\n\n    Returns None if we can't figure out what that would be. For convenience, this function also\n    accepts FuncItems.\n\n    "
    if isinstance(dec, nodes.FuncItem):
        return dec
    if dec.func.is_property:
        return None

    def apply_decorator_to_funcitem(decorator: nodes.Expression, func: nodes.FuncItem) -> Optional[nodes.FuncItem]:
        if (not isinstance(decorator, nodes.RefExpr)):
            return None
        if (decorator.fullname is None):
            return None
        if (decorator.fullname in ('builtins.staticmethod', 'typing.overload', 'abc.abstractmethod')):
            return func
        if (decorator.fullname == 'builtins.classmethod'):
            assert (func.arguments[0].variable.name in ('cls', 'metacls'))
            ret = copy.copy(func)
            ret.arguments = ret.arguments[1:]
            return ret
        return None
    func = dec.func
    for decorator in dec.original_decorators:
        resulting_func = apply_decorator_to_funcitem(decorator, func)
        if (resulting_func is None):
            return None
        func = resulting_func
    return func