docs: def download_pip_based_installations(env, pip_invocation, requirements,
          download_cache_folder):
      """Download requirements for pip based installation."""
      if config.installation_cache_folder() is None:
          raise EnvironmentSetupError("Local installation cache folder not "
              "defined but required for downloading pip based installations.")
      # Installation cache folder needs to be explicitly created for pip to be
      # able to copy its downloaded installation files into it. The same does not
      # hold for pip's download cache folder which gets created by pip on-demand.
      # Seen using Python 3.4.0 & pip 1.5.4.
      _create_installation_cache_folder_if_needed()
      try:
          pip_options = ["install", "-d", config.installation_cache_folder(),
              "--exists-action=i"]
          pip_options.extend(pip_download_cache_options(download_cache_folder))
          # Running pip based installations on Python 2.5.
          #   * Python 2.5 does not come with SSL support enabled by default and
          #     so pip can not use SSL certified downloads from PyPI.
          #   * To work around this either install the
          #     https://pypi.python.org/pypi/ssl package or run pip using the
          #     '--insecure' command-line options.
          #       * Installing the ssl package seems ridden with problems on
          #         Python 2.5 so this workaround has not been tested.
          if (2, 5) <= env.sys_version_info < (2, 6):
              # There are some potential cases where we do not need to use
              # "--insecure", e.g. if the target Python environment already has
              # the 'ssl' module installed. However, detecting whether this is so
              # does not seem to be worth the effort. The only way to detect
              # whether secure download is supported would be to scan the target
              # environment for this information, e.g. setuptools has this
              # information in its pip.backwardcompat.ssl variable - if it is
              # None, the necessary SSL support is not available. But then we
              # would have to be careful:
              #  - not to run the scan if we already know this information from
              #    some previous scan
              #  - to track all actions that could have invalidated our previous
              #    scan results, etc.
              # It just does not seem to be worth the hassle so for now - YAGNI.
              pip_options.append("--insecure")
          env.execute(pip_invocation + pip_options + requirements)
      except (KeyboardInterrupt, SystemExit):
          raise
      except Exception:
          raise EnvironmentSetupError("pip based download failed.")