code: def s3_context(s3_base, bucket, files=None):
      if files is None:
          files = {}
      with ensure_safe_environment_variables():
          client = boto3.client("s3", endpoint_url=s3_base)
          client.create_bucket(Bucket=bucket, ACL="public-read-write")
          for f, data in files.items():
              client.put_object(Bucket=bucket, Key=f, Body=data)
  
          yield s3fs.S3FileSystem(
              client_kwargs={"endpoint_url": s3_base}
          )
  
          for f, data in files.items():
              try:
                  client.delete_object(Bucket=bucket, Key=f)
              except Exception:
                  pass
  
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 6 for calling a global function with example usage: s3_context(s3_base, bucket, files) without return types