code: def pandas_to_avro(df, file_name=None, file_io_obj=None):
      schema = get_avro_schema(df)
      avro_schema = fastavro.parse_schema(schema)
  
      records = df.to_dict("records")
      records = convert_nulls_to_none(records, df)
  
      if file_name is not None:
          with open(file_name, "wb") as out:
              fastavro.writer(out, avro_schema, records)
      elif file_io_obj is not None:
          fastavro.writer(file_io_obj, avro_schema, records)
  
file_path: cudf/python/cudf/cudf/_fuzz_testing/utils.py
imports: import random
  import fastavro
  import numpy
  import pandas
  import pyarrow
  import cudf
  from cudf.testing._utils import assert_eq
  from cudf.utils.dtypes import pandas_dtypes_to_np_dtypes, pyarrow_dtypes_to_pandas_dtypes
label_desc: Use image node_id 8 for calling a global function with example usage: pandas_to_avro(df, file_name, file_io_obj) without return types