Propagate causal relations to children.
321587
def _infer_child_relations_iter(graph, node: BaseEntity) -> Iterable[str]:
    """"""
    for child in iter_children(graph, node):
        yield from transfer_causal_edges(graph, node, child)
        yield from infer_child_relations(graph, child)
53933
def _propagate(self, x, influences, **kwargs):
        """"""
        activation, difference_x = self.forward(x)
        update = self.backward(difference_x, influences, activation)
        # If batch size is 1 we can leave out the call to mean.
        if update.shape[0] == 1:
            self.weights += update[0]
        else:
            self.weights += update.mean(0)

        return activation
332245
public static void propagateIfFatal(Throwable t) {
    if (t instanceof VirtualMachineError) {
      throw (VirtualMachineError) t;
    } else if (t instanceof ThreadDeath) {
      throw (ThreadDeath) t;
    } else if (t instanceof LinkageError) {
      throw (LinkageError) t;
    }
  }
1178061
function ins(parent /* child1, child2, ... */) {
for (let i = 1, n = arguments.length; i < n; i++) {
    parent.appendChild(arguments[i]);
}

return parent;
}
1364805
@Override
    protected void propagateAcrossPhiNode(TypeQualifierValueSet fact, ValueNumber sourceVN, ValueNumber targetVN) {
        // Backwards analysis - propagate value from target to source
        fact.propagateAcrossPhiNode(targetVN, sourceVN);
    }
99257
def add_relation(self, source, destination):
        """"""
        if self.in_sources(source):
            if self.forward[source] != destination:
                raise ValueError("Source is already in use. Destination does "
                                 "not match.")
            else:
                raise ValueError("Source-Destination relation already exists.")
        elif self.in_destinations(destination):
            raise ValueError("Destination is already in use. Source does not "
                             "match.")
        else:
            self.forward[source] = destination
            self.reverse[destination] = source
1113863
def copy_with_new_relations(self, new_relations):
        """"""
        result = self.__class__(self.forward.items())
        result.add_relations(new_relations.items())
        result.previous_ends1 = set(new_relations.values())
        return result
895574
def expand_kids_by_index(self, *indices):
        ""
        for i in sorted(indices, reverse=True): # reverse so that changing tail won't affect indices
            kid = self.children[i]
            self.children[i:i+1] = kid.children
127265
void advance(SimpleDependencyPath path) {
        if (path.length() >= maxPathLength)
            return;

        // Get the last node and last relation to decide how to expand.
        DependencyRelation lastRelation = path.lastRelation();
        DependencyTreeNode last = path.last(); 
        
        // Expand all of the possible relations from the last node, creating a
        // new path for each, except if the relation is the one that generated
        // this path.
        for (DependencyRelation rel : last.neighbors()) {
            // Skip re-adding the current relation
            if (lastRelation.equals(rel) || !acceptor.accept(rel))
                continue;
            SimpleDependencyPath extended = path.extend(rel);
            frontier.offer(extended);
        }
    }
563194
def create(cls, parent, child, relation_type, index=None):
        """"""
        try:
            with db.session.begin_nested():
                obj = cls(parent_id=parent.id,
                          child_id=child.id,
                          relation_type=relation_type,
                          index=index)
                db.session.add(obj)
        except IntegrityError:
            raise Exception("PID Relation already exists.")
            # msg = "PIDRelation already exists: " \
            #       "{0} -> {1} ({2})".format(
            #         parent_pid, child_pid, relation_type)
            # logger.exception(msg)
            # raise Exception(msg)
        return obj
635423
def expand_cause_repertoire(self, new_purview=None):
        """"""
        return self.subsystem.expand_cause_repertoire(
            self.cause.repertoire, new_purview)
564239
def has_causal_in_edges(graph: BELGraph, node: BaseEntity) -> bool:
    """"""
    return any(
        data[RELATION] in CAUSAL_RELATIONS
        for _, _, data in graph.in_edges(node, data=True)
    )
643886
def __radiateDown(self, x1, x2, childId, condition) :
		" "
		ret = []
		i = childId
		while 0 <= i :
			if condition(x1, x2, self.children[i]) :
				ret.append(self.children[i])
			else :
				break
			i -= 1
		return ret
911118
def conditions(self):
        """"""
        for idx in six.moves.range(1, len(self.children), 2):
            yield (self.children[idx - 1], self.children[idx])
529379
def _populate_terms(self, optobj):
        """"""
        has_relationship = optobj is not None and 'relationship' in optobj.optional_attrs
        # Make parents and relationships references to the actual GO terms.
        for rec in self.values():
            # Given parent GO IDs, set parent GO Term objects
            rec.parents = set([self[goid] for goid in rec._parents])

            # For each parent GO Term object, add it's child GO Term to the children data member
            for parent_rec in rec.parents:
                parent_rec.children.add(rec)

            if has_relationship:
                self._populate_relationships(rec)
259080
def find_actual_effect(self, mechanism, purviews=False):
        """"""
        return self.find_causal_link(Direction.EFFECT, mechanism, purviews)
397555
def get_multi_causal_upstream(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]):
    
    result = get_upstream_causal_subgraph(graph, nbunch)
    expand_upstream_causal(graph, result)
    return result