code: def is_local(path):
      # type: (str) -> bool
      
      if not running_under_virtualenv():
          return True
      return normalize_path(path).startswith(normalize_path(sys.prefix))
docs: Return True if path is within sys.prefix, if we're running in a virtualenv.
  
      If we're not in a virtualenv, all paths are considered "local."