def _partitions_of_index_values(divisions, values):
 if (divisions[0] is None):
  msg = 'Can not use loc on DataFrame without known divisions'
  raise ValueError(msg)
 results = defaultdict(list)
 values = pd.Index(values, dtype=object)
 for val in values:
  i = bisect.bisect_right(divisions, val)
  div = min((len(divisions) - 2), max(0, (i - 1)))
  results[div].append(val)
 return results

def _partitions_of_index_values ( divisions , values ) : if ( divisions [ 0 ] is None ) : msg = 'Can not use loc on DataFrame without known divisions' raise ValueError ( msg ) results = defaultdict ( list ) values = pd . Index ( values , dtype = object ) for val in values : i = bisect . bisect_right ( divisions , val ) div = min ( ( len ( divisions ) - 2 ) , max ( 0 , ( i - 1 ) ) ) results [ div ] . append ( val ) return results
return defaultdict of division and values pairs each key corresponds to the division which values are index values belong to the division .