<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_mypy_path(mypy_path):
 """Prepend to MYPYPATH."""

    original = os.environ.get(mypy_path_env_var)
    if original is None:
        new_mypy_path = mypy_path
    elif not original.startswith(mypy_path):
        new_mypy_path = mypy_path + os.pathsep + original
    else:
        new_mypy_path = None
    if new_mypy_path is not None:
        logger.log(mypy_path_env_var + ":", new_mypy_path)
        os.environ[mypy_path_env_var] = new_mypy_path