def _is_arraylike(x):
    return (hasattr(x, '__len__') or
            hasattr(x, 'shape') or
            hasattr(x, '__array__'))
Returns whether the input is array-like
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/utils/validation.py/_is_arraylike