def _strip_prefix(package, version, strip_prefix = ""):
    """Computes the strip prefix for a downloaded archive of the provided
    PyPI package and version.

    Args:
        package: PyPI package name.
        version: version for which the archive should be downloaded.
        strip_prefix: additional directory prefix to strip from the extracted
            files.
    """
    if strip_prefix:
        return "{0}-{1}/{2}".format(package, version, strip_prefix)

    return "{0}-{1}".format(package, version)