Validates list of architectures or platforms. Returns a normalized array if successful, or throws an Error.
176920
function validateListFromOptions (opts, name) {
    if (opts.all) return Array.from(supported[name].values())

    let list = opts[name]
    if (!list) {
      if (name === 'arch') {
        list = hostArch()
      } else {
        list = process[name]
      }
    } else if (list === 'all') {
      return Array.from(supported[name].values())
    }

    if (!Array.isArray(list)) {
      if (typeof list === 'string') {
        list = list.split(/,\s*/)
      } else {
        return unsupportedListOption(name, list, supported[name])
      }
    }

    const officialElectronPackages = usingOfficialElectronPackages(opts)

    for (let value of list) {
      if (officialElectronPackages && !supported[name].has(value)) {
        return unsupportedListOption(name, value, supported[name])
      }
    }

    return list
  }
633460
def get_platforms_set():
    ''''''
    # arch and mageia are not in Py2 _supported_dists, so we add them manually
    # Ubuntu adds itself to the list on Ubuntu
    platforms = set([x.lower() for x in platform._supported_dists])
    platforms |= set(['darwin', 'arch', 'mageia', 'ubuntu'])
    return platforms
78238
def validate(self):
        """"""
        if not self.get('api_key'):
            raise ValueError("api_key not found in config. Please see documentation.")
        host = self.get('host') or DEFAULT_CLOUD_HOST
        if host:
            # remove extraneous slashes and force to byte string
            # otherwise msg += message_body in httplib will fail in python2
            # when message_body contains binary data, and url is unicode

            # remaining failure modes include at least:
            # passing bytes in python3 will fail as we try to strip unicode '/' characters
            # passing unicode code points in python2 will fail due to httplib host.encode('ascii')
            host = host.strip('/')
            if not isinstance(host, str):
                host = host.encode('utf-8')
            self['host'] = host

        self.setdefault('autostart_notification_thread', True)
904817
public function validatePresets()
    {
        $this->presets_data = array();
        if (!empty($this->assets_db)) {
            foreach ($this->assets_db as $package_name=>$package_data) {
                if (!empty($package_data['assets_presets'])) {
                    foreach ($package_data['assets_presets'] as $preset_name=>$preset_data) {
                        if (array_key_exists($preset_name, $this->presets_data) && ($this->conflict_flag & self::PRESETS_CONFLICT)) {
                            throw new \Exception(
                                sprintf('Presets conflict: duplicate entry named "%s"!', $preset_name)
                            );
                        } else {
                            $this->presets_data[$preset_name] = array(
                                'data'=>$preset_data,
                                'package'=>$package_name
                            );
                        }
                    }
                }
            }
        }
    }
39598
def validate():
    """"""

    errors = dict()
    for test in (test_architecture,
                 test_pyqt_availability,
                 test_pyblish_availability,
                 test_qtconf_availability,
                 test_qtconf_correctness,
                 test_qt_availability):
        try:
            test()
        except Exception as e:
            errors[test] = e

    if not errors:
        print("=" * 78)
        print()
        print(""" - Success!

{exe} is well suited to run Pyblish QML""".format(exe=sys.executable))
        print()
        print("=" * 78)

        return True

    print("=" * 78)
    print()
    print(" - Failed")
    print()
    for test, error in errors.iteritems():
        print(test.__name__)
        print("    %s" % error)
    print()
    print("=" * 78)

    return False
68367
def validate(self):
        """"""
        try:
            for pkg in self.resolved_packages:
                pkg.validate_data()
        except RezError as e:
            raise ResolvedContextError("%s: %s" % (e.__class__.__name__, str(e)))
512590
function(project, options) {
    var validations = [];
    var projectConfig = project.config(options.environment);
    var isGlimmer = projectType.isGlimmer(this.project.root);

    if (isGlimmer === false) {
      validations.push(
        new ValidateRootUrl({
          config: projectConfig,
          force: options.force
        }).run()
      );

      validations.push(
        new ValidateLocationType({
          config: projectConfig,
          force: options.force
        }).run()
      );
    }

    validations.push(
      new ValidateAllowNavigation({
        project: project,
        rejectIfUndefined: false
      }).run()
    );

    if (options.skipCordovaBuild !== true) {
      validations.push(
        new ValidatePlatformTask({
          project: project,
          platform: options.platform
        }).run()
      );
    }

    return runValidators(validations);
  }
