code: def compare(
      actual,
      expected,
      actual_name="actual",
      expected_name="expected",
      return_diff=False,
  ):
      """Compare two strings, lists or dict-like objects"""
      if actual != expected:
          diff = difflib.unified_diff(
              _multilines(expected),
              _multilines(actual),
              expected_name,
              actual_name,
              lineterm="",
          )
          if expected_name == "" and actual_name == "":
              diff = list(diff)[2:]
          diff = "\n".join(diff)
          if return_diff:
              return diff
          raise AssertionError("\n" + diff)
      return "" if return_diff else None
  
imports: import difflib
  import json
  import os
  import re
  from jupytext.paired_paths import full_path
  from .cell_metadata import _IGNORE_CELL_METADATA
  from .combine import combine_inputs_with_outputs
  from .formats import check_auto_ext, long_form_one_format
  from .header import _DEFAULT_NOTEBOOK_METADATA
  from .jupytext import read, reads, write, writes
  from .metadata_filter import filter_metadata
label_desc: Use image node_id 2 for calling a global function with example usage: compare(actual, expected, actual_name, expected_name, return_diff) and returns: unknown, diff