#NEWLINE# def iterable_fancy_indexing( iterable , request ) : #NEWLINE# #INDENT# if isinstance ( iterable , numpy . ndarray ) : #NEWLINE# #INDENT# return iterable [ request ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return [ iterable [ r ] for r in request ]