Validate params for recurrent transaction.
167087
def validate_recurrent_transaction_params!(options)
      required_params = [:amount, :payment_method, :invoicenumber, :transaction_id]

      validate_required_params!(options, required_params)

      validate_amount!(options)

      valid_payment_methods = [
        PaymentMethod::VISA, PaymentMethod::MASTER_CARD, PaymentMethod::MAESTRO,
        PaymentMethod::SEPA_DIRECT_DEBIT, PaymentMethod::PAYPAL
      ]
      validate_payment_method!(options, valid_payment_methods)
    end
999680
def validate_block!(original_values)
      raise InvalidBlock, "gas_used mistmatch actual: #{gas_used} target: #{original_values[:gas_used]}" if gas_used != original_values[:gas_used]
      raise InvalidBlock, "timestamp mistmatch actual: #{timestamp} target: #{original_values[:timestamp]}" if timestamp != original_values[:timestamp]
      raise InvalidBlock, "difficulty mistmatch actual: #{difficulty} target: #{original_values[:difficulty]}" if difficulty != original_values[:difficulty]
      raise InvalidBlock, "bloom mistmatch actual: #{bloom} target: #{original_values[:bloom]}" if bloom != original_values[:bloom]

      uh = Utils.keccak256_rlp uncles
      raise InvalidBlock, "uncles_hash mistmatch actual: #{uh} target: #{original_values[:uncles_hash]}" if uh != original_values[:uncles_hash]

      raise InvalidBlock, "header must reference no block" unless header.block.nil?

      raise InvalidBlock, "state_root mistmatch actual: #{Utils.encode_hex @state.root_hash} target: #{Utils.encode_hex header.state_root}" if @state.root_hash != header.state_root
      raise InvalidBlock, "tx_list_root mistmatch actual: #{@transactions.root_hash} target: #{header.tx_list_root}" if @transactions.root_hash != header.tx_list_root
      raise InvalidBlock, "receipts_root mistmatch actual: #{@receipts.root_hash} target: #{header.receipts_root}" if @receipts.root_hash != header.receipts_root

      raise ValueError, "Block is invalid" unless validate_fields

      raise ValueError, "Extra data cannot exceed #{config[:max_extradata_length]} bytes" if header.extra_data.size > config[:max_extradata_length]
      raise ValueError, "Coinbase cannot be empty address" if header.coinbase.false?
      raise ValueError, "State merkle root of block #{self} not found in database" unless @state.root_hash_valid?
      raise InvalidNonce, "PoW check failed" if !genesis? && nonce.true? && !header.check_pow
    end
218525
def validate(self,
                 asset,
                 amount,
                 portfolio,
                 algo_datetime,
                 algo_current_data):
        
        if portfolio.positions[asset].amount + amount < 0:
            self.handle_violation(asset, amount, algo_datetime)
1096203
function (params) {
  const oThis = this
  ;

  params = params || {};
  oThis.transactionHash = params.transaction_hash;
  oThis.chain = 'value';
}
1252011
def validate(self):
        """"""
        if not self._resource.get('permissions'):
            self.permissions = self.default_permissions

        try:
            # update _resource so have default values from the schema
            self._resource = self.schema(self._resource)
        except MultipleInvalid as e:
            errors = [format_error(err, self.resource_type) for err in e.errors]
            raise exceptions.ValidationError({'errors': errors})

        yield self.check_service()
        yield self.check_unique()
