Parses/validates, and breaks off into actions.
359940
def handle(self, *args, **options):
        
        if len(args) < 1:
            raise CommandError("Please specify an action. See --help.")

        action = args[0]
        email = None

        if action not in self.valid_actions:
            message = "Invalid action: %s" % action
            raise CommandError(message)

        if action in ['verify', 'delete']:
            if len(args) < 2:
                message = "Please specify an email address to %s." % action
                raise CommandError(message)

            email = args[1]

            if not email or not self._is_valid_email(email):
                message = "Invalid email address provided: %s" % email
                raise CommandError(message)

        # Hand this off to the action routing method.
        self._route_action(action, email)
89225
public void validate() {
    if (id == null || id.isEmpty()) {
      throw new IllegalArgumentException("missing or empty id");
    }
    Query.validateId(id);
    
    if (expr == null || expr.isEmpty()) {
      throw new IllegalArgumentException("missing or empty expr");
    }
    
    // parse it just to make sure we're happy and extract the variable names. 
    // Will throw JexlException
    parsed_expression = ExpressionIterator.JEXL_ENGINE.createScript(expr);
    variables = new HashSet<String>();
    for (final List<String> exp_list : 
      ExpressionIterator.JEXL_ENGINE.getVariables(parsed_expression)) {
      for (final String variable : exp_list) {
        variables.add(variable);
      }
    }
    
    // others are optional
    if (join == null) {
      join = Join.Builder().setOperator(SetOperator.UNION).build();
    }
  }
625712
public void executeNext() {

        if (!m_idle) {
            if (m_actions.isEmpty()) {
                m_idle = true;
            } else {
                CmsValidationController action = m_actions.removeFirst();
                action.internalStartValidation();
            }
        } else {
            assert false; // this shouldn't happen
        }
    }
497596
protected function doParse()
    {
        $object = $this->objectNameToKey($this->objectName);

        if ('ok' !== $this->data['@attributes']['stat']) {
            $errorCode = (int) $this->data['@attributes']['err_code'];
            $errorMessage = $this->data['err'];

            if (in_array($errorCode, array(1, 15))) {
                throw new AuthenticationErrorException($errorMessage, $errorCode);
            } else {
                throw new RuntimeException($errorMessage, $errorCode);
            }
        } else {
            if (array_key_exists('result', $this->data)) {
                $this->parseMultiRecordResult($object, $this->data);
            } elseif (array_key_exists($object, $this->data)) {
                $this->parseSingleRecordResult($object, $this->data);
            } elseif (array_key_exists('api_key', $this->data)) {
                $this->resultCount = 0;
                $this->result = $this->data['api_key'];
            } else {
                $asString = true;
                throw new RuntimeException('Unknown response format: '.$this->responseObj->getBoby($asString));
            }
        }
    }
807100
protected void validate() {
        Assert.checkNotNullParam("endpoint", endpoint);
        Assert.checkNotNullParam("optionMap", optionMap);
        Assert.checkNotNullParam("uri", uri);
    }
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
304020
private function validate($decoded): void
    {
        // Validate it is an array
        if (! Validator::arrayType()->length(1, 2)->validate($decoded)) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (must contains parameters array, and maybe a class)'
            );
        }

        $size = count($decoded);

        // Validate that if size is 2, first value is a string
        if ($size === 2 && ! Validator::stringType()->validate($decoded[0])) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (constructor class must be a string)'
            );
        }
        // Validate that last value is an array
        if (! Validator::arrayVal()
            ->each(Validator::stringType(), Validator::intType())->validate($decoded[$size - 1])) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (constructor parameters must be a array of string)'
            );
        }
    }
641837
protected void validate() {

        CmsRpcAction<CmsAliasEditValidationReply> action = new CmsRpcAction<CmsAliasEditValidationReply>() {

            @Override
            public void execute() {

                CmsAliasEditValidationRequest validationRequest = new CmsAliasEditValidationRequest();

                List<CmsAliasTableRow> rows = m_view.getLiveData();
                validationRequest.setEditedData(rows);
                validationRequest.setOriginalData(m_initialData);
                getService().validateAliases(validationRequest, this);
            }

            @Override
            public void onResponse(CmsAliasEditValidationReply result) {

                stop(false);
                List<CmsAliasTableRow> changedRows = result.getChangedRows();
                m_view.update(changedRows);
                updateValidationStatus();
            }

        };
        action.execute();
    }
892966
private function validate($decoded): void
    {
        // Validate it is an array
        if (! Validator::arrayType()->length(2, 2)->validate($decoded)) {
            throw new AnnotationParseException(
                '"mock" annotation content is invalid (must contains the class to mock and the property name)'
            );
        }
        // Validate that each value is a string
        if (! Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) {
            throw new AnnotationParseException(
                '"mock" annotation content is invalid (class and property name must be string)'
            );
        }
    }
