class_docstr: Tests for NonStreamingCustomStatsGenerator.
code: def setUp(self):
      super(NonStreamingCustomStatsGeneratorTest, self).setUp()
      # Integration tests involving Beam and AMI are challenging to write
      # because Beam PCollections are unordered while the results of adjusted MI
      # depend on the order of the data for small datasets. This test case tests
      # MI with one label which will give a value of 0 regardless of
      # the ordering of elements in the PCollection. The purpose of this test is
      # to ensure that the Mutual Information pipeline is able to handle a
      # variety of input types. Unit tests ensuring correctness of the MI value
      # itself are included in sklearn_mutual_information_test.
  
      # fa is categorical, fb is numeric, fc is multivalent and fd has null values
      self.record_batches = [
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Red"]]),
                  pa.array([[1.0]]),
                  pa.array([[1, 3, 1]]),
                  pa.array([[0.4]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Green"]]),
                  pa.array([[2.2]]),
                  pa.array([[2, 6]]),
                  pa.array([[0.4]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Blue"]]),
                  pa.array([[3.3]]),
                  pa.array([[4, 6]]),
                  pa.array([[0.3]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Green"]]),
                  pa.array([[1.3]]),
                  pa.array([None]),
                  pa.array([[0.2]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Red"]]),
                  pa.array([[1.2]]),
                  pa.array([[1]]),
                  pa.array([[0.3]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Blue"]]),
                  pa.array([[0.5]]),
                  pa.array([[3, 2]]),
                  pa.array([[0.4]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Blue"]]),
                  pa.array([[1.3]]),
                  pa.array([[1, 4]]),
                  pa.array([[1.7]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Green"]]),
                  pa.array([[2.3]]),
                  pa.array([[0]]),
                  pa.array([[np.NaN]], type=pa.list_(pa.float64())),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["Green"]]),
                  pa.array([[0.3]]),
                  pa.array([[3]]),
                  pa.array([[4.4]]),
                  pa.array([["Label"]]),
              ],
              ["fa", "fb", "fc", "fd", "label_key"],
          ),
      ]
  
      self.schema = text_format.Parse(
          """
          feature {
            name: "fa"
            type: BYTES
            shape {
              dim {
                size: 1
              }
            }
          }
          feature {
            name: "fb"
            type: FLOAT
            shape {
              dim {
                size: 1
              }
            }
          }
          feature {
            name: "fc"
            type: INT
            value_count: {
              min: 0
              max: 2
            }
          }
          feature {
            name: "fd"
            type: FLOAT
            shape {
              dim {
                size: 1
              }
            }
          }
          feature {
            name: "label_key"
            type: BYTES
            shape {
              dim {
                size: 1
              }
            }
          }""",
          schema_pb2.Schema(),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import partitioned_stats_generator
  from tensorflow_data_validation.statistics.generators import sklearn_mutual_information
  from tensorflow_data_validation.utils import test_util
  from google.protobuf import text_format
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 for calling the NonStreamingCustomStatsGeneratorTest obj's underlying member method code with example usage: obj.setUp() without return types