def verify_baseUrl(self, name, required, scheme_optional=False):
    """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.
    """
    try:
      value = self.__bindings.get(name)
    except __HOLE__:
      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

    # We don't really need a full URL since we're validating base urls,
    # (without query parameters and fragments), so the scheme will be optional.
    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
dataset/ETHPy150Open spinnaker/spinnaker/pylib/spinnaker/validate_configuration.py/ValidateConfig.verify_baseUrl