code: def _check_submodule_status(root, submodules):
      
  
      if hasattr(sys, "frozen"):
          # frozen via py2exe or similar, don't bother
          return 'clean'
  
      if not os.path.exists(os.path.join(root, '.git')):
          # 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'
docs: check submodule status
      Has three return values:
      'missing' - submodules are absent
      'unclean' - submodules have unstaged changes
      'clean' - all submodules are up to date