code: def check_updates(self):
      repo = Repo(self.path)
      for fetch in repo.remote().fetch(dry_run=True):
          if fetch.flags != fetch.HEAD_UPTODATE:
              self.can_update = True
              self.status = "new commits"
              return
  
      try:
          origin = repo.rev_parse("origin")
          if repo.head.commit != origin:
              self.can_update = True
              self.status = "behind HEAD"
              return
      except Exception:
          self.can_update = False
          self.status = "unknown (remote error)"
          return
  
      self.can_update = False
      self.status = "latest"
  
imports: from __future__ import annotations
  import configparser
  import os
  import threading
  import re
  from modules import shared, errors, cache, scripts
  from modules.gitpython_hack import Repo
  from modules.paths_internal import extensions_dir, extensions_builtin_dir, script_path
label_desc: Use image node_id 7 for calling the Extension obj's underlying member method code with example usage: obj.check_updates() without return types