Processes gathered elements coming from the legacy rubric strategy
964899
protected function convert_legacy_rubric_elements() {
        $this->write_xml('workshopform_rubric_config', array('layout' => 'grid'));

        foreach ($this->elements as $element) {
            $this->xmlwriter->begin_tag('workshopform_rubric_dimension', array('id' => $element['id']));
            $this->xmlwriter->full_tag('sort', $element['elementno']);
            $this->xmlwriter->full_tag('description', $element['description']);
            $this->xmlwriter->full_tag('descriptionformat', FORMAT_HTML);

            foreach ($this->rubrics[$element['id']] as $rubric) {
                $fakerecord          = new stdClass();
                $fakerecord->rgrade  = $rubric['rubricno'];
                $fakerecord->eweight = $element['weight'];
                $fakerecord->rdesc   = $rubric['description'];
                $level = (array)workshopform_rubric_upgrade_rubric_level($fakerecord, $element['id']);
                unset($level['dimensionid']);
                $level['id'] = $this->converter->get_nextid();
                $this->write_xml('workshopform_rubric_level', $level, array('/workshopform_rubric_level/id'));
            }

            $this->xmlwriter->end_tag('workshopform_rubric_dimension');
        }
    }
1035259
private void process(ImmutableSetMultimap<Class<? extends Annotation>, Element> validElements) {
    for (ProcessingStep step : steps) {
      ImmutableSetMultimap<Class<? extends Annotation>, Element> stepElements =
          new ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element>()
              .putAll(indexByAnnotation(elementsDeferredBySteps.get(step), step.annotations()))
              .putAll(filterKeys(validElements, Predicates.<Object>in(step.annotations())))
              .build();
      if (stepElements.isEmpty()) {
        elementsDeferredBySteps.removeAll(step);
      } else {
        Set<? extends Element> rejectedElements = step.process(stepElements);
        elementsDeferredBySteps.replaceValues(
            step,
            transform(
                rejectedElements,
                new Function<Element, ElementName>() {
                  @Override
                  public ElementName apply(Element element) {
                    return ElementName.forAnnotatedElement(element);
                  }
                }));
      }
    }
  }
552793
public function process_gradinform_rubric_filling($data) {
        global $DB;

        $data = (object)$data;
        $data->instanceid = $this->get_new_parentid('grading_instance');
        $data->criterionid = $this->get_mappingid('gradingform_rubric_criterion', $data->criterionid);
        $data->levelid = $this->get_mappingid('gradingform_rubric_level', $data->levelid);

        if (!empty($data->criterionid)) {
            $DB->insert_record('gradingform_rubric_fillings', $data);
        }

    }
1152246
def _process_docs(self, anexec, docblocks, parent, module, docsearch):
        """"""
        #The documentation for the parameters is stored outside of the executable
        #We need to get hold of them from docblocks from the parent text
        key = "{}.{}".format(parent.name, anexec.name)
        if key in docblocks:
            docs = self.docparser.to_doc(docblocks[key][0], anexec.name)
            anexec.docstart, anexec.docend = (docblocks[key][1], docblocks[key][2])
            self.docparser.process_execdocs(docs, anexec, key)
285323
protected void processLinkTag(LinkTag tag) {

        processLink(tag, ATTRIBUTE_HREF, CmsRelationType.valueOf(tag.getTagName()));
    }
1313209
private void processRevisions()
	{
		logger.info("Processing revisions, extracting template information ...");
		RevisionIterator revisionIter=null;
		try{
			revisionIter = new RevisionIterator(dbConf);

			int revCounter = 0;
			while (revisionIter.hasNext()) {
				revCounter++;

				if (revCounter % VERBOSITY == 0) {
					logger.info("{} revisions processed ...", revCounter);
				}

				Revision curRevision = revisionIter.next();
				int curRevisionId = curRevision.getRevisionID();

				fillMapWithTemplateData(curRevision.getRevisionText(),
						revisionFilter, curRevisionId, TPLNAME_TO_REVISIONIDS);
			}
		}catch(WikiApiException e){
			logger.error("Error initializing Revision Iterator", e);
		}finally{
			if(revisionIter!=null){
				try{
					revisionIter.close();
				}catch(SQLException e){
					logger.error("Error closing RevisionIterator", e);
				}
			}
		}
	}
