@staticmethod
def from_funcitem(stub: nodes.FuncItem) -> 'Signature[nodes.Argument]':
    stub_sig = Signature()
    stub_args = maybe_strip_cls(stub.name, stub.arguments)
    for stub_arg in stub_args:
        if (stub_arg.kind in (nodes.ARG_POS, nodes.ARG_OPT)):
            stub_sig.pos.append(stub_arg)
        elif (stub_arg.kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT)):
            stub_sig.kwonly[stub_arg.variable.name] = stub_arg
        elif (stub_arg.kind == nodes.ARG_STAR):
            stub_sig.varpos = stub_arg
        elif (stub_arg.kind == nodes.ARG_STAR2):
            stub_sig.varkw = stub_arg
        else:
            raise AssertionError
    return stub_sig
@staticmethod
def from_funcitem(stub: nodes.FuncItem) -> 'Signature[nodes.Argument]':
    stub_sig = Signature()
    stub_args = maybe_strip_cls(stub.name, stub.arguments)
    for stub_arg in stub_args:
        if (stub_arg.kind in (nodes.ARG_POS, nodes.ARG_OPT)):
            stub_sig.pos.append(stub_arg)
        elif (stub_arg.kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT)):
            stub_sig.kwonly[stub_arg.variable.name] = stub_arg
        elif (stub_arg.kind == nodes.ARG_STAR):
            stub_sig.varpos = stub_arg
        elif (stub_arg.kind == nodes.ARG_STAR2):
            stub_sig.varkw = stub_arg
        else:
            raise AssertionError
    return stub_sig