class_docstr: Delays object construction to achieve serializability.
  
  Assuming we want to pass a non-serializable Python object, say an environment
  object, to an Actor, the following will lead to a serialization error:
  
      program.add_node(lp.CourierNode(Actor, envloader.load_from_settings(
          platform='Atari',
          settings={
              'levelName': 'pong',
              'env_loader.version': requested_version,
              'zero_indexed_actions': True,
              'interleaved_pixels': True,
          })))
  
  This helper class delays the object construction and fixes this error. The
  object is constructed when the Actor is actually instantiated remotely, where
  the Actor constructed will receive an actual environment object (just like how
  handles are dereferenced automatically):
  
      program.add_node(lp.CourierNode(Actor, lp.Deferred(
          envloader.load_from_settings,
          platform='Atari',
          settings={
              'levelName': 'pong',
              'env_loader.version': requested_version,
              'zero_indexed_actions': True,
              'interleaved_pixels': True,
          })))
code: def __init__(
      self, constructor: Callable[..., T], *args, **kwargs
  ) -> None:
      self._constructor = constructor
      self._args = args
      self._kwargs = kwargs
      self._init_stack = "Stack trace missing"
      self._deferred_object = _Uninitialized()
  
file_path: launchpad/launchpad/nodes/dereference.py
imports: import abc
  from typing import Callable, Generic, TypeVar, Union
  from absl import flags
  import tree
label_desc: Use image node_id 1 to create a new Deferred object from inherited base classes: Dereferenceable, Generic with example: obj = Deferred(constructor)