Check that all domains specified in the settings was provided in the options.
426364
def _validate_domains(domains):
        """"""
        missing = set(settings.TRANSLATION_DOMAINS.keys()) - set(domains.keys())
        if missing:
            print('The following domains have been set in the configuration, '
                  'but their sources were not provided, use the `--source` '
                  'option to specify their sources: {domains}'.format(domains=', '.join(missing)))
            sys.exit(1)
511674
private boolean isDomainInScope(String domain) {
		for (String scope : scopes) {
			if (domain.matches(scope)) {
				return true;
			}
		}
		return false;
	}
985043
def set_allowed_domains(self, allowed_domains):
        """"""
        if allowed_domains is not None:
            allowed_domains = tuple(allowed_domains)
        self._allowed_domains = allowed_domains
1182202
def _is_domain_match(domain: str, hostname: str) -> bool:
        """"""
        if hostname == domain:
            return True

        if not hostname.endswith(domain):
            return False

        non_matching = hostname[:-len(domain)]

        if not non_matching.endswith("."):
            return False

        return not is_ip_address(hostname)
1216538
def _domain_check(domain, domain_list, resolve):
    
    if domain in domain_list:
        return True
    if resolve:
        for exchange in _get_mx_exchanges(domain):
            for value in domain_list:
                if exchange.endswith(value):
                    return True
    return False
443200
function isInvalidConfiguration(config) {
  return R.compose(
    R.any(R.either(R.isNil, R.isEmpty))
  , R.values
  , R.pickAll(['url', 'port'])
  , R.propOr({}, 'server')
  )(config)
}
292337
def is_remote_allowed(remote):
  
  if settings.debug:
    return True
  if not remote:
    return False
  for domain_pattern in settings.node['cors_whitelist_domains']:
    if domain_pattern.match(remote):
      return True
  return False
205311
def validate(config):
    '''
    
    '''
    valid = True
    messages = []

    if not isinstance(config, list):
        valid = False
        messages.append('[-] Configuration for %s beacon must be a list', config)
    else:
        _config = {}
        list(map(_config.update, config))

    try:
        sites = _config.get('sites', {})
    except AttributeError:
        valid = False
        messages.append('[-] Sites for %s beacon must be a dict', __virtualname__)

    if not sites:
        valid = False
        messages.append('[-] Configuration does not contain sites')

    for site, settings in sites.items():
        if required_site_attributes.isdisjoint(set(settings.keys())):
            valid = False
            messages.append('[-] Sites for {} beacon requires {}'.format(__virtualname__,
                                                                         required_site_attributes))
        log.debug('[+] site: %s', site)
        log.debug('[+] settings: %s', settings)

        for optional_attrs in itertools.chain(settings.get(attr, []) for attr in optional_site_attributes):
            for item in optional_attrs:
                cmp = item.get('comp')
                if cmp and cmp not in comparisons:
                    valid = False
                    messages.append('[-] Invalid comparison operator %s', cmp)

    messages.append('[+] Valid beacon configuration')
    return valid, messages
650949
protected function checkAndSetServerOptions()
    {

        // Specific query port defined
        if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
            $this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
        } else {
            // Do math based on the protocol class
            $this->port_query = $this->protocol->findQueryPort($this->port_client);
        }
    }
321559
def all_options(self):
        """"""
        items = chain.from_iterable(hosts.values() for hosts in self.data.values())
        return set(chain.from_iterable(items))
18293
public void setOptions(OPTIONS ...ops) {
		for (OPTIONS op : ops)
			if (op.equals(OPTIONS.AUTO_PROPAGATE)) autoprop = true;
			else if (op.equals(OPTIONS.NO_PROP_ON_VAR_CREATION)) noPropOnVarCreation = true;
			else if (op.equals(OPTIONS.MANUAL_PROPAGATE)) autoprop = false;
		    else if (op.equals(OPTIONS.DOMAINS_AUTO_INSTANTIATED)) domainsAutoInstantiated = true;
			else if (op.equals(OPTIONS.DOMAINS_MANUALLY_INSTANTIATED)) domainsAutoInstantiated = false;
	}
1084800
def _validate_config(strict=False):
    """"""
    for index in settings.get_index_names():
        _validate_mapping(index, strict=strict)
        for model in settings.get_index_models(index):
            _validate_model(model)
    if settings.get_setting("update_strategy", "full") not in ["full", "partial"]:
        raise ImproperlyConfigured(
            "Invalid SEARCH_SETTINGS: 'update_strategy' value must be 'full' or 'partial'."
        )
464210
def options(self, urls=None, **overrides):
        """"""
        if urls is not None:
            overrides['urls'] = urls
        return self.where(accept='OPTIONS', **overrides)
129737
function(options) {
    var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
    if (options.trustedDomains) {
      if (typeof options.trustedDomains === "string") {
        domains = [ options.trustedDomains ];
      } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
        domains = options.trustedDomains;
      }
    }
    if (domains && domains.length) {
      for (i = 0, len = domains.length; i < len; i++) {
        if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
          domain = _extractDomain(domains[i]);
          if (!domain) {
            continue;
          }
          if (domain === "*") {
            trustedOriginsExpanded.length = 0;
            trustedOriginsExpanded.push(domain);
            break;
          }
          trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
        }
      }
    }
    if (trustedOriginsExpanded.length) {
      str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
    }
    if (options.forceEnhancedClipboard === true) {
      str += (str ? "&" : "") + "forceEnhancedClipboard=true";
    }
    if (typeof options.swfObjectId === "string" && options.swfObjectId) {
      str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
    }
    if (typeof options.jsVersion === "string" && options.jsVersion) {
      str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion);
    }
    return str;
  }
1354562
def match_host (host, domainlist):
    """"""
    if not host:
        return False
    for domain in domainlist:
        if domain.startswith('.'):
            if host.endswith(domain):
                return True
        elif host == domain:
            return True
    return False
1091117
def _check_domain(tokens) -> bool:
        

        idx = None
        for e in tokens:
            if e.text == "@":
                idx = e.i
                break
        if not idx or tokens[idx+1].text in FILTER_PROVIDER:
            return False
        else:
            return True
294604
function checkOptions(opts1, opts2) {
        for (var prop in opts1) {
            if (opts1.hasOwnProperty(prop)) {
                if (opts1[prop] !== opts2[prop]) {
                    return true;
                }
            }
        }
        return false;
    }