code: def append_to_path (path, directory):
      
      if not os.path.isdir(directory) or directory in path:
          return path
      if not path.endswith(os.pathsep):
          path += os.pathsep
      return path + directory
docs: Add a directory to the PATH environment variable, if it is a valid
      directory.