docstr: Args:
      lambda_transforms (dict): A dictionary that contains lambda transforms, that
      is instances of the Lambda class.
          This dictionary is required when you are restoring a pipeline that contains lambda transforms. Keys
          in that dictionary should be named same as `name` arguments in respective lambda transforms from
          a serialized pipeline.
docstr_tok: ["Args",":","lambda_transforms","(","dict",")",":","A","dictionary","that","contains","lambda","transforms",",","that","is","instances","of","the","Lambda","class",".","This","dictionary","is","required","when","you","are","restoring","a","pipeline","that","contains","lambda","transforms",".","Keys","in","that","dictionary","should","be","named","same","as","`","name","`","arguments","in","respective","lambda","transforms","from","a","serialized","pipeline","."]
code: def _restore_for_replay(
      transform_dict: typing.Dict[str, typing.Any],
      lambda_transforms: typing.Optional[dict] = None,
  ) -> TransformType:
      """
      Args:
          lambda_transforms (dict): A dictionary that contains lambda transforms, that
          is instances of the Lambda class.
              This dictionary is required when you are restoring a pipeline that contains lambda transforms. Keys
              in that dictionary should be named same as `name` arguments in respective lambda transforms from
              a serialized pipeline.
      """
      applied = transform_dict["applied"]
      params = transform_dict["params"]
      lmbd = instantiate_nonserializable(
          transform_dict, lambda_transforms
      )
      if lmbd:
          transform = lmbd
      else:
          name = transform_dict["__class_fullname__"]
          args = {
              k: v
              for k, v in transform_dict.items()
              if k not in ["__class_fullname__", "applied", "params"]
          }
          cls = SERIALIZABLE_REGISTRY[name]
          if "transforms" in args:
              args["transforms"] = [
                  ReplayCompose._restore_for_replay(
                      t, lambda_transforms=lambda_transforms
                  )
                  for t in args["transforms"]
              ]
          transform = cls(**args)
  
      transform = typing.cast(BasicTransform, transform)
      if isinstance(transform, BasicTransform):
          transform.params = params
      transform.replay_mode = True
      transform.applied_in_replay = applied
      return transform
  
imports: from __future__ import division
  import random
  import typing
  import warnings
  from collections import defaultdict
  import numpy
  from ..None import random_utils
  from .bbox_utils import BboxParams, BboxProcessor
  from .keypoints_utils import KeypointParams, KeypointsProcessor
  from .serialization import SERIALIZABLE_REGISTRY, Serializable, get_shortest_class_fullname, instantiate_nonserializable
  from .transforms_interface import BasicTransform
  from .utils import format_args, get_shape
label_desc: Use image node_id 4 for calling the ReplayCompose obj's underlying member method code with example usage: obj._restore_for_replay(transform_dict, lambda_transforms) and returns: transform