class_docstr: Instantiates a Python object and runs its run() method (if provided).
  
  If disable_run() is called before launch, instance.run() method won't be
  called. This is useful in TAP-based integration tests, where users might need
  to step each worker synchronously.
class_docstr_tok: ["Instantiates","a","Python","object","and","runs","its","run","(",")","method","(","if","provided",")",".","If","disable_run","(",")","is","called","before","launch",",","instance.run","(",")","method","wo","n't","be","called",".","This","is","useful","in","TAP-based","integration","tests",",","where","users","might","need","to","step","each","worker","synchronously","."]
code: def _construct_instance(self) -> WorkerType:
      if self._instance is None:
          args, kwargs = tree.map_structure(
              dereference.maybe_dereference, (self._args, self._kwargs)
          )
          self._instance = self._constructor(*args, **kwargs)
      return self._instance
  
imports: import functools
  import itertools
  from typing import Any, Callable, Generic, TypeVar
  from absl import flags
  from absl import logging
  from launchpad import context
  from launchpad import lazy_loader
  from launchpad.nodes import base
  from launchpad.nodes import dereference
  from launchpad.nodes.python import addressing
  from launchpad.nodes.python import local_multi_processing
  import tree
label_desc: Use image node_id 3 for calling the PyClassNode obj's underlying member method code with example usage: obj._construct_instance() and returns: self