954461
function processTag(tag, targets) {
  if (tag.description) {
    tag.description = replaceLink(tag.description, targets);
  }
  if (tag.params) {
    tag.params.forEach(function (param) {
      if (param.description) {
        param.description = replaceLink(param.description, targets);
      }
    });
  }
  if (tag.members) {
    tag.members.forEach(function (member) {
      processTag(member, targets);
    });
  }
  if (tag.methods) {
    tag.methods.forEach(function (method) {
      processTag(method, targets);
    });
  }
}
1280137
public function process()
    {
        parent::process();

        foreach ($this->columns as $column) {
            $column->process();
        }

        foreach ($this->spanning_columns as $column) {
            $column->process();
        }

        foreach ($this->extra_rows as $row) {
            $row->process();
        }

        // this is part of the old selection API
        if ($this->hasColumn('checkbox')) {
            $items = $this->getColumn('checkbox');
            $this->checked_items = $items->getItems();
        }
    }
902294
def create_legacy_graph_tasks():
  """"""
  return [
    transitive_hydrated_targets,
    transitive_hydrated_target,
    hydrated_targets,
    hydrate_target,
    find_owners,
    hydrate_sources,
    hydrate_bundles,
    RootRule(OwnersRequest),
  ]
1234454
public void processDI() {

    if (processDefinitions.isEmpty()) {
      return;
    }

    if (!bpmnModel.getLocationMap().isEmpty()) {

      // Verify if all referenced elements exist
      for (String bpmnReference : bpmnModel.getLocationMap().keySet()) {
        if (bpmnModel.getFlowElement(bpmnReference) == null) {
          // ACT-1625: don't warn when artifacts are referenced from DI
          if (bpmnModel.getArtifact(bpmnReference) == null) {
            // Check if it's a Pool or Lane, then DI is ok
            if (bpmnModel.getPool(bpmnReference) == null && bpmnModel.getLane(bpmnReference) == null) {
              LOGGER.warn("Invalid reference in diagram interchange definition: could not find " + bpmnReference);
            }
          }
        } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof FlowNode)) {
          LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a flow node");
        }
      }
      
      for (String bpmnReference : bpmnModel.getFlowLocationMap().keySet()) {
        if (bpmnModel.getFlowElement(bpmnReference) == null) {
          // ACT-1625: don't warn when artifacts are referenced from DI
          if (bpmnModel.getArtifact(bpmnReference) == null) {
            LOGGER.warn("Invalid reference in diagram interchange definition: could not find " + bpmnReference);
          }
        } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof SequenceFlow)) {
          LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a sequence flow");
        }
      }

      for (Process process : bpmnModel.getProcesses()) {
        if (!process.isExecutable()) {
          continue;
        }

        // Parse diagram interchange information
        ProcessDefinitionEntity processDefinition = getProcessDefinition(process.getId());
        if (processDefinition != null) {
          processDefinition.setGraphicalNotationDefined(true);
          
          for (String edgeId : bpmnModel.getFlowLocationMap().keySet()) {
            if (bpmnModel.getFlowElement(edgeId) != null) {
              createBPMNEdge(edgeId, bpmnModel.getFlowLocationGraphicInfo(edgeId));
            }
          }
        }
      }
    }
  }
1035735
def legacy_notes_view(request):
    
    notes = TeacherNote.objects.all()
    note_count = notes.count()
    paginator = Paginator(notes, 100)

    page = request.GET.get('page')
    try:
        notes = paginator.page(page)
    except PageNotAnInteger:
        notes = paginator.page(1)
    except EmptyPage:
        notes = paginator.page(paginator.num_pages)
    return render_to_response(
        'teacher_notes.html',
        {'page_name': "Legacy Notes",
         'notes': notes,
         'note_count': note_count,},
        context_instance=RequestContext(request)
    )
