code: def replace_instruction_names(t: str) -> str:
      """Replaces all HLO instruction names by captured FileCheck variables.
  
      Args:
        t: Test text to replace
  
      Returns:
        Test with replacements applied.
      """
      f = FileCheckVarReplacer()
      out = []
      for line in t.split("\n"):
          out.append(f.replace_instruction_names_for_line(line))
      return "\n".join(out)
  
file_path: tensorflow/third_party/xla/xla/service/generate_test_hlo_checks.py
imports: import re
  import shutil
  import sys
  import tempfile
  from typing import Dict
label_desc: Use image node_id 1 for calling a global function with example usage: replace_instruction_names(t) and returns: str