As the base implementation here, all templates will be considered for each edge.
435586
@Override
  protected void populateEdgeTemplateMap() {
    if (templateCatalog.isPresent()) {
      for (FlowEdge flowEdge : this.weightedGraph.edgeSet()) {
        edgeTemplateMap.put(flowEdge.getEdgeIdentity(), templateCatalog.get().
            getAllTemplates().
            stream().map(jobTemplate -> jobTemplate.getUri()).collect(Collectors.toList()));
      }
    }
  }
186003
private static Templates initTemplates() {
		try {
			URL xsltURL = ThemeUtil.class.getResource(RESOURCE_NAME);
			if (xsltURL != null) {
				Source xsltSource = new StreamSource(xsltURL.openStream(), xsltURL.toExternalForm());
				TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();
				Templates templates = factory.newTemplates(xsltSource);
				LOG.debug("Generated XSLT templates for: " + RESOURCE_NAME);
				return templates;
			} else {
				// Server-side XSLT enabled but theme resource not on classpath.
				throw new IllegalStateException(RESOURCE_NAME + " not on classpath");
			}
		} catch (IOException | TransformerConfigurationException ex) {
			throw new SystemException("Could not create transformer for " + RESOURCE_NAME, ex);
		}
	}
495703
def use_all_templates
      Utils.available_templates.each do |ext, template|
        next if engines(ext)
        register_engine ext, template
      end
    end
983549
final void addAll(final Iterable<Cycle> cycles) {
        for (final Cycle cycle : cycles)
            add(cycle);
    }

    /**
     * Check if all the edges of the <i>cycle</i> are present in the current
     * <i>basis</i>.
     *
     * @param cycle an initial cycle
     * @return any edges of the basis are present
     */
    final boolean isSubsetOfBasis(final Cycle cycle) {
        final BitSet edgeVector = cycle.edgeVector();
        final int intersect = and(edgesOfBasis, edgeVector).cardinality();
        return intersect == cycle.length();
    }

    /**
     * Determine whether the <i>candidate</i> cycle is linearly
     * <i>independent</i> from the current basis.
     *
     * @param candidate a cycle not in currently in the basis
     * @return the candidate is independent
     */
    final boolean isIndependent(final Cycle candidate) {

        // simple checks for independence
        if (basis.isEmpty() || !isSubsetOfBasis(candidate)) return true;

        final BitMatrix matrix = BitMatrix.from(basis, candidate);

        // perform gaussian elimination
        matrix.eliminate();

        // if the last row (candidate) was eliminated it is not independent
        return !matrix.eliminated(basis.size());
    }

    /** and <i>s</i> and <i>t</i> without modifying <i>s</i> */
    private static final BitSet and(final BitSet s, final BitSet t) {
        final BitSet u = (BitSet) s.clone();
        u.and(t);
        return u;
    }
}
39309
function UMLCollaborationView() {
        UMLGeneralNodeView.apply(this, arguments);

        /** @member {UMLTemplateParameterCompartmentView} */
        this.templateParameterCompartment = new UMLTemplateParameterCompartmentView();
        this.templateParameterCompartment.selectable = Core.SK_PROPAGATE;
        this.templateParameterCompartment.parentStyle = true;
        this.addSubView(this.templateParameterCompartment);

        this.fillColor = PreferenceManager.get("uml.collaboration.fillColor", "#ffffff") || PreferenceManager.get("view.fillColor", "#ffffff");
    }
62501
private void createLEdges(List<Arc> arcs)
    {
        for(Arc arc: arcs )
        {
            LEdge lEdge = layout.newEdge(null);
            lEdge.type = arc.getClazz();
            lEdge.label = arc.getId();
            LNode sourceLNode = viewToLayout.get(glyphToVNode.get(arc.getSource()));
            LNode targetLNode = viewToLayout.get(glyphToVNode.get(arc.getTarget()));
            idToArcs.put(arc.getId(), arc);

            // Add edge to the layout
            layout.getGraphManager().add(lEdge, sourceLNode, targetLNode);
        }
    }
449574
public function calculateAllTrees()
    {
        $fields = $this->formObject->getConfiguration()->getFields();

        foreach ($fields as $field) {
            $this->getActivationConditionTreeForField($field);

            foreach ($field->getValidation() as $validation) {
                $this->getActivationConditionTreeForValidation($validation);
            }
        }
    }
292385
protected function compile()
    {
        $this->Template->start = $this->getRelatedStart($this);
        $this->Template->stop = $this->getRelatedStop($this);
        $this->Template->separators = $this->getRelatedSeparators($this);
        if ($this->getRelatedStart($this) !== null)
        {
            $this->Template->identifier = sprintf(self::$IDENTIFIER, $this->getRelatedStart($this)->id);
        }

        // Labels
        $this->Template->carouselPrevious = $GLOBALS['TL_LANG']['MSC']['carouselPrev'];
        $this->Template->carouselNext = $GLOBALS['TL_LANG']['MSC']['carouselNext'];

    }
252539
public void traverse(X x, Function<? super X, ? extends Collection<X>> edges)
    {
        traverseS(x, (y)->edges.apply(y).stream());
    }
