def Log(self, m=None):
if self.log:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.log = True<EOL>if m is None:<EOL><INDENT>m = self.MaxLike()<EOL><DEDENT>for x, p in self.d.iteritems():<EOL><INDENT>if p:<EOL><INDENT>self.Set(x, math.log(p / m))<EOL><DEDENT>else:<EOL><INDENT>self.Remove(x)<EOL><DEDENT><DEDENT>
Log transforms the probabilities.

        Removes values with probability 0.

        Normalizes so that the largest logprob is 0.