def _make_label_to_row_indices(labels):
 result = {}
 for (row_index, label) in enumerate(labels):
  short_label = tuple(label[:5])
  if (result.get(short_label, None) is None):
   result[short_label] = []
  result[short_label].append(row_index)
 return result

def _make_label_to_row_indices ( labels ) : result = { } for ( row_index , label ) in enumerate ( labels ) : short_label = tuple ( label [ : 5 ] ) if ( result . get ( short_label , None ) is None ) : result [ short_label ] = [ ] result [ short_label ] . append ( row_index ) return result
returns a map from short labels to the list of row indices of rows in the dense design matrix with that label .