code: def test_coder_end_to_end(self):
      # First check that the registration is done.
      self.assertIsInstance(
          beam.coders.typecoders.registry.get_coder(pa.RecordBatch),
          types._ArrowRecordBatchCoder,
      )
      # Then replace the registered coder with our patched one to track whether
      # encode() / decode() are called.
      beam.coders.typecoders.registry.register_coder(
          pa.RecordBatch, _TrackedCoder
      )
      rb = _make_record_batch(1000, 1)
  
      def pipeline(root):
          sample = (
              root
              | beam.Create([rb] * 20)
              | beam.combiners.Sample.FixedSizeGlobally(5)
          )
  
          def matcher(actual):
              self.assertLen(actual, 1)
              actual = actual[0]
              self.assertLen(actual, 5)
              for actual_rb in actual:
                  self.assertTrue(actual_rb.equals(rb))
  
          util.assert_that(sample, matcher)
  
      _Tracker().reset()
      beam.runners.DirectRunner().run(pipeline)
      self.assertTrue(_Tracker().encode_called)
      self.assertTrue(_Tracker().decode_called)
      beam.coders.typecoders.registry.register_coder(
          pa.RecordBatch, types._ArrowRecordBatchCoder
      )
  
file_path: data-validation/tensorflow_data_validation/types_test.py
imports: from absl.testing import absltest
  import apache_beam
  from apache_beam.testing import util
  import pyarrow
  from tensorflow_data_validation import types
label_desc: Use image node_id 2 for calling the TypesTest obj's underlying member method code with example usage: obj.test_coder_end_to_end() without return types