code: def bucket_exists(self, bucket_name):
          
          is_valid_bucket_name(bucket_name)
  
          try:
              self._url_open('HEAD', bucket_name=bucket_name)
          # If the bucket has not been created yet, MinIO will return a "NoSuchBucket" error.
          except NoSuchBucket:
              return False
          except ResponseError:
              raise
          return True
docs: Check if the bucket exists and if the user has access to it.
  
          :param bucket_name: To test the existence and user access.
          :return: True on success.