def METHOD_NAME(self, operator, *args):
    """Helper method to lookup a function type given the operator and types of arguments."""
    if args:
        func_types_list = self.functions[operator]
        for func_type in func_types_list:
            if len(args) != len(func_type.__args__) - 1:
                continue
            if self.type_constraints.can_unify(
                Callable[list(func_type.__args__[:-1]), Any], Callable[list(args), Any]
            ):
                return func_type
        raise KeyError