code: def make_dataset_feature_stats_list_proto_equal_fn(
      test: absltest.TestCase,
      expected_result: statistics_pb2.DatasetFeatureStatisticsList,
      expected_result_len: int = 1,
      expected_result_merge_fn: Optional[
          Callable[
              [Iterable[statistics_pb2.DatasetFeatureStatisticsList]],
              statistics_pb2.DatasetFeatureStatisticsList,
          ]
      ] = None,
      check_histograms: bool = True,
  ) -> Callable[
      [Iterable[statistics_pb2.DatasetFeatureStatisticsList]], None
  ]:
      """Makes a matcher function for comparing DatasetFeatureStatisticsList proto.
  
      Args:
        test: test case object
        expected_result: the expected DatasetFeatureStatisticsList proto.
        expected_result_len: The expected number of elements. If this is a number
          greater than 1, expected_result_merge_fn should be provided to merge the
          inputs into the form expected by expected_result.
        expected_result_merge_fn: Called on elements to merge multiple inputs into
          the form expected by expected_result.
        check_histograms: If True, asserts equality of histograms.
          Otherwise histograms are not checked, and are assumed to not be specified
          in expected output.
  
      Returns:
        A matcher function for comparing DatasetFeatureStatisticsList proto.
      """
  
      def _matcher(
          actual: Iterable[statistics_pb2.DatasetFeatureStatisticsList],
      ):
          """Matcher function for comparing DatasetFeatureStatisticsList proto."""
          actual = list(actual)
          try:
              test.assertLen(
                  actual,
                  expected_result_len,
                  "Expected exactly %d DatasetFeatureStatisticsList"
                  % expected_result_len,
              )
              if len(actual) == 1:
                  actual = actual[0]
              else:
                  actual = expected_result_merge_fn(actual)
              test.assertLen(
                  actual.datasets, len(expected_result.datasets)
              )
  
              sorted_actual_datasets = sorted(
                  actual.datasets, key=lambda d: d.name
              )
              sorted_expected_datasets = sorted(
                  expected_result.datasets, key=lambda d: d.name
              )
  
              for i in range(len(sorted_actual_datasets)):
                  assert_dataset_feature_stats_proto_equal(
                      test,
                      sorted_actual_datasets[i],
                      sorted_expected_datasets[i],
                      check_histograms,
                  )
          except AssertionError as e:
              raise util.BeamAssertException from e
  
      return _matcher
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import traceback
  from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union
  from absl.testing import absltest
  import apache_beam
  from apache_beam.testing import util
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: make_dataset_feature_stats_list_proto_equal_fn(test, expected_result, expected_result_len, expected_result_merge_fn, check_histograms) and returns: _matcher