class_docstr: Data is an abstraction that handles all of the following:
  
  - Initialize model metadata parameters
  - Create batches of tensors for model training or prediction
  
  It can accomplish these in any way it needs to. The base implementation
  utilizes `pytext.data.sources.DataSource`, and sends batches to
  `pytext.data.tensorizers.Tensorizer` to create tensors.
  
  The `tensorizers` dict passed to the initializer should be considered something like
  a signature for the model. Each batch should be a dictionary with the same keys
  as the `tensorizers` dict, and values should be tensors arranged in the way
  specified by that tensorizer. The tensorizers dict doubles as a simple baseline
  implementation of that same signature, but subclasses of Data can override the
  implementation using other methods. This value is how the model specifies what
  inputs it's looking for.
code: def cache(self, numberized_rows, stage):
      if stage in self.cache_mutex:
          # already have generator caching the numberized data
          for numberized_row in numberized_rows:
              yield numberized_row
      else:
          self.cache_mutex[stage] = True
          result = []
          for numberized_row in numberized_rows:
              result.append(numberized_row)
              yield numberized_row
          self.numberized_cache[stage] = result
  
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 4 for calling the Data obj's underlying member method code with example usage: obj.cache(numberized_rows, stage) without return types