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 __init__(self, state: AppState, work_class: Type):
      super().__init__()
      self._state = state
      self._work_class = work_class
  
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 1 to create a new _PatchedWork object  with example: obj = _PatchedWork(state, work_class)