code: def create_work(self, app: LightningApp, work: LightningWork) -> None:
      app_id = self._get_app_id()
      project_id = self._get_project_id()
      list_response: V1ListLightningworkResponse = (
          self.client.lightningwork_service_list_lightningwork(
              project_id=project_id, app_id=app_id
          )
      )
      external_specs: List[
          Externalv1Lightningwork
      ] = list_response.lightningworks
  
      # Find THIS work in the list of all registered works
      external_spec = None
      for es in external_specs:
          if es.name == work.name:
              external_spec = es
              break
  
      if external_spec is None:
          spec = self._work_to_spec(work)
          try:
              fn = SpecLightningappInstanceIdWorksBody.__init__
              params = list(inspect.signature(fn).parameters)
              extras = {}
              if "display_name" in params:
                  extras["display_name"] = getattr(
                      work, "display_name", ""
                  )
  
              external_spec = self.client.lightningwork_service_create_lightningwork(
                  project_id=project_id,
                  spec_lightningapp_instance_id=app_id,
                  body=SpecLightningappInstanceIdWorksBody(
                      name=work.name,
                      spec=spec,
                      **extras,
                  ),
              )
              # overwriting spec with return value
              spec = external_spec.spec
          except ApiException as e:
              # We might get exceed quotas, or be out of credits.
              message = json.loads(e.body).get("message")
              raise LightningPlatformException(message) from None
      elif (
          external_spec.spec.desired_state
          == V1LightningworkState.RUNNING
      ):
          spec = external_spec.spec
          work._port = spec.network_config[0].port
      else:
          # Signal the LightningWorkState to go into state RUNNING
          spec = external_spec.spec
  
          # getting the updated spec but ignoring everything other than port & drives
          new_spec = self._work_to_spec(work)
  
          spec.desired_state = V1LightningworkState.RUNNING
          spec.network_config[0].port = new_spec.network_config[0].port
          spec.drives = new_spec.drives
          spec.user_requested_compute_config = (
              new_spec.user_requested_compute_config
          )
          spec.build_spec = new_spec.build_spec
          spec.env = new_spec.env
          try:
              self.client.lightningwork_service_update_lightningwork(
                  project_id=project_id,
                  id=external_spec.id,
                  spec_lightningapp_instance_id=app_id,
                  body=WorksIdBody(spec),
              )
          except ApiException as e:
              # We might get exceed quotas, or be out of credits.
              message = json.loads(e.body).get("message")
              raise LightningPlatformException(message) from None
  
      # Replace the undefined url and host by the known one.
      work._host = "0.0.0.0"  # noqa: S104
      work._future_url = (
          f"{self._get_proxy_scheme()}://{spec.network_config[0].host}"
      )
  
      # removing the backend to avoid the threadlock error
      _backend = work._backend
      work._backend = None
      app.work_queues[work.name].put(work)
      work._backend = _backend
  
      logger.info(f"Starting work {work.name}")
      logger.debug(f"With the following external spec: {external_spec}")
  
imports: import inspect
  import json
  import logging
  import os
  import random
  import string
  import urllib
  from time import monotonic, sleep, time
  from typing import List, Optional
  from lightning_cloud.openapi import AppinstancesIdBody, Externalv1LightningappInstance, Externalv1Lightningwork, V1BuildSpec, V1Drive, V1DriveSpec, V1DriveStatus, V1DriveType, V1Flowserver, V1LightningappInstanceState, V1LightningappRestartPolicy, V1LightningworkClusterDriver, V1LightningworkDrives, V1LightningworkSpec, V1LightningworkState, V1ListLightningworkResponse, V1Metadata, V1NetworkConfig, V1PackageManager, V1PythonDependencyInfo, V1SourceType, V1UserRequestedComputeConfig
  from lightning_cloud.openapi.rest import ApiException
  from lightning.app.core import LightningApp, LightningWork
  from lightning.app.core.queues import QueuingSystem
  from lightning.app.runners.backends.backend import Backend
  from lightning.app.storage import Drive, Mount
  from lightning.app.utilities.enum import WorkStageStatus, WorkStopReasons, make_status
  from lightning.app.utilities.exceptions import LightningPlatformException
  from lightning.app.utilities.network import LightningClient, _check_service_url_is_ready
  from lightning_cloud.openapi import SpecLightningappInstanceIdWorksBody, WorksIdBody
label_desc: Use image node_id 3 for calling the CloudBackend obj's underlying member method code with example usage: obj.create_work(app, work) without return types