Construct the propagation links
15910
function FindLinks()
    {
        /* Housekeeping detail:
        ** Add to every propagate link a pointer back to the state to
        ** which the link is attached. */
        foreach ($this->sorted as $info) {
            $info->key->stp = $info->data;
        }
        
        /* Convert all backlinks into forward links.  Only the forward
        ** links are used in the follow-set computation. */
        for ($i = 0; $i < $this->nstate; $i++) {
            $stp = $this->sorted[$i];
            for ($cfp = $stp->data->cfp; $cfp; $cfp = $cfp->next) {
                for ($plp = $cfp->bplp; $plp; $plp = $plp->next) {
                    $other = $plp->cfp;
                    PHP_ParserGenerator_PropagationLink::Plink_add($other->fplp, $cfp);
                }
            }
        }
    }
1313499
def device_gen(chain, urls):
    """"""
    itr = iter(urls)
    last = next(itr)
    for url in itr:
        yield Device(chain, make_hop_info_from_url(last), driver_name='jumphost', is_target=False)
        last = url
    yield Device(chain, make_hop_info_from_url(last), driver_name='generic', is_target=True)
960386
private void propagate() {
        for (int l = 0; l < net.length - 1; l++) {
            propagate(net[l], net[l + 1]);
        }
    }
99643
def link_(a, nodes, b)
      if nodes.empty?
        if a.nil?
          @first = b
        else
          a.instance_variable_set(:@next, b)
        end
        if b.nil?
          @last = a
        else
          b.instance_variable_set(:@prev, a)
        end
      else
        # connect `a' and `b'
        first = nodes.first
        if a.nil?
          @first = first
        else
          a.instance_variable_set(:@next, first)
        end
        last = nodes.last
        if b.nil?
          @last = last
        else
          b.instance_variable_set(:@prev, last)
        end

        # connect `nodes'
        if nodes.length == 1
          node = nodes[0]
          node.instance_variable_set(:@prev, a)
          node.instance_variable_set(:@next, b)
        else
          first.instance_variable_set(:@next, nodes[ 1])
          first.instance_variable_set(:@prev, a)
          last. instance_variable_set(:@prev, nodes[-2])
          last. instance_variable_set(:@next, b)
          (1...nodes.length-1).each do |i|
            n = nodes[i]
            n.instance_variable_set(:@prev, nodes[i-1])
            n.instance_variable_set(:@next, nodes[i+1])
          end
        end
      end
    end
1242268
def link(self, stream_instance):
        """"""
        if isinstance(stream_instance, collections.Iterable):
            self.input_stream = stream_instance
        elif getattr(stream_instance, 'output_stream', None):
            self.input_stream = stream_instance.output_stream
        else:
            raise RuntimeError('Calling link() with unknown instance type %s' % type(stream_instance))
56177
def add_node_to_network(self, node, network):
        """"""
        network.add_node(node)
        parents = node.neighbors(direction="from")
        if len(parents):
            parent = parents[0]
            parent.transmit()
        node.receive()
972443
def _build_url(self):
        """"""
        if self.connection.get("username") and self.connection.get("password"):
            auth = "%s:%s@" % (self.connection["username"],
                               self._encoded_password)
            if self.connection.get("domain"):
                auth = r"%s;%s" % (self.connection["domain"], auth)
        else:
            auth = ""

        # Optional port number
        port = self.connection.get("port")
        port = ":" + port if port else ""

        # Construct mount_url
        self.connection["mount_url"] = "//%s%s%s/%s" % (
            auth, self.connection["url"], port, self.connection["share_name"])
1357337
def _closure_createlink(self):
        """"""
        linkparents = self._closure_model.objects.filter(
            child__pk=self._closure_parent_pk
        ).values("parent", "depth")
        linkchildren = self._closure_model.objects.filter(
            parent__pk=self.pk
        ).values("child", "depth")
        newlinks = [self._closure_model(
            parent_id=p['parent'],
            child_id=c['child'],
            depth=p['depth']+c['depth']+1
        ) for p in linkparents for c in linkchildren]
        self._closure_model.objects.bulk_create(newlinks)
1158911
private List<String> buildUrls(List<String> references) {
		List<String> urls = new ArrayList<String>(references.size());
		for (String url : references) {
			if (url.toUpperCase().startsWith("RFC")) {
				url = RFC_REFERENCE_BASE_URL + url;
			} else if (url.startsWith("http")) {
				// already an URL so do nothing
			} else {
				url = MIME_TYPE_REFERENCE_BASE_URL + "#" + url;
			}
			urls.add(url);
		}
		return urls;
	}