806039
private void processDocs(final RootDoc rootDoc) {
        this.rootDoc = rootDoc;

        // Get a list of all the features and groups that we'll actually retain
        workUnits = computeWorkUnits();

        final Set<String> uniqueGroups = new HashSet<>();
        final List<Map<String, String>> featureMaps = new ArrayList<>();
        final List<Map<String, String>> groupMaps = new ArrayList<>();

        // First pass over work units: create the top level map of features and groups
        workUnits.stream().forEach(
                workUnit -> {
                    featureMaps.add(indexDataMap(workUnit));
                    if (!uniqueGroups.contains(workUnit.getGroupName())) {
                        uniqueGroups.add(workUnit.getGroupName());
                        groupMaps.add(getGroupMap(workUnit));
                    }
                }
        );

        // Second pass:  populate the property map for each work unit
        workUnits.stream().forEach(workUnit -> { workUnit.processDoc(featureMaps, groupMaps); });

        // Third pass: Generate the individual outputs for each work unit, and the top-level index file
        emitOutputFromTemplates(groupMaps, featureMaps);
    }
905372
function processFile (file, version, versions, targetVersions) {
  processTags(file.content, version, versions, file)
  processVersioned(file.content, version, versions)
  processVersionLists(file.content, version, targetVersions)
  return file
}
883559
public function process_legacy_resource(array $data, array $raw = null) {

        // get the course module id and context id
        $instanceid = $data['id'];
        $cminfo     = $this->get_cminfo($instanceid, 'resource');
        $moduleid   = $cminfo['id'];
        $contextid  = $this->converter->get_contextid(CONTEXT_MODULE, $moduleid);

        // convert the legacy data onto the new page record
        $page                       = array();
        $page['id']                 = $data['id'];
        $page['name']               = $data['name'];
        $page['intro']              = $data['intro'];
        $page['introformat']        = $data['introformat'];
        $page['content']            = $data['alltext'];

        if ($data['type'] === 'html') {
            // legacy Resource of the type Web page
            $page['contentformat'] = FORMAT_HTML;

        } else {
            // legacy Resource of the type Plain text page
            $page['contentformat'] = (int)$data['reference'];

            if ($page['contentformat'] < 0 or $page['contentformat'] > 4) {
                $page['contentformat'] = FORMAT_MOODLE;
            }
        }

        $page['legacyfiles']        = RESOURCELIB_LEGACYFILES_ACTIVE;
        $page['legacyfileslast']    = null;
        $page['revision']           = 1;
        $page['timemodified']       = $data['timemodified'];

        // populate display and displayoptions fields
        $options = array('printheading' => 1, 'printintro' => 0);
        if ($data['popup']) {
            $page['display'] = RESOURCELIB_DISPLAY_POPUP;
            $rawoptions = explode(',', $data['popup']);
            foreach ($rawoptions as $rawoption) {
                list($name, $value) = explode('=', trim($rawoption), 2);
                if ($value > 0 and ($name == 'width' or $name == 'height')) {
                    $options['popup'.$name] = $value;
                    continue;
                }
            }
        } else {
            $page['display'] = RESOURCELIB_DISPLAY_OPEN;
        }
        $page['displayoptions'] = serialize($options);

        // get a fresh new file manager for this instance
        $this->fileman = $this->converter->get_file_manager($contextid, 'mod_page');

        // convert course files embedded into the intro
        $this->fileman->filearea = 'intro';
        $this->fileman->itemid   = 0;
        $page['intro'] = moodle1_converter::migrate_referenced_files($page['intro'], $this->fileman);

        // convert course files embedded into the content
        $this->fileman->filearea = 'content';
        $this->fileman->itemid   = 0;
        $page['content'] = moodle1_converter::migrate_referenced_files($page['content'], $this->fileman);

        // write page.xml
        $this->open_xml_writer("activities/page_{$moduleid}/page.xml");
        $this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $moduleid,
            'modulename' => 'page', 'contextid' => $contextid));
        $this->write_xml('page', $page, array('/page/id'));
        $this->xmlwriter->end_tag('activity');
        $this->close_xml_writer();

        // write inforef.xml for migrated resource file.
        $this->open_xml_writer("activities/page_{$moduleid}/inforef.xml");
        $this->xmlwriter->begin_tag('inforef');
        $this->xmlwriter->begin_tag('fileref');
        foreach ($this->fileman->get_fileids() as $fileid) {
            $this->write_xml('file', array('id' => $fileid));
        }
        $this->xmlwriter->end_tag('fileref');
        $this->xmlwriter->end_tag('inforef');
        $this->close_xml_writer();
    }
