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","."]
docstr: Constructs Python object and (maybe) calls its `run` method.
  
  The `run` method is not called if `disable_run` has ben called previously or
  if the constructed Python object does not have a `run` method.
docstr_tok: ["Constructs","Python","object","and","(","maybe",")","calls","its","`","run","`","method",".","The","`","run","`","method","is","not","called","if","`","disable_run","`","has","ben","called","previously","or","if","the","constructed","Python","object","does","not","have","a","`","run","`","method","."]
code: def run(self) -> None:
      """Constructs Python object and (maybe) calls its `run` method.
  
      The `run` method is not called if `disable_run` has ben called previously or
      if the constructed Python object does not have a `run` method.
      """
      instance = self._construct_instance()
      if hasattr(instance, "run") and self._should_run:
          instance.run()
      else:
          logging.warning(
              "run() not defined on the instance (or disable_run() was called.)."
              "Exiting..."
          )
  
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 6 for calling the PyClassNode obj's underlying member method code with example usage: obj.run() without return types