def parse_local_opts(args):
    curr = list(args[:])
    curr.reverse()
    ttl = '20'
    debug_args = None
    args_list = []
    while (len(curr) > 0):
        token = curr.pop()
        if (token == '--local-ttl'):
            ttl = curr.pop()
        elif (token == '--java-debug'):
            debug_args = curr.pop()
        else:
            args_list.append(token)
    return (ttl, debug_args, args_list)
def parse_local_opts(args):
    curr = list(args[:])
    curr.reverse()
    ttl = '20'
    debug_args = None
    args_list = []
    while (len(curr) > 0):
        token = curr.pop()
        if (token == '--local-ttl'):
            ttl = curr.pop()
        elif (token == '--java-debug'):
            debug_args = curr.pop()
        else:
            args_list.append(token)
    return (ttl, debug_args, args_list)