code: def _bisect(
      test: Test,
      commit_list: List[str],
      concurrency: int,
      run_per_commit: int,
      is_full_test: bool = False,
  ) -> str:
      while len(commit_list) > 2:
          logger.info(
              f"Bisecting between {len(commit_list)} commits: "
              f"{commit_list[0]} to {commit_list[-1]} with concurrency {concurrency}"
          )
          idx_to_commit = {}
          for i in range(concurrency):
              idx = len(commit_list) * (i + 1) // (concurrency + 1)
              # make sure that idx is not at the boundary; this avoids rerun bisect
              # on the previously run revision
              idx = min(max(idx, 1), len(commit_list) - 2)
              idx_to_commit[idx] = commit_list[idx]
          outcomes = _run_test(
              test,
              set(idx_to_commit.values()),
              run_per_commit,
              is_full_test,
          )
          passing_idx = 0
          failing_idx = len(commit_list) - 1
          for idx, commit in idx_to_commit.items():
              is_passing = all(
                  outcome == "passed"
                  for outcome in outcomes[commit].values()
              )
              if is_passing and idx > passing_idx:
                  passing_idx = idx
              if not is_passing and idx < failing_idx:
                  failing_idx = idx
          commit_list = commit_list[passing_idx : failing_idx + 1]
      return commit_list[-1]
  
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 2 for calling a global function with example usage: _bisect(test, commit_list, concurrency, run_per_commit, is_full_test) and returns: commit_list