code: def get_extensions():
      extensions = []
  
      extensions_dir = osp.join("csrc")
      main_files = glob.glob(osp.join(extensions_dir, "*.cpp"))
      # remove generated 'hip' files, in case of rebuilds
      main_files = [path for path in main_files if "hip" not in path]
  
      for main, suffix in product(main_files, suffices):
          define_macros = [("WITH_PYTHON", None)]
          undef_macros = []
  
          if sys.platform == "win32":
              define_macros += [("torchscatter_EXPORTS", None)]
  
          extra_compile_args = {"cxx": ["-O3"]}
          if not os.name == "nt":  # Not on Windows:
              extra_compile_args["cxx"] += ["-Wno-sign-compare"]
          extra_link_args = [] if WITH_SYMBOLS else ["-s"]
  
          info = parallel_info()
          if (
              "backend: OpenMP" in info
              and "OpenMP not found" not in info
              and sys.platform != "darwin"
          ):
              extra_compile_args["cxx"] += ["-DAT_PARALLEL_OPENMP"]
              if sys.platform == "win32":
                  extra_compile_args["cxx"] += ["/openmp"]
              else:
                  extra_compile_args["cxx"] += ["-fopenmp"]
          else:
              print("Compiling without OpenMP...")
  
          # Compile for mac arm64
          if sys.platform == "darwin" and platform.machine() == "arm64":
              extra_compile_args["cxx"] += ["-arch", "arm64"]
              extra_link_args += ["-arch", "arm64"]
  
          if suffix == "cuda":
              define_macros += [("WITH_CUDA", None)]
              nvcc_flags = os.getenv("NVCC_FLAGS", "")
              nvcc_flags = (
                  [] if nvcc_flags == "" else nvcc_flags.split(" ")
              )
              nvcc_flags += ["-O3"]
              if torch.version.hip:
                  # USE_ROCM was added to later versions of PyTorch.
                  # Define here to support older PyTorch versions as well:
                  define_macros += [("USE_ROCM", None)]
                  undef_macros += ["__HIP_NO_HALF_CONVERSIONS__"]
              else:
                  nvcc_flags += ["--expt-relaxed-constexpr"]
              extra_compile_args["nvcc"] = nvcc_flags
  
          name = main.split(os.sep)[-1][:-4]
          sources = [main]
  
          path = osp.join(extensions_dir, "cpu", f"{name}_cpu.cpp")
          if osp.exists(path):
              sources += [path]
  
          path = osp.join(extensions_dir, "cuda", f"{name}_cuda.cu")
          if suffix == "cuda" and osp.exists(path):
              sources += [path]
  
          Extension = CppExtension if suffix == "cpu" else CUDAExtension
          extension = Extension(
              f"torch_scatter._{name}_{suffix}",
              sources,
              include_dirs=[extensions_dir],
              define_macros=define_macros,
              undef_macros=undef_macros,
              extra_compile_args=extra_compile_args,
              extra_link_args=extra_link_args,
          )
          extensions += [extension]
  
      return extensions
  
file_path: pytorch_scatter/setup.py
imports: import glob
  import os
  import os.path
  import platform
  import sys
  from itertools import product
  import torch
  from setuptools import find_packages, setup
  from torch.__config__ import parallel_info
  from torch.utils.cpp_extension import CUDA_HOME, BuildExtension, CppExtension, CUDAExtension
label_desc: Use image node_id 1 for calling a global function with example usage: get_extensions() and returns: extensions