code: def test_frame_conversion(dataset, original_pandas_frame, module):
      # convert frame using datatable or polar
      h2oFrame = h2o.import_file(pyunit_utils.locate(dataset))
      startT = time.time()
      new_pandas_frame = h2oFrame.as_data_frame()
      newTime = time.time() - startT
      print(
          "H2O frame to Pandas frame conversion time with multi-thread using module {1} for dataset {2}: {0}".format(
              newTime, module, dataset
          )
      )
      # compare two frames column types
      new_types = new_pandas_frame.dtypes
      old_types = original_pandas_frame.dtypes
      ncol = h2oFrame.ncol
      colNames = new_pandas_frame.columns
  
      for ind in list(range(ncol)):
          assert new_types[colNames[ind]] == old_types[colNames[ind]], (
              "Expected column types: {0}, actual column types: "
              "{1}".format(
                  old_types[colNames[ind]], new_types[colNames[ind]]
              )
          )
          if new_types[colNames[ind]] == "object":
              diff = (
                  new_pandas_frame[colNames[ind]]
                  == original_pandas_frame[colNames[ind]]
              )
              if (
                  not diff.all()
              ):  # difference caused by the presence of NAs
                  newSeries = pd.Series(new_pandas_frame[colNames[ind]])
                  newNA = newSeries.isna()
                  oldSeries = pd.Series(
                      original_pandas_frame[colNames[ind]]
                  )
                  oldNA = oldSeries.isna()
                  assert (newNA == oldNA).all()
          else:
              diff = (
                  new_pandas_frame[colNames[ind]]
                  - original_pandas_frame[colNames[ind]]
              ).abs()
              assert diff.max() < 1e-10
  
file_path: h2o-3/h2o-py/tests/testdir_misc/pyunit_gh_15729_15936_datatable_polars_2_pandas.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.utils.shared_utils import can_use_datatable, can_use_polars, can_use_pyarrow, can_install_datatable, can_install_polars
  import time
  import pandas
  from h2o.utils.threading import local_context
label_desc: Use image node_id 1 for calling a global function with example usage: test_frame_conversion(dataset, original_pandas_frame, module) without return types