code: def get_results_from_build_collection(
      bk: Buildkite, build_dict_list: List[Dict]
  ) -> Dict[str, Dict]:
      results_to_fetch = RESULTS_TO_FETCH.copy()
      fetched_results = {}
  
      for build_dict in sorted(
          build_dict_list, key=lambda bd: -bd["number"]
      ):
          if not results_to_fetch:
              break
  
          build = Build(
              id=build_dict["id"],
              number=build_dict["number"],
              commit=build_dict["commit"],
              job_dict_list=build_dict["jobs"],
          )
          build_results = get_results_from_build(
              bk, build, results_to_fetch
          )
          fetched_results.update(build_results)
  
      return fetched_results
  
file_path: ray/release/release_logs/fetch_release_logs.py
imports: import json
  import os
  import re
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  import boto3
  import click
  from pybuildkite.buildkite import Buildkite
label_desc: Use image node_id 3 for calling a global function with example usage: get_results_from_build_collection(bk, build_dict_list) and returns: fetched_results