code: def _tuple_equals(x, y, return_msg=False):
      """Test two tuples or lists for equality.
  
      Correct if tuples/lists 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: tuple or list
      y: tuple or list
      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 elements:
              .len - length is not equal
              [i] - i-th element not equal
      """
  
      def ret(is_equal, msg):
          if return_msg:
              if is_equal:
                  msg = ""
              return is_equal, msg
          else:
              return is_equal
  
      n = len(x)
  
      if n != len(y):
          return ret(False, f".len, x.len = {n} != y.len = {len(y)}")
  
      # we now know dicts are same length
      for i in range(n):
          xi = x[i]
          yi = y[i]
  
          # recurse through xi/yi
          is_equal, msg = deep_equals(xi, yi, return_msg=True)
          if not is_equal:
              return ret(False, f"[{i}]" + msg)
  
      return ret(True, "")
  
imports: from inspect import isclass
  import numpy
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: _tuple_equals(x, y, return_msg) and returns: ret, ret, is_equal,  msg, is_equal, ret