class_docstr: Batcher designed to batch rows of data, before padding.
code: def __init__(
      self,
      train_batch_size=Config.train_batch_size,
      eval_batch_size=Config.eval_batch_size,
      test_batch_size=Config.test_batch_size,
  ):
      self.train_batch_size = train_batch_size
      self.eval_batch_size = eval_batch_size
      self.test_batch_size = test_batch_size
      self._batch_sizes = {
          Stage.TRAIN: self.train_batch_size,
          Stage.TEST: self.test_batch_size,
          Stage.EVAL: self.eval_batch_size,
      }
  
imports: import functools
  import itertools
  import math
  import random
  from typing import Any, Dict, Iterable, List, MutableMapping, NamedTuple, Optional, Type
  from pytext.common.constants import RawExampleFieldName, Stage
  from pytext.config.component import Component, ComponentType, create_component, Registry
  from pytext.utils.usage import log_class_usage
  from .sources import DataSource, RawExample, TSVDataSource
  from .sources.data_source import GeneratorIterator, RowShardedDataSource, ShardedDataSource
  from .tensorizers import initialize_tensorizers, MetricTensorizer, Tensorizer
label_desc: Use image node_id 2 to create a new Batcher object from inherited base classes: Component with example: obj = Batcher(train_batch_size, eval_batch_size, test_batch_size)