def visit_Call(self, node: ast.Call) -> Optional[Value]:
    func = self.visit(node.func)
    if (not isinstance(func, KnownValue)):
        return None
    if (func.val == NewType):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        args = []
        kwargs = {}
        for arg_value in arg_values:
            if isinstance(arg_value, KnownValue):
                args.append(arg_value.val)
            else:
                return None
        for (name, kwarg_value) in kwarg_values:
            if (name is None):
                if (isinstance(kwarg_value, KnownValue) and isinstance(kwarg_value.val, dict)):
                    kwargs.update(kwarg_value.val)
                else:
                    return None
            elif isinstance(kwarg_value, KnownValue):
                kwargs[name] = kwarg_value.val
            else:
                return None
        return KnownValue(func.val(*args, **kwargs))
    elif (func.val == TypeVar):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        if (not arg_values):
            self.ctx.show_error('TypeVar() requires at least one argument', node=node)
            return None
        name_val = arg_values[0]
        if (not isinstance(name_val, KnownValue)):
            self.ctx.show_error('TypeVar name must be a literal', node=node.args[0])
            return None
        constraints = []
        for arg_value in arg_values[1:]:
            constraints.append(_type_from_value(arg_value, self.ctx))
        bound = None
        for (name, kwarg_value) in kwarg_values:
            if (name in ('covariant', 'contravariant')):
                continue
            elif (name == 'bound'):
                bound = _type_from_value(kwarg_value, self.ctx)
            else:
                self.ctx.show_error(f'Unrecognized TypeVar kwarg {name}', node=node)
                return None
        tv = TypeVar(name_val.val)
        return TypeVarValue(tv, bound, tuple(constraints))
    elif is_typing_name(func.val, 'ParamSpec'):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        if (not arg_values):
            self.ctx.show_error('ParamSpec() requires at least one argument', node=node)
            return None
        name_val = arg_values[0]
        if (not isinstance(name_val, KnownValue)):
            self.ctx.show_error('ParamSpec name must be a literal', node=node.args[0])
            return None
        for (name, _) in kwarg_values:
            self.ctx.show_error(f'Unrecognized ParamSpec kwarg {name}', node=node)
            return None
        tv = ParamSpec(name_val.val)
        return TypeVarValue(tv, is_paramspec=True)
    elif isinstance(func.val, type):
        if (func.val is object):
            return AnyValue(AnySource.inference)
        return TypedValue(func.val)
    else:
        return None
def visit_Call(self, node: ast.Call) -> Optional[Value]:
    func = self.visit(node.func)
    if (not isinstance(func, KnownValue)):
        return None
    if (func.val == NewType):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        args = []
        kwargs = {}
        for arg_value in arg_values:
            if isinstance(arg_value, KnownValue):
                args.append(arg_value.val)
            else:
                return None
        for (name, kwarg_value) in kwarg_values:
            if (name is None):
                if (isinstance(kwarg_value, KnownValue) and isinstance(kwarg_value.val, dict)):
                    kwargs.update(kwarg_value.val)
                else:
                    return None
            elif isinstance(kwarg_value, KnownValue):
                kwargs[name] = kwarg_value.val
            else:
                return None
        return KnownValue(func.val(*args, **kwargs))
    elif (func.val == TypeVar):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        if (not arg_values):
            self.ctx.show_error('TypeVar() requires at least one argument', node=node)
            return None
        name_val = arg_values[0]
        if (not isinstance(name_val, KnownValue)):
            self.ctx.show_error('TypeVar name must be a literal', node=node.args[0])
            return None
        constraints = []
        for arg_value in arg_values[1:]:
            constraints.append(_type_from_value(arg_value, self.ctx))
        bound = None
        for (name, kwarg_value) in kwarg_values:
            if (name in ('covariant', 'contravariant')):
                continue
            elif (name == 'bound'):
                bound = _type_from_value(kwarg_value, self.ctx)
            else:
                self.ctx.show_error(f'Unrecognized TypeVar kwarg {name}', node=node)
                return None
        tv = TypeVar(name_val.val)
        return TypeVarValue(tv, bound, tuple(constraints))
    elif is_typing_name(func.val, 'ParamSpec'):
        arg_values = [self.visit(arg) for arg in node.args]
        kwarg_values = [(kw.arg, self.visit(kw.value)) for kw in node.keywords]
        if (not arg_values):
            self.ctx.show_error('ParamSpec() requires at least one argument', node=node)
            return None
        name_val = arg_values[0]
        if (not isinstance(name_val, KnownValue)):
            self.ctx.show_error('ParamSpec name must be a literal', node=node.args[0])
            return None
        for (name, _) in kwarg_values:
            self.ctx.show_error(f'Unrecognized ParamSpec kwarg {name}', node=node)
            return None
        tv = ParamSpec(name_val.val)
        return TypeVarValue(tv, is_paramspec=True)
    elif isinstance(func.val, type):
        if (func.val is object):
            return AnyValue(AnySource.inference)
        return TypedValue(func.val)
    else:
        return None