Processes the scan parameters.
429783
def _preprocess_scan_params(self, xml_params):
        
        params = {}
        for param in xml_params:
            params[param.tag] = param.text or ''
        # Set default values.
        for key in self.scanner_params:
            if key not in params:
                params[key] = self.get_scanner_param_default(key)
                if self.get_scanner_param_type(key) == 'selection':
                    params[key] = params[key].split('|')[0]
        # Validate values.
        for key in params:
            param_type = self.get_scanner_param_type(key)
            if not param_type:
                continue
            if param_type in ['integer', 'boolean']:
                try:
                    params[key] = int(params[key])
                except ValueError:
                    raise OSPDError('Invalid %s value' % key, 'start_scan')
            if param_type == 'boolean':
                if params[key] not in [0, 1]:
                    raise OSPDError('Invalid %s value' % key, 'start_scan')
            elif param_type == 'selection':
                selection = self.get_scanner_param_default(key).split('|')
                if params[key] not in selection:
                    raise OSPDError('Invalid %s value' % key, 'start_scan')
            if self.get_scanner_param_mandatory(key) and params[key] == '':
                    raise OSPDError('Mandatory %s value is missing' % key,
                                    'start_scan')
        return params
293879
private void processMapping() {
        for (Entry<String, Set<String>> desiredToMatchingLanguages : matcherData.matchingLanguages().keyValuesSet()) {
            String desired = desiredToMatchingLanguages.getKey();
            Set<String> supported = desiredToMatchingLanguages.getValue();
            for (R3<ULocale, ULocale, Double> localeToMaxAndWeight : localeToMaxLocaleAndWeight) {
                final ULocale key = localeToMaxAndWeight.get0();
                String lang = key.getLanguage();
                if (supported.contains(lang)) {
                    addFiltered(desired, localeToMaxAndWeight);
                }
            }
        }
        // now put in the values directly, since languages always map to themselves
        for (R3<ULocale, ULocale, Double> localeToMaxAndWeight : localeToMaxLocaleAndWeight) {
            final ULocale key = localeToMaxAndWeight.get0();
            String lang = key.getLanguage();
            addFiltered(lang, localeToMaxAndWeight);
        }
    }
