code: def are_directories_equal(dir1: Path, dir2: Path) -> bool:
      """Compares two directories recursively.
  
      Files in each directory are
      assumed to be equal if their names and contents are equal.
  
      Args:
          dir1: The first directory.
          dir2: The second directory.
  
      Returns:
          `True` if they are equal, `False` otherwise.
      """
      dirs_cmp = filecmp.dircmp(dir1, dir2)
      if dirs_cmp.left_only or dirs_cmp.right_only:
          return False
  
      (_, mismatches, errors) = filecmp.cmpfiles(
          dir1, dir2, dirs_cmp.common_files, shallow=False
      )
  
      if mismatches or errors:
          return False
  
      for common_dir in dirs_cmp.common_dirs:
          new_dir1 = Path(dir1, common_dir)
          new_dir2 = Path(dir2, common_dir)
  
          is_equal = are_directories_equal(new_dir1, new_dir2)
          if not is_equal:
              return False
  
      return True
  
imports: import asyncio
  import filecmp
  import logging
  import os
  import pickle
  import tempfile
  import warnings
  import re
  from asyncio import AbstractEventLoop
  from pathlib import Path
  from typing import Text, Any, Union, List, Type, Callable, TYPE_CHECKING, Pattern
  from typing_extensions import Protocol
  import rasa.shared.constants
  import rasa.shared.utils.io
label_desc: Use image node_id 14 for calling a global function with example usage: are_directories_equal(dir1, dir2) and returns: True, False, False, False