def parse_signature_type_comment(type_comment):
try:<EOL><INDENT>result = ast3.parse(type_comment, '<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>except SyntaxError:<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT>assert isinstance(result, ast3.FunctionType)<EOL>if len(result.argtypes) == <NUM_LIT:1>:<EOL><INDENT>argtypes = result.argtypes[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>argtypes = result.argtypes<EOL><DEDENT>return argtypes, result.returns<EOL>
Parse the fugly signature type comment into AST nodes.

    Caveats: ASTifying **kwargs is impossible with the current grammar so we
    hack it into unary subtraction (to differentiate from Starred in vararg).

    For example from:
    "(str, int, *int, **Any) -> 'SomeReturnType'"

    To:
    ([ast3.Name, ast.Name, ast3.Name, ast.Name], ast3.Str)