code: def cudf_from_avro_util(
      schema: dict, records: list
  ) -> cudf.DataFrame:
      schema = [] if schema is None else fastavro.parse_schema(schema)
      buffer = io.BytesIO()
      fastavro.writer(buffer, schema, records)
      buffer.seek(0)
      return cudf.read_avro(buffer)
  
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 1 for calling a global function with example usage: cudf_from_avro_util(schema, records) and returns: cudf