@contextlib.contextmanager<EOL>def fix_import_path(args):
orig = list(sys.path)<EOL>changes = []<EOL>for arg in args:<EOL><INDENT>path = _get_python_path(arg)<EOL>if path in changes:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>changes.append(path)<EOL><DEDENT><DEDENT>sys.path[:] = changes + ["<STR_LIT:.>"] + sys.path<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>sys.path[:] = orig<EOL><DEDENT>
Prepare sys.path for running the linter checks.

    Within this context, each of the given arguments is importable.
    Paths are added to sys.path in corresponding order to the arguments.
    We avoid adding duplicate directories to sys.path.
    `sys.path` is reset to its original value upon exiting this context.