code: def extract_compile_commands(
      parsed_aquery_output: _JSONDict,
  ) -> list[CompileCommand]:
      """Gathers compile commands to run from `bazel aquery` JSON output.
  
      Arguments:
        parsed_aquery_output: Parsed JSON representing the output of `bazel aquery
          --output=jsonproto`.
  
      Returns:
        The list of CompileCommands that should be executed.
      """
      actions = parsed_aquery_output["actions"]
  
      commands = []
      for action in actions:
          command = CompileCommand.from_args_list(action["arguments"])
          commands.append(command)
      return commands
  
file_path: tensorflow-upstream/third_party/xla/build_tools/lint/generate_compile_commands.py
imports: import dataclasses
  import json
  import logging
  import pathlib
  import sys
  from typing import Any
label_desc: Use image node_id 1 for calling a global function with example usage: extract_compile_commands(parsed_aquery_output) and returns: commands