code: def testOutputEach(self):
      np.random.seed(97)
      n = 10000
      fx = np.random.randint(0, 8, n)
  
      for method in ["smaller_data", "larger_data"]:
          for categorical0, categorical1 in [
              (True, True),
              (False, True),
              (False, False),
          ]:
              # Test categorical vs categorical, ordinal vs categorical, ordinal
              # vs ordinal.
              result, each_mi = _MI(
                  [fx],
                  [fx],
                  [categorical0],
                  [categorical1],
                  output_each=True,
                  estimate_method=method,
                  seed=5,
              )
              self.assertAlmostEqual(result, 3, places=1)
              self.assertLen(each_mi, n)
              self.assertAlmostEqual(np.mean(each_mi), 3, places=1)
              self.assertAlmostEqual(
                  np.sum(each_mi[fx == 0]) / n,
                  3.0 / 8,
                  places=None,
                  delta=1e-2,
              )
  
      for method in ["smaller_data", "larger_data"]:
          for categorical0, categorical1, categorical2 in [
              (False, False, True),
              (False, True, True),
          ]:
              result, each_mi = _MI(
                  [fx, fx],
                  [fx],
                  [categorical0, categorical1],
                  [categorical2],
                  output_each=True,
                  estimate_method=method,
                  seed=9,
              )
              self.assertAlmostEqual(result, 3, places=2)
              self.assertLen(each_mi, n)
              self.assertAlmostEqual(np.mean(each_mi), 3, places=2)
              self.assertAlmostEqual(
                  np.sum(each_mi[fx == 0]) / n,
                  3.0 / 8,
                  places=None,
                  delta=1e-2,
              )
  
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 11 for calling the RanklabMutualInformationTest obj's underlying member method code with example usage: obj.testOutputEach() without return types