'Resolve function type *func* for argument types *args* and *kws*.
A signature is returned.'

def resolve_function_type(self, func, args, kws):

    if (func not in self._functions):
        functy = self._lookup_global(func)
        if (functy is not None):
            func = functy
    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):
        func_type = self.resolve_getattr(func, '__call__')
        if (func_type is not None):
            return self.resolve_function_type(func_type, args, kws)
    if isinstance(func, types.Callable):
        return func.get_call_type(self, args, kws)
