Put here all precondition verification
344630
@Override protected void init() {
    super.init();

    assert 0 <= ntrees && ntrees < 1000000; // Sanity check
    // Not enough rows to run
    if (source.numRows() - response.naCnt() <=0)
      throw new IllegalArgumentException("Dataset contains too many NAs!");

    if( !classification && (!(response.isEnum() || response.isInt())))
      throw new IllegalArgumentException("Classification cannot be performed on a float column!");

    if(classification) {
      if (0.0f > sample_rate || sample_rate > 1.0f)
        throw new IllegalArgumentException("Sampling rate must be in [0,1] but found " + sample_rate);
    }

    if(regression) throw new IllegalArgumentException("SpeeDRF does not currently support regression.");
  }
583827
def verify(dataset, publication_date, source, refernce_url):
    """"""

    config = ApiConfig()
    client = ApiClient(config.host, config.app_id, config.app_secret)
    client.check_correct_host()
    client.verify(dataset, publication_date, source, refernce_url)
1254864
def _preflight_check(desired, fromrepo, **kwargs):
    '''
    
    '''
    if 'pkg.check_db' not in __salt__:
        return {}
    ret = {'suggest': {}, 'no_suggest': []}
    pkginfo = __salt__['pkg.check_db'](
        *list(desired.keys()), fromrepo=fromrepo, **kwargs
    )
    for pkgname in pkginfo:
        if pkginfo[pkgname]['found'] is False:
            if pkginfo[pkgname]['suggestions']:
                ret['suggest'][pkgname] = pkginfo[pkgname]['suggestions']
            else:
                ret['no_suggest'].append(pkgname)
    return ret
1281513
def verify(self):
        
        pb = self._get_ansible_playbook(self.playbooks.verify)
        pb.execute()
152421
def verify
      (0...size)
        .map { |i| [i, @data[i]] }
        .reject { |_i, val| yield(val) }
        .to_h
    end
930838
def validate(self, model, checks=[]):
        """"""
        custom = [
            check_partial(reaction_id_check,
                          frozenset(r.id for r in model.reactions))
        ]
        super(Medium, self).validate(model=model, checks=checks + custom)
748190
private void ensureDefaultOccurElements(IChemObjectBuilder builder) {
        if (mfRange == null) {
            String[] elements = new String[]{"C", "H", "O", "N", "Si", "P", "S", "F", "Cl", "Br", "I", "Sn", "B", "Pb",
                    "Tl", "Ba", "In", "Pd", "Pt", "Os", "Ag", "Zr", "Se", "Zn", "Cu", "Ni", "Co", "Fe", "Cr", "Ti",
                    "Ca", "K", "Al", "Mg", "Na", "Ce", "Hg", "Au", "Ir", "Re", "W", "Ta", "Hf", "Lu", "Yb", "Tm", "Er",
                    "Ho", "Dy", "Tb", "Gd", "Eu", "Sm", "Pm", "Nd", "Pr", "La", "Cs", "Xe", "Te", "Sb", "Cd", "Rh",
                    "Ru", "Tc", "Mo", "Nb", "Y", "Sr", "Rb", "Kr", "As", "Ge", "Ga", "Mn", "V", "Sc", "Ar", "Ne", "Be",
                    "Li", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu"};

            mfRange = new MolecularFormulaRange();
            for (int i = 0; i < elements.length; i++)
                mfRange.addIsotope(builder.newInstance(IIsotope.class, elements[i]), 0, 50);
        }
    }
349038
protected function prepareForValidation(): void
    {
        $data = $this->all();

        $data['manager']['is_active'] = ! config('cortex.auth.registration.moderated');

        $this->replace($data);
    }
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
                            );
                        }
                    }
                }
            }
        }
    }
126401
def perform
      validate!

      party_options = options.dup

      # merge proxy
      if proxy = self.proxy
        addr, port = proxy.split(':')
        party_options[:http_proxyaddr] = addr
        party_options[:http_proxyport] = port || 80
      end

      # now merge runtime_options
      party_options = party_options.merge(sinew.runtime_options.httparty_options)

      # merge headers
      headers = sinew.runtime_options.headers
      headers = headers.merge(party_options[:headers]) if party_options[:headers]
      party_options[:headers] = headers

      party_response = HTTParty.send(method, uri, party_options)
      Response.from_network(self, party_response)
    end
1333212
def clean(self):
        """"""
        result = super(User, self).clean()
        result['verified'] = 'verification_hash' not in self._resource
        return result
211154
private void verify() {
        // Copy table defs to avoid ConcurrentModificationException if we add a table.
        List<TableDefinition> definedTables = new ArrayList<>(m_tableMap.values());
        for (TableDefinition tableDef : definedTables) {
            // Copy field defs for same reason
            List<FieldDefinition> definedFields = new ArrayList<>(tableDef.getFieldDefinitions());
            for (FieldDefinition fieldDef : definedFields) {
                if (fieldDef.isLinkType()) {
                    verifyLink(tableDef, fieldDef);
                }
            }
        }
    }
492727
protected final void verify() {
        collectInitialisers();
        verifyCandidates();
        verifyInitialisers();
        collectPossibleInitialValues();
        verifyPossibleInitialValues();
        collectEffectiveAssignmentInstructions();
        verifyEffectiveAssignmentInstructions();
        collectAssignmentGuards();
        verifyAssignmentGuards();
        end();
    }
1122947
def _verify(self):
        
        scenario_names = [c.scenario.name for c in self._configs]
        if self._scenario_name not in scenario_names:
            msg = ("Scenario '{}' not found.  "
                   'Exiting.').format(self._scenario_name)
            util.sysexit_with_message(msg)
770165
protected function validateInputDbInstall()
    {
        $this->validatePrompt('database.name', $this->text('Database name'), 'install');
        $this->validatePrompt('database.user', $this->text('Database user'), 'install', 'root');
        $this->validatePrompt('database.password', $this->text('Database password'), 'install', '');
        $this->validatePrompt('database.port', $this->text('Database port'), 'install', '3306');
        $this->validatePrompt('database.host', $this->text('Database port'), 'install', 'localhost');

        $this->validateInputDbTypeInstall();
    }
1158294
public function verifyElements(): void
    {
        $this->context->waitUntilElementIsVisible($this->fields['username']);
        $this->context->waitUntilElementIsVisible($this->fields['password']);

        $this->context->waitUntil(5, function () {
            return '' == $this->context->findElement($this->fields['password'], $this->defaultTimeout)->getValue();
        });
    }
209748
protected function prepareForValidation(): void
    {
        $data = $this->all();

        $guardian = $this->route('guardian') ?? app('cortex.auth.guardian');

        if ($guardian->exists && empty($data['password'])) {
            unset($data['password'], $data['password_confirmation']);
        }

        $this->replace($data);
    }