code: def test_hdf_writer(tmpdir, pdf, gdf, complib, format):
      pdf, nrows = pdf
      gdf, _ = gdf
  
      if format == "fixed":
          pdf = pdf.drop("col_category", axis=1)
          gdf = gdf.drop("col_category", axis=1)
  
      pdf_df_fname = tmpdir.join("pdf_df.hdf")
      gdf_df_fname = tmpdir.join("gdf_df.hdf")
  
      pdf.to_hdf(
          pdf_df_fname, "hdf_tests", format=format, complib=complib
      )
      gdf.to_hdf(
          gdf_df_fname, "hdf_tests", format=format, complib=complib
      )
  
      assert os.path.exists(pdf_df_fname)
      assert os.path.exists(gdf_df_fname)
  
      if format == "table" and nrows == 0:
          pytest.skip("Can't read 0 row table with format 'table'")
  
      expect = pd.read_hdf(pdf_df_fname)
      got = pd.read_hdf(gdf_df_fname)
  
      assert_eq(expect, got, check_index_type=False)
  
      for column in pdf.columns:
          pdf_series_fname = tmpdir.join(
              column + "_" + "pdf_series.hdf"
          )
          gdf_series_fname = tmpdir.join(
              column + "_" + "gdf_series.hdf"
          )
  
          pdf[column].to_hdf(
              pdf_series_fname,
              "hdf_tests",
              format=format,
              complib=complib,
          )
          gdf[column].to_hdf(
              gdf_series_fname,
              "hdf_tests",
              format=format,
              complib=complib,
          )
  
          assert os.path.exists(pdf_series_fname)
          assert os.path.exists(gdf_series_fname)
  
          expect_series = pd.read_hdf(pdf_series_fname)
          got_series = pd.read_hdf(gdf_series_fname)
  
          assert_eq(expect_series, got_series, check_index_type=False)
  
file_path: cudf/python/cudf/cudf/tests/test_hdf.py
imports: import os
  from string import ascii_letters
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq
label_desc: Use image node_id 5 for calling a global function with example usage: test_hdf_writer(tmpdir, pdf, gdf, complib, format) without return types