Verify that the value is a Fully qualified domain name URL.

    >>> s = Schema(FqdnUrl())
    >>> with raises(MultipleInvalid, 'expected a Fully qualified domain name URL'):
    ...   s("http://localhost/")
    >>> s('http://w3.org')
    'http://w3.org'
14381
def FqdnUrl(v):
    
    try:
        parsed_url = _url_validation(v)
        if "." not in parsed_url.netloc:
            raise UrlInvalid("must have a domain name in URL")
        return v
    except:
        raise ValueError
1077061
def validate_name(ctx, param, value):
    """"""
    if not value:
        value = os.path.basename(ctx.params['directory'].rstrip(os.path.sep))
    return value
7177
def domain_name(self, levels=1):
        
        if levels < 1:
            raise ValueError("levels must be greater than or equal to 1")
        if levels == 1:
            return self.domain_word() + '.' + self.tld()
        else:
            return self.domain_word() + '.' + self.domain_name(levels - 1)
1042326
def name(self, value):
        
        self._name = value
        self.slug = re.sub('[^0-9a-zA-Z_-]+', '_', str(value).lower())
        self.root = os.path.abspath(os.path.join(_cfg.get('Paths', 'HttpRoot'), self.domain.name, self.slug))
1250746
def validate_value(value)
      v = value.to_s
      return v unless v.include?("\n")
      raise HeaderError, "Invalid HTTP header field value: #{v.inspect}"
    end
1286448
def validate_url(uri_string):
    """"""
    try:
        result = urlparse(uri_string)
        has_elements = all([result.scheme, result.netloc, result.path])
        is_http = result.scheme == "http" or result.scheme == "https"
        return True if has_elements and is_http else False

    except Exception:
        return False
1101798
def is_url(default_scheme='http', **kwargs):
    """"""
    def converter(value):
        if value is None:
            return value
        if '://' not in value and default_scheme:
            value = '://'.join((default_scheme, value.strip()))
        try:
            return uris.validate(value)
        except uris.ValidationError as e:
            raise Invalid(e.message)
    return converter
248814
def is_valid_url(url):
    """"""
    from .misc import to_text

    if not url:
        return url
    pieces = urllib_parse.urlparse(to_text(url))
    return all([pieces.scheme, pieces.netloc])
641124
def validate_extension(url_hash, url)
      return unless url.present?
      uri_parts = URI(url).host&.split('.')
      url_exts = uri_parts[2..-1]

      ### Finds Errors
      if url_exts.empty? ## Missing ext.
        err_msg = 'error: ext.none'
      else ## Has ext(s), but need to verify validity and count.
        iana_list = CrmFormatter::Extensions.list
        matched_exts = iana_list & url_exts

        if matched_exts.empty? ## Has ext, but not valid.
          err_msg = "error: ext.invalid [#{url_exts.join(', ')}]"
        elsif matched_exts.count > 1 ## Has too many valid exts, Limit 1.
          err_msg = "error: ext.valid > 1 [#{matched_exts.join(', ')}]"
        end
      end

      if err_msg
        url_hash[:web_neg] << err_msg
        url = nil
        url_hash[:url_f] = nil
        return { url_hash: url_hash, url: url }
      end

      ### Only Non-Errors Get Here ###
      ## Has one valid ext, but need to check if original url exts were > 1.  Replace if so.
      if url_exts.count > matched_exts.count
        matched_ext = matched_exts.first
        u1 = url.split(matched_ext).first
        url = "#{u1}#{matched_ext}"
        # inv_ext = (url_exts - matched_exts).join
        # url = url.gsub(".#{inv_ext}", '')
      end

      ext_result = { url_hash: url_hash, url: url }
      ext_result
    end
