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 number of shards.
docstr_tok: ["Returns","the","number","of","shards","."]
code: def _number_of_shards(
      self, num_examples: int, total_size: int
  ) -> int:
      """Returns the number of shards."""
      num_shards = self._shard_config.get_number_shards(
          total_size=total_size,
          num_examples=num_examples,
          uses_precise_sharding=False,
      )
      self.inc_counter(name="NumberOfShards", value=num_shards)
      return num_shards
  
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 10 for calling the BeamWriter obj's underlying member method code with example usage: obj._number_of_shards(num_examples, total_size) and returns: num_shards