141485
public void run() {
    final Scanner scanner = getScanner();

    // start the process by loading all of the trees in the system
    final List<Tree> trees;
    try {
      trees = Tree.fetchAllTrees(tsdb).joinUninterruptibly();
      LOG.info("[" + thread_id + "] Complete");
    } catch (Exception e) {
      LOG.error("[" + thread_id + "] Unexpected Exception", e);
      throw new RuntimeException("[" + thread_id + "] Unexpected exception", e);
    }
    
    if (trees == null) {
      LOG.warn("No tree definitions were found");
      return;
    } else {
      boolean has_enabled_tree = false;
      for (Tree tree : trees) {
        if (tree.getEnabled()) {
          has_enabled_tree = true;
          break;
        }
      }
      if (!has_enabled_tree) {
        LOG.warn("No enabled trees were found");
        return;
      }
      LOG.info("Found [" + trees.size() + "] trees");
    }
    
    // setup an array for storing the tree processing calls so we can block 
    // until each call has completed
    final ArrayList<Deferred<Boolean>> tree_calls = 
      new ArrayList<Deferred<Boolean>>();
    
    final Deferred<Boolean> completed = new Deferred<Boolean>();

    /**
     * Scanner callback that loops through the UID table recursively until 
     * the scanner returns a null row set.
     */
    final class TsuidScanner implements Callback<Deferred<Boolean>, 
      ArrayList<ArrayList<KeyValue>>> {

      /**
       * Fetches the next set of rows from the scanner, adding this class as a 
       * callback
       * @return A meaningless deferred used to wait on until processing has
       * completed
       */
      public Deferred<Boolean> scan() {
        return scanner.nextRows().addCallbackDeferring(this);
      }
      
      @Override
      public Deferred<Boolean> call(ArrayList<ArrayList<KeyValue>> rows)
          throws Exception {
        if (rows == null) {
          completed.callback(true);
          return null;
        }
        
        for (final ArrayList<KeyValue> row : rows) {
          // convert to a string one time
          final String tsuid = UniqueId.uidToString(row.get(0).key());
          
          /**
           * A throttling callback used to wait for the current TSMeta to 
           * complete processing through the trees before continuing on with 
           * the next set.
           */
          final class TreeBuilderBufferCB implements Callback<Boolean, 
            ArrayList<ArrayList<Boolean>>> {

            @Override
            public Boolean call(ArrayList<ArrayList<Boolean>> builder_calls)
                throws Exception {
              //LOG.debug("Processed [" + builder_calls.size() + "] tree_calls");
              return true;
            }
            
          }
          
          /**
           * Executed after parsing a TSMeta object and loading all of the
           * associated UIDMetas. Once the meta has been loaded, this callback
           * runs it through each of the configured TreeBuilder objects and
           * stores the resulting deferred in an array. Once processing of all
           * of the rules has completed, we group the deferreds and call
           * BufferCB() to wait for their completion.
           */
          final class ParseCB implements Callback<Deferred<Boolean>, TSMeta> {

            final ArrayList<Deferred<ArrayList<Boolean>>> builder_calls = 
              new ArrayList<Deferred<ArrayList<Boolean>>>();
            
            @Override
            public Deferred<Boolean> call(TSMeta meta) throws Exception {
              if (meta != null) {
                LOG.debug("Processing TSMeta: " + meta + " w value: " + 
                    JSON.serializeToString(meta));
                
                // copy the trees into a tree builder object and iterate through
                // each builder. We need to do this as a builder is not thread
                // safe and cannot be used asynchronously.
                final ArrayList<TreeBuilder> tree_builders = 
                new ArrayList<TreeBuilder>(trees.size());
                for (Tree tree : trees) {
                  if (!tree.getEnabled()) {
                    continue;
                  }
                  final TreeBuilder builder = new TreeBuilder(tsdb, tree);
                  tree_builders.add(builder);
                }
                
                for (TreeBuilder builder : tree_builders) {
                  builder_calls.add(builder.processTimeseriesMeta(meta));
                }
                return Deferred.group(builder_calls)
                  .addCallback(new TreeBuilderBufferCB());
              } else {
                return Deferred.fromResult(false);
              }
            }
            
          }
          
          /**
           * An error handler used to catch issues when loading the TSMeta such
           * as a missing UID name. In these situations we want to log that the 
           * TSMeta had an issue and continue on.
           */
          final class ErrBack implements Callback<Deferred<Boolean>, Exception> {
            
            @Override
            public Deferred<Boolean> call(Exception e) throws Exception {
              
              if (e.getClass().equals(IllegalStateException.class)) {
                LOG.error("Invalid data when processing TSUID [" + tsuid + "]", e);
              } else if (e.getClass().equals(IllegalArgumentException.class)) {
                LOG.error("Invalid data when processing TSUID [" + tsuid + "]", e);
              } else if (e.getClass().equals(NoSuchUniqueId.class)) {
                LOG.warn("Timeseries [" + tsuid + 
                    "] includes a non-existant UID: " + e.getMessage());
              } else {
                LOG.error("[" + thread_id + "] Exception while processing TSUID [" + 
                    tsuid + "]", e);
              }
              
              return Deferred.fromResult(false);
            }
            
          }

          // matched a TSMeta column, so request a parsing and loading of
          // associated UIDMeta objects, then pass it off to callbacks for 
          // parsing through the trees.
          final Deferred<Boolean> process_tsmeta = 
            TSMeta.parseFromColumn(tsdb, row.get(0), true)
              .addCallbackDeferring(new ParseCB());
          process_tsmeta.addErrback(new ErrBack());
          tree_calls.add(process_tsmeta);
        }
        
        /**
         * Another buffer callback that waits for the current set of TSMetas to
         * complete their tree calls before we fetch another set of rows from
         * the scanner. This necessary to avoid OOM issues.
         */
        final class ContinueCB implements Callback<Deferred<Boolean>, 
          ArrayList<Boolean>> {

          @Override
          public Deferred<Boolean> call(ArrayList<Boolean> tsuids)
              throws Exception {
            LOG.debug("Processed [" + tsuids.size() + "] tree_calls, continuing");
            tree_calls.clear();
            return scan();
          }
          
        }
        
        // request the next set of rows from the scanner, but wait until the
        // current set of TSMetas has been processed so we don't slaughter our
        // host
        Deferred.group(tree_calls).addCallback(new ContinueCB());
        return Deferred.fromResult(null);
      }
      
    }
    
    /**
     * Used to capture unhandled exceptions from the scanner callbacks and 
     * exit the thread properly
     */
    final class ErrBack implements Callback<Deferred<Boolean>, Exception> {
      
      @Override
      public Deferred<Boolean> call(Exception e) throws Exception {
        LOG.error("Unexpected exception", e);
        completed.callback(false);
        return Deferred.fromResult(false);
      }
      
    }
    
    final TsuidScanner tree_scanner = new TsuidScanner();
    tree_scanner.scan().addErrback(new ErrBack());
    try {
      completed.joinUninterruptibly();
      LOG.info("[" + thread_id + "] Complete");
    } catch (Exception e) {
      LOG.error("[" + thread_id + "] Scanner Exception", e);
      throw new RuntimeException("[" + thread_id + "] Scanner exception", e);
    }
    return;
  }
