def split_to_last_line_break(data):
    last_break_index = 1 + data.rfind(b'\n')
    return data[:last_break_index], data[last_break_index:]
This splits a byte buffer into (head, tail) where head contains the
dataset/ETHPy150Open catkin/catkin_tools/catkin_tools/jobs/commands/cmake.py/split_to_last_line_break