diff --git a/tutorials/W1D2_ComparingTasks/W1D2_Tutorial3.ipynb b/tutorials/W1D2_ComparingTasks/W1D2_Tutorial3.ipynb index e04f97c9c..78ef7c73a 100644 --- a/tutorials/W1D2_ComparingTasks/W1D2_Tutorial3.ipynb +++ b/tutorials/W1D2_ComparingTasks/W1D2_Tutorial3.ipynb @@ -173,47 +173,6 @@ "logging.basicConfig(level=logging.INFO)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# @title Data retrieval\n", - "\n", - "import os\n", - "import requests\n", - "import hashlib\n", - "\n", - "# Variables for file and download URL\n", - "fname = \"trials.py\" # The name of the file to be downloaded\n", - "url = \"https://osf.io/swrmj/download\" # URL from where the file will be downloaded\n", - "expected_md5 = \"99bd315fd9a84663afbaa98f552cce79\" # MD5 hash for verifying file integrity\n", - "\n", - "if not os.path.isfile(fname):\n", - " try:\n", - " # Attempt to download the file\n", - " r = requests.get(url) # Make a GET request to the specified URL\n", - " except requests.ConnectionError:\n", - " # Handle connection errors during the download\n", - " print(\"!!! Failed to download data !!!\")\n", - " else:\n", - " # No connection errors, proceed to check the response\n", - " if r.status_code != requests.codes.ok:\n", - " # Check if the HTTP response status code indicates a successful download\n", - " print(\"!!! Failed to download data !!!\")\n", - " elif hashlib.md5(r.content).hexdigest() != expected_md5:\n", - " # Verify the integrity of the downloaded file using MD5 checksum\n", - " print(\"!!! Data download appears corrupted !!!\")\n", - " else:\n", - " # If download is successful and data is not corrupted, save the file\n", - " with open(fname, \"wb\") as fid:\n", - " fid.write(r.content) # Write the downloaded content to a file\n", - "\n", - "# Execute the downloaded Python file\n", - "%run trials.py" - ] - }, { "cell_type": "code", "execution_count": null,