def get_indices_pattern(lines, pattern, num_lines, offset):
    """Processes the output file of the QM software used to
    find the first occurence of a specifie pattern. Useful
    if this block will be in the file only once and if there
    is no line that explicitly indicates the end of the block.

    Args:
        lines (list):
            Log file of the QM software to be processed.
        pattern (str):
            The pattern of the block.
        num_lines (int):
            How many line should be read.
        offset (int):
            How many lines are between the pattern and the first line of the block.

    Returns:
        list: Indices of the first and the last line of the block (including the offset).
    """

    idxs = [None] * 2

    for i, line in enumerate(lines):
        if pattern in line:
            # only go with first occurence
            idxs[0] = i + offset
            idxs[1] = i + num_lines + offset
            break

    return idxs