class_docstr: Batcher designed to batch rows of data, before padding.
docstr: Group rows by batch_size.  Assume iterable of dicts, yield dict of lists.
  The last batch will be of length len(iterable) % batch_size.
docstr_tok: ["Group","rows","by","batch_size",".","Assume","iterable","of","dicts",",","yield","dict","of","lists",".","The","last","batch","will","be","of","length","len","(","iterable",")","%","batch_size","."]
code: def batchify(
      self,
      iterable: Iterable[RawExample],
      sort_key=None,
      stage=Stage.TRAIN,
  ):
      """Group rows by batch_size.  Assume iterable of dicts, yield dict of lists.
      The last batch will be of length len(iterable) % batch_size."""
      batch_size = self._batch_sizes[stage]
      for batch in self._group_iter(iterable, batch_size, sort_key):
          raw_batch, numberized_batch = zip(*batch)
          yield BatchData(raw_batch, zip_dicts(numberized_batch))
  
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 3 for calling the Batcher obj's underlying member method code with example usage: obj.batchify(iterable, sort_key, stage) without return types