def adjust_index(idx, default=None):
if idx is None:<EOL><INDENT>return default<EOL><DEDENT>elif idx < <NUM_LIT:0>:<EOL><INDENT>return idx - <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>return idx<EOL><DEDENT>
Convert from python indexing convention to nvim indexing convention.