docstr: Return a list of kernel keys that cover the used ops
docstr_tok: ["Return","a","list","of","kernel","keys","that","cover","the","used","ops"]
code: def et_get_selected_kernels(
      self, op_name: str, kernel_key: List[str]
  ) -> List[str]:
      """
      Return a list of kernel keys that cover the used ops
      """
      # If no kernel metadata, either it's implied by include_all_operators=True or the op is not used.
      if op_name not in self.et_kernel_metadata:
          return kernel_key if self.include_all_operators else []
      # Otherwise, only return the specific kernel keys.
  
      result_set = set()
  
      for model_kernel_keys in self.et_kernel_metadata[op_name]:
          key_found = False
          for key in kernel_key:
              # Don't compare the version for now
              if (
                  key != "default"
                  and key.split("/")[1]
                  == model_kernel_keys.split("/")[1]
              ):
                  result_set.add(key)
                  key_found = True
                  break
          if not key_found:
              if "default" not in kernel_key:
                  raise Exception("Missing kernel for the model")
              else:
                  result_set.add("default")
  
      return list(result_set)
  
imports: from collections import defaultdict
  from collections.abc import Iterable
  from dataclasses import dataclass
  from typing import Dict, List, Optional, Set, Tuple
  import yaml
  from torchgen.model import NativeFunction
  from torchgen.selective_build.operator import merge_debug_info, merge_operator_dicts, SelectiveBuildOperator, strip_operator_overload_name
label_desc: Use image node_id 12 for calling the SelectiveBuilder obj's underlying member method code with example usage: obj.et_get_selected_kernels(op_name, kernel_key) and returns: list, unknown