def tuplize(seq):
    if isinstance(seq, (list, tuple)):
        return tuple(tuplize(i) for i in seq)
    return seq
Turn all nested sequences to tuples in given sequence.
dataset/ETHPy150Open django/django/tests/gis_tests/test_data.py/tuplize