#NEWLINE# def _BinIndex( self , item ) : #NEWLINE# #INDENT# 'Get bin to which item belongs.\n\n    E.g., if intervals are [0, 10], [10, 20], [20, 40], [40, 80],\n    _BinIndex(25) is 2, and _BinIndex(50) is 3.\n    Bin numbers are 0-based.\n\n    Args:\n      item: data item\n\n    Returns:\n      bin to which item belongs, assuming 0-based binning.\n    ' #NEWLINE# if ( item <= self . start ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# itembin = math . ceil ( math . log ( ( float ( item ) / self . start ) , self . exponent ) ) #NEWLINE# return int ( item )