code: def cleanup(self):
      if not self.cleanup_bucket:
          return
      if self.bucket_cleaned_up:
          return
  
      # Delete current S3 bucket completely.
      prefix: str = ""
      is_truncated: bool = True
      max_keys = 1000
      key_marker = None
  
      while is_truncated:
          version_list = None
  
          try:
              if key_marker is None:
                  version_list = self.client.list_object_versions(
                      Bucket=self.bucket,
                      MaxKeys=max_keys,
                      Prefix=prefix,
                  )
              else:
                  version_list = self.client.list_object_versions(
                      Bucket=self.bucket,
                      MaxKeys=max_keys,
                      Prefix=prefix,
                      KeyMarker=key_marker,
                  )
          except Exception as exc:
              self.logger.error(
                  "FAILED to list objects in bucket: %s - %s",
                  self.bucket,
                  exc,
              )
  
          if version_list is None:
              break
  
          try:
              objects = []
              versions = version_list.get("Versions", [])
              for v in versions:
                  objects.append(
                      {"VersionId": v["VersionId"], "Key": v["Key"]}
                  )
              response = self.client.delete_objects(
                  Bucket=self.bucket, Delete={"Objects": objects}
              )
          except Exception as exc:
              self.logger.error(
                  "FAILED to delete objects in bucket: %s - %s",
                  self.bucket,
                  exc,
              )
  
          try:
              objects = []
              delete_markers = version_list.get("DeleteMarkers", [])
              for d in delete_markers:
                  objects.append(
                      {"VersionId": d["VersionId"], "Key": d["Key"]}
                  )
              response = self.client.delete_objects(
                  Bucket=self.bucket, Delete={"Objects": objects}
              )
          except Exception as exc:
              self.logger.error(
                  "FAILED to delete markers in bucket: %s - %s",
                  self.bucket,
                  exc,
              )
  
          is_truncated = version_list.get("IsTruncated", False)
          key_marker = version_list.get("NextKeyMarker", None)
  
      # Now we can delete bucket itself:
      try:
          self.client.delete_bucket(Bucket=self.bucket)
          self.bucket_cleaned_up = True
      except Exception as exc:
          self.logger.error(
              "FAILED to delete bucket: %s - %s", self.bucket, exc
          )
  
imports: import calendar
  import os
  from urllib.parse import urlparse
  from boto3.s3.transfer import TransferConfig
  from boto3.session import Session
  import botocore
  from botocore.client import Config
  from botocore.handlers import set_list_objects_encoding_type_url
  from typing import Dict
  import re
  from studio.util import logs
  from studio.util import util
  from studio.credentials.credentials import Credentials, AWS_TYPE
  from studio.storage.storage_handler import StorageHandler
  from studio.storage.storage_type import StorageType
  from studio.storage.storage_setup import get_storage_verbose_level
label_desc: Use image node_id 11 for calling the S3StorageHandler obj's underlying member method code with example usage: obj.cleanup() without return types