code: def __del__(self):
      if (
          self._handle_batch_task is None
          or not get_or_create_event_loop().is_running()
      ):
          return
  
      # TODO(edoakes): although we try to gracefully shutdown here, it still
      # causes some errors when the process exits due to the asyncio loop
      # already being destroyed.
      self._handle_batch_task.cancel()
  
imports: import asyncio
  import time
  from dataclasses import dataclass
  from functools import wraps
  from inspect import isasyncgenfunction, iscoroutinefunction
  from typing import Any, AsyncGenerator, Callable, Dict, Iterable, List, Optional, Tuple, Type, TypeVar, overload
  from ray._private.signature import extract_signature, flatten_args, recover_args
  from ray._private.utils import get_or_create_event_loop
  from ray.serve._private.utils import extract_self_if_method_call
  from ray.serve.exceptions import RayServeException
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 4 for calling the _BatchQueue obj's underlying member method code with example usage: obj.__del__() without return types