code: def all_equal(left, right, cache=None):
      
      if cache is None:
          cache = {}
  
      if util.is_iterable(left):
          # check that left and right are equal length iterables and that all
          # of their elements are equal
          return (
              util.is_iterable(right)
              and len(left) == len(right)
              and all(
                  itertools.starmap(
                      functools.partial(all_equal, cache=cache), zip(left, right)
                  )
              )
          )
  
      if hasattr(left, 'equals'):
          return left.equals(right, cache=cache)
      return left == right
docs: Check whether two objects `left` and `right` are equal.
  
      Parameters
      ----------
      left : Union[object, Expr, Node]
      right : Union[object, Expr, Node]
      cache : Optional[Dict[Tuple[Node, Node], bool]]
          A dictionary indicating whether two Nodes are equal