get the next consecutive number
161823
def get_number(self, key):
        
        storage = self.storage

        logger.debug("NUMBER before => %s" % storage.get(key, '-'))
        try:
            logger.debug("*** consecutive number lock acquire ***")
            lock.acquire()
            try:
                counter = storage[key]
                storage[key] = counter + 1
            except KeyError:
                storage[key] = 1
        finally:
            logger.debug("*** consecutive number lock release ***")
            self.storage._p_changed = True
            lock.release()

        logger.debug("NUMBER after => %s" % storage.get(key, '-'))
        return storage[key]
824853
public static int nextAllOnesInt(int x) {
    x |= x >>> 1;
    x |= x >>> 2;
    x |= x >>> 4;
    x |= x >>> 8;
    x |= x >>> 16;
    return x;
  }
833708
def check_if_numbers_are_consecutive(list_):
    
    return all((True if second - first == 1 else False
                for first, second in zip(list_[:-1], list_[1:])))
315981
def next(self):
        
        if self.index < self.length:
            index = self.index
            self.index += 1
            return self.data[index]
        else:
            raise StopIteration()
1247155
def _get_next_obj(self, length):
        """"""
        data = b''
        while len(data) < length:
            data += self.sock.recv(length - len(data))

        return pickle.loads(data)
535648
public int getNextRangeIndex() {
        int length = rangeIndexList.size();
        if (length > 0) {
            Integer rindex = rangeIndexList.get(length - 1);
            return rindex.intValue();
        }
        return 0;
    }
1305377
def next_value(val)
      index = index_of(val)
      return nil unless index
      return nil if index == (get_length - 1)
      return get(index + 1)
    end
1004318
def group_consecutives(data, stepsize=1):
    
    run = []
    result = [run]
    expect = None
    for item in data:
        if (item == expect) or (expect is None):
            run.append(item)
        else:
            run = [item]
            result.append(run)
        expect = item + stepsize
    return result
1040991
def _next(self):
        
        c = self._get()
        if c == '/':
            p = self._peek()
            if p == '/':
                c = self._get()
                while c > '\n':
                    c = self._get()
                return c
            if p == '*':
                c = self._get()
                while 1:
                    c = self._get()
                    if c == '*':
                        if self._peek() == '/':
                            self._get()
                            return ' '
                    if c == '\000':
                        raise UnterminatedComment()

        return c
344541
def next(self):
        
        if self._records_iter >= len(self._records):
            raise StopIteration
        self._records_iter += 1
        return self._records[self._records_iter - 1]
467167
def next(self):
        
        # need new iterable?
        if self.r == self.repeats:
            self.i = (self.i + 1) % self.lenght
            self.r = 0

        self.r += 1
        if self.stopping and self.i == 0 and self.r == 1:
            self.stopped = True
        if self.i == 0 and self.stopped:
            raise StopIteration
        else:
            iterator = self.iterators[self.i]
            return iterator.next()
284295
def next(self):
        
        try:
            results = self._stride_buffer.pop()
        except (IndexError, AttributeError):
            self._rebuffer()
            results = self._stride_buffer.pop()
        if not results:
            raise StopIteration
        return results
883323
def next_weekday(weekday):
    """"""
    ix = WEEKDAYS.index(weekday)
    if ix == len(WEEKDAYS)-1:
        return WEEKDAYS[0]
    return WEEKDAYS[ix+1]
470868
def next(self):
        
        x, y = next(self.scan)
        xs = int(round(x))
        ys = int(round(y))
        return xs, ys
1008705
def _get_next(self):
        

        self.state = PRNG_A * self.state % PRNG_M
        return self.state
200522
public String next() {
        if (done) return null;

        // construct return value

        buffer.setLength(0); // delete old contents
        for (int i = 0; i < pieces.length; ++i) {
            buffer.append(pieces[i][current[i]]);
        }
        String result = buffer.toString();

        // find next value for next time

        for (int i = current.length - 1; ; --i) {
            if (i < 0) {
                done = true;
                break;
            }
            current[i]++;
            if (current[i] < pieces[i].length) break; // got sequence
            current[i] = 0;
        }
        return result;
    }
920384
def next(self):
        """"""
        try:
            self._current = self.services.pop(0)
        except IndexError:
            raise StopIteration
        else:
            return self._current