Did I find the right examples for you? yes no

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
[0, 1, 3] -> 2
[0, 'asdf', '3', 5] -> 1

        def nextinseq(seq, start=0):
    ''' [0, 1, 3] -> 2
        [0, 'asdf', '3', 5] -> 1
    '''

    seq = map(onlyint, seq)
    seq = filter(lambda x: x != None, seq)

    if not seq: return start
    if len(seq) == 1: return seq[0] + 1

    i=0; j=0

    for i, j in pairwise(seq):
        if (j-i) > 1: return i + 1
    else:
        return j + 1
        


src/g/i/gitolite-sshkey-form-0.2.1/gitolite_sshkey_form/dir.py   gitolite-sshkey-form(Download)
from os import unlink, makedirs
from os.path import basename, join as pjoin, exists, isdir
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))

src/g/i/gitolite-sshkey-form-0.2.1/gitolite_sshkey_form/gitolite.py   gitolite-sshkey-form(Download)
 
from os.path import basename, join as pjoin
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))

src/g/i/gitolite-sshkey-form-HEAD/gitolite_sshkey_form/dir.py   gitolite-sshkey-form(Download)
from os import unlink, makedirs
from os.path import basename, join as pjoin, exists, isdir
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))

src/g/i/gitolite-sshkey-form-HEAD/gitolite_sshkey_form/gitolite.py   gitolite-sshkey-form(Download)
 
from os.path import basename, join as pjoin
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))