class_docstr: Limit time spent for training.
  
  This is useful when ensuring that training for a given model doesn't
  exceed a budget, for example when doing AutoML.
  
  If `stop_within_epoch` is set to true, training can be stopped after
  each batch, otherwise it stops after the end of the epoch.
code: def __init__(self, **data):
      super().__init__(**data)
      self._timer = _Timer(self.time_limit)
  
imports: from dataclasses import dataclass, field
  from typing import List, Union, Dict, Any, Optional
  import logging
  import math
  import time
  import mxnet.gluon.nn
  import mxnet
  from mxnet import gluon
  from gluonts.core.component import validated
  from gluonts.mx.util import copy_parameters
  from gluonts.pydantic import BaseModel, PrivateAttr
label_desc: Use image node_id 1 to create a new TrainingTimeLimit object from inherited base classes: BaseModel, Callback with example: obj = TrainingTimeLimit()