code: def pretty_ptx(s):
      # all expressions match `<valid_before><expr><valid_after>` and replace it with `<valid_before>color(<expr>)<valid_after>`
      s = re.sub(
          r"([!@<\[\s,\+\-;\n])((?:[_%$][\w%\$_]+(?:\.[xyz])?\:?)|(?:buf\d+))([<>\]\s,\+\-;\n\)])",
          lambda m: m[1] + colored(m[2], "blue") + m[3],
          s,
          flags=re.M,
      )  # identifiers  # noqa: E501
      s = re.sub(
          r"(.)((?:b|s|u|f)(?:8|16|32|64)|pred)([\.\s])",
          lambda m: m[1] + colored(m[2], "green") + m[3],
          s,
          flags=re.M,
      )  # types
      s = re.sub(
          r"^(\s*)([\w]+)(.*?;$)",
          lambda m: m[1] + colored(m[2], "yellow") + m[3],
          s,
          flags=re.M,
      )  # instructions
      s = re.sub(
          r"([<>\[\]\s,\+\-;])((?:0[fF][0-9a-fA-F]{8})|(?:[0-9]+)|(?:0[xX][0-9a-fA-F]+))([<>\[\]\s,\+\-;])",
          lambda m: m[1] + colored(m[2], "yellow") + m[3],
          s,
          flags=re.M,
      )  # numbers  # noqa: E501
      s = re.sub(
          r"(\.)(param|reg|global)",
          lambda m: m[1] + colored(m[2], "magenta"),
          s,
          flags=re.M,
      )  # space
      s = re.sub(
          r"(\.)(version|target|address_size|visible|entry)",
          lambda m: m[1] + colored(m[2], "magenta"),
          s,
          flags=re.M,
      )  # derivatives
      return s
  
imports: from __future__ import annotations
  import subprocess, hashlib, tempfile, ctypes, ctypes.util, functools, re
  from pathlib import Path
  from typing import Tuple, Optional
  import gpuctypes.cuda
  from tinygrad.helpers import DEBUG, getenv, from_mv, init_c_var, colored, cpu_time_execution, compile_cuda_style, encode_args_cuda_style, time_execution_cuda_style
  from tinygrad.device import Compiled, LRUAllocator, MallocAllocator
  from tinygrad.codegen.kernel import LinearizerOptions
  from tinygrad.renderer.cstyle import CUDARenderer
label_desc: Use image node_id 1 for calling a global function with example usage: pretty_ptx(s) and returns: s