code: def _write_examples(
      path: epath.PathLike,
      iterator: Iterable[type_utils.KeySerializedExample],
      file_format: file_adapters.FileFormat = file_adapters.DEFAULT_FILE_FORMAT,
  ) -> Optional[file_adapters.ExamplePositions]:
      """Write examples from iterator in the given `file_format`."""
      return file_adapters.ADAPTER_FOR_FORMAT[
          file_format
      ].write_examples(path, iterator)
  
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 5 for calling a global function with example usage: _write_examples(path, iterator, file_format) and returns: file_adapters