in python/pipelines/components/python/component.py [0:0]
def _create_gcs_bucket(bucket_name):
"""Creates a Google Cloud Storage bucket."""
from google.cloud import storage
storage_client = storage.Client()
bucket = storage_client.lookup_bucket(bucket_name)
if bucket is None:
bucket = storage_client.create_bucket(bucket_name)
print(f"Bucket {bucket.name} created.")
else:
print(f"Bucket {bucket.name} already exists.")
return bucket