def _is_valid_bucket(bucket_name: str):
    """Validates correctness of bucket naming.

    Reference: https://cloud.google.com/storage/docs/naming
    """
    if bucket_name.startswith("gs://"):
        return False

    if len(bucket_name) < 3 or len(bucket_name) > 63:
        return False

    # IP address
    if re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", bucket_name):
        return False

    if not re.fullmatch(r"([^A-Z]|-|_|[.]|)+", bucket_name):
        return False

    if ".." in bucket_name:
        return False

    if "goog" in bucket_name or "g00g" in bucket_name:
        return False

    return True
Validates correctness of bucket naming.

    Reference: https://cloud.google.com/storage/docs/naming
    
sacred/observers/gcs_observer.py