def _natsort_key_case_insensitive(item):
 item = str(item).lower()
 try:
  chunks = re.split('(\\d+(?:\\.\\d+)?)', item)
 except TypeError:
  chunks = re.split('(\\d+(?:\\.\\d+)?)', item[0])
 for ii in range(len(chunks)):
  if (chunks[ii] and (chunks[ii][0] in '0123456789')):
   if ('.' in chunks[ii]):
    numtype = float
   else:
    numtype = int
   chunks[ii] = (0, numtype(chunks[ii]))
  else:
   chunks[ii] = (1, chunks[ii])
 return (chunks, item)

def _natsort_key_case_insensitive ( item ) : item = str ( item ) . lower ( ) try : chunks = re . split ( '(\\d+(?:\\.\\d+)?)' , item ) except TypeError : chunks = re . split ( '(\\d+(?:\\.\\d+)?)' , item [ 0 ] ) for ii in range ( len ( chunks ) ) : if ( chunks [ ii ] and ( chunks [ ii ] [ 0 ] in '0123456789' ) ) : if ( '.' in chunks [ ii ] ) : numtype = float else : numtype = int chunks [ ii ] = ( 0 , numtype ( chunks [ ii ] ) ) else : chunks [ ii ] = ( 1 , chunks [ ii ] ) return ( chunks , item )
provides normalized version of item for sorting with digits .