code: def check_submodules():
      def check_for_files(folder, files):
          if not any(
              os.path.exists(os.path.join(folder, f)) for f in files
          ):
              report(
                  "Could not find any of {} in {}".format(
                      ", ".join(files), folder
                  )
              )
              report(
                  "Did you run 'git submodule update --init --recursive'?"
              )
              sys.exit(1)
  
      def not_exists_or_empty(folder):
          return not os.path.exists(folder) or (
              os.path.isdir(folder) and len(os.listdir(folder)) == 0
          )
  
      if bool(os.getenv("USE_SYSTEM_LIBS", False)):
          return
      folders = get_submodule_folders()
      # If none of the submodule folders exists, try to initialize them
      if all(not_exists_or_empty(folder) for folder in folders):
          try:
              print(" --- Trying to initialize submodules")
              start = time.time()
              subprocess.check_call(
                  [
                      "git",
                      "submodule",
                      "update",
                      "--init",
                      "--recursive",
                  ],
                  cwd=cwd,
              )
              end = time.time()
              print(
                  f" --- Submodule initialization took {end - start:.2f} sec"
              )
          except Exception:
              print(" --- Submodule initalization failed")
              print(
                  "Please run:\n\tgit submodule update --init --recursive"
              )
              sys.exit(1)
      for folder in folders:
          check_for_files(
              folder,
              [
                  "CMakeLists.txt",
                  "Makefile",
                  "setup.py",
                  "LICENSE",
                  "LICENSE.md",
                  "LICENSE.txt",
              ],
          )
      check_for_files(
          os.path.join(
              third_party_path, "fbgemm", "third_party", "asmjit"
          ),
          ["CMakeLists.txt"],
      )
      check_for_files(
          os.path.join(
              third_party_path, "onnx", "third_party", "benchmark"
          ),
          ["CMakeLists.txt"],
      )
  
imports: import sys
  import platform
  import filecmp
  import glob
  import importlib
  import json
  import os
  import shutil
  import subprocess
  import sysconfig
  import time
  from collections import defaultdict
  import setuptools.command.build_ext
  import setuptools.command.install
  import setuptools.command.sdist
  from setuptools import Extension, find_packages, setup
  from setuptools.dist import Distribution
  from tools.build_pytorch_libs import build_caffe2
  from tools.generate_torch_version import get_torch_version
  from tools.setup_helpers.cmake import CMake
  from tools.setup_helpers.env import build_type, IS_DARWIN, IS_LINUX, IS_WINDOWS
label_desc: Use image node_id 2 for calling a global function with example usage: check_submodules() and returns: unknown