code: def test_generate_sliced_statistics_impl_without_slice_fns(self):
      sliced_record_batches = [
          (
              "test_slice",
              pa.RecordBatch.from_arrays(
                  [pa.array([[]], type=pa.list_(pa.float32()))], ["b"]
              ),
          ),
          (
              "test_slice",
              pa.RecordBatch.from_arrays(
                  [pa.array([[]], type=pa.list_(pa.float32()))], ["b"]
              ),
          ),
      ]
      # No slice functions are specified in options.
      options = stats_options.StatsOptions(
          num_top_values=2,
          num_rank_histogram_buckets=2,
          num_values_histogram_buckets=2,
      )
      expected_result_without_slice_key = text_format.Parse(
          """
          datasets {
            num_examples: 2
            features {
                  path {
                    step: "b"
                  }
              type: FLOAT
              num_stats {
                common_stats {
                  num_non_missing: 2
                }
              }
            }
          }""",
          statistics_pb2.DatasetFeatureStatisticsList(),
      )
      expected_result_with_slice_key = text_format.Parse(
          """
          datasets {
            name: "test_slice"
            num_examples: 2
            features {
              path {
                step: "b"
              }
              type: FLOAT
              num_stats {
                common_stats {
                  num_non_missing: 2
                }
              }
            }
          }""",
          statistics_pb2.DatasetFeatureStatisticsList(),
      )
      with beam.Pipeline() as p:
          result = (
              p
              | beam.Create(sliced_record_batches, reshuffle=False)
              | stats_impl.GenerateSlicedStatisticsImpl(options=options)
          )
          # GenerateSlicedStatisticsImpl() does not add slice keys to the result
          # because is_slicing_enabled is not set to True (and no slice functions
          # are provided via the stats options).
          util.assert_that(
              result,
              test_util.make_dataset_feature_stats_list_proto_equal_fn(
                  self,
                  expected_result_without_slice_key,
                  check_histograms=False,
              ),
          )
  
      with beam.Pipeline() as p:
          result = (
              p
              | beam.Create(sliced_record_batches, reshuffle=False)
              | stats_impl.GenerateSlicedStatisticsImpl(
                  options=options, is_slicing_enabled=True
              )
          )
          # GenerateSlicedStatisticsImpl() adds slice keys to the result because
          # is_slicing_enabled is set to True.
          util.assert_that(
              result,
              test_util.make_dataset_feature_stats_list_proto_equal_fn(
                  self,
                  expected_result_with_slice_key,
                  check_histograms=False,
              ),
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import sys
  from typing import Iterable
  import unittest
  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.statistics import stats_impl
  from tensorflow_data_validation.statistics import stats_options
  from tensorflow_data_validation.statistics.generators import cross_feature_stats_generator
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import slicing_util
  from tensorflow_data_validation.utils import test_util
  from tfx_bsl.arrow import array_util
  from tfx_bsl.arrow import table_util
  from tfx_bsl.public.proto import slicing_spec_pb2
  from tfx_bsl.statistics import merge_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 5 for calling the StatsImplTest obj's underlying member method code with example usage: obj.test_generate_sliced_statistics_impl_without_slice_fns() without return types