Validates fast installation
437903
protected function validateFastInstall()
    {
        $mapping = $this->getMappingInstall();
        $default = $this->getDefaultInstall();

        $this->setSubmittedMapped($mapping, null, $default);
        $this->validateComponent('install');
        $this->errors(true);
    }
252024
function checkInstallationStatus() {
        var searchParams = {
                "updateDir": updateDir,
                "installErrorStr": ["ERROR:"],
                "bracketsErrorStr": ["ERROR:"],
                "encoding": "utf8"
            },
            // Below are the possible Windows Installer error strings, which will be searched for in the installer logs to track failures.
            winInstallErrorStrArr = [
                "Installation success or error status",
                "Reconfiguration success or error status"
            ];
        if (brackets.platform === "win") {
            searchParams.installErrorStr = winInstallErrorStrArr;
            searchParams.encoding = "utf16le";
        }
        postMessageToNode(MessageIds.CHECK_INSTALLER_STATUS, searchParams);
    }
1211267
public function validateCurrentInstall() {
		if (!file_exists($this->installStatusFile)) {
			throw new MoufException("No install status file found. I don't know what install task should be run.");
		}
		
		$statusArray = json_decode(file_get_contents($this->installStatusFile), true);
		if ($statusArray['type'] == 'one') {
			$taskArray = $statusArray['task'];
			// Now, let's find the matching task and mark it "done".
			$installTask = $this->findInstallTaskFromArray($taskArray);
			$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
			$this->save();
			
			// Finally, let's delete the install status file.
			unlink($this->installStatusFile);
		} else {
			$installTasks = $this->getInstallTasks();
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
					$this->save();
					break;
				}
			}
			$todoRemaining = false;
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$todoRemaining = true;
					break;
				}
			}
			if (!$todoRemaining) {
				// Finally, let's delete the install status file if there are no actions in "todo" state
				unlink($this->installStatusFile);
			}
		}
		
	}
697378
def verify_directory(verbose=True, max_size_mb=50):
    
    # Check required files
    ok = True
    mb_to_bytes = 1000 * 1000
    expected_files = ["config.txt", "experiment.py"]

    for f in expected_files:
        if os.path.exists(f):
            log("✓ {} is PRESENT".format(f), chevrons=False, verbose=verbose)
        else:
            log("✗ {} is MISSING".format(f), chevrons=False, verbose=verbose)
            ok = False

    # Check size
    max_size = max_size_mb * mb_to_bytes
    size = size_on_copy()
    if size > max_size:
        size_in_mb = round(size / mb_to_bytes)
        log(
            "✗ {}MB is TOO BIG (greater than {}MB)".format(size_in_mb, max_size_mb),
            chevrons=False,
            verbose=verbose,
        )
        ok = False

    return ok
225145
def is_fasta_valid(fasta_file):
    
    try:
        f = pysam.FastaFile(fasta_file)
    except IOError:
        raise
    else:
        f.close()
    return True
209941
def validate(output, resource):
    '''
    
    '''
    try:
        import cerberus  # pylint: disable=import-error
    except ImportError:
        log.critical('You need module cerberus in order to use validation')
        return

    roots = __opts__['pepa_roots']

    valdir = os.path.join(roots['base'], resource, 'validate')

    all_schemas = {}
    pepa_schemas = []
    for fn in glob.glob(valdir + '/*.yaml'):
        log.info("Loading schema: %s", fn)
        with salt.utils.files.fopen(fn) as fhr:
            template = jinja2.Template(fhr.read())
        data = output
        data['grains'] = __grains__.copy()
        data['pillar'] = __pillar__.copy()
        schema = salt.utils.yaml.safe_load(template.render(data))
        all_schemas.update(schema)
        pepa_schemas.append(fn)

    val = cerberus.Validator()
    if not val.validate(output['pepa_keys'], all_schemas):
        for ekey, error in six.iteritems(val.errors):
            log.warning('Validation failed for key %s: %s', ekey, error)

    output['pepa_schema_keys'] = all_schemas
    output['pepa_schemas'] = pepa_schemas
5790
def _validate(wdl_file):
    
    start_dir = os.getcwd()
    os.chdir(os.path.dirname(wdl_file))
    print("Validating", wdl_file)
    subprocess.check_call(["wdltool", "validate", wdl_file])
    os.chdir(start_dir)
