def METHOD_NAME(src, functor):
    return_list = isinstance(src, list)
    src = gpt.util.to_list(gpt.eval(src))
    # check for consistent otype
    assert all([src[0].otype.__name__ == obj.otype.__name__ for obj in src])
    result = functor(src)
    if return_list:
        return [[gpt.util.value_to_tensor(v, src[0].otype) for v in res] for res in result]
    return [gpt.util.value_to_tensor(v, src[0].otype) for v in result[0]]