code: def group_tests(
      test_collection_filtered: List[Tuple[Test, bool]]
  ) -> Dict[str, List[Tuple[Test, bool]]]:
      groups = defaultdict(list)
      for test, smoke in test_collection_filtered:
          group = test.get("group", "Ungrouped release tests")
          groups[group].append((test, smoke))
      return groups
  
file_path: ray/release/ray_release/buildkite/filter.py
imports: import re
  import copy
  from collections import defaultdict
  from typing import List, Optional, Tuple, Dict, Any
  from ray_release.buildkite.settings import Frequency, get_frequency
  from ray_release.test import Test
  from ray_release.test_automation.state_machine import TestStateMachine
label_desc: Use image node_id 3 for calling a global function with example usage: group_tests(test_collection_filtered) and returns: groups