993333
def _populate_label_legacy_structures():
    
    global DIE_CUT_LABEL, ENDLESS_LABEL, ROUND_DIE_CUT_LABEL
    global label_sizes, label_type_specs

    from brother_ql.labels import FormFactor
    DIE_CUT_LABEL =       FormFactor.DIE_CUT
    ENDLESS_LABEL =       FormFactor.ENDLESS
    ROUND_DIE_CUT_LABEL = FormFactor.ROUND_DIE_CUT

    from brother_ql.labels import LabelsManager
    lm = LabelsManager()
    label_sizes = list(lm.iter_identifiers())
    for label in lm.iter_elements():
        l = {}
        l['name'] = label.name
        l['kind'] = label.form_factor
        l['color'] = label.color
        l['tape_size'] = label.tape_size
        l['dots_total'] = label.dots_total
        l['dots_printable'] = label.dots_printable
        l['right_margin_dots'] = label.offset_r
        l['feed_margin'] = label.feed_margin
        l['restrict_printers'] = label.restricted_to_models
        label_type_specs[label.identifier] = l
325876
private function processLinkbases()
	{
		// Begin processing any in the appinfo element
		$this->xbrlDocument->registerXPathNamespace( 'link', XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_LINK ] );
		$this->xbrlDocument->registerXPathNamespace( 'xlink', XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XLINK ] );
		$this->xbrlDocument->registerXPathNamespace( 'xs', SCHEMA_NAMESPACE );
		$linkbases = $this->xbrlDocument->xpath("/xs:schema/xs:annotation/xs:appinfo/link:linkbase");

		foreach ( $linkbases as $linkbase )
		{
			// Look inside

			$arcRole = XBRL_Constants::$arcRoleAll;
			$title = "Custom linkbase";
			$function = 'processCustomLinkbaseXml';
			$usedOn = '';

			foreach ( XBRL_Constants::$standardLinkElements as $linkElement => $value )
			{
				if ( ! count( $linkbase->children( XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_LINK ] )->$linkElement ) ) continue;

				switch ( $linkElement )
				{
					case 'definitionLink':

						$arcRole = XBRL_Constants::$DefinitionLinkbaseRef;
						$title = 'Definition linkbase';
						$function = 'processDefinitionLinkbaseXml';
						$usedOn = 'link:definitionLink';

						break;

					case 'calculationLink':

						$arcRole = XBRL_Constants::$CalculationLinkbaseRef;
						$title = 'Calculation linkbase';
						$function = 'processCalculationLinkbaseXml';
						$usedOn = 'link:calculationLink';

						break;

					case 'presentationLink':

						$arcRole = XBRL_Constants::$PresentationLinkbaseRef;
						$title = 'Presentation linkbase';
						$function = 'processPresentationLinkbaseXml';
						$usedOn = 'link:presentationLink';

						break;

					case 'labelLink':

						$arcRole = XBRL_Constants::$LabelLinkbaseRef;
						$title = 'Label linkbase';
						$function = 'processLabelLinkbaseXml';
						$usedOn = 'link:label';

						break;

					case 'referenceLink':

						$arcRole = XBRL_Constants::$ReferenceLinkbaseRef;
						$title = 'Reference linkbase';
						$function = 'processReferenceLinkbaseXml';
						$usedOn = 'link:referenceLink';

						break;
				}
			}

			$linkbaseRef = array(
				'type' => 'simple',
				'href' => $this->schemaLocation,
				'role' => XBRL_Constants::$defaultLinkRole,
				'arcrole' => $arcRole,
				'title' => $title,
				'base' => "",
			);

			$this->$function( $linkbaseRef, $linkbase, basename( $linkbaseRef['href'] ), $usedOn );
		}

		foreach ( $this->linkbaseTypes as $linkbaseTypesKey => &$linkbaseType )
		{
			switch ( $linkbaseTypesKey )
			{
				case XBRL_Constants::$anyLinkbaseRef:
					$this->processPresentationLinkbases( $linkbaseType );
					$this->processLabelLinkbases( $linkbaseType );
					$this->processDefinitionLinkbases( $linkbaseType );
					$this->processCalculationLinkbases( $linkbaseType );
					$this->processReferenceLinkbases( $linkbaseType );
					// Handle custom linkbases
					$this->processCustomLinkbases( $linkbaseType );
					break;

				case XBRL_Constants::$PresentationLinkbaseRef:
					$this->processPresentationLinkbases( $linkbaseType );
					break;

				case XBRL_Constants::$LabelLinkbaseRef:
					$this->processLabelLinkbases( $linkbaseType );
					break;

				case XBRL_Constants::$DefinitionLinkbaseRef:
					$this->processDefinitionLinkbases( $linkbaseType );
					break;

				case XBRL_Constants::$CalculationLinkbaseRef:
					$this->processCalculationLinkbases( $linkbaseType );
					break;

				case XBRL_Constants::$ReferenceLinkbaseRef:
					$this->processReferenceLinkbases( $linkbaseType );
					break;

				default:
					// Handle custom linkbases
					$this->processCustomLinkbases( $linkbaseType );
					break;
			}
		}
	}
