class_docstr: 定制给 :class:`~fastNLP.core.dataloaders.MixDataLoader` 的 ``BatchSampler``，其功能是将传入的 ``datasets`` 轮流采样并返回 index，
  处理结束上个 dataset 的一个 batch 后会处理下一个。
class_docstr_tok: ["\u5b9a\u5236\u7ed9",":","class",":","`","~fastNLP.core.dataloaders.MixDataLoader","`","\u7684","``","BatchSampler","``","\uff0c\u5176\u529f\u80fd\u662f\u5c06\u4f20\u5165\u7684","``","datasets","``","\u8f6e\u6d41\u91c7\u6837\u5e76\u8fd4\u56de","index\uff0c","\u5904\u7406\u7ed3\u675f\u4e0a\u4e2a","dataset","\u7684\u4e00\u4e2a","batch","\u540e\u4f1a\u5904\u7406\u4e0b\u4e00\u4e2a\u3002"]
code: def __init__(
      self,
      dataset: Union[List, Dict],
      batch_size: int = 16,
      sampler: Union[List["Sampler"], Dict[str, "Sampler"], str] = None,
      drop_last: bool = False,
      ds_ratio="pad_to_most",
      rank: int = -1,
      word_size: int = -1,
  ) -> None:
      super(PollingSampler, self).__init__(
          dataset=dataset,
          batch_size=batch_size,
          sampler=sampler,
          ds_ratio=ds_ratio,
          drop_last=drop_last,
          rank=rank,
          word_size=word_size,
      )
  
imports: import array
  import numpy
  from typing import Union, List, Iterable, Dict
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
label_desc: Use image node_id 1 to create a new PollingSampler object from inherited base classes: MixSampler with example: obj = PollingSampler(dataset, batch_size, sampler, drop_last, ds_ratio, rank, word_size)