code: def test_can_parse_avro_date_logical_type(
      namespace, nullable, prepend_null
  ):
      avro_type = {"logicalType": "date", "type": "int"}
      if nullable:
          if prepend_null:
              avro_type = ["null", avro_type]
          else:
              avro_type = [avro_type, "null"]
  
      schema_dict = {
          "type": "record",
          "name": "test",
          "fields": [
              {"name": "o_date", "type": avro_type},
          ],
      }
  
      if namespace:
          schema_dict["namespace"] = namespace
  
      schema = fastavro.parse_schema(schema_dict)
  
      # Insert some None values in no particular order.  These will get converted
      # into avro "nulls" by the fastavro writer (or filtered out if we're not
      # nullable).  The first and last dates are epoch min/max values, the rest
      # are arbitrarily chosen.
      dates = [
          None,
          datetime.date(1970, 1, 1),
          datetime.date(1970, 1, 2),
          datetime.date(1981, 10, 25),
          None,
          None,
          datetime.date(2012, 5, 18),
          None,
          datetime.date(2019, 9, 3),
          None,
          datetime.date(9999, 12, 31),
      ]
  
      if not nullable:
          dates = [date for date in dates if date is not None]
  
      days_from_epoch = [get_days_from_epoch(date) for date in dates]
  
      records = [{"o_date": day} for day in days_from_epoch]
  
      actual = cudf_from_avro_util(schema, records)
  
      expected = cudf.DataFrame(
          {"o_date": cudf.Series(dates, dtype="datetime64[s]")}
      )
  
      assert_eq(expected, actual)
  
imports: import datetime
  import io
  import pathlib
  from typing import Optional
  import fastavro
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing._utils import assert_eq
  from cudf.testing.dataset_generator import rand_dataframe
label_desc: Use image node_id 12 for calling a global function with example usage: test_can_parse_avro_date_logical_type(namespace, nullable, prepend_null) without return types