924684
def workflow_validate_batch(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/validateBatch' % object_id, input_params, always_retry=always_retry, **kwargs)
1342514
def validate(self):
        
        errors = []
        for param in self.required_params:
            if (not hasattr(self, param) or getattr(self, param) is None):
                errors.append("missing %s parameter" % (param))
        if (len(errors) > 0):
            raise IIIFInfoError("Bad data for info.json: " + ", ".join(errors))
        return True
1155891
def validate(self,
                 _portfolio,
                 _account,
                 _algo_datetime,
                 _algo_current_data):
        
        if _account.leverage > self.max_leverage:
            self.fail()
1158636
def _validate_param(param):  # pylint: disable=too-many-branches
    

    detail = None

    if param.oper not in goldman.config.QUERY_FILTERS:
        detail = 'The query filter {} is not a supported ' \
                 'operator. Please change {} & retry your ' \
                 'request'.format(param.oper, param)

    elif param.oper in goldman.config.GEO_FILTERS:
        try:
            if not isinstance(param.val, list) or len(param.val) <= 2:
                raise ValueError
            else:
                param.val = [float(i) for i in param.val]
        except ValueError:
            detail = 'The query filter {} requires a list ' \
                     'of floats for geo evaluation. Please ' \
                     'modify your request & retry'.format(param)

    elif param.oper in goldman.config.ENUM_FILTERS:
        if not isinstance(param.val, list):
            param.val = [param.val]

        param.val = tuple(param.val)

    elif isinstance(param.val, list):
        detail = 'The query filter {} should not be specified more ' \
                 'than once or have multiple values. Please modify ' \
                 'your request & retry'.format(param)

    elif param.oper in goldman.config.BOOL_FILTERS:
        try:
            param.val = str_to_bool(param.val)
        except ValueError:
            detail = 'The query filter {} requires a boolean ' \
                     'for evaluation. Please modify your ' \
                     'request & retry'.format(param)

    elif param.oper in goldman.config.DATE_FILTERS:
        try:
            param.val = str_to_dt(param.val)
        except ValueError:
            detail = 'The query filter {} supports only an ' \
                     'epoch or ISO 8601 timestamp. Please ' \
                     'modify your request & retry'.format(param)

    elif param.oper in goldman.config.NUM_FILTERS:
        try:
            param.val = int(param.val)
        except ValueError:
            detail = 'The query filter {} requires a number ' \
                     'for evaluation. Please modify your ' \
                     'request & retry'.format(param)

    if detail:
        raise InvalidQueryParams(**{
            'detail': detail,
            'links': LINK,
            'parameter': PARAM,
        })
445865
function checkParams(params, reqParams) {
    if ( reqParams.length < 1 ) {
      return;
    }

    if ( (_.isEmpty(params) || !params) && (reqParams.length > 0) ) {
      throw new Error('Missing parameters: ' + reqParams.join(', '));
    }

    var paramsKeys = _.keys(params);
  
    _.each(reqParams, function(reqParam) {
      if ( paramsKeys.indexOf(reqParam) === -1 ) {
        throw new Error('Missing parameter: ' + reqParam);
      }
    });
  }
994654
def _validated(self, data):
        """"""
        for sub in self.schemas:
            data = sub(data)
        return data
553961
def _validate(self):
        """"""
        if self.tpid.value not in (EtherType.VLAN, EtherType.VLAN_QINQ):
            raise UnpackException
        return
567056
def make_request_validator(request):
    """"""
    verb = request.values.get('verb', '', type=str)
    resumption_token = request.values.get('resumptionToken', None)

    schema = Verbs if resumption_token is None else ResumptionVerbs
    return getattr(schema, verb, OAISchema)(partial=False)
103435
def validate(self,
                 _portfolio,
                 account,
                 algo_datetime,
                 _algo_current_data):
        
        if (algo_datetime > self.deadline and
                account.leverage < self.min_leverage):
            self.fail()
376418
def validate(self):
        """"""
        validate_rows_length(self.data, self.columns, exception=self.error)
        validate_categories_equal_entities(self.categories, self.entities,
                                           exception=self.error)
        if self.square:
            validate_square(self.data, exception=self.error)
427185
def timestamping_validate(data, schema):
    
    jsonschema.validate(data, schema)
    data['timestamp'] = str(time.time())
677657
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  if(!info.conn.transaction) {
    throw DiscardWithoutMulti;
  }
}