code: def _sanity_check(
      test: Test,
      passing_revision: str,
      failing_revision: str,
      run_per_commit: int,
      is_full_test: bool = False,
  ) -> bool:
      """
      Sanity check that the test indeed passes on the passing revision, and fails on the
      failing revision
      """
      logger.info(
          f"Sanity check passing revision: {passing_revision}"
          f" and failing revision: {failing_revision}"
      )
      outcomes = _run_test(
          test,
          [passing_revision, failing_revision],
          run_per_commit,
          is_full_test,
      )
      if any(
          map(
              lambda x: x != "passed",
              outcomes[passing_revision].values(),
          )
      ):
          return False
      return any(
          map(
              lambda x: x != "passed",
              outcomes[failing_revision].values(),
          )
      )
  
imports: import click
  import copy
  import subprocess
  import os
  import json
  import time
  from typing import Dict, List, Set, Tuple
  from pathlib import Path
  from ray_release.bazel import bazel_runfile
  from ray_release.logger import logger
  from ray_release.buildkite.step import get_step
  from ray_release.byod.build import build_anyscale_base_byod_images, build_anyscale_custom_byod_image
  from ray_release.config import read_and_validate_release_test_collection
  from ray_release.configs.global_config import init_global_config
  from ray_release.test import Test
  from ray_release.test_automation.release_state_machine import ReleaseTestStateMachine
label_desc: Use image node_id 3 for calling a global function with example usage: _sanity_check(test, passing_revision, failing_revision, run_per_commit, is_full_test) and returns: any, False