code: def _gen_bucket_test0(bucket_name="datalad-test0", versioned=True):
      bucket = gen_test_bucket(bucket_name)
  
      # Enable web access to that bucket to everyone
      bucket.configure_website("index.html")
      set_bucket_public_access_policy(bucket)
  
      files = VersionedFilesPool(bucket)
  
      files("1version-nonversioned1.txt")
      files("2versions-nonversioned1.txt")
  
      if versioned:
          # make bucket versioned AFTER we uploaded one file already
          bucket.configure_versioning(True)
  
      files("2versions-nonversioned1.txt")
      files("2versions-nonversioned1.txt_sameprefix")
      for v in range(3):
          files("3versions-allversioned.txt")
      files(
          "3versions-allversioned.txt_sameprefix"
      )  # to test possible problems
  
      # File which was created and then removed
      bucket.delete_key(files("1version-removed.txt"))
  
      # File which was created/removed/recreated (with new content)
      bucket.delete_key(files("2versions-removed-recreated.txt"))
      files("2versions-removed-recreated.txt")
      files("2versions-removed-recreated.txt_sameprefix")
  
      # File which was created/removed/recreated (with new content)
      f = "1version-removed-recreated.txt"
      bucket.delete_key(files(f))
      files.reset_version(f)
      files(f)
      lgr.info("Bucket %s was generated and populated", bucket_name)
  
      return bucket
  
imports: import mimetypes
  from os.path import splitext
  import re
  from datalad.support.network import urlquote, URL
  import logging
  import datalad.log
  from datalad.support.exceptions import CapturedException, DownloadError, AccessDeniedError, AccessPermissionExpiredError, AnonymousAccessDeniedError
  from datalad.utils import try_multiple_dec
  from urllib.request import urlopen, Request
label_desc: Use image node_id 10 for calling a global function with example usage: _gen_bucket_test0(bucket_name, versioned) and returns: bucket