709679
public function process()
    {
        parent::process();

        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        $data = &$this->getForm()->getFormData();
        $this->value = array_key_exists($this->id, $data);
    }
602828
public void process() {
        processOverview();
        for ( ClassDoc doc : rootDoc.classes() ) {
            packages.add(doc.containingPackage());
            processClass(doc);
        }
        for ( PackageDoc doc : packages ) {
            processPackage(doc);
        }
    }
74737
def _process(self):
        
        buffer = self.key_buffer
        retry = False

        while True:
            if retry:
                retry = False
            else:
                buffer.append((yield))

            # If we have some key presses, check for matches.
            if buffer:
                is_prefix_of_longer_match = self._is_prefix_of_longer_match(buffer)
                matches = self._get_matches(buffer)

                # When eager matches were found, give priority to them and also
                # ignore all the longer matches.
                eager_matches = [m for m in matches if m.eager(self._cli_ref())]

                if eager_matches:
                    matches = eager_matches
                    is_prefix_of_longer_match = False

                # Exact matches found, call handler.
                if not is_prefix_of_longer_match and matches:
                    self._call_handler(matches[-1], key_sequence=buffer[:])
                    del buffer[:]  # Keep reference.

                # No match found.
                elif not is_prefix_of_longer_match and not matches:
                    retry = True
                    found = False

                    # Loop over the input, try longest match first and shift.
                    for i in range(len(buffer), 0, -1):
                        matches = self._get_matches(buffer[:i])
                        if matches:
                            self._call_handler(matches[-1], key_sequence=buffer[:i])
                            del buffer[:i]
                            found = True
                            break

                    if not found:
                        del buffer[:1]
985789
@Override
	public void process() {
		processed = true;
		for (int i = 0; i < histogram.length; i++) {
			histogram[i] /= total;
		}
	}
821338
def process_filters(input)
      keys = input.path.match(@pattern)[0].scan(/(?<=\.)\w+/)

      filters = keys.reverse_each.map do |key|
        @filters[key.to_sym]
      end

      filters.each do |filter|
        input = process_with_filter(input, filter)
      end

      input.read
    end
1025905
public function process()
    {
        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        parent::process();

        foreach ($this->values as $option_value) {
            $this->getEntryWidget($option_value)->process();
        }
    }
839466
def _process_params(self):
        
        # transform sort dict into str
        self._sort_to_str()

        if 'rows' not in self._solr_params:
            self._solr_params['rows'] = self._cfg['row_size']

        for key, val in self._solr_params.items():
            if isinstance(val, str) and six.PY2:
                self._solr_params[key] = val.encode(encoding='UTF-8')
        return self._solr_params
