def resolve_function_type(self, func, args, kws):
        """
        Resolve function type *func* for argument types *args* and *kws*.
        A signature is returned.
        """
        if func not in self._functions:
            # It's not a known function type, perhaps it's a global?
            try:
                func = self._lookup_global(func)
            except __HOLE__:
                pass
        if func in self._functions:
            defns = self._functions[func]
            for defn in defns:
                res = defn.apply(args, kws)
                if res is not None:
                    return res

        if isinstance(func, types.Type):
            # If it's a type, it may support a __call__ method
            func_type = self.resolve_getattr(func, "__call__")
            if func_type is not None:
                # The function has a __call__ method, type its call.
                return self.resolve_function_type(func_type, args, kws)

        if isinstance(func, types.Callable):
            # XXX fold this into the __call__ attribute logic?
            return func.get_call_type(self, args, kws)
dataset/ETHPy150Open numba/numba/numba/typing/context.py/BaseContext.resolve_function_type