Verify that the Event's code is a valid one.
768559
def validate_event_type(sender, event, created):
    """"""
    if event.code not in sender.event_codes():
        raise ValueError("The Event.code '{}' is not a valid Event "
                         "code.".format(event.code))
989824
def _verify_validator(self, validator, path):
        """"""

        # Validator should be a function
        if not callable(validator):
            raise SchemaFormatException("Invalid validations for {}", path)

        # Validator should accept a single argument
        (args, varargs, keywords, defaults) = getargspec(validator)
        if len(args) != 1:
            raise SchemaFormatException("Invalid validations for {}", path)
1304622
public final boolean verifyEventCondition(MessageEnvelope envelope) {
		String message = safeGetQuickReplyPayload(envelope);
		if (caseSensitive) {
			expectedString = expectedString.toLowerCase();
			message = message.toLowerCase();
		}
		return message.equals(expectedString);
	}
90724
def register_check(check, codes=None):
    """"""
    def _add_check(check, kind, codes, args):
        if check in _checks[kind]:
            _checks[kind][check][0].extend(codes or [])
        else:
            _checks[kind][check] = (codes or [''], args)
    if inspect.isfunction(check):
        args = _get_parameters(check)
        if args and args[0] in ('physical_line', 'logical_line'):
            if codes is None:
                codes = ERRORCODE_REGEX.findall(check.__doc__ or '')
            _add_check(check, args[0], codes, args)
    elif inspect.isclass(check):
        if _get_parameters(check.__init__)[:2] == ['self', 'tree']:
            _add_check(check, 'tree', codes, None)
454483
private void validateType() {
      if (getType().isCarrierMovementRequired() && getCarrierMovement() == null) {
        throw new IllegalArgumentException("Carrier movement is required for event type " + getType());
      }
      if (!getType().isCarrierMovementRequired() && getCarrierMovement() != null) {
        throw new IllegalArgumentException("Carrier movement is not allowed with event type " + getType());
      }
    }
218522
function validate(message, type) {
  assert(
    typeOf(message) === 'object',
    'You must pass a message object.',
  );

  rules.forEach((rule) => {
    if (message[rule.name]) {
      const types = [].concat(rule.types);

      assert(
        types.some(t => typeOf(message[rule.name]) === t),
        `"${rule.name}" must be ${types.join(' or ')}.`,
      );
    }
  });

  if (asserts[type]) {
    asserts[type](message);
  } else {
    throw new TypeError('Invalid event type');
  }
}
960987
function _gpfEventsIsValidHandler (eventHandler) {
    var type = typeof eventHandler,
        validator = _gpfEventsHandlerValidators[type];
    if (validator === undefined) {
        return false;
    }
    return validator(eventHandler);
}
291408
def valid?(request)
      begin
        valid!(request)
      rescue AlexaVerifier::BaseError => e
        puts e

        return false
      end

      true
    end
1151365
def Validate(self):
    """"""
    ValidateMultiple(self.probe, "Method has invalid probes")
    Validate(self.target, "Method has invalid target")
    Validate(self.hint, "Method has invalid hint")
704987
public boolean validateEventName(String eventName) {
        boolean isValid = false;
        if ((AuditConstants.validEventNamesList).contains(eventName))
            isValid = true;
        return isValid;
    }
454879
public void validateVerification(int id, String code) {
		getResourceFactory().getApiResource("/hook/" + id + "/verify/validate")
				.entity(new HookValidate(code), MediaType.APPLICATION_JSON)
				.post();
	}
774023
def is_valid_index(self, code):
        
        index_list = self.get_index_list()
        return True if code.upper() in index_list else False
490994
def valid?
      result = true

      selected.each do |view|
        view.rmq_data.validations.each do |validation|

          has_events = view.rmq_data.events

          if validation.valid?(rmq(view).data)
            if has_events && view.rmq_data.events.has_event?(:valid)
              view.rmq_data.events[:valid].fire!
            end
          else
            if has_events && view.rmq_data.events.has_event?(:invalid)
              view.rmq_data.events[:invalid].fire!
            end
            result = false
          end
        end
      end
      return result
    end
1038660
def is_faulty(self, event):
        
        for each in self._faults:
            if each.name.upper() == event.name.upper():
                return True
        return False
1239508
def assert_valid(key, value)
      validators[key].each do |validator|
        validator.call(key, value)
      end
    end
177815
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Instance, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
        if isinstance(value, HasProperties):
            value.validate()
        return True
688428
def _validate(self):
        

        if self._state is not states.INITIAL:
            raise ValueError(obj=self._uid,
                             attribute='state',
                             expected_value=states.INITIAL,
                             actual_value=self._state)

        if not self._executable:
            raise MissingError(obj=self._uid,
                               missing_attribute='executable')