def url(value):
if not url_regex.search(value):<EOL><INDENT>message = u"<STR_LIT>".format(value)<EOL>if url_regex.search('<STR_LIT>' + value):<EOL><INDENT>message += u"<STR_LIT>".format(value)<EOL><DEDENT>raise ValueError(message)<EOL><DEDENT>return value<EOL>
Validate a URL.

    :param string value: The URL to validate
    :returns: The URL if valid.
    :raises: ValueError