code: def check_submodule_status(root=None):
      """check submodule status
  
      Has three return values:
  
      'missing' - submodules are absent
      'unclean' - submodules have unstaged changes
      'clean' - all submodules are up to date
      """
      if root is None:
          root = os.path.dirname(os.path.abspath(__file__))
  
      if hasattr(sys, "frozen"):
          # frozen via py2exe or similar, don't bother
          return "clean"
  
      if not is_repo(root):
          # not in git, assume clean
          return "clean"
  
      for submodule in SUBMODULES:
          if not os.path.exists(submodule):
              return "missing"
  
      # Popen can't handle unicode cwd on Windows Python 2
      if (
          sys.platform == "win32"
          and sys.version_info[0] < 3
          and not isinstance(root, bytes)
      ):
          root = root.encode(sys.getfilesystemencoding() or "ascii")
      # check with git submodule status
      proc = subprocess.Popen(
          "git submodule status",
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=True,
          cwd=root,
      )
      status, _ = proc.communicate()
      status = status.decode("ascii", "replace")
  
      for line in status.splitlines():
          if line.startswith("-"):
              return "missing"
          elif line.startswith("+"):
              return "unclean"
  
      return "clean"
  
imports: import os
  import subprocess
  import sys
  import warnings
  import shutil
label_desc: Use image node_id 3 for calling a global function with example usage: check_submodule_status(root) and returns: str, str, str, str, str, str