def _remove_lines(part, title=True, empty=False, sep=False):
    """
    remove unneeded lines of part string

    Args:
        part (str): part in report file
        title (bool): if title should be removed
        empty (bool): if empty lines should be removed
        sep (bool):  if separator should be removed

    Returns:
        str: converted part
    """
    lines = part.split('\n')
    remove_lines = list()
    for no, line in enumerate(lines):
        if title:
            if no == 0 or no == len(lines) - 1:
                continue
            if '***' in lines[no + 1] and '***' in lines[no - 1]:
                remove_lines.append(no - 1)
                remove_lines.append(no)
                remove_lines.append(no + 1)
        if empty:
            if len(line.strip()) == 0:
                remove_lines.append(no)
        if sep:
            if len(line.replace('-', '').strip()) == 0:
                remove_lines.append(no)
    new_lines = lines
    for r in sorted(remove_lines, reverse=True):
        new_lines.pop(r)
    return '\n'.join(new_lines)
