code: def extract_duplicates(
      list1: List[Any], list2: List[Any]
  ) -> List[Any]:
      """Extracts duplicates from two lists."""
      if list1:
          dict1 = {
              (
                  sorted(list(i.keys()))[0]
                  if isinstance(i, dict)
                  else i
              ): i
              for i in list1
          }
      else:
          dict1 = {}
  
      if list2:
          dict2 = {
              (
                  sorted(list(i.keys()))[0]
                  if isinstance(i, dict)
                  else i
              ): i
              for i in list2
          }
      else:
          dict2 = {}
  
      set1 = set(dict1.keys())
      set2 = set(dict2.keys())
      dupes = set1.intersection(set2)
      return sorted(list(dupes))
  
imports: import asyncio
  import functools
  import importlib
  import inspect
  import logging
  from typing import Text, Dict, Optional, Any, List, Callable, Collection, Type
  from rasa.shared.exceptions import RasaException
label_desc: Use image node_id 11 for calling a global function with example usage: extract_duplicates(list1, list2) and returns: sorted