code: def are_equal_metadata(
      actual_meta: List[Dict[str, Any]],
      expected_meta: List[Dict[str, Any]],
  ) -> bool:
      if actual_meta == expected_meta:
          return True
  
      for actual_dict, expected_dict in zip(actual_meta, expected_meta):
          for (act_k, act_v), (exp_k, exp_v) in zip(
              sorted(actual_dict.items(), key=lambda kv: kv[0]),
              sorted(expected_dict.items(), key=lambda kv: kv[0]),
          ):
              if act_k != exp_k:
                  return False
  
              if act_v == exp_v:
                  continue
  
              """
              Allow relative paths in expected metadata: just check that the end of the
              actual path matches the expected path
              """
              if not (
                  isinstance(act_v, str)
                  and isinstance(exp_v, str)
                  and os.path.normpath(act_v[-len(exp_v) :]).split(
                      os.path.sep
                  )
                  == os.path.normpath(exp_v).split(os.path.sep)
              ):
                  return False
  
      return True
  
imports: import json
  import os
  import random
  import unittest
  from typing import Any, Dict, List
  from augly import text
  from augly.utils import TEXT_METADATA_PATH
label_desc: Use image node_id 1 for calling a global function with example usage: are_equal_metadata(actual_meta, expected_meta) and returns: True, True, False, False