code: def convert_nulls_to_none(records, df):
      columns_with_nulls = {
          col for col in df.columns if df[col].isnull().any()
      }
      scalar_columns_convert = [
          col
          for col in df.columns
          if df[col].dtype in pandas_dtypes_to_np_dtypes
          or pd.api.types.is_datetime64_dtype(df[col].dtype)
          or pd.api.types.is_timedelta64_dtype(df[col].dtype)
      ]
  
      for record in records:
          for col, value in record.items():
              if col in scalar_columns_convert:
                  if col in columns_with_nulls and value in (
                      pd.NA,
                      pd.NaT,
                  ):
                      record[col] = None
                  else:
                      if isinstance(value, str):
                          record[col] = value
                      elif isinstance(
                          value, (pd.Timestamp, pd.Timedelta)
                      ):
                          record[col] = int(value.value)
                      else:
                          record[col] = value.item()
  
      return 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 7 for calling a global function with example usage: convert_nulls_to_none(records, df) and returns: records