code: def load_traceback_code(code_frags: dict, cache: dict = None):
      """
      Load dumped codes for remote tracebacks.
  
      Parameters
      ----------
      code_frags: dict
          Dumped codes for remote traceback.
      cache: dict
          Target for codes to be dumped, for test purpose only.
          Production code should keep this field as None.
      """
      if cache is not None:
          real_cache = False
      else:
          real_cache = True
          cache = linecache.cache
  
      for file_name, profile in code_frags.items():
          if real_cache and os.path.exists(file_name):
              # skip rewriting caches of existing files
              continue
  
          if file_name not in cache:
              # keep field 1 (mtime) as None to ensure lazy cache
              cache[file_name] = (
                  profile["size"],
                  None,
                  [""] * profile["lines"],
                  file_name,
              )
          for fragment in profile["fragments"]:
              left_range, right_range = (
                  fragment["left"],
                  fragment["right"],
              )
              cache[file_name][2][left_range:right_range] = fragment[
                  "code"
              ]
  
imports: import linecache
  import os
  import types
  from collections import defaultdict
label_desc: Use image node_id 2 for calling a global function with example usage: load_traceback_code(code_frags, cache) without return types