824994
def checksums(self, install):
        
        check_md5(pkg_checksum(install, self.repo), self.tmp_path + install)
846466
protected function validateInstallerInstall()
    {
        $field = 'installer';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (empty($value)) {
            $this->setSubmitted('installer', 'default');
            return null;
        }

        $installer = $this->install->getHandler($value);

        if (empty($installer)) {
            $this->setErrorInvalid('installer', $this->translation->text('Installer'));
            return false;
        }

        return true;
    }
424899
def validate(self, path):
        """"""
        # Exclude hidden files and folders with '.' prefix
        if os.path.basename(path).startswith('.'):
            return False

        # Check that current path level is more than min path and less than max path
        if not self.check_level(path):
            return False

        if self.filters:
            if not self._level_filters(path):
                return False

        # Force include and exclude iterations to be strings in case of integer filters
        # Handle exclusions
        if self.to_exclude:
            if any(str(ex).lower() in path.lower() for ex in self.to_exclude):
                return False

        # Handle inclusions
        if self.to_include:
            if not any(str(inc).lower() in path.lower() for inc in self.to_include):
                return False

        return True
389735
function handleInstall(event) {
  logger.log('Entering install handler.');
  self.skipWaiting();
  if ($Cache.precache) {
    event.waitUntil(precache());
  }
}
940909
def validate_create_package(
    ctx, opts, owner, repo, package_type, skip_errors, **kwargs
):
    """"""
    click.echo(
        "Checking %(package_type)s package upload parameters ... "
        % {"package_type": click.style(package_type, bold=True)},
        nl=False,
    )

    context_msg = "Failed to validate upload parameters!"
    with handle_api_exceptions(
        ctx, opts=opts, context_msg=context_msg, reraise_on_error=skip_errors
    ):
        with maybe_spinner(opts):
            api_validate_create_package(
                package_format=package_type, owner=owner, repo=repo, **kwargs
            )

    click.secho("OK", fg="green")
    return True
948646
public static function validateInstaller($installer_class)
    {
        if (class_exists($installer_class)) {
            $interfaces = class_implements($installer_class);
            $installer_interface = Config::getInternal('assets-package-installer-interface');
            return in_array($installer_interface, $interfaces);
        }
        return false;
    }
360556
def verify():
    """"""
    verbose = True
    log(
        "Verifying current directory as a Dallinger experiment...",
        delay=0,
        verbose=verbose,
    )
    ok = verify_package(verbose=verbose)
    if ok:
        log("✓ Everything looks good!", delay=0, verbose=verbose)
    else:
        log("☹ Some problems were found.", delay=0, verbose=verbose)
351276
def validate_pro():
    """"""
    cmd = ['python3', 'validate.py', FLAGS.pro_dataset,
           '--use_tpu',
           '--tpu_name={}'.format(TPU_NAME),
           '--work_dir={}'.format(fsdb.working_dir()),
           '--flagfile=rl_loop/distributed_flags',
           '--validate_name=pro']
    mask_flags.run(cmd)
993852
def validate(self):
        
        self.phase = PHASE.VALIDATE
        self.logger.info("Validating %s..." % self.namespace)
        self.instantiate_features()
        context_dict = {}
        if self.target:
            for s in self.target.formula_sections():
                context_dict["%s:root_dir" % s] = self.directory.install_directory(s)
                context_dict['config:root_dir'] = self.directory.root_dir
                context_dict['config:node'] = system.NODE
                self.target.add_additional_context(context_dict)
        for feature in self.features.run_order:
            self.run_action(feature, 'validate', run_if_error=True)
963622
def prepare_installed_requirement(self, req, require_hashes, skip_reason):
        # type: (InstallRequirement, bool, Optional[str]) -> DistAbstraction
        
        assert req.satisfied_by, "req should have been satisfied but isn't"
        assert skip_reason is not None, (
            "did not get skip reason skipped but req.satisfied_by "
            "is set to %r" % (req.satisfied_by,)
        )
        logger.info(
            'Requirement %s: %s (%s)',
            skip_reason, req, req.satisfied_by.version
        )
        with indent_log():
            if require_hashes:
                logger.debug(
                    'Since it is already installed, we are trusting this '
                    'package without checking its hash. To ensure a '
                    'completely repeatable environment, install into an '
                    'empty virtualenv.'
                )
            abstract_dist = Installed(req)

        return abstract_dist