Private helper method to find the free range just after the given address.
329635
private IPv6AddressRange findFreeRangeAfter(IPv6Network network)
    {
        for (IPv6AddressRange freeRange : freeRanges)
        {
            if (freeRange.getFirst().subtract(1).equals(network.getLast()))
            {
                return freeRange;
            }
        }

        // not found
        return null;
    }
354604
public static E164CountryCode lookup(String address) {
        // analyze just the first few chars -- max of 4 or length of address
        int len = (address.length() > maxPrefixLength ? maxPrefixLength : address.length());
        // search backwards first, return the first result
        for (int i = len; i > 0; i--) {
            String prefix = address.substring(0, i);
            E164CountryCode entry = byPrefix.get(prefix);
            if (entry != null) {
                return entry;
            }
        }
        // nothing found
        return null;
    }
1316146
function findStoresInRangeAddress(address, range, callback) {
  range = range || 3;

  geo.geocode(address, function(err, georesult) {
    if (err) return callback(err);
    findStoresInRange(georesult, range, callback);
  });
}
846947
def free(id)
      enclosing_range_index = @allocated_ranges.index { |range| range.last >= id && range.first <= id }
      enclosing_range = @allocated_ranges[enclosing_range_index]
      if enclosing_range.size == 1
        @allocated_ranges.delete(enclosing_range)
      elsif enclosing_range.first == id
        @allocated_ranges[enclosing_range_index] = (enclosing_range.first.succ..enclosing_range.last)
      elsif enclosing_range.last == id
        @allocated_ranges[enclosing_range_index] = (enclosing_range.first..enclosing_range.last.pred)
      else
        @allocated_ranges[enclosing_range_index] = (enclosing_range.first..id.pred)
        @allocated_ranges.insert(enclosing_range_index.succ, (id.succ..enclosing_range.last))
      end
    end
696969
private static void rangeCheck(int length, int fromIndex, int toIndex) {
        if (fromIndex > toIndex) {
            throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
        }
        if (fromIndex < 0) {
            throw new ArrayIndexOutOfBoundsException(fromIndex);
        }
        if (toIndex > length) {
            throw new ArrayIndexOutOfBoundsException(toIndex);
        }
    }
603585
def get_range(self, address=None):
        
        url = self.build_url(self._endpoints.get('get_range'))
        if address is not None:
            url = "{}(address='{}')".format(url, address)
        response = self.session.get(url)
        if not response:
            return None
        return self.range_constructor(parent=self, **{self._cloud_data_key: response.json()})
894043
def find_range(coeffs):
    '''
    
    '''

    coeffs = [float(x) != 0 for x in coeffs]
    first = coeffs.index(True)
    coeffs.reverse()
    last = len(coeffs) - coeffs.index(True) - 1
    return first, last
622536
def _range10_90(x):
    '''
    

    '''

    x = np.delete(x, np.where(np.isnan(x)))
    i = np.argsort(x)
    a = int(0.1 * len(x))
    b = int(0.9 * len(x))
    return x[i][b] - x[i][a]
891083
private void checkRange(long index) {
    Assert.indexNot(isEmpty(), "segment is empty");
    Assert.indexNot(index < firstIndex(), index + " is less than the first index in the segment");
    Assert.indexNot(index > lastIndex(), index + " is greater than the last index in the segment");
  }
283698
def fromAddress(address):
        
        validate_address(address)
        address_as_integer = int(address, 16)
        address_as_base36 = baseN(address_as_integer, 36)
        padded = pad_left_hex(address_as_base36, 15)
        return Iban.fromBban(padded.upper())
1349820
private static void checkRange(int fromIndex, int toIndex) {
		if (fromIndex < 0)
			throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
		if (toIndex < 0)
			throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);
		if (fromIndex > toIndex)
			throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +
					" > toIndex: " + toIndex);
	}
903495
def after(self, idx):
        """"""
        if not isinstance(idx, datetime):
            raise TypeError("'%s' is not %s" % (idx, datetime))
        day = max(idx.date(), self._lo_limit)
        while day < self._hi_limit:
            if day < self._rd_cache.lo or day >= self._rd_cache.hi:
                self._load(self._rd_cache, day)
            self._rd_cache.set_ptr(idx)
            if self._rd_cache.ptr < len(self._rd_cache.data):
                return self._rd_cache.data[self._rd_cache.ptr]['idx']
            day = self._rd_cache.hi
        return None
905883
function rateAddress(addr){
    var rating = 0;
    if(addr != undefined){
        if (addr['extended-address']) rating++;          
        if (addr['street-address']) rating++;
        if (addr.locality) rating++;
        if (addr.region) rating++;
        if (addr['postal-code']) rating++;
        if (addr['country-name']) rating++;
    }
    return rating;
}
596295
private int nextBoundaryAfter(int startIndex) {
        BreakIterator breakiterator = search_.breakIter();

        if (breakiterator == null) {
            breakiterator = search_.internalBreakIter_;
        }

        if (breakiterator != null) {
            return breakiterator.following(startIndex);
        }

        return startIndex;
    }
665602
def getbalance(self, address: str) -> Decimal:
        ''''''

        try:
            return Decimal(cast(float, self.ext_fetch('getbalance/' + address)))
        except TypeError:
            return Decimal(0)
38823
def next_addr(addr, i):
    """"""
    str_addr = pad_zeroes(str(int_addr(addr) + i), len(addr[1:]))
    return addr[0] + str_addr
182560
function getNextRange(ranges, anchor) {
	for (let i = 0; i < ranges.length; i++) {
		if (anchor.isEqual(ranges[i])) {
			// NB may return `undefined`, which is totally fine and means that
			// we should move to next element
			return ranges[i + 1];
		}
	}

	// Keep ranges which are not on the left of given selection
	ranges = ranges.filter(r => anchor.end.isLessThanOrEqual(r.start));

	return ranges[0];
}