<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace_lines(html_file, transformed):
 """Replace lines in the old file with the transformed lines."""

    result = []
    with codecs.open(html_file, 'r', 'utf-8') as input_file:
        for line in input_file:
            # replace all single quotes with double quotes
            line = re.sub(r'\'', '"', line)

            for attr, value, new_link in transformed:
                if attr in line and value in line:

                    # replace old link with new staticfied link
                    new_line = line.replace(value, new_link)

                    result.append(new_line)
                    break
            else:
                result.append(line)

        return ''.join(result)