def infer_typing_typevar_or_newtype(node, context=None):
try:<EOL><INDENT>func = next(node.func.infer(context=context))<EOL><DEDENT>except InferenceError as exc:<EOL><INDENT>raise UseInferenceDefault from exc<EOL><DEDENT>if func.qname() not in TYPING_TYPEVARS_QUALIFIED:<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>if not node.args:<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>typename = node.args[<NUM_LIT:0>].as_string().strip("<STR_LIT:'>")<EOL>node = extract_node(TYPING_TYPE_TEMPLATE.format(typename))<EOL>return node.infer(context=context)<EOL>
Infer a typing.TypeVar(...) or typing.NewType(...) call