325316
private static <L> Map<Name, TypeSet<ResourceType<L>>> buildTypeMapForConstructor(
            Collection<ResourceType<L>> allTypes) {
        TypeSetBuilder<ResourceType<L>> bldr = TypeSet.<ResourceType<L>> builder();
        bldr.enabled(true);
        bldr.name(new Name("all"));
        for (ResourceType<L> type : allTypes) {
            bldr.type(type);
        }
        TypeSet<ResourceType<L>> typeSet = bldr.build();

        return Collections.singletonMap(typeSet.getName(), typeSet);
    }
119635
def all_edges(self, node):
        
        return set(self.inc_edges(node) + self.out_edges(node))
1236726
public function all()
    {
        $this->forAuthorization();
        $this->forAccessTokens();
        $this->forTransientTokens();
        $this->forClients();
        $this->forPersonalAccessTokens();
    }
142253
function() {
            var element = this.element,
                template = this.template,
                offset = element.offset(),
                width = element.outerWidth(),
                height = element.outerHeight(),
                position = this.options.position,
                alignment = this.options.alignment,
                styles = {},
                self = this;

            template.show();

            // Place the template
            switch (position) {
                case 'bottom':
                    styles.top = offset.top + height;
                    break;
                case 'right':
                    styles.left = offset.left + width;
                    break;
                case 'top':
                    styles.top = offset.top - template.outerHeight();
                    break;
                case 'left':
                    styles.left = offset.left - template.outerWidth();
                    break;
            }

            // Align the template arrow
            switch (alignment) {
                case 'left':
                    styles.left = offset.left;
                    break;
                case 'right':
                    styles.left = offset.left + width - template.outerWidth();
                    break;
            }

            template.css(styles);
        }
1314537
function setupTemplates() {
  
  // Reset templates before proceeding
  // NOTE: This is needed for templates to be copatible with hot code loading
  this.templates = {};

  var self = this;
  var tplDir = app.mvcpath + app.paths.templates;
  var multiSlashes = this.regex.multipleSlashes;
  
  if (fs.existsSync(tplDir) && fs.statSync(tplDir).isDirectory()) {
    
    var files = protos.util.walkDir(tplDir, this.regex.templateFile);
  
    files.forEach(function(path) {
      buildTemplatePartial.call(this, path);
      watchPartial.call(this, path, buildTemplatePartial);
    }, this);
    
  }
  
  this.emit('templates_loaded', this.templates);
  
}
218716
private <E> Collection<Block<S, L>> initialize(UniversalGraph<S, E, ?, L> graph,
                                                   Collection<? extends S> initialNodes) {
        Iterable<? extends S> origStates;
        if (initialNodes == null || initialNodes.isEmpty()) {
            origStates = graph.getNodes();
        } else {
            origStates = GraphTraversal.depthFirstOrder(graph, initialNodes);
        }

        Map<L, TransitionLabel<S, L>> transitionMap = new HashMap<>();

        stateStorage = graph.createStaticNodeMapping();

        int numStates = 0;
        for (S origState : origStates) {
            State<S, L> state = new State<>(numStates++, origState);
            stateStorage.put(origState, state);
            stateList.add(state);
        }

        InitialPartitioning<S, L> initPartitioning = new HashMapInitialPartitioning<>(graph);

        for (State<S, L> state : stateList) {
            S origState = state.getOriginalState();

            Block<S, L> block = initPartitioning.getBlock(origState);
            block.addState(state);

            for (E edge : graph.getOutgoingEdges(origState)) {
                S origTarget = graph.getTarget(edge);
                State<S, L> target = stateStorage.get(origTarget);
                L label = graph.getEdgeProperty(edge);
                TransitionLabel<S, L> transition = transitionMap.computeIfAbsent(label, TransitionLabel::new);
                Edge<S, L> edgeObj = new Edge<>(state, target, transition);
                state.addOutgoingEdge(edgeObj);
                target.addIncomingEdge(edgeObj);
            }
        }
        stateList.quickClear();

        return initPartitioning.getInitialBlocks();
    }
1364093
def _internal_build(self):
        
        self.nodes = self.__tree.Nodes()
        self.edges = self.__tree.Edges()
        self.augmentedEdges = {}
        for key, val in self.__tree.AugmentedEdges().items():
            self.augmentedEdges[key] = list(val)
        self.root = self.__tree.Root()

        seen = set()
        self.branches = set()

        # Find all of the branching nodes in the tree, degree > 1
        # That is, they appear in more than one edge
        for e1, e2 in self.edges:
            if e1 not in seen:
                seen.add(e1)
            else:
                self.branches.add(e1)

            if e2 not in seen:
                seen.add(e2)
            else:
                self.branches.add(e2)

        # The nodes that are not branches are leaves
        self.leaves = set(self.nodes.keys()) - self.branches
        self.leaves.remove(self.root)
1222624
function (done) {
      var root = node_path.join(__dirname, 'templates', template);

      fs.exists(root, function(exists){
        if(exists){
          template_root = root;
        }else{
          template_root = node_path.join(DIR_CUSTOM_TEMPLATES, template)
        }
        done(null);
      });
    }