|
260 | 260 | },
|
261 | 261 | {
|
262 | 262 | "data": {
|
263 |
| - "application/javascript": [ |
264 |
| - "\n", |
265 |
| - " setTimeout(function() {\n", |
266 |
| - " var nbb_cell_id = 12;\n", |
267 |
| - " var nbb_unformatted_code = \"from box import Box\\n\\nfood_box = Box({\\\"food\\\": {\\\"fruit\\\": {\\\"name\\\": \\\"apple\\\", \\\"flavor\\\": \\\"sweet\\\"}}})\\nprint(food_box)\";\n", |
268 |
| - " var nbb_formatted_code = \"from box import Box\\n\\nfood_box = Box({\\\"food\\\": {\\\"fruit\\\": {\\\"name\\\": \\\"apple\\\", \\\"flavor\\\": \\\"sweet\\\"}}})\\nprint(food_box)\";\n", |
269 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
270 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
271 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
272 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
273 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
274 |
| - " }\n", |
275 |
| - " break;\n", |
276 |
| - " }\n", |
277 |
| - " }\n", |
278 |
| - " }, 500);\n", |
279 |
| - " " |
280 |
| - ], |
| 263 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 12;\n var nbb_unformatted_code = \"from box import Box\\n\\nfood_box = Box({\\\"food\\\": {\\\"fruit\\\": {\\\"name\\\": \\\"apple\\\", \\\"flavor\\\": \\\"sweet\\\"}}})\\nprint(food_box)\";\n var nbb_formatted_code = \"from box import Box\\n\\nfood_box = Box({\\\"food\\\": {\\\"fruit\\\": {\\\"name\\\": \\\"apple\\\", \\\"flavor\\\": \\\"sweet\\\"}}})\\nprint(food_box)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
281 | 264 | "text/plain": [
|
282 | 265 | "<IPython.core.display.Javascript object>"
|
283 | 266 | ]
|
|
313 | 296 | },
|
314 | 297 | {
|
315 | 298 | "data": {
|
316 |
| - "application/javascript": [ |
317 |
| - "\n", |
318 |
| - " setTimeout(function() {\n", |
319 |
| - " var nbb_cell_id = 13;\n", |
320 |
| - " var nbb_unformatted_code = \"print(food_box.food.fruit.name)\";\n", |
321 |
| - " var nbb_formatted_code = \"print(food_box.food.fruit.name)\";\n", |
322 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
323 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
324 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
325 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
326 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
327 |
| - " }\n", |
328 |
| - " break;\n", |
329 |
| - " }\n", |
330 |
| - " }\n", |
331 |
| - " }, 500);\n", |
332 |
| - " " |
333 |
| - ], |
| 299 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 13;\n var nbb_unformatted_code = \"print(food_box.food.fruit.name)\";\n var nbb_formatted_code = \"print(food_box.food.fruit.name)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
334 | 300 | "text/plain": [
|
335 | 301 | "<IPython.core.display.Javascript object>"
|
336 | 302 | ]
|
|
404 | 370 | },
|
405 | 371 | {
|
406 | 372 | "data": {
|
407 |
| - "application/javascript": [ |
408 |
| - "\n", |
409 |
| - " setTimeout(function() {\n", |
410 |
| - " var nbb_cell_id = 15;\n", |
411 |
| - " var nbb_unformatted_code = \"from time import time, sleep\\n\\n\\ndef time_func_complex(func):\\n def wrapper(*args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n return wrapper\\n\\n\\n@time_func_complex\\ndef test_func_complex():\\n sleep(1)\\n\\n\\ntest_func_complex()\";\n", |
412 |
| - " var nbb_formatted_code = \"from time import time, sleep\\n\\n\\ndef time_func_complex(func):\\n def wrapper(*args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n return wrapper\\n\\n\\n@time_func_complex\\ndef test_func_complex():\\n sleep(1)\\n\\n\\ntest_func_complex()\";\n", |
413 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
414 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
415 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
416 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
417 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
418 |
| - " }\n", |
419 |
| - " break;\n", |
420 |
| - " }\n", |
421 |
| - " }\n", |
422 |
| - " }, 500);\n", |
423 |
| - " " |
424 |
| - ], |
| 373 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 15;\n var nbb_unformatted_code = \"from time import time, sleep\\n\\n\\ndef time_func_complex(func):\\n def wrapper(*args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n return wrapper\\n\\n\\n@time_func_complex\\ndef test_func_complex():\\n sleep(1)\\n\\n\\ntest_func_complex()\";\n var nbb_formatted_code = \"from time import time, sleep\\n\\n\\ndef time_func_complex(func):\\n def wrapper(*args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n return wrapper\\n\\n\\n@time_func_complex\\ndef test_func_complex():\\n sleep(1)\\n\\n\\ntest_func_complex()\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
425 | 374 | "text/plain": [
|
426 | 375 | "<IPython.core.display.Javascript object>"
|
427 | 376 | ]
|
|
483 | 432 | },
|
484 | 433 | {
|
485 | 434 | "data": {
|
486 |
| - "application/javascript": [ |
487 |
| - "\n", |
488 |
| - " setTimeout(function() {\n", |
489 |
| - " var nbb_cell_id = 17;\n", |
490 |
| - " var nbb_unformatted_code = \"from decorator import decorator\\n\\n@decorator\\ndef time_func_simple(func, *args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n \\n@time_func_simple \\ndef test_func_simple():\\n sleep(1)\\n\\ntest_func()\";\n", |
491 |
| - " var nbb_formatted_code = \"from decorator import decorator\\n\\n\\n@decorator\\ndef time_func_simple(func, *args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n\\n@time_func_simple\\ndef test_func_simple():\\n sleep(1)\\n\\n\\ntest_func()\";\n", |
492 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
493 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
494 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
495 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
496 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
497 |
| - " }\n", |
498 |
| - " break;\n", |
499 |
| - " }\n", |
500 |
| - " }\n", |
501 |
| - " }, 500);\n", |
502 |
| - " " |
503 |
| - ], |
| 435 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 17;\n var nbb_unformatted_code = \"from decorator import decorator\\n\\n@decorator\\ndef time_func_simple(func, *args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n \\n@time_func_simple \\ndef test_func_simple():\\n sleep(1)\\n\\ntest_func()\";\n var nbb_formatted_code = \"from decorator import decorator\\n\\n\\n@decorator\\ndef time_func_simple(func, *args, **kwargs):\\n start_time = time()\\n func(*args, **kwargs)\\n end_time = time()\\n print(\\n f\\\"\\\"\\\"It takes {round(end_time - start_time, 3)} seconds to execute the function\\\"\\\"\\\"\\n )\\n\\n\\n@time_func_simple\\ndef test_func_simple():\\n sleep(1)\\n\\n\\ntest_func()\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
504 | 436 | "text/plain": [
|
505 | 437 | "<IPython.core.display.Javascript object>"
|
506 | 438 | ]
|
|
1259 | 1191 | },
|
1260 | 1192 | {
|
1261 | 1193 | "data": {
|
1262 |
| - "application/javascript": [ |
1263 |
| - "\n", |
1264 |
| - " setTimeout(function() {\n", |
1265 |
| - " var nbb_cell_id = 33;\n", |
1266 |
| - " var nbb_unformatted_code = \"# find the difference between two dictionaries\\nresult = diff(user1, user2)\\nlist(result)\";\n", |
1267 |
| - " var nbb_formatted_code = \"# find the difference between two dictionaries\\nresult = diff(user1, user2)\\nlist(result)\";\n", |
1268 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
1269 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
1270 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
1271 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
1272 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
1273 |
| - " }\n", |
1274 |
| - " break;\n", |
1275 |
| - " }\n", |
1276 |
| - " }\n", |
1277 |
| - " }, 500);\n", |
1278 |
| - " " |
1279 |
| - ], |
| 1194 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 33;\n var nbb_unformatted_code = \"# find the difference between two dictionaries\\nresult = diff(user1, user2)\\nlist(result)\";\n var nbb_formatted_code = \"# find the difference between two dictionaries\\nresult = diff(user1, user2)\\nlist(result)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
1280 | 1195 | "text/plain": [
|
1281 | 1196 | "<IPython.core.display.Javascript object>"
|
1282 | 1197 | ]
|
|
1315 | 1230 | },
|
1316 | 1231 | {
|
1317 | 1232 | "data": {
|
1318 |
| - "application/javascript": [ |
1319 |
| - "\n", |
1320 |
| - " setTimeout(function() {\n", |
1321 |
| - " var nbb_cell_id = 34;\n", |
1322 |
| - " var nbb_unformatted_code = \"# swap the diff result\\nresult = diff(user1, user2)\\nswapped = swap(result)\\nlist(swapped)\";\n", |
1323 |
| - " var nbb_formatted_code = \"# swap the diff result\\nresult = diff(user1, user2)\\nswapped = swap(result)\\nlist(swapped)\";\n", |
1324 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
1325 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
1326 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
1327 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
1328 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
1329 |
| - " }\n", |
1330 |
| - " break;\n", |
1331 |
| - " }\n", |
1332 |
| - " }\n", |
1333 |
| - " }, 500);\n", |
1334 |
| - " " |
1335 |
| - ], |
| 1233 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 34;\n var nbb_unformatted_code = \"# swap the diff result\\nresult = diff(user1, user2)\\nswapped = swap(result)\\nlist(swapped)\";\n var nbb_formatted_code = \"# swap the diff result\\nresult = diff(user1, user2)\\nswapped = swap(result)\\nlist(swapped)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
1336 | 1234 | "text/plain": [
|
1337 | 1235 | "<IPython.core.display.Javascript object>"
|
1338 | 1236 | ]
|
|
2110 | 2008 | "celltoolbar": "Tags",
|
2111 | 2009 | "hide_input": false,
|
2112 | 2010 | "kernelspec": {
|
2113 |
| - "display_name": "Python 3 (ipykernel)", |
| 2011 | + "display_name": "venv", |
2114 | 2012 | "language": "python",
|
2115 | 2013 | "name": "python3"
|
2116 | 2014 | },
|
|
0 commit comments