code: def _write_index_file(
      sharded_index_path: epath.PathLike, record_keys: List[Any]
  ):
      """Writes index file for records of a shard at given `sharded_index_path`.
  
      NOTE: Each record position (i.e shard_key in shard_keys) is stored as a
      string for better readability of the index files. The reader should parse the
      position from string using `RecordPosition.from_str()` method.
  
      Args:
        sharded_index_path: Path to the sharded index path.
        record_keys: List of keys/indices of the records in the shard.
      """
      # Store string representation of each record position.
      #
      # NOTE: This makes the index file more readable. Although the reader should
      # parse the record position from a string.
      index_info = {
          "index": [str(record_key) for record_key in record_keys]
      }
      epath.Path(sharded_index_path).write_text(json.dumps(index_info))
      logging.info(
          "Wrote index file to %s", os.fspath(sharded_index_path)
      )
  
imports: import dataclasses
  import functools
  import itertools
  import json
  import os
  from typing import Any, Iterable, List, Optional, Tuple
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import example_serializer
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import hashing
  from tensorflow_datasets.core import lazy_imports_lib
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import shuffle
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import apache_beam
label_desc: Use image node_id 6 for calling a global function with example usage: _write_index_file(sharded_index_path, record_keys) without return types