code: def _handle_idle_timeout(
      self,
      idle_timeout: float,
      work: LightningWork,
      resp: Externalv1Lightningwork,
  ) -> None:
      if idle_timeout is None:
          return
  
      if work.status.stage != WorkStageStatus.SUCCEEDED:
          return
  
      if time() > (idle_timeout + work.status.timestamp):
          logger.info(
              f"Idle Timeout {idle_timeout} has triggered. Stopping gracefully the {work.name}."
          )
          latest_hash = work._calls["latest_call_hash"]
          status = make_status(
              WorkStageStatus.STOPPED, reason=WorkStopReasons.PENDING
          )
          work._calls[latest_hash]["statuses"].append(status)
          self._stop_work(resp)
          logger.debug(f"Stopping work: {resp.id}")
  
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 11 for calling the CloudBackend obj's underlying member method code with example usage: obj._handle_idle_timeout(idle_timeout, work, resp) without return types