def option2tuple ( opt ) : if isinstance ( opt [ 0 ] , int ) : tup = opt [ 1 ] , opt [ 2 : ] else : tup = opt [ 0 ] , opt [ 1 : ] return tup
python get second value form tuple
Return a tuple of option taking possible presence of level into account
def option2tuple(opt):
    """Return a tuple of option, taking possible presence of level into account"""

    if isinstance(opt[0], int):
        tup = opt[1], opt[2:]
    else:
        tup = opt[0], opt[1:]

    return tup