code: def _cache_image(image: Image.Image, image_path: str):
      cache_dir = Path(IMAGE_CACHE_DIR)
      filename = image_path.replace("/", CHITRA_URL_SEP)
      os.makedirs(cache_dir, exist_ok=True)
      image.save(cache_dir / filename)
  
imports: import io
  import os
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import matplotlib.pyplot
  import numpy
  import requests
  from PIL import Image
  from chitra.constants import CHITRA_URL_SEP, IMAGE_CACHE_DIR
  from chitra.coordinates import BoundingBoxes
label_desc: Use image node_id 1 for calling a global function with example usage: _cache_image(image, image_path) without return types