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: Initializes a new instance of the `PyClassNode` class.
  
  Args:
    constructor: A function that when called returns a Python object with a
      run method.
    *args: Arguments passed to the constructor.
    **kwargs: Key word arguments passed to the constructor.
docstr_tok: ["Initializes","a","new","instance","of","the","`","PyClassNode","`","class",".","Args",":","constructor",":","A","function","that","when","called","returns","a","Python","object","with","a","run","method",".","*","args",":","Arguments","passed","to","the","constructor",".","*","*","kwargs",":","Key","word","arguments","passed","to","the","constructor","."]
code: def __init__(
      self, constructor: Callable[..., WorkerType], *args, **kwargs
  ):
      """Initializes a new instance of the `PyClassNode` class.
  
      Args:
        constructor: A function that when called returns a Python object with a
          run method.
        *args: Arguments passed to the constructor.
        **kwargs: Key word arguments passed to the constructor.
      """
      super().__init__(self.run)
      self._constructor = constructor
      self._args = args
      self._kwargs = kwargs
      self._should_run = True
      self._collect_input_handles()
      self._instance = None
  
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 1 to create a new PyClassNode object from inherited base classes: PyNode, Generic with example: obj = PyClassNode(constructor)