def replace_line_for_line(file, line_for_line_dict):
    """
    Will replace a line for a line in a file.
    Notice: this function use contains() and not ==.

    Args:
        param file:
        param line_for_line_dict:
    """
    lines = []
    with open(file, 'r') as f:
        for line in f:
            appended = False
            for key, val in line_for_line_dict.items():
                if key in line:
                    lines.append(val + '\n')
                    appended = True
            if not appended:
                lines.append(line)
    with open(file, 'w') as f:
        f.writelines(lines)
