class_docstr: Maintains a stack of applied transforms to data.
  
  Data can be one of two types:
      1. A `MetaTensor` (this is the preferred data type).
      2. A dictionary of data containing arrays/tensors and auxiliary metadata. In
          this case, a key must be supplied (this dictionary-based approach is deprecated).
  
  If `data` is of type `MetaTensor`, then the applied transform will be added to ``data.applied_operations``.
  
  If `data` is a dictionary, then one of two things can happen:
      1. If data[key] is a `MetaTensor`, the applied transform will be added to ``data[key].applied_operations``.
      2. Else, the applied transform will be appended to an adjacent list using
          `trace_key`. If, for example, the key is `image`, then the transform
          will be appended to `image_transforms` (this dictionary-based approach is deprecated).
  
  Hopefully it is clear that there are three total possibilities:
      1. data is `MetaTensor`
      2. data is dictionary, data[key] is `MetaTensor`
      3. data is dictionary, data[key] is not `MetaTensor` (this is a deprecated approach).
  
  The ``__call__`` method of this transform class must be implemented so
  that the transformation information is stored during the data transformation.
  
  The information in the stack of applied transforms must be compatible with the
  default collate, by only storing strings, numbers and arrays.
  
  `tracing` could be enabled by `self.set_tracing` or setting
  `MONAI_TRACE_TRANSFORM` when initializing the class.
docstr: Push to a stack of applied transforms of ``data``.
  
  Args:
      data: dictionary of data or `MetaTensor`.
      args: additional positional arguments to track_transform_meta.
      kwargs: additional keyword arguments to track_transform_meta,
          set ``replace=True`` (default False) to rewrite the last transform infor in
          applied_operation/pending_operation based on ``self.get_transform_info()``.
docstr_tok: ["Push","to","a","stack","of","applied","transforms","of","``","data","``",".","Args",":","data",":","dictionary","of","data","or","`","MetaTensor","`",".","args",":","additional","positional","arguments","to","track_transform_meta",".","kwargs",":","additional","keyword","arguments","to","track_transform_meta",",","set","``","replace=True","``","(","default","False",")","to","rewrite","the","last","transform","infor","in","applied_operation\/pending_operation","based","on","``","self.get_transform_info","(",")","``","."]
code: def push_transform(self, data, *args, **kwargs):
      """
      Push to a stack of applied transforms of ``data``.
  
      Args:
          data: dictionary of data or `MetaTensor`.
          args: additional positional arguments to track_transform_meta.
          kwargs: additional keyword arguments to track_transform_meta,
              set ``replace=True`` (default False) to rewrite the last transform infor in
              applied_operation/pending_operation based on ``self.get_transform_info()``.
      """
      lazy_eval = kwargs.get("lazy", False)
      transform_info = self.get_transform_info()
      do_transform = transform_info.get(TraceKeys.DO_TRANSFORM, True)
      kwargs = kwargs or {}
      replace = kwargs.pop(
          "replace", False
      )  # whether to rewrite the most recently pushed transform info
      if replace and get_track_meta() and isinstance(data, MetaTensor):
          if not lazy_eval:
              xform = (
                  self.pop_transform(data, check=False)
                  if do_transform
                  else {}
              )
              meta_obj = self.push_transform(
                  data,
                  orig_size=xform.get(TraceKeys.ORIG_SIZE),
                  extra_info=xform,
              )
              return data.copy_meta_from(meta_obj)
          if do_transform:
              xform = data.pending_operations.pop()
              extra = xform.copy()
              xform.update(transform_info)
          else:  # lazy, replace=True, do_transform=False
              xform, extra = transform_info, {}
          meta_obj = self.push_transform(
              data, transform_info=xform, lazy=True, extra_info=extra
          )
          return data.copy_meta_from(meta_obj)
      kwargs["lazy"] = lazy_eval
      if "transform_info" in kwargs and isinstance(
          kwargs["transform_info"], dict
      ):
          kwargs["transform_info"].update(transform_info)
      else:
          kwargs["transform_info"] = transform_info
      meta_obj = TraceableTransform.track_transform_meta(
          data, *args, **kwargs
      )
      return (
          data.copy_meta_from(meta_obj)
          if isinstance(data, MetaTensor)
          else data
      )
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Hashable, Mapping
  from contextlib import contextmanager
  from typing import Any
  import torch
  from monai import transforms
  from monai.data.meta_obj import MetaObj, get_track_meta
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import to_affine_nd
  from monai.transforms.traits import InvertibleTrait
  from monai.transforms.transform import Transform
  from monai.utils import LazyAttr, MetaKeys, TraceKeys, TraceStatusKeys, convert_to_dst_type, convert_to_numpy, convert_to_tensor
  from monai.utils.misc import MONAIEnvVars
label_desc: Use image node_id 5 for calling the TraceableTransform obj's underlying member method code with example usage: obj.push_transform(data) and returns: unknown, data, data