code: def _detect_duplicate_installation():
      # List of all CuPy packages, including out-dated ones.
      known = {
          "cupy",
          "cupy-cuda80",
          "cupy-cuda90",
          "cupy-cuda91",
          "cupy-cuda92",
          "cupy-cuda100",
          "cupy-cuda101",
          "cupy-cuda102",
          "cupy-cuda110",
          "cupy-cuda111",
          "cupy-cuda112",
          "cupy-cuda113",
          "cupy-cuda114",
          "cupy-cuda115",
          "cupy-cuda116",
          "cupy-cuda117",
          "cupy-cuda118",
          "cupy-cuda11x",
          "cupy-cuda12x",
          "cupy-rocm-4-0",
          "cupy-rocm-4-1",
          "cupy-rocm-4-2",
          "cupy-rocm-4-3",
          "cupy-rocm-5-0",
      }
      installed_names = {
          d.metadata["Name"] for d in importlib.metadata.distributions()
      }
      cupy_installed = known & installed_names
      if 1 < len(cupy_installed):
          cupy_packages_list = ", ".join(sorted(cupy_installed))
          warnings.warn(
              f"""
  --------------------------------------------------------------------------------
  
    CuPy may not function correctly because multiple CuPy packages are installed
    in your environment:
  
      {cupy_packages_list}
  
    Follow these steps to resolve this issue:
  
      1. For all packages listed above, run the following command to remove all
         existing CuPy installations:
  
           $ pip uninstall <package_name>
  
        If you previously installed CuPy via conda, also run the following:
  
           $ conda uninstall cupy
  
      2. Install the appropriate CuPy package.
         Refer to the Installation Guide for detailed instructions.
  
           https://docs.cupy.dev/en/stable/install.html
  
  --------------------------------------------------------------------------------
  """
          )
  
imports: import ctypes
  import importlib.metadata
  import json
  import os
  import os.path
  import re
  import shutil
  import sys
  from typing import Any, Dict, List, Optional, Tuple
  import warnings
label_desc: Use image node_id 22 for calling a global function with example usage: _detect_duplicate_installation() without return types