def toTupple(obj):
    """
    Converts recursively to tuple

    :param obj: numpy array, list structure, iterators, etc.
    :return: tuple representation obj.
    """
    try:
        return tuple(map(toTupple, obj))
    except TypeError:
        return obj