: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/pytest/\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Requirement already satisfied: pytest in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (7.4.3)\n",
- "Requirement already satisfied: iniconfig in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (from pytest) (2.0.0)\n",
- "Requirement already satisfied: packaging in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (from pytest) (23.2)\n",
- "Requirement already satisfied: pluggy<2.0,>=0.12 in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (from pytest) (1.3.0)\n",
- "Requirement already satisfied: colorama in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (from pytest) (0.4.6)\n",
- "Note: you may need to restart the kernel to use updated packages.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%pip install pytest"
]
@@ -155,42 +64,10 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"id": "38fd0a98-c5d9-448e-bd00-e7fded8d9aee",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 1 item\n",
- "\n",
- "tmp.py F [100%]\n",
- "\n",
- "================================== FAILURES ===================================\n",
- "_______________________________ test_something ________________________________\n",
- "\n",
- " def test_something():\n",
- " val = 1\n",
- "> assert val == 5\n",
- "E assert 1 == 5\n",
- "\n",
- "tmp.py:3: AssertionError\n",
- "=========================== short test summary info ===========================\n",
- "FAILED tmp.py::test_something - assert 1 == 5\n",
- "============================== 1 failed in 0.10s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def test_something():\n",
@@ -222,42 +99,10 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"id": "1132e4b0-ddd6-486a-bbf2-eb3315046d2a",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 1 item\n",
- "\n",
- "tmp.py F [100%]\n",
- "\n",
- "================================== FAILURES ===================================\n",
- "__________________________________ test_add ___________________________________\n",
- "\n",
- " def test_add():\n",
- "> assert add(1, 2) == 3\n",
- "E assert None == 3\n",
- "E + where None = add(1, 2)\n",
- "\n",
- "tmp.py:6: AssertionError\n",
- "=========================== short test summary info ===========================\n",
- "FAILED tmp.py::test_add - assert None == 3\n",
- "============================== 1 failed in 0.07s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def add(num1, num2):\n",
@@ -270,31 +115,10 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"id": "6965ab16-7184-4672-bbdc-b15ee11be477",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 1 item\n",
- "\n",
- "tmp.py . [100%]\n",
- "\n",
- "============================== 1 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def add(num1, num2):\n",
@@ -315,42 +139,10 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": null,
"id": "498cb615-4747-415a-b2e2-9ba20e2d6151",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 2 items\n",
- "\n",
- "tmp.py .F [100%]\n",
- "\n",
- "================================== FAILURES ===================================\n",
- "_______________________________ test_add_float ________________________________\n",
- "\n",
- " def test_add_float():\n",
- "> assert add(0.1, 0.2) == 0.3\n",
- "E assert 0.30000000000000004 == 0.3\n",
- "E + where 0.30000000000000004 = add(0.1, 0.2)\n",
- "\n",
- "tmp.py:9: AssertionError\n",
- "=========================== short test summary info ===========================\n",
- "FAILED tmp.py::test_add_float - assert 0.30000000000000004 == 0.3\n",
- "========================= 1 failed, 1 passed in 0.14s =========================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def add(num1, num2):\n",
@@ -366,31 +158,10 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": null,
"id": "e8957e45-7538-42d7-b1d9-30c2e1d08368",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 2 items\n",
- "\n",
- "tmp.py .. [100%]\n",
- "\n",
- "============================== 2 passed in 0.02s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def add(num1, num2):\n",
@@ -415,31 +186,10 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": null,
"id": "5e3735bb-d685-40ab-b1a6-179097ac44e3",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collected 2 items\n",
- "\n",
- "tmp.py .. [100%]\n",
- "\n",
- "============================== 2 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest\n",
"def add(num1, num2):\n",
@@ -462,33 +212,10 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": null,
"id": "a0d62060-a4ab-4d26-bb73-7a4ed238a917",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_add[input_arg0-3] PASSED [ 50%]\n",
- "tmp.py::test_add[input_arg1-0.3] PASSED [100%]\n",
- "\n",
- "============================== 2 passed in 0.02s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -v\n",
"def add(num1, num2):\n",
@@ -519,37 +246,10 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": null,
"id": "252781d2-a153-42da-9dc7-9345aa9f3b98",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_add[input_arg0-3] \n",
- "input_arg = (1, 2), expected = 3\n",
- "PASSED\n",
- "tmp.py::test_add[input_arg1-0.3] \n",
- "input_arg = (0.1, 0.2), expected = 0.3\n",
- "PASSED\n",
- "\n",
- "============================== 2 passed in 0.02s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -vs\n",
"def add(num1, num2):\n",
@@ -581,32 +281,10 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": null,
"id": "0f0f4466-24a3-4e88-8961-0977722efd9a",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 1 item\n",
- "\n",
- "tmp.py::test_raises PASSED [100%]\n",
- "\n",
- "============================== 1 passed in 0.00s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -v\n",
"import pytest\n",
@@ -640,33 +318,10 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": null,
"id": "de096fb9-fba3-4a2d-ad88-3db4605212fa",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_addition PASSED [ 50%]\n",
- "tmp.py::test_subtraction PASSED [100%]\n",
- "\n",
- "============================== 2 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -v\n",
"class Calculator:\n",
@@ -689,33 +344,10 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": null,
"id": "041a810b-0398-48de-8cac-0efc1e1ba7c9",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_addition PASSED [ 50%]\n",
- "tmp.py::test_subtraction PASSED [100%]\n",
- "\n",
- "============================== 2 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -v\n",
"class Calculator:\n",
@@ -750,39 +382,10 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": null,
"id": "9e0fd8fa-1653-4d62-a319-87307db52a22",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_add Setup - Before the test\n",
- "Running test_add\n",
- "PASSEDTeardown - After the test\n",
- "\n",
- "tmp.py::test_sub Setup - Before the test\n",
- "Running test_sub\n",
- "PASSEDTeardown - After the test\n",
- "\n",
- "\n",
- "============================== 2 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -vs\n",
"import pytest\n",
@@ -813,39 +416,10 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": null,
"id": "f41c08b3-83c6-4129-9195-d75cc237ac2f",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_add Setup - Before the test\n",
- "Running test_add\n",
- "PASSEDTeardown - After the test\n",
- "\n",
- "tmp.py::test_sub Setup - Before the test\n",
- "Running test_sub\n",
- "PASSEDTeardown - After the test\n",
- "\n",
- "\n",
- "============================== 2 passed in 0.01s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -vs\n",
"import pytest\n",
@@ -875,37 +449,10 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": null,
"id": "f7d77a4e-1866-4c4a-8296-ce14e3a00950",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "============================= test session starts =============================\n",
- "platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\\Users\\bhmiller\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe\n",
- "cachedir: .pytest_cache\n",
- "rootdir: c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\n",
- "collecting ... collected 2 items\n",
- "\n",
- "tmp.py::test_add Setup - Before the test\n",
- "Running test_add\n",
- "PASSED\n",
- "tmp.py::test_sub Running test_sub\n",
- "PASSEDTeardown - After the test\n",
- "\n",
- "\n",
- "============================== 2 passed in 0.02s ==============================\n",
- "
"
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"%%save_and_run_magic pytest -vs\n",
"import pytest\n",
diff --git a/content/10_concurrency.ipynb b/content/10_concurrency.ipynb
index 555ee61..88b581f 100644
--- a/content/10_concurrency.ipynb
+++ b/content/10_concurrency.ipynb
@@ -37,48 +37,10 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": null,
"id": "bd4ab344-0029-451f-8c26-fa2b5499f935",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Requirement already satisfied: viztracer in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (0.16.1)\n",
- "Requirement already satisfied: objprint>0.1.3 in c:\\users\\bhmiller\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (from viztracer) (0.2.3)\n",
- "Note: you may need to restart the kernel to use updated packages.\n",
- "Collecting requests\n",
- " Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)\n",
- "Collecting charset-normalizer<4,>=2 (from requests)\n",
- " Downloading charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl.metadata (34 kB)\n",
- "Collecting idna<4,>=2.5 (from requests)\n",
- " Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB)\n",
- "Collecting urllib3<3,>=1.21.1 (from requests)\n",
- " Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)\n",
- "Collecting certifi>=2017.4.17 (from requests)\n",
- " Downloading certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)\n",
- "Downloading requests-2.31.0-py3-none-any.whl (62 kB)\n",
- " ---------------------------------------- 0.0/62.6 kB ? eta -:--:--\n",
- " ---------------------------------------- 62.6/62.6 kB 1.7 MB/s eta 0:00:00\n",
- "Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)\n",
- " ---------------------------------------- 0.0/162.5 kB ? eta -:--:--\n",
- " ---------------------------------------- 162.5/162.5 kB 4.9 MB/s eta 0:00:00\n",
- "Downloading charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl (99 kB)\n",
- " ---------------------------------------- 0.0/99.9 kB ? eta -:--:--\n",
- " ---------------------------------------- 99.9/99.9 kB ? eta 0:00:00\n",
- "Downloading idna-3.6-py3-none-any.whl (61 kB)\n",
- " ---------------------------------------- 0.0/61.6 kB ? eta -:--:--\n",
- " ---------------------------------------- 61.6/61.6 kB 3.2 MB/s eta 0:00:00\n",
- "Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)\n",
- " ---------------------------------------- 0.0/104.6 kB ? eta -:--:--\n",
- " ---------------------------------------- 104.6/104.6 kB ? eta 0:00:00\n",
- "Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests\n",
- "Successfully installed certifi-2023.11.17 charset-normalizer-3.3.2 idna-3.6 requests-2.31.0 urllib3-2.1.0\n",
- "Note: you may need to restart the kernel to use updated packages.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%pip install viztracer\n",
"%pip install requests"
@@ -103,7 +65,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"id": "da7c7a00-ee14-4fcd-bc1e-80dea07dcf3f",
"metadata": {},
"outputs": [],
@@ -113,18 +75,10 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"id": "663372ae-735e-4d91-b268-89f53146545f",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Overwriting example/downloader.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/downloader.py\n",
"import shutil\n",
@@ -152,18 +106,10 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"id": "faf8dc35-9da9-4e99-8803-afcd5e5273e9",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Overwriting example/single_core_single_process.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/single_core_single_process.py\n",
"from downloader import download_file\n",
@@ -193,45 +139,10 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": null,
"id": "650c5547-7e34-49dc-9ecf-d6b181c2cda9",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Downloading itr1_english.pdf...\n",
- "Download complete for itr1_english.pdf!\n",
- "Downloading itr2_english.pdf...\n",
- "Download complete for itr2_english.pdf!\n",
- "Downloading itr3_english.pdf...\n",
- "Download complete for itr3_english.pdf!\n",
- "Downloading itr4_english.pdf...\n",
- "Download complete for itr4_english.pdf!\n",
- "Downloading itr5_english.pdf...\n",
- "Download complete for itr5_english.pdf!\n",
- "Downloading itr6_english.pdf...\n",
- "Download complete for itr6_english.pdf!\n",
- "Downloading itr7_english.pdf...\n",
- "Download complete for itr7_english.pdf!\n",
- "All downloads completed!\n",
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/1\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 153212\n",
- " \n",
- "Total Entries: 153212\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/single_core_single_process.py"
]
@@ -249,18 +160,10 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"id": "2bb3d508-450a-4508-9d3e-d7278097ebd2",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/single_core_multi_thread.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/single_core_multi_thread.py\n",
"import threading\n",
@@ -299,45 +202,10 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": null,
"id": "40d1b34f-d586-432b-afbf-e7d5359aade9",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Downloading itr3_english.pdf...\n",
- "Download complete for itr3_english.pdf!\n",
- "Downloading itr6_english.pdf...\n",
- "Downloading itr5_english.pdf...\n",
- "Downloading itr4_english.pdf...\n",
- "Download complete for itr6_english.pdf!\n",
- "Downloading itr2_english.pdf...\n",
- "Download complete for itr5_english.pdf!Downloading itr7_english.pdf...\n",
- "Download complete for itr4_english.pdf!\n",
- "Downloading itr1_english.pdf...\n",
- "\n",
- "Download complete for itr2_english.pdf!\n",
- "Download complete for itr1_english.pdf!Download complete for itr7_english.pdf!\n",
- "\n",
- "All downloads completed!\n",
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/1\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 153730\n",
- " \n",
- "Total Entries: 153730\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/single_core_multi_thread.py"
]
@@ -368,18 +236,10 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": null,
"id": "912cb044-33e2-495a-8949-c7a03ba72e86",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/single_core_multi_thread_class_imp.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/single_core_multi_thread_class_imp.py\n",
"import threading\n",
@@ -444,59 +304,10 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": null,
"id": "981d7dfc-6efb-466d-bd0f-ffda209f1586",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Starting Thread-1\n",
- "Starting Thread-2\n",
- "Starting Thread-3\n",
- "Starting Thread-4\n",
- "Starting Thread-5\n",
- "Starting Thread-6\n",
- "Starting Thread-7\n",
- "Downloading itr3_english.pdf...\n",
- "Download complete for itr3_english.pdf!\n",
- "Completing Thread-3\n",
- "Downloading itr2_english.pdf...\n",
- "Download complete for itr2_english.pdf!\n",
- "Completing Thread-2\n",
- "Downloading itr5_english.pdf...Downloading itr4_english.pdf...\n",
- "\n",
- "Download complete for itr5_english.pdf!\n",
- "Completing Thread-5\n",
- "Download complete for itr4_english.pdf!\n",
- "Completing Thread-4\n",
- "Downloading itr6_english.pdf...\n",
- "Download complete for itr6_english.pdf!\n",
- "Completing Thread-6\n",
- "Downloading itr7_english.pdf...Downloading itr1_english.pdf...\n",
- "\n",
- "Download complete for itr1_english.pdf!\n",
- "Completing Thread-1Download complete for itr7_english.pdf!\n",
- "\n",
- "Completing Thread-7\n",
- "All downloads completed!\n",
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/1\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 154785\n",
- " \n",
- "Total Entries: 154785\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/single_core_multi_thread_class_imp.py"
]
@@ -511,18 +322,10 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": null,
"id": "8a288c25-3c2d-4d68-a232-6878ee055614",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/single_core_multi_thread_cpu_bound.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/single_core_multi_thread_cpu_bound.py\n",
"import threading\n",
@@ -553,30 +356,10 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": null,
"id": "d71b888e-34e3-45db-8ba8-ab1925bf402a",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/1\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 29141\n",
- " \n",
- "Total Entries: 29141\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/single_core_multi_thread_cpu_bound.py"
]
@@ -599,20 +382,10 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": null,
"id": "74242817-0545-4c93-aac2-e3f25d32871d",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "counter=10\n",
- "counter=20\n",
- "The final counter is 20\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"from threading import Thread\n",
"from time import sleep\n",
@@ -654,46 +427,10 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": null,
"id": "037dba1e-c83d-49d9-a3ff-75710805eaf7",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- " 7 0 RESUME 0\n",
- "\n",
- " 11 2 LOAD_GLOBAL 0 (counter)\n",
- " 14 STORE_FAST 1 (local_counter)\n",
- "\n",
- " 14 16 LOAD_FAST 1 (local_counter)\n",
- " 18 LOAD_FAST 0 (by)\n",
- " 20 BINARY_OP 13 (+=)\n",
- " 24 STORE_FAST 1 (local_counter)\n",
- "\n",
- " 17 26 LOAD_GLOBAL 3 (NULL + sleep)\n",
- " 38 LOAD_CONST 1 (0.1)\n",
- " 40 PRECALL 1\n",
- " 44 CALL 1\n",
- " 54 POP_TOP\n",
- "\n",
- " 20 56 LOAD_FAST 1 (local_counter)\n",
- " 58 STORE_GLOBAL 0 (counter)\n",
- "\n",
- " 21 60 LOAD_GLOBAL 5 (NULL + print)\n",
- " 72 LOAD_CONST 2 ('counter=')\n",
- " 74 LOAD_GLOBAL 0 (counter)\n",
- " 86 FORMAT_VALUE 0\n",
- " 88 BUILD_STRING 2\n",
- " 90 PRECALL 1\n",
- " 94 CALL 1\n",
- " 104 POP_TOP\n",
- " 106 LOAD_CONST 0 (None)\n",
- " 108 RETURN_VALUE\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import dis\n",
"\n",
@@ -732,20 +469,10 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": null,
"id": "574aa7a5-89c0-4792-a0b0-05677bfa73e1",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "counter=10\n",
- "counter=30\n",
- "The final counter is 30\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"from threading import Thread, Lock\n",
"from time import sleep\n",
@@ -805,30 +532,10 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": null,
"id": "bbc2441f-b5f3-48cf-ae8d-6040abba73c9",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- "Pinging www.google.com [142.250.69.196] with 32 bytes of data:\n",
- "Reply from 142.250.69.196: bytes=32 time=17ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=14ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=15ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=15ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=15ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=15ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=15ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=18ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=13ms TTL=114\n",
- "Reply from 142.250.69.196: bytes=32 time=14ms TTL=114\n",
- "\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import subprocess\n",
"import threading\n",
@@ -880,26 +587,10 @@
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": null,
"id": "ddb2aed2-4a1c-4f53-b4de-92050ab8a8b7",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Produced: Item 1\n",
- "Consumed: Item 1\n",
- "Produced: Item 2Consumed: Item 2\n",
- "\n",
- "Produced: Item 3Consumed: Item 3\n",
- "\n",
- "Produced: Item 4Consumed: Item 4\n",
- "\n",
- "Producer and consumer have finished.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import threading\n",
"import queue\n",
@@ -965,320 +656,10 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": null,
"id": "ab4b526a-f4ea-4cc3-b863-6749661c9e81",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Has been waiting for 1 second(s)...\n",
- "Has been waiting for 2 second(s)...\n",
- "Has been waiting for 3 second(s)...\n",
- "Has been waiting for 4 second(s)...\n",
- "Has been waiting for 5 second(s)...\n",
- "Has been waiting for 6 second(s)...\n",
- "Has been waiting for 7 second(s)...\n",
- "Has been waiting for 8 second(s)...\n",
- "Has been waiting for 9 second(s)...\n",
- "Has been waiting for 10 second(s)...\n",
- "Has been waiting for 11 second(s)...\n",
- "Has been waiting for 12 second(s)...\n",
- "Has been waiting for 13 second(s)...\n",
- "Has been waiting for 14 second(s)...\n",
- "Has been waiting for 15 second(s)...\n",
- "Has been waiting for 16 second(s)...\n",
- "Has been waiting for 17 second(s)...\n",
- "Has been waiting for 18 second(s)...\n",
- "Has been waiting for 19 second(s)...\n",
- "Has been waiting for 20 second(s)...\n",
- "Has been waiting for 21 second(s)...\n",
- "Has been waiting for 22 second(s)...\n",
- "Has been waiting for 23 second(s)...\n",
- "Has been waiting for 24 second(s)...\n",
- "Has been waiting for 25 second(s)...\n",
- "Has been waiting for 26 second(s)...\n",
- "Has been waiting for 27 second(s)...\n",
- "Has been waiting for 28 second(s)...\n",
- "Has been waiting for 29 second(s)...\n",
- "Has been waiting for 30 second(s)...\n",
- "Has been waiting for 31 second(s)...\n",
- "Has been waiting for 32 second(s)...\n",
- "Has been waiting for 33 second(s)...\n",
- "Has been waiting for 34 second(s)...\n",
- "Has been waiting for 35 second(s)...\n",
- "Has been waiting for 36 second(s)...\n",
- "Has been waiting for 37 second(s)...\n",
- "Has been waiting for 38 second(s)...\n",
- "Has been waiting for 39 second(s)...\n",
- "Has been waiting for 40 second(s)...\n",
- "Has been waiting for 41 second(s)...\n",
- "Has been waiting for 42 second(s)...\n",
- "Has been waiting for 43 second(s)...\n",
- "Has been waiting for 44 second(s)...\n",
- "Has been waiting for 45 second(s)...\n",
- "Has been waiting for 46 second(s)...\n",
- "Has been waiting for 47 second(s)...\n",
- "Has been waiting for 48 second(s)...\n",
- "Has been waiting for 49 second(s)...\n",
- "Has been waiting for 50 second(s)...\n",
- "Has been waiting for 51 second(s)...\n",
- "Has been waiting for 52 second(s)...\n",
- "Has been waiting for 53 second(s)...\n",
- "Has been waiting for 54 second(s)...\n",
- "Has been waiting for 55 second(s)...\n",
- "Has been waiting for 56 second(s)...\n",
- "Has been waiting for 57 second(s)...\n",
- "Has been waiting for 58 second(s)...\n",
- "Has been waiting for 59 second(s)...\n",
- "Has been waiting for 60 second(s)...\n",
- "Has been waiting for 61 second(s)...\n",
- "Has been waiting for 62 second(s)...\n",
- "Has been waiting for 63 second(s)...\n",
- "Has been waiting for 64 second(s)...\n",
- "Has been waiting for 65 second(s)...\n",
- "Has been waiting for 66 second(s)...\n",
- "Has been waiting for 67 second(s)...\n",
- "Has been waiting for 68 second(s)...\n",
- "Has been waiting for 69 second(s)...\n",
- "Has been waiting for 70 second(s)...\n",
- "Has been waiting for 71 second(s)...\n",
- "Has been waiting for 72 second(s)...\n",
- "Has been waiting for 73 second(s)...\n",
- "Has been waiting for 74 second(s)...\n",
- "Has been waiting for 75 second(s)...\n",
- "Has been waiting for 76 second(s)...\n",
- "Has been waiting for 77 second(s)...\n",
- "Has been waiting for 78 second(s)...\n",
- "Has been waiting for 79 second(s)...\n",
- "Has been waiting for 80 second(s)...\n",
- "Has been waiting for 81 second(s)...\n",
- "Has been waiting for 82 second(s)...\n",
- "Has been waiting for 83 second(s)...\n",
- "Has been waiting for 84 second(s)...\n",
- "Has been waiting for 85 second(s)...\n",
- "Has been waiting for 86 second(s)...\n",
- "Has been waiting for 87 second(s)...\n",
- "Has been waiting for 88 second(s)...\n",
- "Has been waiting for 89 second(s)...\n",
- "Has been waiting for 90 second(s)...\n",
- "Has been waiting for 91 second(s)...\n",
- "Has been waiting for 92 second(s)...\n",
- "Has been waiting for 93 second(s)...\n",
- "Has been waiting for 94 second(s)...\n",
- "Has been waiting for 95 second(s)...\n",
- "Has been waiting for 96 second(s)...\n",
- "Has been waiting for 97 second(s)...\n",
- "Has been waiting for 98 second(s)...\n",
- "Has been waiting for 99 second(s)...\n",
- "Has been waiting for 100 second(s)...\n",
- "Has been waiting for 101 second(s)...\n",
- "Has been waiting for 102 second(s)...\n",
- "Has been waiting for 103 second(s)...\n",
- "Has been waiting for 104 second(s)...\n",
- "Has been waiting for 105 second(s)...\n",
- "Has been waiting for 106 second(s)...\n",
- "Has been waiting for 107 second(s)...\n",
- "Has been waiting for 108 second(s)...\n",
- "Has been waiting for 109 second(s)...\n",
- "Has been waiting for 110 second(s)...\n",
- "Has been waiting for 111 second(s)...\n",
- "Has been waiting for 112 second(s)...\n",
- "Has been waiting for 113 second(s)...\n",
- "Has been waiting for 114 second(s)...\n",
- "Has been waiting for 115 second(s)...\n",
- "Has been waiting for 116 second(s)...\n",
- "Has been waiting for 117 second(s)...\n",
- "Has been waiting for 118 second(s)...\n",
- "Has been waiting for 119 second(s)...\n",
- "Has been waiting for 120 second(s)...\n",
- "Has been waiting for 121 second(s)...\n",
- "Has been waiting for 122 second(s)...\n",
- "Has been waiting for 123 second(s)...\n",
- "Has been waiting for 124 second(s)...\n",
- "Has been waiting for 125 second(s)...\n",
- "Has been waiting for 126 second(s)...\n",
- "Has been waiting for 127 second(s)...\n",
- "Has been waiting for 128 second(s)...\n",
- "Has been waiting for 129 second(s)...\n",
- "Has been waiting for 130 second(s)...\n",
- "Has been waiting for 131 second(s)...\n",
- "Has been waiting for 132 second(s)...\n",
- "Has been waiting for 133 second(s)...\n",
- "Has been waiting for 134 second(s)...\n",
- "Has been waiting for 135 second(s)...\n",
- "Has been waiting for 136 second(s)...\n",
- "Has been waiting for 137 second(s)...\n",
- "Has been waiting for 138 second(s)...\n",
- "Has been waiting for 139 second(s)...\n",
- "Has been waiting for 140 second(s)...\n",
- "Has been waiting for 141 second(s)...\n",
- "Has been waiting for 142 second(s)...\n",
- "Has been waiting for 143 second(s)...\n",
- "Has been waiting for 144 second(s)...\n",
- "Has been waiting for 145 second(s)...\n",
- "Has been waiting for 146 second(s)...\n",
- "Has been waiting for 147 second(s)...\n",
- "Has been waiting for 148 second(s)...\n",
- "Has been waiting for 149 second(s)...\n",
- "Has been waiting for 150 second(s)...\n",
- "Has been waiting for 151 second(s)...\n",
- "Has been waiting for 152 second(s)...\n",
- "Has been waiting for 153 second(s)...\n",
- "Has been waiting for 154 second(s)...\n",
- "Has been waiting for 155 second(s)...\n",
- "Has been waiting for 156 second(s)...\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Has been waiting for 157 second(s)...\n",
- "Has been waiting for 158 second(s)...\n",
- "Has been waiting for 159 second(s)...\n",
- "Has been waiting for 160 second(s)...\n",
- "Has been waiting for 161 second(s)...\n",
- "Has been waiting for 162 second(s)...\n",
- "Has been waiting for 163 second(s)...\n",
- "Has been waiting for 164 second(s)...\n",
- "Has been waiting for 165 second(s)...\n",
- "Has been waiting for 166 second(s)...\n",
- "Has been waiting for 167 second(s)...\n",
- "Has been waiting for 168 second(s)...\n",
- "Has been waiting for 169 second(s)...\n",
- "Has been waiting for 170 second(s)...\n",
- "Has been waiting for 171 second(s)...\n",
- "Has been waiting for 172 second(s)...\n",
- "Has been waiting for 173 second(s)...\n",
- "Has been waiting for 174 second(s)...\n",
- "Has been waiting for 175 second(s)...\n",
- "Has been waiting for 176 second(s)...\n",
- "Has been waiting for 177 second(s)...\n",
- "Has been waiting for 178 second(s)...\n",
- "Has been waiting for 179 second(s)...\n",
- "Has been waiting for 180 second(s)...\n",
- "Has been waiting for 181 second(s)...\n",
- "Has been waiting for 182 second(s)...\n",
- "Has been waiting for 183 second(s)...\n",
- "Has been waiting for 184 second(s)...\n",
- "Has been waiting for 185 second(s)...\n",
- "Has been waiting for 186 second(s)...\n",
- "Has been waiting for 187 second(s)...\n",
- "Has been waiting for 188 second(s)...\n",
- "Has been waiting for 189 second(s)...\n",
- "Has been waiting for 190 second(s)...\n",
- "Has been waiting for 191 second(s)...\n",
- "Has been waiting for 192 second(s)...\n",
- "Has been waiting for 193 second(s)...\n",
- "Has been waiting for 194 second(s)...\n",
- "Has been waiting for 195 second(s)...\n",
- "Has been waiting for 196 second(s)...\n",
- "Has been waiting for 197 second(s)...\n",
- "Has been waiting for 198 second(s)...\n",
- "Has been waiting for 199 second(s)...\n",
- "Has been waiting for 200 second(s)...\n",
- "Has been waiting for 201 second(s)...\n",
- "Has been waiting for 202 second(s)...\n",
- "Has been waiting for 203 second(s)...\n",
- "Has been waiting for 204 second(s)...\n",
- "Has been waiting for 205 second(s)...\n",
- "Has been waiting for 206 second(s)...\n",
- "Has been waiting for 207 second(s)...\n",
- "Has been waiting for 208 second(s)...\n",
- "Has been waiting for 209 second(s)...\n",
- "Has been waiting for 210 second(s)...\n",
- "Has been waiting for 211 second(s)...\n",
- "Has been waiting for 212 second(s)...\n",
- "Has been waiting for 213 second(s)...\n",
- "Has been waiting for 214 second(s)...\n",
- "Has been waiting for 215 second(s)...\n",
- "Has been waiting for 216 second(s)...\n",
- "Has been waiting for 217 second(s)...\n",
- "Has been waiting for 218 second(s)...\n",
- "Has been waiting for 219 second(s)...\n",
- "Has been waiting for 220 second(s)...\n",
- "Has been waiting for 221 second(s)...\n",
- "Has been waiting for 222 second(s)...\n",
- "Has been waiting for 223 second(s)...\n",
- "Has been waiting for 224 second(s)...\n",
- "Has been waiting for 225 second(s)...\n",
- "Has been waiting for 226 second(s)...\n",
- "Has been waiting for 227 second(s)...\n",
- "Has been waiting for 228 second(s)...\n",
- "Has been waiting for 229 second(s)...\n",
- "Has been waiting for 230 second(s)...\n",
- "Has been waiting for 231 second(s)...\n",
- "Has been waiting for 232 second(s)...\n",
- "Has been waiting for 233 second(s)...\n",
- "Has been waiting for 234 second(s)...\n",
- "Has been waiting for 235 second(s)...\n",
- "Has been waiting for 236 second(s)...\n",
- "Has been waiting for 237 second(s)...\n",
- "Has been waiting for 238 second(s)...\n",
- "Has been waiting for 239 second(s)...\n",
- "Has been waiting for 240 second(s)...\n",
- "Has been waiting for 241 second(s)...\n",
- "Has been waiting for 242 second(s)...\n",
- "Has been waiting for 243 second(s)...\n",
- "Has been waiting for 244 second(s)...\n",
- "Has been waiting for 245 second(s)...\n",
- "Has been waiting for 246 second(s)...\n",
- "Has been waiting for 247 second(s)...\n",
- "Has been waiting for 248 second(s)...\n",
- "Has been waiting for 249 second(s)...\n",
- "Has been waiting for 250 second(s)...\n",
- "Has been waiting for 251 second(s)...\n",
- "Has been waiting for 252 second(s)...\n",
- "Has been waiting for 253 second(s)...\n",
- "Has been waiting for 254 second(s)...\n",
- "Has been waiting for 255 second(s)...\n",
- "Has been waiting for 256 second(s)...\n",
- "Has been waiting for 257 second(s)...\n",
- "Has been waiting for 258 second(s)...\n",
- "Has been waiting for 259 second(s)...\n",
- "Has been waiting for 260 second(s)...\n",
- "Has been waiting for 261 second(s)...\n",
- "Has been waiting for 262 second(s)...\n",
- "Has been waiting for 263 second(s)...\n",
- "Has been waiting for 264 second(s)...\n",
- "Has been waiting for 265 second(s)...\n",
- "Has been waiting for 266 second(s)...\n",
- "Has been waiting for 267 second(s)...\n",
- "Has been waiting for 268 second(s)...\n",
- "Has been waiting for 269 second(s)...\n",
- "Has been waiting for 270 second(s)...\n",
- "Has been waiting for 271 second(s)...\n",
- "Has been waiting for 272 second(s)...\n",
- "Has been waiting for 273 second(s)...\n",
- "Has been waiting for 274 second(s)...\n",
- "Has been waiting for 275 second(s)...\n",
- "Has been waiting for 276 second(s)...\n",
- "Has been waiting for 277 second(s)...\n",
- "Has been waiting for 278 second(s)...\n",
- "Has been waiting for 279 second(s)...\n",
- "Has been waiting for 280 second(s)...\n",
- "Has been waiting for 281 second(s)...\n",
- "Has been waiting for 282 second(s)...\n",
- "Has been waiting for 283 second(s)...\n",
- "Has been waiting for 284 second(s)...\n",
- "Has been waiting for 285 second(s)...\n",
- "Has been waiting for 286 second(s)...\n",
- "Has been waiting for 287 second(s)...\n",
- "Has been waiting for 288 second(s)...\n",
- "Has been waiting for 289 second(s)...\n",
- "Has been waiting for 290 second(s)...\n",
- "Has been waiting for 291 second(s)...\n",
- "Has been waiting for 292 second(s)...\n",
- "Has been waiting for 293 second(s)...\n",
- "Has been waiting for 294 second(s)...\n",
- "Has been waiting for 295 second(s)...\n",
- "Has been waiting for 296 second(s)...\n",
- "Has been waiting for 297 second(s)...\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import threading\n",
"import time\n",
@@ -1304,127 +685,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "ad264d27-a6dd-4fe9-bc4e-78248cb7497c",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Has been waiting for 1 second(s)...\n",
- "Has been waiting for 2 second(s)...\n",
- "Has been waiting for 3 second(s)...\n",
- "Has been waiting for 4 second(s)...\n",
- "Has been waiting for 5 second(s)...\n",
- "Has been waiting for 6 second(s)...\n",
- "Has been waiting for 7 second(s)...\n"
- ]
- },
- {
- "ename": "AttributeError",
- "evalue": "'Thread' object has no attribute 'stop'",
- "output_type": "error",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32mc:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\10_concurrency.ipynb Cell 38\u001b[0m line \u001b[0;36m1\n\u001b[0;32m 17\u001b[0m \u001b[39m# Wait for user input to exit\u001b[39;00m\n\u001b[0;32m 18\u001b[0m answer \u001b[39m=\u001b[39m \u001b[39minput\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mDo you want to exit? (Type \u001b[39m\u001b[39m'\u001b[39m\u001b[39myes\u001b[39m\u001b[39m'\u001b[39m\u001b[39m to exit)\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m---> 19\u001b[0m timer_thread\u001b[39m.\u001b[39;49mstop()\n",
- "\u001b[1;31mAttributeError\u001b[0m: 'Thread' object has no attribute 'stop'"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Has been waiting for 8 second(s)...\n",
- "Has been waiting for 9 second(s)...\n",
- "Has been waiting for 10 second(s)...\n",
- "Has been waiting for 11 second(s)...\n",
- "Has been waiting for 12 second(s)...\n",
- "Has been waiting for 13 second(s)...\n",
- "Has been waiting for 14 second(s)...\n",
- "Has been waiting for 15 second(s)...\n",
- "Has been waiting for 16 second(s)...\n",
- "Has been waiting for 17 second(s)...\n",
- "Has been waiting for 18 second(s)...\n",
- "Has been waiting for 19 second(s)...\n",
- "Has been waiting for 20 second(s)...\n",
- "Has been waiting for 21 second(s)...\n",
- "Has been waiting for 22 second(s)...\n",
- "Has been waiting for 23 second(s)...\n",
- "Has been waiting for 24 second(s)...\n",
- "Has been waiting for 25 second(s)...\n",
- "Has been waiting for 26 second(s)...\n",
- "Has been waiting for 27 second(s)...\n",
- "Has been waiting for 28 second(s)...\n",
- "Has been waiting for 29 second(s)...\n",
- "Has been waiting for 30 second(s)...\n",
- "Has been waiting for 31 second(s)...\n",
- "Has been waiting for 32 second(s)...\n",
- "Has been waiting for 33 second(s)...\n",
- "Has been waiting for 34 second(s)...\n",
- "Has been waiting for 35 second(s)...\n",
- "Has been waiting for 36 second(s)...\n",
- "Has been waiting for 37 second(s)...\n",
- "Has been waiting for 38 second(s)...\n",
- "Has been waiting for 39 second(s)...\n",
- "Has been waiting for 40 second(s)...\n",
- "Has been waiting for 41 second(s)...\n",
- "Has been waiting for 42 second(s)...\n",
- "Has been waiting for 43 second(s)...\n",
- "Has been waiting for 44 second(s)...\n",
- "Has been waiting for 45 second(s)...\n",
- "Has been waiting for 46 second(s)...\n",
- "Has been waiting for 47 second(s)...\n",
- "Has been waiting for 48 second(s)...\n",
- "Has been waiting for 49 second(s)...\n",
- "Has been waiting for 50 second(s)...\n",
- "Has been waiting for 51 second(s)...\n",
- "Has been waiting for 52 second(s)...\n",
- "Has been waiting for 53 second(s)...\n",
- "Has been waiting for 54 second(s)...\n",
- "Has been waiting for 55 second(s)...\n",
- "Has been waiting for 56 second(s)...\n",
- "Has been waiting for 57 second(s)...\n",
- "Has been waiting for 58 second(s)...\n",
- "Has been waiting for 59 second(s)...\n",
- "Has been waiting for 60 second(s)...\n",
- "Has been waiting for 61 second(s)...\n",
- "Has been waiting for 62 second(s)...\n",
- "Has been waiting for 63 second(s)...\n",
- "Has been waiting for 64 second(s)...\n",
- "Has been waiting for 65 second(s)...\n",
- "Has been waiting for 66 second(s)...\n",
- "Has been waiting for 67 second(s)...\n",
- "Has been waiting for 68 second(s)...\n",
- "Has been waiting for 69 second(s)...\n",
- "Has been waiting for 70 second(s)...\n",
- "Has been waiting for 71 second(s)...\n",
- "Has been waiting for 72 second(s)...\n",
- "Has been waiting for 73 second(s)...\n",
- "Has been waiting for 74 second(s)...\n",
- "Has been waiting for 75 second(s)...\n",
- "Has been waiting for 76 second(s)...\n",
- "Has been waiting for 77 second(s)...\n",
- "Has been waiting for 78 second(s)...\n",
- "Has been waiting for 79 second(s)...\n",
- "Has been waiting for 80 second(s)...\n",
- "Has been waiting for 81 second(s)...\n",
- "Has been waiting for 82 second(s)...\n",
- "Has been waiting for 83 second(s)...\n",
- "Has been waiting for 84 second(s)...\n",
- "Has been waiting for 85 second(s)...\n",
- "Has been waiting for 86 second(s)...\n",
- "Has been waiting for 87 second(s)...\n",
- "Has been waiting for 88 second(s)...\n",
- "Has been waiting for 89 second(s)...\n",
- "Has been waiting for 90 second(s)...\n",
- "Has been waiting for 91 second(s)...\n",
- "Has been waiting for 92 second(s)...\n",
- "Has been waiting for 93 second(s)...\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import threading\n",
"import time\n",
@@ -1467,18 +731,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "723389fb-ed7b-4c11-b430-c543af43666a",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/multiprocess_example.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/multiprocess_example.py\n",
"import multiprocessing\n",
@@ -1510,36 +766,10 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"id": "3e46e6e4-75e8-4f35-9fea-14b299502203",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/4\n",
- " \n",
- "Loading trace data from processes 1/4\n",
- " \n",
- "Loading trace data from processes 2/4\n",
- " \n",
- "Loading trace data from processes 3/4\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 29555\n",
- " \n",
- "Total Entries: 29555\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/multiprocess_example.py"
]
@@ -1562,18 +792,10 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"id": "333ae24a-9b35-4b97-b224-bf5dcdc99cbe",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/single_core_multi_thread_concurrent.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/single_core_multi_thread_concurrent.py\n",
"import concurrent.futures\n",
@@ -1610,63 +832,20 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"id": "699b56b1-5b88-4466-bbea-e58f757658d5",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Downloading itr3_english.pdf...\n",
- "Download complete for itr3_english.pdf!\n",
- "Downloading itr5_english.pdf...\n",
- "Downloading itr2_english.pdf...\n",
- "Download complete for itr5_english.pdf!\n",
- "Download complete for itr2_english.pdf!\n",
- "Downloading itr1_english.pdf...\n",
- "Downloading itr6_english.pdf...\n",
- "Downloading itr7_english.pdf...\n",
- "Download complete for itr1_english.pdf!\n",
- "Download complete for itr6_english.pdf!\n",
- "Download complete for itr7_english.pdf!\n",
- "Downloading itr4_english.pdf...\n",
- "Download complete for itr4_english.pdf!\n",
- "All downloads completed!\n",
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/1\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 154337\n",
- " \n",
- "Total Entries: 154337\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer example/single_core_multi_thread_concurrent.py"
]
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": null,
"id": "36a97443-2dfb-4fd7-85ae-d73d481f62b0",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Writing example/multiprocess_example_concurrent.py\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%%writefile example/multiprocess_example_concurrent.py\n",
"import concurrent.futures\n",
@@ -1697,38 +876,10 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": null,
"id": "819e02ef-9a4d-4d5b-8259-d535e8963456",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\u001b[93m--log_multiprocess and --log_subprocess are no longer needed to trace multi-process program\u001b[0m\n",
- "All prime number calculations completed!\n",
- "\n",
- " \n",
- "Saving trace data, this could take a while\n",
- " \n",
- "Loading trace data from processes 0/4\n",
- " \n",
- "Loading trace data from processes 1/4\n",
- " \n",
- "Loading trace data from processes 2/4\n",
- " \n",
- "Loading trace data from processes 3/4\n",
- " \n",
- "Combining trace data\n",
- " \n",
- "Dumping trace data, total entries: 33063\n",
- " \n",
- "Total Entries: 33063\n",
- "Use the following command to open the report:\n",
- "\u001b[92mvizviewer \"c:\\Users\\bhmiller\\OneDrive - Intel Corporation\\Documents\\GitHub\\intermediate-python\\content\\result.json\"\u001b[0m\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!viztracer --log_multiprocess example/multiprocess_example_concurrent.py"
]
diff --git a/content/14_python_builtin_cli.ipynb b/content/14_python_builtin_cli.ipynb
index 555d8a7..e536ed9 100644
--- a/content/14_python_builtin_cli.ipynb
+++ b/content/14_python_builtin_cli.ipynb
@@ -26,32 +26,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "83f54fa9-d481-4c2b-944c-b6ced5592e59",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "sys.path = [\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\content',\n",
- " 'C:\\\\Python311\\\\python311.zip',\n",
- " 'C:\\\\Python311\\\\DLLs',\n",
- " 'C:\\\\Python311\\\\Lib',\n",
- " 'C:\\\\Python311',\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\.venv',\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\.venv\\\\Lib\\\\site-packages',\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\.venv\\\\Lib\\\\site-packages\\\\win32',\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\.venv\\\\Lib\\\\site-packages\\\\win32\\\\lib',\n",
- " 'C:\\\\Source\\\\intermediate-python\\\\.venv\\\\Lib\\\\site-packages\\\\Pythonwin',\n",
- "]\n",
- "USER_BASE: 'C:\\\\Users\\\\debakarr\\\\AppData\\\\Roaming\\\\Python' (exists)\n",
- "USER_SITE: 'C:\\\\Users\\\\debakarr\\\\AppData\\\\Roaming\\\\Python\\\\Python311\\\\site-packages' (doesn't exist)\n",
- "ENABLE_USER_SITE: False\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"!python -m site"
]
@@ -275,4 +253,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
-}
\ No newline at end of file
+}