code: def assert_from_dataframe_equals(dfobj, allow_copy):
      df2 = from_dataframe(dfobj, allow_copy=allow_copy)
  
      assert_dataframe_equal(dfobj.__dataframe__(allow_copy), df2)
      if isinstance(dfobj, cudf.DataFrame):
          assert_eq(dfobj, df2)
  
      elif isinstance(dfobj, pd.DataFrame):
          assert_eq(cudf.DataFrame(dfobj), df2)
  
      else:
          raise TypeError(f"{type(dfobj)} not supported yet.")
  
imports: from typing import Any, Tuple
  import cupy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.core.buffer import as_buffer
  from cudf.core.column import as_column, build_column
  from cudf.core.df_protocol import DataFrameObject, _CuDFBuffer, _CuDFColumn, _DtypeKind, _MaskKind, _protocol_buffer_to_cudf_buffer, from_dataframe, protocol_dtype_to_cupy_dtype
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 6 for calling a global function with example usage: assert_from_dataframe_equals(dfobj, allow_copy) without return types