code: def resolve_url(self, app, base_url: Optional[str] = None) -> None:
      if not self.base_url:
          self.base_url = base_url
  
      for flow in app.flows:
          if self.base_url:
              # Replacing the path with complete URL
              if not (
                  self.base_url.startswith("http://")
                  or self.base_url.startswith("https://")
              ):
                  raise ValueError(
                      "Base URL doesn't have a valid scheme, expected it to start with 'http://' or 'https://' "
                  )
              if (
                  isinstance(flow._layout, dict)
                  and "target" not in flow._layout
              ):
                  # FIXME: Why _check_service_url_is_ready doesn't work ?
                  frontend_url = urllib.parse.urljoin(
                      self.base_url, flow.name + "/"
                  )
                  flow._layout["target"] = frontend_url
  
      for work in app.works:
          if (
              work._url == ""
              and work.status.stage
              in (
                  WorkStageStatus.RUNNING,
                  WorkStageStatus.SUCCEEDED,
              )
              and work._internal_ip != ""
              and _check_service_url_is_ready(
                  f"http://{work._internal_ip}:{work._port}"
              )
          ):
              work._url = work._future_url
  
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 6 for calling the CloudBackend obj's underlying member method code with example usage: obj.resolve_url(app, base_url) without return types