code: def shard(
      dataset: Dataset,
      split: Split,
      obfuscation: Optional[str] = None,
      shard_index: int = 0,
      num_shards: int = 1,
  ) -> Tuple[int, int]:
      """Returns [start, end) for the given shard index."""
      assert shard_index < num_shards
      arange = np.arange(get_num_examples(dataset, split, obfuscation))
      shard_range = np.array_split(arange, num_shards)[shard_index]
      start, end = shard_range[0], (shard_range[-1] + 1)
      if split == Split.TRAIN:
          # Note that our TRAIN=TFDS_TRAIN[10000:] and VALID=TFDS_TRAIN[:10000] for
          # ImageNet and the same with 5000 instead of 10000 for Coco.
          offset = get_num_examples(dataset, Split.VALID, obfuscation)
          start += offset
          end += offset
      return start, end
  
file_path: neural-structured-learning/research/meo/mlp_baseline/data_utils.py
imports: import enum
  from typing import Optional, Sequence, Tuple
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: shard(dataset, split, obfuscation, shard_index, num_shards) and returns: start,  end