class_docstr: Represents a compilation command with options on a specific file.
class_docstr_tok: ["Represents","a","compilation","command","with","options","on","a","specific","file","."]
docstr: Alternative constructor which uses the args_list from `bazel aquery`.
  
  This collects arguments and the file being run on from the output of
  `bazel aquery`. Also filters out arguments which break clang-tidy.
  
  Arguments:
    args_list: List of arguments generated by `bazel aquery`
  
  Returns:
    The corresponding ClangTidyCommand.
docstr_tok: ["Alternative","constructor","which","uses","the","args_list","from","`","bazel","aquery","`",".","This","collects","arguments","and","the","file","being","run","on","from","the","output","of","`","bazel","aquery","`",".","Also","filters","out","arguments","which","break","clang-tidy",".","Arguments",":","args_list",":","List","of","arguments","generated","by","`","bazel","aquery","`","Returns",":","The","corresponding","ClangTidyCommand","."]
code: def from_args_list(cls, args_list: list[str]) -> "CompileCommand":
      """Alternative constructor which uses the args_list from `bazel aquery`.
  
      This collects arguments and the file being run on from the output of
      `bazel aquery`. Also filters out arguments which break clang-tidy.
  
      Arguments:
        args_list: List of arguments generated by `bazel aquery`
  
      Returns:
        The corresponding ClangTidyCommand.
      """
      cc_file = None
      filtered_args = []
  
      for arg in args_list:
          if arg in _DISALLOWED_ARGS:
              continue
  
          if arg.endswith(".cc"):
              cc_file = arg
  
          filtered_args.append(arg)
  
      return cls(cc_file, filtered_args)
  
file_path: tensorflow/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 the CompileCommand obj's underlying member method code with example usage: obj.from_args_list(cls, args_list) and returns: cls