306074
protected function process()
    {

        // initialize the array for the artefacts
        $artefacts = array();

        // initialize the artefacts
        $artefact = array();
        foreach (array_keys($this->getSubject()->getHeaders()) as $columnName) {
            $artefact[$columnName] = $this->getValue($columnName);
        }

        // add the artefacts to the subject
        array_push($artefacts, $artefact);
        $this->addArtefacts($artefacts);
    }
661535
public function process()
    {
        $this->initializeStorageNode($this->storageNodeNodePath, $this->storageNodeTitle);
        $this->initializeNodeTemplates();

        $nodeTemplate = new NodeTemplate();
        $this->processBatch($nodeTemplate);
    }
1045728
private void processMethodCall() {
        int numParams = SignatureUtils.getNumParameters(getSigConstantOperand());

        int depth = stack.getStackDepth();
        for (int i = 0; i < numParams; i++) {
            if (depth > i) {
                OpcodeStack.Item item = stack.getStackItem(i);
                XField xf = item.getXField();
                if (xf != null) {
                    removeField(item);
                }
            } else {
                return;
            }
        }
    }
405212
def process(self, buff):
        '''
            
        '''
        
        # adding the current to the available
        self.memory = self.memory + buff 
        self._available = len(self.memory)
        idx = 0
        # prepare pointers and inputs
        # read first byte 
        
        handleheader = self.handle_read_header
        handlelength = self.handle_read_length
        handlevalue = self.handle_read_value
        handleegend = self.handle_segment_ended
        # process input while exists
        while self._available >= self._advance:
            # expected start of a new segment
            if self._scstate.value <= ScannerState.WAITING_FOR_HEADER.value:
                self._advance = 1
                handleheader(self.memory[idx])
            # the scanner expects to read one or multiple bytes that contain an 
            # integer contain the length of the value to be expected
            elif self._scstate is ScannerState.WAITING_FOR_LENGTH:
                self._advance = self._state[3]
                # breaking if not available
                if self._available < self._state[3]:
                    break
                handlelength(self.memory, idx, idx + self._advance)
                # if the scanner is expecting to parse one or multiple bytes as the value of the segment
            elif self._scstate is ScannerState.WAITING_FOR_VALUE:
                self._advance = self._state[3]
                if self._available < self._advance:
                    break
                handlevalue(self.memory, idx, idx + self._advance)
            # if the scanner is expecting to parse an extension
            elif self._scstate is ScannerState.WAITING_FOR_EXT_TYPE:
                self._advance = 1
                self.handle_read_ext_type(self.memory, idx)
            
            # if a data segment is ended
            if self._scstate is ScannerState.SEGMENT_ENDED:
                handleegend()
            # proceed with scanning
            
            self._available -= self._advance   
            idx = idx + self._advance
            self._advance = 1
        
        #  finished processing all since it needed extra info     
        self.memory = buffer(self.memory, idx, len(self.memory))
1166875
public function process ()
    {
        if ($this->isProcessed)
            return;
        $this->isProcessed = true;
        foreach ($this->getFields() as $field)
            /* @var $field Field */
            $field->preprocess();
        $this->isUserSubmitted = $this->getValue($this->getSubmitConfirmFieldName(), 'false') == 'true' || $this->forceSubmit;
        if ($this->isUserSubmitted) {
            foreach ($this->getFields() as $field)
                $field->restoreValue($this->method);

            $this->activateHandlers();

            if ($this->isValid()) {
                $this->submit();
            }
        }
    }
778085
protected function _process()
    {
        $name = $this->config('field');
        $this->value = $this->_registry->data($name);
        $this->_processed = true;
    }
1325806
private function process_parameters($param){
    foreach ($param as $key => $val){
      //$val is an array
      if (\is_array($val)){
        $param[$key] = $this->process_parameters($val);
      }
      else {
        $param[$key] = $this->sanitize($val);
      }
    }
    //Return the processed parameters
    return $param;
  }