class_docstr: Shuffles / writes Examples beam collection to sharded TFRecord files.
  
  The given examples are not directly writen to the final tfrecord file, but to
  temporary files.
class_docstr_tok: ["Shuffles","\/","writes","Examples","beam","collection","to","sharded","TFRecord","files",".","The","given","examples","are","not","directly","writen","to","the","final","tfrecord","file",",","but","to","temporary","files","."]
docstr: Returns the sorted shard ids and logs information.
docstr_tok: ["Returns","the","sorted","shard","ids","and","logs","information","."]
code: def _sort_shard_ids(
      self, shard_ids: List[int], ideal_num_shards: int
  ) -> List[int]:
      """Returns the sorted shard ids and logs information."""
      if len(shard_ids) != ideal_num_shards:
          logging.info(
              "Ideally there would be %d shards, but got %d non-empty shards.",
              ideal_num_shards,
              len(shard_ids),
          )
      return sorted(shard_ids)
  
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 13 for calling the BeamWriter obj's underlying member method code with example usage: obj._sort_shard_ids(shard_ids, ideal_num_shards) and returns: sorted