code: def _dict_equals(x, y, return_msg=False):
      """Test two dicts for equality.
  
      Correct if dicts contain the following valid types:
          types compatible with != comparison
          pd.Series, pd.DataFrame, np.ndarray
          lists, tuples, or dicts of a valid type (recursive)
  
      Parameters
      ----------
      x: dict
      y: dict
      return_msg : bool, optional, default=False
          whether to return informative message about what is not equal
  
      Returns
      -------
      is_equal: bool - True if x and y are equal in value
          x and y do not need to be equal in reference
      msg : str, only returned if return_msg = True
          indication of what is the reason for not being equal
              concatenation of the following strings:
              .keys - keys are not equal
              [key] - values at key is not equal
      """
  
      def ret(is_equal, msg):
          if return_msg:
              if is_equal:
                  msg = ""
              return is_equal, msg
          else:
              return is_equal
  
      xkeys = set(x.keys())
      ykeys = set(y.keys())
  
      if xkeys != ykeys:
          xmy = xkeys.difference(ykeys)
          ymx = ykeys.difference(xkeys)
          diffmsg = ".keys,"
          if len(xmy) > 0:
              diffmsg += f" x.keys-y.keys = {xmy}."
          if len(ymx) > 0:
              diffmsg += f" y.keys-x.keys = {ymx}."
          return ret(False, diffmsg)
  
      # we now know that xkeys == ykeys
      for key in xkeys:
          xi = x[key]
          yi = y[key]
  
          # recurse through xi/yi
          is_equal, msg = deep_equals(xi, yi, return_msg=True)
          if not is_equal:
              return ret(False, f"[{key}]" + msg)
  
      return ret(True, "")
  
imports: from inspect import isclass
  import numpy
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: _dict_equals(x, y, return_msg) and returns: ret, ret, is_equal,  msg, is_equal, ret