code: def assert_frame_equal(
      left: Union[ps.DataFrame, pd.DataFrame],
      right: Union[ps.DataFrame, pd.DataFrame],
      check_dtype: bool = True,
      check_index_type: Union[bool, Literal["equiv"]] = "equiv",
      check_column_type: Union[bool, Literal["equiv"]] = "equiv",
      check_frame_type: bool = True,
      check_names: bool = True,
      by_blocks: bool = False,
      check_exact: bool = False,
      check_datetimelike_compat: bool = False,
      check_categorical: bool = True,
      check_like: bool = False,
      check_freq: bool = True,
      check_flags: bool = True,
      rtol: float = 1.0e-5,
      atol: float = 1.0e-8,
      obj: str = "DataFrame",
  ) -> None:
      """
      Check that left and right DataFrame are equal.
  
      This function is intended to compare two DataFrames and output any
      differences. It is mostly intended for use in unit tests.
      Additional parameters allow varying the strictness of the
      equality checks performed.
  
      .. versionadded:: 4.0.0
  
      Parameters
      ----------
      left : DataFrame
          First DataFrame to compare.
      right : DataFrame
          Second DataFrame to compare.
      check_dtype : bool, default True
          Whether to check the DataFrame dtype is identical.
      check_index_type : bool or {'equiv'}, default 'equiv'
          Whether to check the Index class, dtype and inferred_type
          are identical.
      check_column_type : bool or {'equiv'}, default 'equiv'
          Whether to check the columns class, dtype and inferred_type
          are identical. Is passed as the ``exact`` argument of
          :func:`assert_index_equal`.
      check_frame_type : bool, default True
          Whether to check the DataFrame class is identical.
      check_names : bool, default True
          Whether to check that the `names` attribute for both the `index`
          and `column` attributes of the DataFrame is identical.
      by_blocks : bool, default False
          Specify how to compare internal data. If False, compare by columns.
          If True, compare by blocks.
      check_exact : bool, default False
          Whether to compare number exactly.
      check_datetimelike_compat : bool, default False
          Compare datetime-like which is comparable ignoring dtype.
      check_categorical : bool, default True
          Whether to compare internal Categorical exactly.
      check_like : bool, default False
          If True, ignore the order of index & columns.
          Note: index labels must match their respective rows
          (same as in columns) - same labels must be with the same data.
      check_freq : bool, default True
          Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
      check_flags : bool, default True
          Whether to check the `flags` attribute.
      rtol : float, default 1e-5
          Relative tolerance. Only used when check_exact is False.
      atol : float, default 1e-8
          Absolute tolerance. Only used when check_exact is False.
      obj : str, default 'DataFrame'
          Specify object name being compared, internally used to show appropriate
          assertion message.
  
      See Also
      --------
      assert_series_equal : Equivalent method for asserting Series equality.
      DataFrame.equals : Check DataFrame equality.
  
      Examples
      --------
      This example shows comparing two DataFrames that are equal
      but with columns of differing dtypes.
  
      >>> from pyspark.pandas.testing import assert_frame_equal
      >>> df1 = ps.DataFrame({'a': [1, 2], 'b': [3, 4]})
      >>> df2 = ps.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})
  
      df1 equals itself.
  
      >>> assert_frame_equal(df1, df1)
  
      df1 differs from df2 as column 'b' is of a different type.
  
      >>> assert_frame_equal(df1, df2)
      Traceback (most recent call last):
      ...
      AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different
      <BLANKLINE>
      Attribute "dtype" are different
      [left]:  int64
      [right]: float64
  
      Ignore differing dtypes in columns with check_dtype.
  
      >>> assert_frame_equal(df1, df2, check_dtype=False)
      """
      if isinstance(left, ps.DataFrame):
          left = left.to_pandas()
      if isinstance(right, ps.DataFrame):
          right = right.to_pandas()
  
      pd.testing.assert_frame_equal(
          left,
          right,
          check_dtype=check_dtype,
          check_index_type=check_index_type,  # type: ignore[arg-type]
          check_column_type=check_column_type,  # type: ignore[arg-type]
          check_frame_type=check_frame_type,
          check_names=check_names,
          by_blocks=by_blocks,
          check_exact=check_exact,
          check_datetimelike_compat=check_datetimelike_compat,
          check_categorical=check_categorical,
          check_like=check_like,
          check_freq=check_freq,
          check_flags=check_flags,
          rtol=rtol,
          atol=atol,
          obj=obj,
      )
  
imports: from typing import Literal, Union
  import pyspark.pandas
label_desc: Use image node_id 1 for calling a global function with example usage: assert_frame_equal(left, right, check_dtype, check_index_type, check_column_type, check_frame_type, check_names, by_blocks, check_exact, check_datetimelike_compat, check_categorical, check_like, check_freq, check_flags, rtol, atol, obj) without return types