code: def __check_submodules(self):
          
          if not os.path.exists('.git'):
              return
          with open('.gitmodules') as f:
              for l in f:
                  if 'path' in l:
                      p = l.split('=')[-1].strip()
                      if not os.path.exists(p):
                          raise ValueError('Submodule %s missing' % p)
  
          proc = subprocess.Popen(['git', 'submodule', 'status'],
                                  stdout=subprocess.PIPE)
          status, _ = proc.communicate()
          status = status.decode("ascii", "replace")
          for line in status.splitlines():
              if line.startswith('-') or line.startswith('+'):
                  raise ValueError('Submodule not clean: %s' % line)
docs: Verify that the submodules are checked out and clean.