code: def test_write_csv(s3_base, s3so, pdf, chunksize):
      # Write to buffer
      fname = "test_csv_writer.csv"
      bucket = "csv"
      gdf = cudf.from_pandas(pdf)
      with s3_context(s3_base=s3_base, bucket=bucket) as s3fs:
          gdf.to_csv(
              f"s3://{bucket}/{fname}",
              index=False,
              chunksize=chunksize,
              storage_options=s3so,
          )
          assert s3fs.exists(f"s3://{bucket}/{fname}")
  
          # TODO: Update to use `storage_options` from pandas v1.2.0
          got = pd.read_csv(s3fs.open(f"s3://{bucket}/{fname}"))
  
      assert_eq(pdf, got)
  
imports: import os
  import socket
  from contextlib import contextmanager
  from io import BytesIO
  import numpy
  import pandas
  import pyarrow.fs
  import pytest
  from fsspec.core import get_fs_token_paths
  import cudf
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 12 for calling a global function with example usage: test_write_csv(s3_base, s3so, pdf, chunksize) without return types