def s3_bucket_name(b):
    if ('..' in b):
        raise ValueError(('%s is not a valid s3 bucket name' % b))
    ip_re = compile('^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$')
    if ip_re.match(b):
        raise ValueError(('%s is not a valid s3 bucket name' % b))
    s3_bucket_name_re = compile('^[a-z\\d][a-z\\d\\.-]{1,61}[a-z\\d]$')
    if s3_bucket_name_re.match(b):
        return b
    else:
        raise ValueError(('%s is not a valid s3 bucket name' % b))
def s3_bucket_name(b):
    if ('..' in b):
        raise ValueError(('%s is not a valid s3 bucket name' % b))
    ip_re = compile('^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$')
    if ip_re.match(b):
        raise ValueError(('%s is not a valid s3 bucket name' % b))
    s3_bucket_name_re = compile('^[a-z\\d][a-z\\d\\.-]{1,61}[a-z\\d]$')
    if s3_bucket_name_re.match(b):
        return b
    else:
        raise ValueError(('%s is not a valid s3 bucket name' % b))