prev_sib returns the network immediately preceding this one or nil if this network is ::.
542384
def prev_sib()
			if (self.network.addr == 0)
				return nil
			end
			
			shift = 128 - self.netmask.prefix_len
			addr = ((self.network.addr>>shift) - 1) << shift
			if addr < 0
				return nil
			end
			return IPv6Net.new(IPv6.new(addr), self.netmask)
		end
1195455
function next(prev, current, isPre) {
    if (prev && prev.parentNode === current || isPre(current)) {
        return current.nextSibling || current.parentNode;
    }

    return current.firstChild || current.nextSibling || current.parentNode;
}
496449
def get_(i)
      # return a Node
      if i < (@length >> 1)
        # go from the beginning
        node = @first
        i.times{node = node.next}
      else
        # go from the end
        node = @last
        (@length - 1 - i).times{node = node.prev}
      end
      return node
    end
132966
def node_before(node)
      node.parent.equal? self or
        raise ArgumentError, "node is not a child"
      fields = self.fields
      i = node.instance_variable_get(:@parent_field).index - 1
      i.downto(0) do |i|
        f = fields[i]
        if f.child? && (val = self.send(f.reader))
          return val
        end
      end
      return nil
    end
27411
def has_predecessor(self, u, v):
        
        if u not in self.vertices:
            raise GraphInsertError("Vertex %s doesn't exist." % (u,))
        return(u in self.pred and v in self.pred[u])
670945
private Node getPreviousSibling(Node node) {

		if (node == null || node == root)
			return null;

		Node newNode = node.getPreviousSibling();
		if (newNode == null) {
			newNode = node.getParentNode();
			if (newNode == null || node == root)
				return null;
			int parentAccept = acceptNode(newNode);
			if (parentAccept == NodeFilter.FILTER_SKIP)
				return getPreviousSibling(newNode);

			return null;
		}

		int accept = acceptNode(newNode);

		if (accept == NodeFilter.FILTER_ACCEPT)
			return newNode;
		else if (accept == NodeFilter.FILTER_SKIP) {
			Node fChild = getLastChild(newNode);
			if (fChild == null)
				return getPreviousSibling(newNode);

			return fChild;
		} else
			// if (accept == NodeFilter.REJECT_NODE)
			return getPreviousSibling(newNode);

	}
924399
def Get(self,key):
		

		for network in self.networks:
			try:
				if network.id == key:  return(network)
				if network.name == key:  return(network)
				if network.cidr == key:  return(network)
			except:
				# We ignore malformed records with missing attributes
				pass
446458
def get_prev_sibling(self):
        
        siblings = self.get_siblings()
        ids = [obj.pk for obj in siblings]
        if self.pk in ids:
            idx = ids.index(self.pk)
            if idx > 0:
                return siblings[idx - 1]
665308
def previous_element(name = nil)
      if siblings = parent.children
        found = nil
        siblings.each do |node|
          return found if node.equal?(self)
          found = node if node.tag? && (name.nil? || node.name == name)
        end
      end
      nil
    end
1089711
def prev(self):
        """"""
        seg = Segment(segment_t=idaapi.get_prev_seg(self.ea))

        if seg.ea >= self.ea:
            raise exceptions.NoMoreSegments("This is the first segment. no segments exist before it.")

        return seg
1237120
def bsp_traverse_pre_order(
    node: tcod.bsp.BSP,
    callback: Callable[[tcod.bsp.BSP, Any], None],
    userData: Any = 0,
) -> None:
    
    _bsp_traverse(node.pre_order(), callback, userData)
700552
public function prevNode($nID)
    {
        $nodeOverride = $this->movePrevOverride($nID);
        if ($nodeOverride > 0) {
            return $nodeOverride;
        }
        if (!isset($this->nodesRawIndex[$nID])) {
            return -3;
        }
        $prevNodeInd = $this->nodesRawIndex[$nID]-1;
        if ($prevNodeInd < 0 || !isset($this->nodesRawOrder[$prevNodeInd])) {
            return -3;
        }
        $prevNodeID = $this->nodesRawOrder[$prevNodeInd];
        return $prevNodeID;
    }
981722
int calculateConnectionID(int currentConnectionID, final Set<ExecutionGroupVertex> alreadyVisited) {

		if (!alreadyVisited.add(this)) {
			return currentConnectionID;
		}
		
		for (final ExecutionGroupEdge backwardLink : this.backwardLinks) {
		
			backwardLink.setConnectionID(currentConnectionID);
			
			++currentConnectionID;
			
			currentConnectionID = backwardLink.getSourceVertex()
				.calculateConnectionID(currentConnectionID, alreadyVisited);
		}
		
		return currentConnectionID;
	}
858408
def goForward(self):
        
        if not self.canGoForward():
            return ''
        
        self._blockStack = True
        self._index += 1
        self.emitCurrentChanged()
        self._blockStack = False
        return self.currentUrl()
1324560
function() {
                var network = typeof connection_id === 'undefined' ?
                    _kiwi.app.connections.active_connection :
                    _kiwi.app.connections.getByConnectionId(connection_id);

                return network ?
                    network :
                    undefined;
            }
472690
def previousSibling(self) -> Optional[AbstractNode]:
        
        parent = self.parentNode
        if parent is None:
            return None
        return parent.childNodes.item(parent.childNodes.index(self) - 1)
666307
def get_if_addr6(iff):
    
    return next((x[0] for x in in6_getifaddr()
                 if x[2] == iff and x[1] == IPV6_ADDR_GLOBAL), None)