def _getOrCreateBucket(self, bucket_name, versioning=False):
        assert self.minBucketNameLen <= len(bucket_name) <= self.maxBucketNameLen
        assert self.bucketNameRe.match(bucket_name)
        try:
            bucket = self.s3.get_bucket(bucket_name, validate=True)
            assert versioning is self.__getBucketVersioning(bucket)
            return bucket
        except S3ResponseError as e:
            if e.error_code == 'NoSuchBucket':
                bucket = self.s3.create_bucket(bucket_name, location=self.region)
                if versioning:
                    bucket.configure_versioning(versioning)
                return bucket
            else:
                raise
:rtype: Bucket
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/jobStores/aws/jobStore.py/AWSJobStore._getOrCreateBucket