780974
function constructFromObject(instance, source) {
  instance.transmitterId = identifiers.format(source.transmitterId);
  instance.transmitterIdType = source.transmitterIdType;
  instance.rssiSignature = source.rssiSignature || [];

  instance.rssiSignature.forEach(function(entry) {
    entry.receiverIdType = entry.receiverIdType || identifiers.TYPE_UNKNOWN;
    entry.rssi = entry.rssi || -Number.MAX_SAFE_INTEGER;
    entry.numberOfDecodings = entry.numberOfDecodings || 1;
    entry.rssiSum = entry.rssiSum || entry.rssi;
  });

  if(source.hasOwnProperty('packets')) {
    instance.packets = source.packets;
  }
  if(source.hasOwnProperty('timestamp')) {
    instance.timestamp = source.timestamp;
  }
  if(source.hasOwnProperty('events')) {
    instance.events = source.events;
  }
  if(source.hasOwnProperty('earliestDecodingTime')) {
    instance.earliestDecodingTime = source.earliestDecodingTime;
  }
  instance.creationTime = new Date().getTime();
}
280399
def generate_links(self, nodes):
        
        new_links = []

        for link in self.links:
            # Expand port name if required
            if INTERFACE_RE.search(link['dest_port'])\
                    or VBQ_INT_RE.search(link['dest_port']):
                int_type = link['dest_port'][0]
                dest_port = link['dest_port'].replace(
                    int_type, PORT_TYPES[int_type.upper()])
            else:
                dest_port = link['dest_port']

            # Convert dest_dev and port to id's
            dest_details = self.convert_destination_to_id(
                link['dest_dev'], dest_port, nodes)

            desc = 'Link from %s port %s to %s port %s' % \
                   (link['source_dev'], link['source_port_name'],
                    dest_details['name'], dest_port)

            new_links.append({'description': desc,
                              'destination_node_id': dest_details['id'],
                              'destination_port_id': dest_details['pid'],
                              'source_port_id': link['source_port_id'],
                              'source_node_id': link['source_node_id']})

        # Remove duplicate links and add link_id
        link_id = 1
        for link in new_links:
            t_link = str(link['source_node_id']) + ':' + \
                str(link['source_port_id'])
            for link2 in new_links:
                d_link = str(link2['destination_node_id']) + ':' + \
                    str(link2['destination_port_id'])
                if t_link == d_link:
                    new_links.remove(link2)
                    break
            link['id'] = link_id
            link_id += 1

            self.add_node_connection(link, nodes)

        return new_links
128208
def build(self):
        """"""
        for i in range(2):
            self._molecules.append(
                self.make_helix(self.aas[i], self.axis_distances[i],
                                self.z_shifts[i], self.phis[i], self.splays[i],
                                self.off_plane[i]))
        return
84564
def setup_link(self, interface, cidr):
        
        # clear old ipaddr in interface
        cmd = ['ip', 'addr', 'flush', 'dev', interface]
        agent_utils.execute(cmd, root=True)
        ip = IPNetwork(cidr)
        cmd = ['ip', 'addr', 'add', cidr, 'broadcast',
               str(ip.broadcast), 'dev', interface]
        stdcode, stdout = agent_utils.execute(cmd, root=True)
        if stdcode == 0:
            cmd = ['ip', 'link', 'set', 'dev', interface, 'up']
            stdcode, stdout = agent_utils.execute(cmd, root=True)
            if stdcode == 0:
                return agent_utils.make_response(code=stdcode)
        # execute failed.
        message = stdout.pop(0)
        return agent_utils.make_response(code=stdcode, message=message)
1035894
def addLink(self, node1, node2, capacity, delay):
        '''
        
        '''
        for n in (node1, node2):
            if not self.__nxgraph.has_node(n):
                raise Exception("No node {} exists for building a link".format(n))
        macs = [None,None]
        if self.__auto_macs:
            for i in range(len(macs)):
                macstr = '{:012x}'.format(self.__ifnum)
                self.__ifnum += 1
                macaddr = ':'.join([ macstr[j:(j+2)] for j in range(0,len(macstr),2)])
                macs[i] = macaddr
        node1if = self.__nxgraph.node[node1]['nodeobj'].addInterface(ethaddr=macs[0])
        node2if = self.__nxgraph.node[node2]['nodeobj'].addInterface(ethaddr=macs[1])
        self.__nxgraph.add_edge(node1, node2)
        self.__nxgraph[node1][node2][node1] = node1if
        self.__nxgraph[node1][node2][node2] = node2if
        self.setLinkCharacteristics(node1, node2, capacity, delay)
1310522
@Override
	public void propagate(int evtmask) throws ContradictionException {
		int max = -1;
		for (int i : g.getPotentialNodes()) {
			if (g.getMandatoryNodes().contains(i)) {
				diameter.updateLowerBound(depthBFS(i, true), this);
			}
			max = Math.max(max, depthBFS(i, false));
		}
		diameter.updateUpperBound(max, this);
	}
60848
static function Plink_copy(PHP_ParserGenerator_PropagationLink &$to, PHP_ParserGenerator_PropagationLink $from)
    {
        while ($from) {
            $nextpl = $from->next;
            $from->next = $to;
            $to = $from;
            $from = $nextpl;
        }
    }
428703
function traverseTwoPhase(inst, fn, arg) {
  var path = [];
  while (inst) {
    path.push(inst);
    inst = inst._hostParent;
  }
  var i;
  for (i = path.length; i-- > 0;) {
    fn(path[i], 'captured', arg);
  }
  for (i = 0; i < path.length; i++) {
    fn(path[i], 'bubbled', arg);
  }
}