<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def entropy(self, base = 2):
 """Compute the entropy of the distribution"""

        entropy = 0
        if not base and self.base: base = self.base
        for type in self._dist:
            if not base:
                entropy += self._dist[type] * -math.log(self._dist[type])
            else:
                entropy += self._dist[type] * -math.log(self._dist[type], base)
        return entropy