code: def _write_tfrecord(self, split_name, shards_number, records):
      filename_template = self._filename_template(split=split_name)
      num_examples = len(records)
      shard_specs = writer_lib._get_shard_specs(
          num_examples=num_examples,
          total_size=0,
          bucket_lengths=[num_examples],
          filename_template=filename_template,
          shard_config=shard_utils.ShardConfig(
              num_shards=shards_number
          ),
      )
      serialized_records = [
          (key, bytes(rec, encoding="utf-8"))
          for key, rec in enumerate(records)
      ]
      for shard_spec in shard_specs:
          _write_tfrecord_from_shard_spec(
              shard_spec, lambda unused_i: iter(serialized_records)
          )
      return splits.SplitInfo(
          name=split_name,
          shard_lengths=[int(s.examples_number) for s in shard_specs],
          num_bytes=0,
          filename_template=filename_template,
      )
  
imports: import functools
  import itertools
  import os
  from unittest import mock
  import tensorflow
  import tensorflow_datasets
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import reader
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import writer
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import shard_utils
label_desc: Use image node_id 3 for calling the ReaderTest obj's underlying member method code with example usage: obj._write_tfrecord(split_name, shards_number, records) and returns: splits