<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bucket_exists(self, bucket_name):
 """ 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. """

        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