196221
@Override
  public void process(CAS tcas) {

    final AnnotationComboIterator comboIterator = new AnnotationComboIterator(tcas,
        this.sentenceType, this.tokenType);

    for (AnnotationIteratorPair annotationIteratorPair : comboIterator) {
      
      final List<AnnotationFS> sentenceTokenAnnotationList = new LinkedList<AnnotationFS>();

      final List<String> sentenceTokenList = new LinkedList<String>();
      final List<String> additionalContextList = new LinkedList<String>();

      for (AnnotationFS tokenAnnotation : annotationIteratorPair.getSubIterator()) {

        sentenceTokenAnnotationList.add(tokenAnnotation);

        sentenceTokenList.add(tokenAnnotation.getFeatureValueAsString(lexemeFeature));
        
        additionalContextList.add(tokenAnnotation.getFeatureValueAsString(additionalContextFeature));
      }
      
      String[] toks = sentenceTokenList.toArray(new String[sentenceTokenList.size()]);
      
      String[][] additionalContext = new String[toks.length][2];
      
      int i = 0;
      for (String ac : additionalContextList) {
        if(ac != null) {
          if(ac.equals("P")) {
            additionalContext[i][1] = ac;
          } else {
            additionalContext[i][0] = ac;
          }
        }
        i++;
      }
      
      final List<String> posTags = Arrays.asList(this.posTagger.tag(toks, additionalContext));

      double posProbabilities[] = null;

      if (this.probabilityFeature != null) {
        posProbabilities = this.posTagger.probs();
      }

      final Iterator<String> posTagIterator = posTags.iterator();
      final Iterator<AnnotationFS> sentenceTokenIterator = sentenceTokenAnnotationList.iterator();

      int index = 0;
      while (posTagIterator.hasNext() && sentenceTokenIterator.hasNext()) {
        final String posTag = posTagIterator.next();
        final AnnotationFS tokenAnnotation = sentenceTokenIterator.next();

        tokenAnnotation.setStringValue(this.posFeature, posTag);

        if (posProbabilities != null) {
          tokenAnnotation.setDoubleValue(this.posFeature, posProbabilities[index]);
        }

        index++;
      }

      // log tokens with pos
      if (this.logger.isLoggable(Level.FINER)) {

        final StringBuilder sentenceWithPos = new StringBuilder();

        sentenceWithPos.append("\"");

        for (final AnnotationFS token : sentenceTokenAnnotationList) {
          sentenceWithPos.append(token.getCoveredText());
          sentenceWithPos.append('\\');
          sentenceWithPos.append(token.getStringValue(this.posFeature));
          sentenceWithPos.append(' ');
        }

        // delete last whitespace
        if (sentenceWithPos.length() > 1) // not 0 because it contains already the " char
          sentenceWithPos.setLength(sentenceWithPos.length() - 1);
        
        sentenceWithPos.append("\"");

        this.logger.log(Level.FINER, sentenceWithPos.toString());
      }
    }
  }