code: def testEntropyD(self):
      discrete_f = np.array(["foo", "bar", "baz", "foo"])
      entropy, each = mutual_information_util._entropy_discrete(
          discrete_f, np.ones_like(discrete_f, dtype=float)
      )
      expected_entropy = -(
          np.log2(0.5) * 0.5 + np.log2(0.25) * 0.25 * 2
      )
      expected_each = np.array(
          [-np.log2(0.5), -np.log2(0.25), -np.log2(0.25), -np.log2(0.5)]
      )
      self.assertTrue(np.allclose(expected_entropy, entropy, atol=1e-5))
      self.assertTrue(np.allclose(expected_each, each, atol=1e-5))
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_data_validation.utils import mutual_information_util
label_desc: Use image node_id 16 for calling the RanklabMutualInformationTest obj's underlying member method code with example usage: obj.testEntropyD() without return types