code: def extract_ir(filename: str) -> List[str]:
      BEGIN = "<GRAPH_EXPORT>"
      END = "</GRAPH_EXPORT>"
      pfx = None
      current = ""
      graphs = []
      with open(filename) as f:
          split_strs = f.read().split(BEGIN)
          for i, split_str in enumerate(split_strs):
              if i == 0:
                  continue
              end_loc = split_str.find(END)
              if end_loc == -1:
                  continue
              s = split_str[:end_loc]
              pfx = split_strs[i - 1].splitlines()[-1]
              lines = [
                  x[len(pfx) :] for x in s.splitlines(keepends=True)
              ]
              graphs.append("".join(lines))
  
      return graphs
  
file_path: pytorch/torch/utils/jit/log_extract.py
imports: from contextlib import contextmanager
  from typing import Any, List, Tuple, cast
  import random
  import torch
  import time
  from torch.utils.benchmark import Timer
label_desc: Use image node_id 1 for calling a global function with example usage: extract_ir(filename) and returns: graphs