def _tosequence(X):
    if isinstance(X, Mapping):  # single sample
        return [X]
    else:
        return tosequence(X)
Turn X into a sequence or ndarray, avoiding a copy if possible.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/feature_extraction/dict_vectorizer.py/_tosequence