#NEWLINE# def IndexInto( li , indices ) : #NEWLINE# #INDENT# ' Index into a list (or list of lists) using the indices given. If the\n  indices are out of bounds, or are too many in number, return None, instead\n  of throwing an error. 0 is a special case.' #NEWLINE# for i in i : #NEWLINE# #INDENT# if ( ( type ( li ) != list ) and ( i == 0 ) ) : #NEWLINE# #INDENT# return li #NEWLINE# #UNINDENT# if ( ( type ( li ) != list ) or ( i >= len ( li ) ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# li = li [ i ] #NEWLINE# #UNINDENT# return li