code: def __init__(self, src, metadata_group):
      from collections import namedtuple
  
      metadata_path = next(
          (
              Path(p)
              for c, p in metadata_group.items()
              if c.endswith(".json")
          )
      )
      self.metadata = json.loads(metadata_path.read_text())
      self.metadata["tensormaps_info"] = (
          [
              InfoFromBackendForTensorMap(e)
              for e in self.metadata["tensormaps_info"]
          ]
          if "tensormaps_info" in self.metadata
          else []
      )
      for i, _ in enumerate(self.metadata["tensormaps_info"]):
          self.metadata["tensormaps_info"][
              i
          ].ids_of_folded_args = tuple(
              self.metadata["ids_of_folded_args"]
          )
      self.metadata["tensormaps_info"] = tuple(
          self.metadata["tensormaps_info"]
      )
      KernelMetadata = namedtuple(
          "KernelMetadata", sorted(list(self.metadata.keys()))
      )
      self.metadata = KernelMetadata(**self.metadata)
  
      self.name = self.metadata.name
      # create launcher
      self.run = driver.launcher_cls(src, self.metadata)
      # stores the text of each level of IR that was generated during compilation
      asm_files = [
          Path(p)
          for c, p in metadata_group.items()
          if not c.endswith(".json")
      ]
      self.asm = {
          file.suffix[1:]: file.read_bytes()
          if file.suffix[1:] == driver.binary_ext
          else file.read_text()
          for file in asm_files
      }
      self.kernel = self.asm[driver.binary_ext]
      # binaries are lazily initialized
      # because it involves doing runtime things
      # (e.g., checking amount of shared memory on current device)
      self.module = None
      self.function = None
  
imports: from __future__ import annotations
  import hashlib
  import json
  from .._C.libtriton import get_env_vars, ir
  from ..backends import backends
  from ..None import __version__
  from ..runtime.autotuner import OutOfResources
  from ..runtime.cache import get_cache_manager
  from ..runtime.driver import driver
  from ..backends.nvidia.compiler import InfoFromBackendForTensorMap
  from dataclasses import dataclass
  from .code_generator import ast_to_ttir
  from pathlib import Path
  import re
  import functools
  import os
label_desc: Use image node_id 1 to create a new CompiledKernel object  with example: obj = CompiledKernel(src, metadata_group)