#NEWLINE# def logprob( self , sample ) : #NEWLINE# #INDENT# i = self . _sample_dict . get ( sample ) #NEWLINE# if ( i is None ) : #NEWLINE# #INDENT# return float ( '-inf' ) #NEWLINE# #UNINDENT# return ( self . _data [ i ] if self . _logs else math . log ( self . _data [ i ] , 2 ) )