def METHOD_NAME(tup):
    # A helper function that takes a tuple of inputs and returns their result
    # dtype. Used for poly functions.
    res_dtype = np.float64
    for item in tup:
        if isinstance(item, types.Number):
            s1 = str(as_dtype(item))
        elif isinstance(item, types.Tuple):
            t = [as_dtype(ty) for ty in item.types]
            s1 = str(np.result_type(*t))
        else:
            s1 = str(item.dtype)
        res_dtype = (np.result_type(res_dtype, s1))
    return from_dtype(res_dtype)