51762
def url(self, url):
        
        if url is None:
            raise ValueError("Invalid value for `url`, must not be `None`")
        if url is not None and len(url) > 4096:
            raise ValueError("Invalid value for `url`, length must be less than or equal to `4096`")
        if url is not None and len(url) < 1:
            raise ValueError("Invalid value for `url`, length must be greater than or equal to `1`")
        if url is not None and not re.search('^https?:.*', url):
            raise ValueError("Invalid value for `url`, must be a follow pattern or equal to `/^https?:.*/`")

        self._url = url
590661
def is_valid_url(value):
    
    match = URL_REGEX.match(value)
    host_str = urlparse(value).hostname
    return match and is_valid_host(host_str)
30284
private String fullyQualifiedRegistrationDomain() {
    if (job.getRegistrationDomain().endsWith(".")) {
      return job.getRegistrationDomain();
    } else if ("".equals(job.getRegistrationDomain())) {
      return defaultRegistrationDomain;
    } else {
      return job.getRegistrationDomain() + "." + defaultRegistrationDomain;
    }
  }
1110856
function _validateBaseUrl(url) {
        var result = "";
        // Empty url means "no server mapping; use file directly"
        if (url === "") {
            return result;
        }

        var obj = PathUtils.parseUrl(url);
        if (!obj) {
            result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
        } else if (obj.href.search(/^(http|https):\/\//i) !== 0) {
            result = StringUtils.format(Strings.BASEURL_ERROR_INVALID_PROTOCOL, obj.href.substring(0, obj.href.indexOf("//")));
        } else if (obj.search !== "") {
            result = StringUtils.format(Strings.BASEURL_ERROR_SEARCH_DISALLOWED, obj.search);
        } else if (obj.hash !== "") {
            result = StringUtils.format(Strings.BASEURL_ERROR_HASH_DISALLOWED, obj.hash);
        } else {
            var index = url.search(/[ \^\[\]\{\}<>\\"\?]+/);
            if (index !== -1) {
                result = StringUtils.format(Strings.BASEURL_ERROR_INVALID_CHAR, url[index]);
            }
        }

        return result;
    }
1325818
def validate_instance_dbname(self, dbname):
        '''  '''
        # 1-64 alphanumeric characters, cannot be a reserved MySQL word
        if re.match('[\w-]+$', dbname) is not None:
            if len(dbname) <= 41 and len(dbname) >= 1:
                if dbname.lower() not in MYSQL_RESERVED_WORDS:
                    return True
        return '*** Error: Database names must be 1-64 alphanumeric characters,\
            cannot be a reserved MySQL word.'
1006353
def parse_fully_qualified_name(fq_name: str) -> Tuple[Optional[str], str]:
    
    last_dot = fq_name.rfind('.')
    if last_dot != -1:
        return fq_name[:last_dot], fq_name[last_dot + 1:]
    else:
        return None, fq_name
618151
def validate_redirect_uri(value):
    
    sch, netloc, path, par, query, fra = urlparse(value)
    if not (sch and netloc):
        raise InvalidRedirectURIError()
    if sch != 'https':
        if ':' in netloc:
            netloc, port = netloc.split(':', 1)
        if not (netloc in ('localhost', '127.0.0.1') and sch == 'http'):
            raise InsecureTransportError()
1187281
def index
      validate_arguments!
      domains = api.get_domains_v3_domain_cname(app)

      styled_header("#{app} Heroku Domain")
      heroku_domain = domains.detect { |d| d['kind'] == 'heroku' || d['kind'] == 'default' } # TODO: remove 'default' after API change
      if heroku_domain
        display heroku_domain['hostname']
      else
        output_with_bang "Not found"
      end

      display

      styled_header("#{app} Custom Domains")
      custom_domains = domains.select{ |d| d['kind'] == 'custom' }
      if custom_domains.length > 0
        display_table(custom_domains, ['hostname', 'cname'], ['Domain Name', 'DNS Target'])
      else
        display("#{app} has no custom domains.")
        display("Use `heroku domains:add DOMAIN` to add one.")
      end
    end