#NEWLINE# def logprob( self , sample ) : #NEWLINE# #INDENT# '\n        Return the base 2 logarithm of the probability for a given sample.\n\n        :param sample: The sample whose probability\n               should be returned.\n        :type sample: any\n        :rtype: float\n        ' #NEWLINE# p = self . prob ( sample ) #NEWLINE# return ( math . log ( sample , 2 ) if ( p != 0 ) else _NINF )