code: def assert_same_code(code1, code2):
      """Verify whether 2 code fragments are identical, and if not print an error message."""
      regex = re.compile(r"\s+\\$", re.M)
      code1 = re.sub(regex, r"\\", code1)
      code2 = re.sub(regex, r"\\", code2)
      if code2 != code1:
          print()
          lines_code1 = code1.splitlines()
          lines_code2 = code2.splitlines()
          n_diffs = 0
          for i in range(len(lines_code1)):
              old_line = lines_code1[i]
              new_line = lines_code2[i] if i < len(lines_code2) else ""
              if old_line != new_line:
                  print("%3d - %s" % (i + 1, old_line))
                  print("%3d + %s" % (i + 1, new_line))
                  n_diffs += 1
                  if n_diffs == 5:
                      break
          raise AssertionError(
              "Unparsed code1 does not match the original."
          )
  
file_path: h2o-3/h2o-bindings/bin/pyunit_parser_test.py
imports: import os
  import re
  import textwrap
  import tokenize
  import pyparser
label_desc: Use image node_id 2 for calling a global function with example usage: assert_same_code(code1, code2) without return types