def code_to_line(code, cursor_pos):
    """Turn a multiline code block and cursor position into a single line
    and new cursor position.

    For adapting ``complete_`` and ``object_info_request``.
    """
    if not code:
        return "", 0
    for line in code.splitlines(True):
        n = len(line)
        if n > cursor_pos:
            cursor_pos -= n
        else:
            break
    return line, cursor_pos
dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/adapter.py/code_to_line/swapped operands of `>`