code: def exists(self):
          
          # keep attributes for later, and restore them if we have no valid data
          # this way we do not actually alter the state of the object
          loc = locals()
          for attr in self._cache_attrs:
              try:
                  if hasattr(self, attr):
                      loc[attr] = getattr(self, attr)
                  # END if we have the attribute cache
              except (cp.NoSectionError, ValueError):
                  # on PY3, this can happen apparently ... don't know why this doesn't happen on PY2
                  pass
          # END for each attr
          self._clear_cache()
  
          try:
              try:
                  self.path
                  return True
              except Exception:
                  return False
              # END handle exceptions
          finally:
              for attr in self._cache_attrs:
                  if attr in loc:
                      setattr(self, attr, loc[attr])
docs: :return: True if the submodule exists, False otherwise. Please note that
              a submodule may exist (in the .gitmodules file) even though its module
              doesn't exist on disk