'Verify value of variable |name| is a valid url.
Args:
name [string]: variable name.
required [bool]: If True value cannot be empty.
scheme_optional: True if the URL protocol scheme is not required.'

def verify_baseUrl(self, name, required, scheme_optional=False):

    try:
        value = self.__bindings.get(name)
    except KeyError:
        if (not required):
            return True
        self.__errors.append('Missing    "{name}".'.format(name=name))
        return False
    if self.is_reference(value):
        if (not required):
            return True
        self.__errors.append('Missing    "{name}".'.format(name=name))
        return False
    scheme_token = '[a-z0-9]+'
    host_token = _host_regex_token()
    port_token = '[1-9][0-9]*'
    path_token = '(?:[-\\._+a-zA-Z0-9]|(?:%[0-9a-fA-F]{2}))+'
    url_re = re.compile('^({scheme}://){scheme_optional}({host})(:{port})?((?:/{path})*/?)$'.format(scheme=scheme_token, scheme_optional=('?' if scheme_optional else ''), host=host_token, port=port_token, path=path_token))
    match = url_re.match(value)
    return (match != None)