1288866
def handle(self, *arguments, **options):
        
        self.arguments = arguments
        self.options = options
        self.arguments = self.parse_arguments(arguments)
        self.options = self.parse_options(options)
        
        for name in self.get_actions():
            validate = getattr(self, "validate_{name:s}".format(
                name=name), None)
            if validate is not None and isinstance(validate, collections.Callable):
                validate(*arguments, **options)
        for name in self.get_actions():
            handle = getattr(self, "handle_{name:s}".format(
                name=name), None)
            if handle is not None and isinstance(handle, collections.Callable):
                handle(*self.arguments, **self.options)
311732
public void process() throws CDKException {
        logger.debug("Started parsing from input...");
        try {
            parser.setFeature("http://xml.org/sax/features/validation", false);
            logger.info("Deactivated validation");
        } catch (SAXException e) {
            logger.warn("Cannot deactivate validation.");
        }
        parser.setContentHandler(new EventCMLHandler(this, builder));
        parser.setEntityResolver(new CMLResolver());
        parser.setErrorHandler(new CMLErrorHandler());
        try {
            logger.debug("Parsing from Reader");
            parser.parse(new InputSource(input));
        } catch (IOException e) {
            String error = "Error while reading file: " + e.getMessage();
            logger.error(error);
            logger.debug(e);
            throw new CDKException(error, e);
        } catch (SAXParseException saxe) {
            SAXParseException spe = (SAXParseException) saxe;
            String error = "Found well-formedness error in line " + spe.getLineNumber();
            logger.error(error);
            logger.debug(saxe);
            throw new CDKException(error, saxe);
        } catch (SAXException saxe) {
            String error = "Error while parsing XML: " + saxe.getMessage();
            logger.error(error);
            logger.debug(saxe);
            throw new CDKException(error, saxe);
        }
    }
206056
private function validate(string $value) : void
    {
        foreach ($this->validators as $validator) {
            if (! $validator->isValid($value)) {
                foreach ($validator->getFailureMessages() as $messageKey => $message) {
                    $this->addTranslatableError($messageKey, $message);
                }
            }
        }
    }
225427
def validate(identifier):
    ''''''
    source = actions.validate_source(identifier)
    log.info('Source %s (%s) has been validated', source.slug, str(source.id))
1130179
public function process()
    {
        parent::process();

        $data = &$this->getForm()->getFormData();
        if (isset($data[$this->id])) {
            $this->value = $data[$this->id];
        } else {
            $this->value = null;
        }

        $this->value = ltrim($this->value, '#');

        if ($this->value == '') {
            $this->value = null;
        }

        if ($this->required && $this->value === null) {
            $this->addMessage($this->getValidationMessage('required'));
        } elseif (
            $this->value !== null &&
            !$this->validateColor($this->value)
        ) {
            $message = sprintf(
                Swat::_('“%s” is not a valid color.'),
                $this->value
            );

            $this->addMessage(new SwatMessage($message, 'error'));
        }
    }
39587
public function process()
    {
        parent::process();

        if (!$this->processValue()) {
            return;
        }

        if ($this->required && $this->isSensitive()) {
            // When values are not serialized, an empty string is treated as
            // null. As a result, you should not use a null value and an empty
            // string value in the same flydown except when using serialized
            // values.
            if (
                ($this->serialize_values && $this->value === null) ||
                (!$this->serialize_values && $this->value == '')
            ) {
                $this->addMessage($this->getValidationMessage('required'));
            }
        }
    }
24103
public void validate() {
    if (interval == null || interval.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty interval");
    }
    DateTime.parseDuration(interval);
    
    if (aggregator == null || aggregator.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty aggregator");
    }
    try {
      Aggregators.get(aggregator.toLowerCase());
    } catch (final NoSuchElementException e) {
      throw new IllegalArgumentException("Invalid aggregator");
    }
    
    if (fill_policy != null) {
      fill_policy.validate();
    }
  }
198100
def post_parse_action(self, entry):
        """"""
        if 'source_host' in entry.keys():
            host = self.ip_port_regex.findall(entry['source_host'])
            if host:
                hlist = host[0].split('.')
                entry['source_host'] = '.'.join(hlist[:4])
                entry['source_port'] = hlist[-1]
        if 'dest_host' in entry.keys():
            host = self.ip_port_regex.findall(entry['dest_host'])
            if host:
                hlist = host[0].split('.')
                entry['dest_host'] = '.'.join(hlist[:4])
                entry['dest_port'] = hlist[-1]

        return entry