code: def is_repo_rebased(repo: str, branch: str):
      """Returns True if the local branch contains the latest remote SHA (i.e. if it is rebased)"""
      # We import it locally so that click autocomplete works
      import requests
  
      gh_url = f"https://api.github.com/repos/{repo}/commits/{branch}"
      headers_dict = {"Accept": "application/vnd.github.VERSION.sha"}
      latest_sha = requests.get(
          gh_url, headers=headers_dict
      ).text.strip()
      rebased = False
      command_result = run_command(
          ["git", "log", "--format=format:%H"],
          capture_output=True,
          text=True,
      )
      commit_list = (
          command_result.stdout.strip().splitlines()
          if command_result is not None
          else "missing"
      )
      if latest_sha in commit_list:
          rebased = True
      return rebased
  
imports: from __future__ import annotations
  import atexit
  import contextlib
  import os
  import re
  import shlex
  import shutil
  import signal
  import stat
  import subprocess
  import sys
  from functools import lru_cache
  from pathlib import Path
  from typing import Mapping, Union
  from rich.markup import escape
  from airflow_breeze.utils.ci_group import ci_group
  from airflow_breeze.utils.console import Output, get_console
  from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT, WWW_ASSET_COMPILE_LOCK, WWW_ASSET_HASH_FILE, WWW_ASSET_OUT_DEV_MODE_FILE, WWW_ASSET_OUT_FILE, WWW_NODE_MODULES_DIR, WWW_STATIC_DIST_DIR
  from airflow_breeze.utils.shared_options import get_dry_run, get_verbose
label_desc: Use image node_id 10 for calling a global function with example usage: is_repo_rebased(repo, branch) and returns: rebased