#NEWLINE# def indexable( * iterables ) : #NEWLINE# #INDENT# 'Make arrays indexable for cross-validation.\n\n    Checks consistent length, passes through None, and ensures that everything\n    can be indexed by converting sparse matrices to csr and converting\n    non-interable objects to arrays.\n\n    Parameters\n    ----------\n    *iterables : lists, dataframes, arrays, sparse matrices\n        List of objects to ensure sliceability.\n    ' #NEWLINE# result = [ ] #NEWLINE# for X in iterables : #NEWLINE# #INDENT# if sp . issparse ( X ) : #NEWLINE# #INDENT# result . append ( X . tocsr ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hasattr ( X , '__getitem__' ) or hasattr ( X , 'iloc' ) ) : #NEWLINE# #INDENT# result . append ( X ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( result is None ) : #NEWLINE# #INDENT# result . append ( X ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result . append ( np . array ( X ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# check_consistent_length ( * result ) #NEWLINE# return result