code: def _is_dirty(dir_path):
      
      try:
          subprocess.check_call(["git", "diff", "--quiet"], cwd=dir_path)
          return False
      except subprocess.CalledProcessError:
          return True
docs: Check whether a git repository has uncommitted changes.