class_docstr: This sampler iterates over all the datasets, sampling according to
  the weighted number of samples in each dataset.
class_docstr_tok: ["This","sampler","iterates","over","all","the","datasets",",","sampling","according","to","the","weighted","number","of","samples","in","each","dataset","."]
code: def from_config(cls, config: Config):
      return cls(config.dataset_counts)
  
imports: from collections.abc import Iterator
  from typing import Dict, Optional
  import numpy
  from pytext.config.component import Component, ComponentType
label_desc: Use image node_id 1 for calling the NaturalBatchSampler obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls