def tosequence(x):
    if isinstance(x, np.ndarray):
        return np.asarray(x)
    elif isinstance(x, Sequence):
        return x
    else:
        return list(x)
Cast iterable x to a Sequence, avoiding a copy if possible.
dataset/ETHPy150Open trevorstephens/gplearn/gplearn/skutils/__init__.py/tosequence