def tuplify(xs):
    try:
        return tuple(tuplify(x) for x in xs)
    except TypeError:
        return xs
Turn a data structure into a tuple tree.
dataset/ETHPy150Open OP2/PyOP2/pyop2/utils.py/tuplify