class_docstr: The Backend provides and interface for the framework to communicate with resources in the cloud.
class_docstr_tok: ["The","Backend","provides","and","interface","for","the","framework","to","communicate","with","resources","in","the","cloud","."]
code: def _dynamic_run_wrapper(
      self,
      *args: Any,
      app: "lightning.app.LightningApp",
      work: "lightning.app.LightningWork",
      work_run: Callable,
      **kwargs: Any,
  ) -> None:
      if not work.name:
          # the name is empty, which means this work was never assigned to a parent flow
          raise AttributeError(
              f"Failed to create process for {work.__class__.__name__}."
              f" Make sure to set this work as an attribute of a `LightningFlow` before calling the run method."
          )
  
      # 1. Create and register the queues associated the work
      self._register_queues(app, work)
  
      work.run = work_run
  
      # 2. Create the work
      self.create_work(app, work)
  
      # 3. Attach backend
      work._backend = self
  
      # 4. Create the work proxy to manipulate the work
      work.run = ProxyWorkRun(
          work_run=work_run,
          work_name=work.name,
          work=work,
          caller_queue=app.caller_queues[work.name],
      )
  
      # 5. Run the work proxy
      return work.run(*args, **kwargs)
  
imports: from abc import ABC, abstractmethod
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable, List, Optional
  from lightning.app.core.queues import QueuingSystem
  from lightning.app.utilities.proxies import ProxyWorkRun, unwrap
label_desc: Use image node_id 7 for calling the Backend obj's underlying member method code with example usage: obj._dynamic_run_wrapper() and returns: work