class_docstr: Split the dataset into `num_parts` parts and randomly sample from the part
  with index `part_index`.
  The data is randomly shuffled at each iteration within each partition.
  
  Parameters
  ----------
  length: int
    Number of examples in the dataset
  num_parts: int
    Number of partitions which the data is split into
  part_index: int
    The index of the part to read from
class_docstr_tok: ["Split","the","dataset","into","`","num_parts","`","parts","and","randomly","sample","from","the","part","with","index","`","part_index","`",".","The","data","is","randomly","shuffled","at","each","iteration","within","each","partition",".","Parameters","--","--","--","--","--","length",":","int","Number","of","examples","in","the","dataset","num_parts",":","int","Number","of","partitions","which","the","data","is","split","into","part_index",":","int","The","index","of","the","part","to","read","from"]
code: def __init__(self, length, num_parts=1, part_index=0, seed=0):
      if length % num_parts != 0:
          print(
              "Length ({}) must be a multiple of the number of partitions ({}).".format(
                  length, num_parts
              )
          )
      self._seed = seed
      self._state = np.random.RandomState(seed)
      self._indices = list(range(length))
      # Compute the length of each partition
      part_len = length // num_parts
      # Compute the start index for this partition
      self._start = part_len * part_index
      # Compute the end index for this partition
      self._end = self._start + part_len
      if part_index == num_parts - 1:
          self._end = length
  
file_path: gluon-cv/gluoncv/data/sampler.py
imports: import random
  import numpy
  from mxnet import gluon
label_desc: Use image node_id 1 to create a new ShuffleSplitSampler object from inherited base classes: gluon.data.sampler with example: obj = ShuffleSplitSampler(length, num_parts, part_index, seed)