class_docstr: Information of a split that is being created.
docstr: Finalizes a shard and updates the split metadata accordingly.
docstr_tok: ["Finalizes","a","shard","and","updates","the","split","metadata","accordingly","."]
code: def close_shard(self) -> None:
      """Finalizes a shard and updates the split metadata accordingly."""
      if not self.current_shard:
          return
      self.current_shard.close_writer()
      self.info = splits_lib.SplitInfo(
          name=self.info.name,
          shard_lengths=self.info.shard_lengths
          + [self.current_shard.num_examples],
          num_bytes=self.info.num_bytes + self.current_shard.num_bytes,
          filename_template=self.info.filename_template,
      )
      self.complete_shards += 1
      self.current_shard = None
  
imports: from __future__ import annotations
  import dataclasses
  import os
  from typing import Any, Dict, List, Optional
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import example_serializer
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import array_record_module
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 2 for calling the Split obj's underlying member method code with example usage: obj.close_shard() without return types