class_docstr: The ``_PatchedWork`` is used to emulate a work instance from a subprocess. This is acheived by patching the self
  reference in methods an properties to point to the AppState.
  
  Args:
      state: The work state to patch
      work_class: The work class to emulate
class_docstr_tok: ["The","``","_PatchedWork","``","is","used","to","emulate","a","work","instance","from","a","subprocess",".","This","is","acheived","by","patching","the","self","reference","in","methods","an","properties","to","point","to","the","AppState",".","Args",":","state",":","The","work","state","to","patch","work_class",":","The","work","class","to","emulate"]
code: def __getattr__(self, name: str) -> Any:
      try:
          return getattr(self._state, name)
      except AttributeError:
          # The name isn't in the state, so check if it's a callable or a property
          attribute = inspect.getattr_static(self._work_class, name)
          if callable(attribute):
              attribute = attribute.__get__(self, self._work_class)
              return attribute
          if isinstance(attribute, (staticmethod, property)):
              return attribute.__get__(self, self._work_class)
  
          # Look for the name in the instance (e.g. for private variables)
          return object.__getattribute__(self, name)
  
imports: import abc
  import inspect
  import os
  import pydoc
  import subprocess
  import sys
  from typing import Any, Callable, Type
  from lightning.app.core.work import LightningWork
  from lightning.app.utilities.app_helpers import StreamLitStatePlugin
  from lightning.app.utilities.state import AppState
label_desc: Use image node_id 2 for calling the _PatchedWork obj's underlying member method code with example usage: obj.__getattr__(name) and returns: getattr, object, attribute, attribute