Downloads an unzips a package to the sandbox
    :param sandbox: temporary directory name
    :param package_url: link to package download
    :returns: name of unzipped package directory

def download_package_to_sandbox(sandbox, package_url):
    """
    Downloads an unzips a package to the sandbox
    :param sandbox: temporary directory name
    :param package_url: link to package download
    :returns: name of unzipped package directory
    """

    response = requests.get(package_url)

    package_tar = os.path.join(sandbox, 'package.tar.gz')

    with open(package_tar, 'w') as f:
        f.write(response.content)

    os.chdir(sandbox)

    with tarfile.open('package.tar.gz', 'r:gz') as tf:
        tf.extractall()

    directory = [d for d in os.listdir(sandbox) if os.path.isdir(d)][0]

    return os.path.join(sandbox, directory)