code: def test_stats_pipeline_with_sample_rate(self):
      record_batches = [
          pa.RecordBatch.from_arrays(
              [pa.array([np.linspace(1, 3000, 3000, dtype=np.int32)])],
              ["c"],
          ),
      ]
  
      with beam.Pipeline() as p:
          options = stats_options.StatsOptions(
              sample_rate=1.0,
              num_top_values=2,
              num_rank_histogram_buckets=2,
              num_values_histogram_buckets=2,
              num_histogram_buckets=2,
              num_quantiles_histogram_buckets=2,
              epsilon=0.001,
          )
          result = (
              p
              | beam.Create(record_batches)
              | stats_api.GenerateStatistics(options)
          )
          util.assert_that(
              result,
              test_util.make_dataset_feature_stats_list_proto_equal_fn(
                  self,
                  self._sampling_test_expected_result,
                  check_histograms=False,
              ),
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tempfile
  from absl.testing import absltest
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  import tensorflow
  from tensorflow_data_validation.api import stats_api
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.statistics import stats_options
  from tensorflow_data_validation.utils import io_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import test_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 5 for calling the StatsAPITest obj's underlying member method code with example usage: obj.test_stats_pipeline_with_sample_rate() without return types