def _partition_of_index_value(divisions, val):
 if (divisions[0] is None):
  msg = 'Can not use loc on DataFrame without known divisions'
  raise ValueError(msg)
 val = _coerce_loc_index(divisions, val)
 i = bisect.bisect_right(divisions, val)
 return min((len(divisions) - 2), max(0, (i - 1)))

def _partition_of_index_value ( divisions , val ) : if ( divisions [ 0 ] is None ) : msg = 'Can not use loc on DataFrame without known divisions' raise ValueError ( msg ) val = _coerce_loc_index ( divisions , val ) i = bisect . bisect_right ( divisions , val ) return min ( ( len ( divisions ) - 2 ) , max ( 0 , ( i - 1 ) ) )
in which partition does this value lie? .