code: def _plot_detection_sample(img: Image.Image, target):
      from matplotlib import patches
      import matplotlib.pyplot as plt
  
      plt.gca().imshow(img)
      for box in target["boxes"]:
          box = box.tolist()
  
          rect = patches.Rectangle(
              (box[0], box[1]),
              box[2] - box[0],
              box[3] - box[1],
              linewidth=1,
              edgecolor="r",
              facecolor="none",
          )
          plt.gca().add_patch(rect)
  
imports: from pathlib import Path
  from typing import Optional, Union, List, Sequence
  import torch
  from PIL import Image
  from torchvision.datasets.folder import default_loader
  from torchvision.transforms import ToTensor
  from typing_extensions import TypedDict
  from avalanche.benchmarks.datasets import DownloadableDataset, default_dataset_location
  from avalanche.benchmarks.datasets.lvis_dataset.lvis_data import lvis_archives
label_desc: Use image node_id 3 for calling a global function with example usage: _plot_detection_sample(img, target) without return types