<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_file(c_source, virtualenv_dirname):
 """Strip trailing whitespace and clean up "local" names in C source. These source files are autogenerated from the ``cython`` CLI. Args: c_source (str):
 Path to a ``.c`` source file. virtualenv_dirname (str):
 The name of the ``virtualenv`` directory where Cython is installed (this is part of a """

    with open(c_source, "r") as file_obj:
        contents = file_obj.read().rstrip()
    # Replace the path to the Cython include files.
    py_version = "python{}.{}".format(*sys.version_info[:2])
    lib_path = os.path.join(
        ".nox", virtualenv_dirname, "lib", py_version, "site-packages", ""
    )
    contents = contents.replace(lib_path, "")
    # Write the files back, but strip all trailing whitespace.
    lines = contents.split("\n")
    with open(c_source, "w") as file_obj:
        for line in lines:
            file_obj.write(line.rstrip() + "\n")