code: def gdf_writer_types(request):
      # datetime64[us], datetime64[ns] are unsupported due to a bug in parser
      types = (
          NUMERIC_TYPES
          + ["datetime64[s]", "datetime64[ms]"]
          + TIMEDELTA_TYPES
          + ["bool", "str"]
      )
      typer = {"col_" + val: val for val in types}
      ncols = len(types)
      nrows = request.param
  
      # Create a pandas dataframe with random data of mixed types
      test_pdf = cudf.DataFrame(
          [
              list(range(ncols * i, ncols * (i + 1)))
              for i in range(nrows)
          ],
          columns=pd.Index([f"col_{typ}" for typ in types]),
      )
  
      # Cast all the column dtypes to objects, rename them, and then cast to
      # appropriate types
      test_pdf = test_pdf.astype(typer)
  
      return test_pdf
  
imports: import copy
  import gzip
  import itertools
  import os
  from io import BytesIO, StringIO
  from pathlib import Path
  import numpy
  import pandas
  import pyarrow
  import pytest
  import cudf
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, TIMEDELTA_TYPES, assert_eq
label_desc: Use image node_id 4 for calling a global function with example usage: gdf_writer_types(request) and returns: test_pdf