489949
def _validate_resources(self):
        """"""
        resources = self.options.resources

        for key in ['num_machines', 'num_mpiprocs_per_machine', 'tot_num_mpiprocs']:
            if key in resources and resources[key] != 1:
                raise exceptions.FeatureNotAvailable(
                    "Cannot set resource '{}' to value '{}' for {}: parallelization is not supported, "
                    "only a value of '1' is accepted.".format(key, resources[key], self.__class__.__name__))
1179817
def validate(args):
    
    if args.format not in FORMATTERS:
        print(
            "Subtitle format not supported. "
            "Run with --list-formats to see all supported formats."
        )
        return False

    if args.src_language not in LANGUAGE_CODES.keys():
        print(
            "Source language not supported. "
            "Run with --list-languages to see all supported languages."
        )
        return False

    if args.dst_language not in LANGUAGE_CODES.keys():
        print(
            "Destination language not supported. "
            "Run with --list-languages to see all supported languages."
        )
        return False

    if not args.source_path:
        print("Error: You need to specify a source path.")
        return False

    return True
1017150
def index
      validate_arguments!

      stacks_data = api.get_stack(app).body

      styled_header("#{app} Available Stacks")
      stacks = stacks_data.map do |stack|
        row = [stack['current'] ? '*' : ' ', Codex.out(stack['name'])]
        row << '(beta)' if stack['beta']
        row << '(deprecated)' if stack['deprecated']
        row << '(prepared, will migrate on next git push)' if stack['requested']
        row.join(' ')
      end
      styled_array(stacks)
    end
1245565
def _validate_completeness(self):
        
        errors = list()

        # First we'll make sure there's no mismatch between the filesystem
        # and the list of files in the manifest(s)
        only_in_manifests, only_on_fs, only_in_fetch = self.compare_manifests_with_fs_and_fetch()
        for path in only_in_manifests:
            e = FileMissing(path)
            LOGGER.warning(force_unicode(e))
            errors.append(e)
        for path in only_on_fs:
            e = UnexpectedFile(path)
            LOGGER.warning(force_unicode(e))
            errors.append(e)
        for path in only_in_fetch:
            e = UnexpectedRemoteFile(path)
            # this is non-fatal according to spec but the warning is still reasonable
            LOGGER.warning(force_unicode(e))

        if errors:
            raise BagValidationError(_("Bag validation failed"), errors)
1106353
def validate_api_compatibility(args):
  
  if args.api_version and args.api_version < MINIMUM_SUPPORTED_API_VERSION:
    print("ERROR: Given API version: {0}. Minimum supported API version: {1}"
          .format(args.api_version, MINIMUM_SUPPORTED_API_VERSION))
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
405383
def index
      validate_arguments!

      app_buildpacks = api.get_app_buildpacks_v3(app)[:body]

      if app_buildpacks.nil? or app_buildpacks.empty?
        display("#{app} has no Buildpack URL set.")
      else
        styled_header("#{app} Buildpack URL#{app_buildpacks.size > 1 ? 's' : ''}")
        display_buildpacks(app_buildpacks.map{|bp| bp["buildpack"]["url"]}, "")
      end
    end
1242758
def _validate_applications(self, apps):
		""""""
		for application_id, application_config in apps.items():
			self._validate_config(application_id, application_config)

			application_config["APPLICATION_ID"] = application_id
164447
def validate(config):
    '''
    
    '''
    vcfg_ret = True
    vcfg_msg = 'Valid beacon configuration'

    if not isinstance(config, list):
        vcfg_ret = False
        vcfg_msg = 'Configuration for vmadm beacon must be a list!'

    return vcfg_ret, vcfg_msg
1271108
async function validateBaseBranches(config) {
  if (!is.nonEmptyArray(config.baseBranches)) {
    return [];
  }
  const missingBranches = [];
  for (const baseBranch of config.baseBranches) {
    if (!(await platform.branchExists(baseBranch))) {
      missingBranches.push(baseBranch);
    }
  }
  if (missingBranches.length) {
    return [
      {
        depName: 'Missing baseBranches',
        message:
          'One or more configured baseBranches are missing from this repo: ' +
          missingBranches.join(', '),
      },
    ];
  }
  return [];
}