code: def __init__(self, sampler, batch_size: int, drop_last: bool) -> None:
      # Since collections.abc.Iterable does not check for `__getitem__`, which
      # is one way for an object to be an iterable, we don't do an `isinstance`
      # check here.
      if (
          not isinstance(batch_size, int)
          or isinstance(batch_size, bool)
          or batch_size <= 0
      ):
          raise ValueError(
              "batch_size should be a positive integer value, "
              "but got batch_size={}".format(batch_size)
          )
      if not isinstance(drop_last, bool):
          raise ValueError(
              "drop_last should be a boolean value, but got "
              "drop_last={}".format(drop_last)
          )
      self.sampler = sampler
      self.batch_size = batch_size
      self.drop_last = drop_last
  
file_path: fastNLP/tests/helpers/datasets/normal_data.py
imports: import numpy
  import random
label_desc: Use image node_id 1 to create a new NormalBatchSampler object  with example: obj = NormalBatchSampler(sampler, batch_size, drop_last)