<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def overwrite_view_source(project, dir_path):
 """In the project's index.html built file, replace the top "source" link with a link to the documentation's home, which is mkdoc's home Args: project (str):
 project to update dir_path (pathlib.Path):
 this file's path """


    project_html_location = dir_path / project / HTML_LOCATION
    if not project_html_location.exists():
        return

    files_to_overwrite = [
        f for f in project_html_location.iterdir() if "html" in f.suffix
    ]

    for html_file in files_to_overwrite:
        with open(html_file, "r") as f:
            html = f.readlines()
        for i, l in enumerate(html):
            if TO_REPLACE_WITH_HOME in l:
                html[i] = NEW_HOME_LINK
                break
        with open(html_file, "w") as f:
            f.writelines(html)