def download_package_to_sandbox(sandbox, package_url):
response = requests.get(package_url)<EOL>package_tar = os.path.join(sandbox, '<STR_LIT>')<EOL>with open(package_tar, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(response.content)<EOL><DEDENT>os.chdir(sandbox)<EOL>with tarfile.open('<STR_LIT>', '<STR_LIT>') as tf:<EOL><INDENT>tf.extractall()<EOL><DEDENT>directory = [d for d in os.listdir(sandbox) if os.path.isdir(d)][<NUM_LIT:0>]<EOL>return os.path.join(sandbox, directory)<EOL>
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