'Create the bucket if not exists.'

@gcs_logger
def put_container(self, bucket):

    buckets = self.conn.buckets().list(project=self.gcs_project_id, prefix=bucket, fields='items(name)').execute(num_retries=self.num_retries).get('items', [])
    if (not any(((b.get('name') == bucket) for b in buckets))):
        self.conn.buckets().insert(project=self.gcs_project_id, body={'name': bucket, 'location': self.bucket_location, 'storageClass': self.storage_class}).execute(num_retries=self.num_retries)
