code: def try_import_pycocotools():
      """
      Tricks to optionally install and import pycocotools. Modified from gluon cv.
      """
      # first we can try import pycocotools
      try:
          import pycocotools as _
      except ImportError:
          # we need to install pycootools, which is a bit tricky
          # pycocotools sdist requires Cython, numpy(already met)
          import_try_install("cython")
          # pypi pycocotools is not compatible with windows
          win_url = "git+https://github.com/zhreshold/cocoapi.git#subdirectory=PythonAPI"
          try:
              if os.name == "nt":
                  import_try_install("pycocotools", win_url)
              else:
                  import_try_install("pycocotools")
          except ImportError:
              faq = "cocoapi FAQ"
              raise ImportError(
                  "Cannot import or install pycocotools, please refer to %s."
                  % faq
              )
  
imports: import json
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Union
  import defusedxml.ElementTree
  import numpy
  import pandas
  import PIL
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from ..constants import BBOX, LABEL, MAP, MAP_50, MAP_75, MAP_LARGE, MAP_MEDIUM, MAP_SMALL, MAR_1, MAR_10, MAR_100, MAR_LARGE, MAR_MEDIUM, MAR_SMALL, MEAN_AVERAGE_PRECISION
  from .download import download, is_url
label_desc: Use image node_id 11 for calling a global function with example usage: try_import_pycocotools() without return types