code: def cleanup(self) -> None:
      # TODO: make _done atomic
      if self._done:
          return
      self._done = True
      if self.interface:
          self.interface.join()
      if self.wandb_process:
          self.wandb_process.join()
  
      if self.record_q and hasattr(self.record_q, "close"):
          self.record_q.close()
      if self.result_q and hasattr(self.result_q, "close"):
          self.result_q.close()
  
imports: import importlib.machinery
  import logging
  import multiprocessing
  import os
  import queue
  import sys
  import threading
  from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union, cast
  import wandb
  from wandb.sdk.interface.interface import InterfaceBase
  from wandb.sdk.interface.interface_queue import InterfaceQueue
  from wandb.sdk.internal.internal import wandb_internal
  from wandb.sdk.internal.settings_static import SettingsStatic
  from wandb.sdk.lib.mailbox import Mailbox
  from wandb.sdk.wandb_manager import _Manager
  from wandb.sdk.wandb_settings import Settings
label_desc: Use image node_id 9 for calling the Backend obj's underlying member method code with example usage: obj.cleanup() without return types