# Path: dev_tools/shell_tools.py
# BOLD = 1
# DIM = 2
# RED = 31
# GREEN = 32
# YELLOW = 33
# def highlight(text: str, color_code: int, bold: bool=False) -> str:
#     def __init__(self, out_pipe: Optional[IO[str]] = None) -> None:
# async def _async_forward(async_chunks: collections.AsyncIterable,
#                          out: Optional[Union[TeeCapture, IO[str]]]
#                          ) -> Optional[str]:
# async def _async_wait_for_process(
#         future_process: Any,
#         out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#         err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr
# ) -> CommandOutput:
# def abbreviate_command_arguments_after_switches(
#         cmd: Tuple[str, ...]) -> Tuple[str, ...]:
# def run_cmd(*cmd: Optional[str],
#             out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#             err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#             raise_on_fail: bool = True,
#             log_run_to_stderr: bool = True,
#             abbreviate_non_option_arguments: bool = False,
#             **kwargs
#             ) -> CommandOutput:
# def run_shell(cmd: str,
#               out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#               err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#               raise_on_fail: bool = True,
#               log_run_to_stderr: bool = True,
#               **kwargs
#               ) -> CommandOutput:
# def output_of(*cmd: Optional[str], **kwargs) -> str:
# class TeeCapture:
# 
# Path: dev_tools/github_repository.py
# class GithubRepository:
#     def __init__(self,
#                  organization: str,
#                  name: str,
#                  access_token: Optional[str]) -> None:
#     def as_remote(self) -> str:
# 
# Path: dev_tools/prepared_env.py
# class PreparedEnv:
#     def __init__(self,
#                  github_repo: Optional[github_repository.GithubRepository],
#                  actual_commit_id: Optional[str],
#                  compare_commit_id: str,
#                  destination_directory: Optional[str],
#                  virtual_env_path: Optional[str]) -> None:
#     def bin(self, program: str) -> str:
#     def report_status_to_github(self,
#                                 state: str,
#                                 description: str,
#                                 context: str,
#                                 target_url: Optional[str] = None):
#     def get_changed_files(self) -> List[str]:


import os
import shutil
import subprocess
import sys
from dev_tools import shell_tools, github_repository, prepared_env
    depth exponentially and tries again when the initial guess is not deep
    enough.

    Args:
        remote: The location of the remote repository, in a format that the
            git command will understand.
        actual_branch: A remote branch or ref to fetch,
        compare_branch: Another remote branch or ref to fetch,
        verbose: When set, more progress output is produced.

    Returns:
        A ComparableCommits containing the commit id of the actual branch and
        a the id of a commit to compare against (e.g. for when doing incremental
        checks).
    """
    actual_id = ''
    base_id = ''
    for depth in [10, 100, 1000, None]:
        depth_str = '' if depth is None else '--depth={}'.format(depth)

        shell_tools.run_cmd(
            'git',
            'fetch',
            None if verbose else '--quiet',
            remote,
            actual_branch,
            depth_str,
            log_run_to_stderr=verbose)
        actual_id = shell_tools.output_of('git', 'rev-parse', 'FETCH_HEAD')


# Path: dev_tools/shell_tools.py
# BOLD = 1
# DIM = 2
# RED = 31
# GREEN = 32
# YELLOW = 33
# def highlight(text: str, color_code: int, bold: bool=False) -> str:
#     def __init__(self, out_pipe: Optional[IO[str]] = None) -> None:
# async def _async_forward(async_chunks: collections.AsyncIterable,
#                          out: Optional[Union[TeeCapture, IO[str]]]
#                          ) -> Optional[str]:
# async def _async_wait_for_process(
#         future_process: Any,
#         out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#         err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr
# ) -> CommandOutput:
# def abbreviate_command_arguments_after_switches(
#         cmd: Tuple[str, ...]) -> Tuple[str, ...]:
# def run_cmd(*cmd: Optional[str],
#             out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#             err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#             raise_on_fail: bool = True,
#             log_run_to_stderr: bool = True,
#             abbreviate_non_option_arguments: bool = False,
#             **kwargs
#             ) -> CommandOutput:
# def run_shell(cmd: str,
#               out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#               err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#               raise_on_fail: bool = True,
#               log_run_to_stderr: bool = True,
#               **kwargs
#               ) -> CommandOutput:
# def output_of(*cmd: Optional[str], **kwargs) -> str:
# class TeeCapture:
# 
# Path: dev_tools/github_repository.py
# class GithubRepository:
#     def __init__(self,
#                  organization: str,
#                  name: str,
#                  access_token: Optional[str]) -> None:
#     def as_remote(self) -> str:
# 
# Path: dev_tools/prepared_env.py
# class PreparedEnv:
#     def __init__(self,
#                  github_repo: Optional[github_repository.GithubRepository],
#                  actual_commit_id: Optional[str],
#                  compare_commit_id: str,
#                  destination_directory: Optional[str],
#                  virtual_env_path: Optional[str]) -> None:
#     def bin(self, program: str) -> str:
#     def report_status_to_github(self,
#                                 state: str,
#                                 description: str,
#                                 context: str,
#                                 target_url: Optional[str] = None):
#     def get_changed_files(self) -> List[str]:


# Path: dev_tools/git_env_tools.py
import os
import shutil
import subprocess
import sys
from dev_tools import shell_tools, github_repository, prepared_env

    depth exponentially and tries again when the initial guess is not deep
    enough.

    Args:
        remote: The location of the remote repository, in a format that the
            git command will understand.
        actual_branch: A remote branch or ref to fetch,
        compare_branch: Another remote branch or ref to fetch,
        verbose: When set, more progress output is produced.

    Returns:
        A ComparableCommits containing the commit id of the actual branch and
        a the id of a commit to compare against (e.g. for when doing incremental
        checks).
    """
    actual_id = ''
    base_id = ''
    for depth in [10, 100, 1000, None]:
        depth_str = '' if depth is None else '--depth={}'.format(depth)

        shell_tools.run_cmd(
            'git',
            'fetch',
            None if verbose else '--quiet',
            remote,
            actual_branch,
            depth_str,
            log_run_to_stderr=verbose)
        actual_id = shell_tools.output_of('git', 'rev-parse', 'FETCH_HEAD')


        shell_tools.run_cmd('git',