def read_np_array_from_binary_string(process_output, use_pickle):
    """Read numpy array from binary string using start and end identifier."""
    lines = process_output.splitlines(keepends=True)
    binary_start_index, binary_end_index = _find_serialize_meta_information(
        lines
    )
    # IMPORTANT: The binary encoding of the numpy array potentially contains
    # new line characters (i.e. "\n"). Thus, while parsing the byte
    # representation multiple lines must be considered.
    serialized = b"".join(lines[binary_start_index + 1 : binary_end_index])
    np_array = deserialize_numpy_array(serialized, use_pickle=use_pickle)
    return np_array
Read numpy array from binary string using start and end identifier.
photogrammetry_importer/process_communication/pipe_communication.py