Created
December 8, 2022 17:04
-
-
Save PiotrCzapla/1ff0fa083e8a4ca657ad86b1942abf42 to your computer and use it in GitHub Desktop.
Cleaning up after unhandled exception in jupyter notebooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import torch" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import weakref, traceback" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"True" | |
] | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"torch.backends.mps.is_available()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"1" | |
] | |
}, | |
"execution_count": 24, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"t = { 1,2,3}\n", | |
"import gc\n", | |
"len (gc.get_referrers(t))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 25, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"dict_keys(['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__builtin__', '__builtins__', '_ih', '_oh', '_dh', 'In', 'Out', 'get_ipython', 'exit', 'quit', '_', '__', '___', 'sys', 'os', '__vsc_ipynb_file__', '_i', '_ii', '_iii', '_i1', 'torch', '_i2', 'weakref', 'traceback', '_i3', '_3', '_i4', 't', 'gc', '_4', '_i5', '_5', '_i6', '_6', '_i7', '_i8', 'tensors', 'print_tensor_size', '_i9', '_i10', 'test_exception_raise', 'allocate_tensor', '_i11', 'clean_up', '_i12', 'types', 'hiddenref', '_i13', 'dump_holders', '_i14', 'get_holders', '_i15', '_i16', '_i17', 'find_type', 'find_tracebacks', '_i18', 'ex_reference_path', 'tb', '_i19', '_i20', 'print_ref_graph', '_i21', '_i22', '_i23', '_23', '_i24', '_24', '_i25'])" | |
] | |
}, | |
"execution_count": 25, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"gc.get_referrers(t)[0].keys()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[(None, '__main__')]" | |
] | |
}, | |
"execution_count": 26, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"[(o['__package__'],o['__name__']) for o in gc.get_referrers(t)]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import sys" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 28, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"4809481632 torch.Size([10000, 10000]) 4\n" | |
] | |
} | |
], | |
"source": [ | |
"\n", | |
"import gc\n", | |
"def tensors():\n", | |
" objs = gc.get_objects()\n", | |
" for v in objs:\n", | |
" if isinstance(v, torch.Tensor):\n", | |
" yield weakref.ref(v)\n", | |
"\n", | |
"def print_tensor_size(message=\"\"):\n", | |
" gc.collect()\n", | |
" if message: print(message)\n", | |
" for v in tensors():\n", | |
" if isinstance(v(), torch.Tensor):\n", | |
" print( id(v()), v().shape, len(gc.get_referrers(v())))\n", | |
" #show_holders(v)\n", | |
" \n", | |
" gc.collect()\n", | |
"\n", | |
"print_tensor_size()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 29, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# [type(o) for l in gc.get_referrers(t) for o in l]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 30, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def test_exception_raise(should_raise=False):\n", | |
" try:\n", | |
" allocate_tensor(should_raise)\n", | |
" finally:\n", | |
" print_tensor_size('Finally block')\n", | |
" \n", | |
"def allocate_tensor(should_raise=False): \n", | |
" x = torch.rand(10000, 10000)\n", | |
" print_tensor_size('after allocation') \n", | |
" x *= 2\n", | |
" if should_raise:\n", | |
" raise Exception('I am a bad function')\n", | |
" return x" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 31, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def clean_up():\n", | |
" import sys, gc, traceback\n", | |
" if 'last_traceback' in sys.__dict__:\n", | |
" print(sys.last_traceback)\n", | |
" print(get_ipython().InteractiveTB.tb)\n", | |
" traceback.clear_frames(sys.last_traceback)\n", | |
" del sys.last_traceback \n", | |
" if 'last_type' in sys.__dict__: del sys.last_type\n", | |
" if 'last_value' in sys.__dict__: del sys.last_value\n", | |
" gc.collect()\n", | |
"# above code translated to use hasttr and delattr\n", | |
"\n", | |
"# def clean_up():\n", | |
"# import sys, gc, traceback\n", | |
"# if hasattr(sys, 'last_traceback'):\n", | |
"# traceback.clear_frames(sys.last_traceback)\n", | |
"# delattr(sys, 'last_traceback')\n", | |
"# if hasattr(sys, 'last_type'): delattr(sys, 'last_type')\n", | |
"# if hasattr(sys, 'last_value'): delattr(sys, 'last_value')\n", | |
"# gc.collect() \n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 32, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import types\n", | |
"class hiddenref:\n", | |
" def __new__(cls, r):\n", | |
" try:\n", | |
" return weakref.ref(r)\n", | |
" except:\n", | |
" self = super().__new__(cls)\n", | |
" self.hiddenref=r\n", | |
" def __call__(self):\n", | |
" return self.hiddenref" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 33, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def dump_holders(v, t, f=repr):\n", | |
" for r in gc.get_referrers(v()):\n", | |
" if str(t) in str(type(r)):\n", | |
" v = f(r)\n", | |
" if v:\n", | |
" print(v[:400])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def get_holders(v, t):\n", | |
" for r in gc.get_referrers(v()):\n", | |
" if str(t) in str(type(r)):\n", | |
" if isinstance(r, dict) and 'hiddenref' in r: continue\n", | |
" yield hiddenref(r)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 35, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"after allocation\n", | |
"4809481632 torch.Size([10000, 10000]) 4\n", | |
"4808024016 torch.Size([10000, 10000]) 2\n", | |
"Finally block\n", | |
"4809481632 torch.Size([10000, 10000]) 4\n", | |
"Outside\n", | |
"4809481632 torch.Size([10000, 10000]) 4\n" | |
] | |
} | |
], | |
"source": [ | |
"test_exception_raise()\n", | |
"print_tensor_size('Outside')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 36, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"after allocation\n", | |
"4809481632 torch.Size([10000, 10000]) 4\n", | |
"4802386880 torch.Size([10000, 10000]) 2\n", | |
"Finally block\n", | |
"4809481632 torch.Size([10000, 10000]) 4\n", | |
"4802386880 torch.Size([10000, 10000]) 3\n" | |
] | |
}, | |
{ | |
"ename": "Exception", | |
"evalue": "I am a bad function", | |
"output_type": "error", | |
"traceback": [ | |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | |
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 16\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m test_exception_raise(should_raise\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 16\u001b[0m in \u001b[0;36mtest_exception_raise\u001b[0;34m(should_raise)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mtest_exception_raise\u001b[39m(should_raise\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m):\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m allocate_tensor(should_raise)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m print_tensor_size(\u001b[39m'\u001b[39m\u001b[39mFinally block\u001b[39m\u001b[39m'\u001b[39m)\n", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 16\u001b[0m in \u001b[0;36mallocate_tensor\u001b[0;34m(should_raise)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m x \u001b[39m*\u001b[39m\u001b[39m=\u001b[39m \u001b[39m2\u001b[39m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39mif\u001b[39;00m should_raise:\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mException\u001b[39;00m(\u001b[39m'\u001b[39m\u001b[39mI am a bad function\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X22sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m \u001b[39mreturn\u001b[39;00m x\n", | |
"\u001b[0;31mException\u001b[0m: I am a bad function" | |
] | |
} | |
], | |
"source": [ | |
"test_exception_raise(should_raise=True)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 37, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import types\n", | |
"\n", | |
"def find_type(variables, type, along_type=None, debug=False):\n", | |
" seen = set()\n", | |
" objs = []\n", | |
" \n", | |
" q = [v() if isinstance(v, (weakref.ref,hiddenref)) else v for v in variables]\n", | |
" while q:\n", | |
" v = q.pop()\n", | |
" gc.collect()\n", | |
" for r in gc.get_referrers(v):\n", | |
" if id(r) in seen: continue\n", | |
" seen.add(id(r))\n", | |
" \n", | |
" if debug: print(type(r), id(r))\n", | |
" if isinstance(r, dict) and 'hiddenref' in r: continue\n", | |
" if isinstance(r, type):\n", | |
" objs.append(r)\n", | |
" else:\n", | |
" if debug: print(len(q), len(seen))\n", | |
" if along_type and isinstance(r, along_type):\n", | |
" q.append(r)\n", | |
" if debug: print('q',len(q), [id(v) for v in q])\n", | |
" return objs\n", | |
"\n", | |
"def find_tracebacks(*variables):\n", | |
" frames = find_type(variables, types.FrameType, debug=False)\n", | |
" tracebacks = find_type(frames, types.TracebackType, types.FrameType, debug=False)\n", | |
" return list(set(tracebacks))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 38, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"traceback test_exception_raise 4799405888\n", | |
" traceback <cell line: 1> 5068031040\n", | |
" traceback run_code 5068041408\n", | |
" <class 'dict'> last_traceback\n", | |
" <class 'Exception'> 4808441616\n", | |
" 4306726464 cycle, skipping\n", | |
" <class 'dict'> error_in_exec\n", | |
" <class 'IPython.core.interactiveshell.ExecutionResult'> 5070315984\n", | |
" frame run_code\n", | |
" 5068041408 cycle, skipping\n", | |
" frame <cell line: 1>\n", | |
" 5068031040 cycle, skipping\n", | |
" frame test_exception_raise\n", | |
" 4799405888 cycle, skipping\n", | |
" frame allocate_tensor\n", | |
" traceback allocate_tensor 4736199296\n", | |
" 4358453760 cycle, skipping\n", | |
" 4799405888 cycle, skipping\n", | |
" <class 'list'> 0\n", | |
" <class 'tuple'> 1\n", | |
" <class 'list_iterator'> 5072358848\n", | |
"-- Starting over\n", | |
" <class 'IPython.core.ultratb.AutoFormattedTB'> 4358465776\n", | |
" <class 'dict'> InteractiveTB\n", | |
" <class 'ipykernel.zmqshell.ZMQInteractiveShell'> 4358460208\n", | |
" <class 'dict'> _instance\n", | |
" <class 'method'> get_ipython\n", | |
" <class 'method'> _clear_warning_registry\n", | |
" <class 'method'> editor\n", | |
" <class 'method'> synchronize_with_editor\n", | |
" <class 'method'> show_in_pager\n", | |
" <class 'method'> <lambda>\n", | |
" <class 'method'> pre_prompt_hook\n", | |
" <class 'method'> clipboard_get\n", | |
" <class 'method'> dummy_handler\n", | |
" <class 'method'> get_ipython\n", | |
" <class 'method'> module_completer\n", | |
" <class 'method'> module_completer\n", | |
" <class 'method'> magic_run_completer\n", | |
" <class 'method'> cd_completer\n", | |
" <class 'method'> reset_completer\n", | |
" <class 'method'> module_completer\n", | |
" <class 'method'> atexit_operations\n", | |
" <class 'method'> _showtraceback\n", | |
" <class 'method'> run_cell\n", | |
" <class 'method'> run_cell\n", | |
" <class 'method'> excepthook\n", | |
" <class 'method'> run_cell_async\n", | |
" <class 'method'> should_run_async\n", | |
" <class 'cell'> 4367959040\n", | |
" <class 'cell'> 5070567552\n", | |
" 4800719520 cycle, skipping\n", | |
" frame run_cell_async\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'function'> error_before_exec\n", | |
" 4360299568 cycle, skipping\n", | |
"------------------------------ Starting over\n", | |
" frame <cell line: 1>\n", | |
" frame test_exception_raise\n", | |
" frame allocate_tensor\n", | |
" traceback allocate_tensor 4807687872\n", | |
" 4814807616 cycle, skipping\n", | |
" traceback test_exception_raise 4802244864\n", | |
" <class 'tuple'> 1\n", | |
" <class 'list'> 93\n", | |
"----------------------------------- Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"----------------------------------- Starting over\n", | |
" <class 'tuple'> 1\n", | |
" <class 'Exception'> 4808676016\n", | |
" <class 'dict'> error_in_exec\n", | |
" <class 'IPython.core.interactiveshell.ExecutionResult'> 5067852240\n", | |
" frame run_code\n", | |
" 4830216640 cycle, skipping\n", | |
" traceback run_code 4479959872\n", | |
" 5780368192 cycle, skipping\n", | |
" 4808676016 cycle, skipping\n", | |
"-------------------------------- Starting over\n", | |
" traceback <cell line: 1> 4364014912\n", | |
" 5780359936 cycle, skipping\n", | |
" 4479959872 cycle, skipping\n", | |
"------------------------------- Starting over\n", | |
" 4479959872 cycle, skipping\n", | |
"------------------------------ Starting over\n", | |
" 4808676016 cycle, skipping\n", | |
"------------------------- Starting over\n", | |
" <class 'coroutine'> run_code\n", | |
"------------------------- Starting over\n", | |
" <class 'coroutine'> run_ast_nodes\n", | |
"------------------------- Starting over\n", | |
" 5780147328 cycle, skipping\n", | |
"----------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.extensions.storemagic.StoreMagics'> 4358830016\n", | |
" <class 'list'> 30\n", | |
" <class 'method'> store\n", | |
" <class 'dict'> store\n", | |
" <class 'dict'> line\n", | |
" <class 'dict'> magics\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicsManager'> 4358466784\n", | |
" <class 'dict'> magics_manager\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'method'> register\n", | |
" 4358454208 cycle, skipping\n", | |
"----------------------------- Starting over\n", | |
" <class 'IPython.core.alias.AliasManager'> 4358466880\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
"---------------------------- Starting over\n", | |
" <class 'dict'> line\n", | |
" 4358799616 cycle, skipping\n", | |
"-------------------------- Starting over\n", | |
" 4358724544 cycle, skipping\n", | |
"----------------------- Starting over\n", | |
" 4358830016 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.payload.PayloadManager'> 4358826416\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.extensions.ExtensionManager'> 4358470384\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'method'> _on_ipython_dir_changed\n", | |
" <class 'list'> 1\n", | |
" <class 'dict'> change\n", | |
" <class 'dict'> ipython_dir\n", | |
" 4358454208 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358826560\n", | |
" <class 'dict'> lx\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.UserMagics'> 4358466688\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358724544 cycle, skipping\n", | |
" <class 'dict'> UserMagics\n", | |
" 4358724544 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358826752\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358827040\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358826944\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358825216\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358469952\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358469856\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358470096\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358470288\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358470432\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358470192\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.alias.Alias'> 4358470624\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358466880 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358470912\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'ipykernel.zmqshell.KernelMagics'> 4358470672\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> edit\n", | |
" <class 'method'> clear\n", | |
" <class 'method'> less\n", | |
" <class 'method'> less\n", | |
" <class 'method'> man\n", | |
" <class 'method'> connect_info\n", | |
" <class 'method'> qtconsole\n", | |
" <class 'method'> autosave\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> autosave\n", | |
" <class 'dict'> line\n", | |
" 4358848704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" 4358470672 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358470576\n", | |
" 4358723264 cycle, skipping\n", | |
" <class 'dict'> file\n", | |
" 4358449472 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358470960\n", | |
" 4358723264 cycle, skipping\n", | |
" 4358723968 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358470816\n", | |
" 4358723264 cycle, skipping\n", | |
" 4358723968 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358468752\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'IPython.core.magic.MagicAlias'> 4358470864\n", | |
" 4358723264 cycle, skipping\n", | |
" 4352336704 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.basic.AsyncMagics'> 4358467552\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> autoawait\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> autoawait\n", | |
" <class 'dict'> line\n", | |
" 4358857536 cycle, skipping\n", | |
"--------------------- Starting over\n", | |
" 4358467552 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.script.ScriptMagics'> 4358467504\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> killbgscripts\n", | |
" <class 'method'> shebang\n", | |
" <class 'cell'> 4358467744\n", | |
" <class 'cell'> 4358469712\n", | |
" <class 'cell'> 4358471008\n", | |
" <class 'cell'> 4358817152\n", | |
" <class 'cell'> 4358819168\n", | |
" <class 'cell'> 4358821184\n", | |
" <class 'method'> kill_bg_processes\n", | |
" <class 'cell'> 4358467600\n", | |
" <class 'cell'> 4358823200\n", | |
" <class 'tuple'> 1\n", | |
" <class 'function'> named_script_magic\n", | |
" 4358723968 cycle, skipping\n", | |
" <class 'dict'> pypy\n", | |
" <class 'dict'> cell\n", | |
" 4358771840 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467504 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.pylab.PylabMagics'> 4358467456\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> matplotlib\n", | |
" <class 'method'> pylab\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> pylab\n", | |
" <class 'dict'> line\n", | |
" 4358770944 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467456 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.packaging.PackagingMagics'> 4358467408\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> pip\n", | |
" <class 'method'> conda\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> conda\n", | |
" <class 'dict'> line\n", | |
" 4358769728 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467408 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.osm.OSMagics'> 4358467360\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> alias\n", | |
" <class 'method'> unalias\n", | |
" <class 'method'> rehashx\n", | |
" <class 'method'> pwd\n", | |
" <class 'method'> cd\n", | |
" <class 'method'> env\n", | |
" <class 'method'> set_env\n", | |
" <class 'method'> pushd\n", | |
" <class 'method'> popd\n", | |
" <class 'method'> dirs\n", | |
" <class 'method'> dhist\n", | |
" <class 'method'> sc\n", | |
" <class 'method'> sx\n", | |
" <class 'method'> sx\n", | |
" <class 'method'> bookmark\n", | |
" <class 'method'> pycat\n", | |
" <class 'method'> sx\n", | |
" <class 'method'> sx\n", | |
" <class 'method'> sx\n", | |
" <class 'method'> writefile\n", | |
" 4358723968 cycle, skipping\n", | |
" <class 'dict'> writefile\n", | |
" <class 'dict'> cell\n", | |
" 4358768384 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467360 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.namespace.NamespaceMagics'> 4358467312\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> pinfo\n", | |
" <class 'method'> pinfo2\n", | |
" <class 'method'> pdef\n", | |
" <class 'method'> pdoc\n", | |
" <class 'method'> psource\n", | |
" <class 'method'> pfile\n", | |
" <class 'method'> psearch\n", | |
" <class 'method'> who_ls\n", | |
" <class 'method'> who\n", | |
" <class 'method'> whos\n", | |
" <class 'method'> reset\n", | |
" <class 'method'> reset_selective\n", | |
" <class 'method'> xdel\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> xdel\n", | |
" <class 'dict'> line\n", | |
" 4358766848 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467312 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.logging.LoggingMagics'> 4358467216\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> logstart\n", | |
" <class 'method'> logstop\n", | |
" <class 'method'> logoff\n", | |
" <class 'method'> logon\n", | |
" <class 'method'> logstate\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> logstate\n", | |
" <class 'dict'> line\n", | |
" 4358733056 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467216 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.history.HistoryMagics'> 4358467264\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> history\n", | |
" <class 'method'> recall\n", | |
" <class 'method'> rerun\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> rerun\n", | |
" <class 'dict'> line\n", | |
" 4358732160 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467264 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.extension.ExtensionMagics'> 4358467168\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> load_ext\n", | |
" <class 'method'> unload_ext\n", | |
" <class 'method'> reload_ext\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> reload_ext\n", | |
" <class 'dict'> line\n", | |
" 4358731072 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467168 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.execution.ExecutionMagics'> 4358467072\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> prun\n", | |
" <class 'method'> pdb\n", | |
" <class 'method'> debug\n", | |
" <class 'method'> tb\n", | |
" <class 'method'> run\n", | |
" <class 'method'> timeit\n", | |
" <class 'method'> time\n", | |
" <class 'method'> macro\n", | |
" <class 'method'> prun\n", | |
" <class 'method'> debug\n", | |
" <class 'method'> timeit\n", | |
" <class 'method'> time\n", | |
" <class 'method'> capture\n", | |
" 4358723968 cycle, skipping\n", | |
" <class 'dict'> capture\n", | |
" <class 'dict'> cell\n", | |
" 4358729664 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467072 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.display.DisplayMagics'> 4358467120\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> javascript\n", | |
" <class 'method'> latex\n", | |
" <class 'method'> svg\n", | |
" <class 'method'> html\n", | |
" <class 'method'> markdown\n", | |
" <class 'method'> js\n", | |
" <class 'dict'> js\n", | |
" 4358723968 cycle, skipping\n", | |
" <class 'dict'> cell\n", | |
" 4358727552 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467120 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.config.ConfigMagics'> 4358467024\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> config\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> config\n", | |
" <class 'dict'> line\n", | |
" 4358727616 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358467024 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.code.CodeMagics'> 4358466448\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> save\n", | |
" <class 'method'> pastebin\n", | |
" <class 'method'> loadpy\n", | |
" <class 'method'> load\n", | |
" <class 'method'> edit\n", | |
" <class 'dict'> edit\n", | |
" <class 'dict'> line\n", | |
" 4358727424 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358466448 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.basic.BasicMagics'> 4358466832\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> alias_magic\n", | |
" <class 'method'> lsmagic\n", | |
" <class 'method'> magic\n", | |
" <class 'method'> page\n", | |
" <class 'method'> pprint\n", | |
" <class 'method'> colors\n", | |
" <class 'method'> xmode\n", | |
" <class 'method'> quickref\n", | |
" <class 'method'> doctest_mode\n", | |
" <class 'method'> gui\n", | |
" <class 'method'> precision\n", | |
" <class 'method'> notebook\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> notebook\n", | |
" <class 'dict'> line\n", | |
" 4358726016 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358466832 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.magics.auto.AutoMagics'> 4358466544\n", | |
" 4358397248 cycle, skipping\n", | |
" 4358725120 cycle, skipping\n", | |
" <class 'method'> autocall\n", | |
" <class 'method'> automagic\n", | |
" <class 'dict'> automagic\n", | |
" 4352336704 cycle, skipping\n", | |
" <class 'dict'> line\n", | |
" 4352565760 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358466544 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358466784 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358723264 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358466688 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'ipykernel.displayhook.ZMQShellDisplayHook'> 4358466640\n", | |
" 4306726464 cycle, skipping\n", | |
" 4358454208 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'dict'> hook\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.display_trap.DisplayTrap'> 4358466736\n", | |
" 4358454144 cycle, skipping\n", | |
" <class 'method'> __exit__\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'ipykernel.zmqshell.ZMQDisplayPublisher'> 4358466592\n", | |
" 4358454208 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" 4358466592 cycle, skipping\n", | |
"-------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.DisplayFormatter'> 4358466496\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'dict'> parent\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.IPythonDisplayFormatter'> 4369324144\n", | |
" <class 'dict'> ipython_display_formatter\n", | |
" 4358721408 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.PlainTextFormatter'> 5068049040\n", | |
" <class 'dict'> text/plain\n", | |
" <class 'cell'> 5068049664\n", | |
" <class 'tuple'> 0\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'function'> <lambda>\n", | |
" <class 'dict'> <class 'numpy.float64'>\n", | |
" <class 'dict'> type_printers\n", | |
" 4808104640 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.JavascriptFormatter'> 5068050576\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.JSONFormatter'> 5068050528\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.LatexFormatter'> 5068050480\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.JPEGFormatter'> 5068050432\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.PDFFormatter'> 5068050384\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.PNGFormatter'> 5068050336\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.SVGFormatter'> 5068050288\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.MarkdownFormatter'> 5068049136\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.HTMLFormatter'> 5068048704\n", | |
" 4807996352 cycle, skipping\n", | |
"---------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.formatters.MimeBundleFormatter'> 4369324768\n", | |
" 4358721280 cycle, skipping\n", | |
"------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358465776 cycle, skipping\n", | |
"------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.ultratb.SyntaxTB'> 4358465296\n", | |
" 4358454208 cycle, skipping\n", | |
"------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'tuple'> 1\n", | |
" <class 'IPython.core.completer.IPCompleter'> 4358463280\n", | |
" 4358454208 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'method'> _clean_glob\n", | |
" <class 'method'> magic_color_matches\n", | |
" <class 'method'> magic_config_matches\n", | |
" <class 'list'> 0\n", | |
" 4358683520 cycle, skipping\n", | |
"------------- Starting over\n", | |
" 4358463280 cycle, skipping\n", | |
"------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.utils.PyColorize.Parser'> 4358461600\n", | |
" <class 'method'> format\n", | |
" <class 'cell'> 4358461696\n", | |
" <class 'tuple'> 0\n", | |
" <class 'function'> <lambda>\n", | |
" 4358454208 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.prefilter.PrefilterHandler'> 4358461744\n", | |
" <class 'dict'> normal\n", | |
" <class 'dict'> _handlers\n", | |
" <class 'IPython.core.prefilter.PrefilterManager'> 4358461552\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'dict'> parent\n", | |
" <class 'method'> prefilter_lines\n", | |
" 4358454208 cycle, skipping\n", | |
"------------- Starting over\n", | |
" 4358080448 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.AutocallChecker'> 4358462416\n", | |
" <class 'list'> 6\n", | |
" 4358670528 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.PythonOpsChecker'> 4358462368\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.AutoMagicChecker'> 4358462320\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.AssignmentChecker'> 4358462272\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.IPyAutocallChecker'> 4358462224\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.MacroChecker'> 4358462176\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.EmacsChecker'> 4358462128\n", | |
" 4358673152 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.EmacsHandler'> 4358462080\n", | |
" 4358669632 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.AutoHandler'> 4358462032\n", | |
" 4358669632 cycle, skipping\n", | |
" <class 'dict'> /\n", | |
" 4358670528 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'tuple'> 1\n", | |
" 4814814720 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'IPython.core.prefilter.MagicHandler'> 4358461984\n", | |
" 4358669632 cycle, skipping\n", | |
" 4358670464 cycle, skipping\n", | |
"------ Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.builtin_trap.BuiltinTrap'> 4358463184\n", | |
" 4358454144 cycle, skipping\n", | |
" <class 'method'> __exit__\n", | |
"------ Starting over\n", | |
" <class 'IPython.core.autocall.ZMQExitAutocall'> 4358463088\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358453760 cycle, skipping\n", | |
" <class 'dict'> exit\n", | |
" 4358454208 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'IPython.core.events.EventManager'> 4358462848\n", | |
" 4358454208 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462416 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462368 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462320 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462272 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462224 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462176 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462128 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462080 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358462032 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" 4358461984 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.prefilter.MacroHandler'> 4358461792\n", | |
" 4358669632 cycle, skipping\n", | |
"----- Starting over\n", | |
" 4358670528 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'IPython.core.history.HistoryManager'> 4358460880\n", | |
" 4358454144 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'dict'> history_manager\n", | |
" <class 'IPython.core.history.HistorySavingThread'> 4358460976\n", | |
" <class 'dict'> 6269448192\n", | |
" <class 'method'> stop\n", | |
" <class 'method'> _bootstrap\n", | |
" notfound <class 'tuple'>\n", | |
" notfound <class 'tuple'>\n", | |
" notfound <class 'tuple'>\n", | |
"--------- Starting over\n", | |
" 4358668864 cycle, skipping\n", | |
"----- Starting over\n", | |
" 4358454208 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'ipykernel.ipkernel.IPythonKernel'> 4358459008\n", | |
" <class 'dict'> _instance\n", | |
" <class 'method'> complete_request\n", | |
" <class 'method'> inspect_request\n", | |
" <class 'method'> history_request\n", | |
" <class 'method'> comm_info_request\n", | |
" <class 'method'> kernel_info_request\n", | |
" <class 'method'> connect_request\n", | |
" <class 'method'> shutdown_request\n", | |
" <class 'method'> is_complete_request\n", | |
" <class 'method'> interrupt_request\n", | |
" <class 'method'> apply_request\n", | |
" <class 'method'> complete_request\n", | |
" <class 'method'> inspect_request\n", | |
" <class 'method'> history_request\n", | |
" <class 'method'> comm_info_request\n", | |
" <class 'method'> kernel_info_request\n", | |
" <class 'method'> connect_request\n", | |
" <class 'method'> shutdown_request\n", | |
" <class 'method'> is_complete_request\n", | |
" <class 'method'> interrupt_request\n", | |
" <class 'method'> apply_request\n", | |
" <class 'method'> clear_request\n", | |
" <class 'method'> abort_request\n", | |
" <class 'method'> debug_request\n", | |
" <class 'method'> usage_request\n", | |
" 4358454144 cycle, skipping\n", | |
" <class 'method'> execute_request\n", | |
" <class 'method'> execute_request\n", | |
" <class 'method'> _publish_debug_event\n", | |
" <class 'cell'> 4358457568\n", | |
" <class 'method'> dispatch_control\n", | |
" <class 'method'> dispatch_debugpy\n", | |
" <class 'method'> schedule_dispatch\n", | |
" <class 'method'> dispatch_shell\n", | |
" <class 'method'> raw_input\n", | |
" <class 'method'> getpass\n", | |
" <class 'dict'> getpass\n", | |
" module getpass\n", | |
" <class 'function'> unix_getpass\n", | |
" <class 'function'> win_getpass\n", | |
" <class 'function'> fallback_getpass\n", | |
" <class 'function'> _raw_input\n", | |
" <class 'function'> getuser\n", | |
" 4327957056 cycle, skipping\n", | |
"----------------------------------------- Starting over\n", | |
" <class 'coroutine'> poll_control_queue\n", | |
" <class '_asyncio.Task'> 4363423664\n", | |
" <class 'builtin_function_or_method'> task_wakeup\n", | |
" <class 'cell'> 4363980320\n", | |
" <class 'tuple'> 1\n", | |
" <class 'function'> _call_check_cancel\n", | |
" <class 'list'> 0\n", | |
" <class 'dict'> _done_callbacks\n", | |
" <class 'concurrent.futures._base.Future'> 4363979648\n", | |
" <class 'cell'> 4363978400\n", | |
" <class 'tuple'> 2\n", | |
" <class 'function'> _call_set_state\n", | |
"--------------------------------------- Starting over\n", | |
" <class 'coroutine'> do_execute\n", | |
" frame execute_request\n", | |
" 5780370624 cycle, skipping\n", | |
" <class 'coroutine'> execute_request\n", | |
" frame dispatch_shell\n", | |
" 5780364864 cycle, skipping\n", | |
" <class 'coroutine'> dispatch_shell\n", | |
" 4360301392 cycle, skipping\n", | |
"----------------------------------------- Starting over\n", | |
" 5079085376 cycle, skipping\n", | |
"--------------------------------------- Starting over\n", | |
" 5079082912 cycle, skipping\n", | |
" frame do_execute\n", | |
" 5079085376 cycle, skipping\n", | |
"--------------------------------------- Starting over\n", | |
" 5070259696 cycle, skipping\n", | |
" 4360301392 cycle, skipping\n", | |
"--------------------------------------- Starting over\n", | |
" <class 'coroutine'> process_one\n", | |
" 4349464944 cycle, skipping\n", | |
"---------------------------------- Starting over\n", | |
" <class 'coroutine'> poll_stopped_queue\n", | |
" <class '_asyncio.Task'> 4363423872\n", | |
" <class 'builtin_function_or_method'> task_wakeup\n", | |
" <class 'cell'> 4363980272\n", | |
" <class 'tuple'> 1\n", | |
" <class 'function'> _call_check_cancel\n", | |
" <class 'list'> 0\n", | |
" <class 'dict'> _done_callbacks\n", | |
" <class 'concurrent.futures._base.Future'> 4363979984\n", | |
" <class 'cell'> 4363980128\n", | |
" <class 'tuple'> 2\n", | |
" <class 'function'> _call_set_state\n", | |
"---------------------------------- Starting over\n", | |
" <class 'coroutine'> dispatch_queue\n", | |
" <class '_asyncio.Task'> 4363424080\n", | |
" <class 'dict'> <_UnixSelectorEventLoop running=True closed=False debug=False>\n", | |
" <class 'cell'> 4358825168\n", | |
" <class 'builtin_function_or_method'> task_wakeup\n", | |
" <class 'asyncio.events.Handle'> 5079540608\n", | |
" notfound <class 'tuple'>\n", | |
"---------------------------------- Starting over\n", | |
" 4367489328 cycle, skipping\n", | |
" 4349464944 cycle, skipping\n", | |
"---------------------------------- Starting over\n", | |
" <class 'dict'> _trait_values\n", | |
" <class 'ipykernel.comm.manager.CommManager'> 4358826656\n", | |
" 4358449024 cycle, skipping\n", | |
" 4358397248 cycle, skipping\n", | |
" <class 'method'> comm_open\n", | |
" <class 'method'> comm_msg\n", | |
" <class 'method'> comm_close\n", | |
" <class 'dict'> comm_close\n", | |
" 4358449024 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.MetaHasTraits'> IPythonKernel\n", | |
" <class 'dict'> IPythonKernel\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'traitlets.traitlets.MetaHasTraits'> Kernel\n", | |
" <class 'tuple'> 0\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'cell'> 4346563696\n", | |
" 4358459008 cycle, skipping\n", | |
" <class 'tuple'> 0\n", | |
" notfound <class 'tuple'>\n", | |
" notfound <class 'tuple'>\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'function'> init_metadata\n", | |
" <class 'dict'> init_metadata\n", | |
" 4349433440 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.List'> 4358150448\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358150400\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358150352\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.ObserveHandler'> 4358150208\n", | |
" 4352389760 cycle, skipping\n", | |
" <class 'list'> 0\n", | |
" <class 'dict'> change\n", | |
" <class 'dict'> user_ns\n", | |
" 4358449024 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Instance'> 4358150160\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.ObserveHandler'> 4358150016\n", | |
" 4352389760 cycle, skipping\n", | |
" <class 'list'> 0\n", | |
" <class 'dict'> change\n", | |
" 4358449088 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358149968\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Instance'> 4358149920\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358149872\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Type'> 4346563792\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Instance'> 4346563744\n", | |
" 4352389760 cycle, skipping\n", | |
"------------ Starting over\n", | |
" <class 'traitlets.traitlets.Type'> 4358150832\n", | |
" <class 'dict'> kernel_class\n", | |
" <class 'traitlets.traitlets.MetaHasTraits'> IPKernelApp\n", | |
" 4308432320 cycle, skipping\n", | |
" <class 'tuple'> 0\n", | |
" <class 'method'> launch_instance\n", | |
" <class 'ipykernel.kernelapp.IPKernelApp'> 4307692576\n", | |
" <class 'cell'> 4329244848\n", | |
" <class 'tuple'> 0\n", | |
" <class 'function'> initialize\n", | |
" <class 'dict'> __wrapped__\n", | |
" <class 'cell'> 4358152128\n", | |
" <class 'tuple'> 0\n", | |
" <class 'function'> initialize\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.DefaultHandler'> 4358151600\n", | |
" 4352560320 cycle, skipping\n", | |
" <class 'dict'> connection_dir\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Unicode'> 4358151552\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Dict'> 4358151504\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151456\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151408\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151360\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151312\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151264\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151216\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151168\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151120\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358151072\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Instance'> 4358151024\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358150976\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358150592\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Dict'> 4329244944\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Dict'> 4329244896\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358151792\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358151840\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Int'> 4358152032\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.DottedObjectName'> 4358151888\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358151696\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358151744\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" 4358150832 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Int'> 4358152080\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.DottedObjectName'> 4358151936\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" <class 'traitlets.traitlets.Bool'> 4358151984\n", | |
" 4352560320 cycle, skipping\n", | |
"----------------- Starting over\n", | |
" 5780362048 cycle, skipping\n", | |
" <class 'dict'> classes\n", | |
" 4307692576 cycle, skipping\n", | |
"------------ Starting over\n", | |
" 4352560320 cycle, skipping\n", | |
"----------- Starting over\n", | |
" 4308431616 cycle, skipping\n", | |
"----------- Starting over\n", | |
" <class 'tuple'> 1\n", | |
" notfound <class 'tuple'>\n", | |
" 4308431616 cycle, skipping\n", | |
" 4814814720 cycle, skipping\n", | |
"-------- Starting over\n", | |
" module ipykernel.ipkernel\n", | |
" <class 'function'> __init__\n", | |
" <class 'function'> dispatch_debugpy\n", | |
" <class 'function'> poll_stopped_queue\n", | |
" <class 'function'> start\n", | |
" <class 'function'> set_parent\n", | |
" 4358262496 cycle, skipping\n", | |
" <class 'function'> finish_metadata\n", | |
" <class 'function'> _forward_input\n", | |
" <class 'function'> _restore_input\n", | |
" <class 'function'> do_execute\n", | |
" <class 'function'> do_complete\n", | |
" <class 'function'> do_debug_request\n", | |
" <class 'function'> _experimental_do_complete\n", | |
" <class 'function'> do_inspect\n", | |
" <class 'function'> do_history\n", | |
" <class 'function'> do_shutdown\n", | |
" <class 'function'> do_is_complete\n", | |
" <class 'function'> do_apply\n", | |
" <class 'function'> do_clear\n", | |
" <class 'function'> __init__\n", | |
" <class 'function'> banner\n", | |
" <class 'function'> execution_count\n", | |
" <class 'function'> execution_count\n", | |
" <class 'function'> _cancel_on_sigint\n", | |
" <class 'function'> _user_module_changed\n", | |
" <class 'function'> _user_ns_changed\n", | |
" 4349476288 cycle, skipping\n", | |
" <class 'cell'> 4358150304\n", | |
" <class 'tuple'> 0\n", | |
" <class 'function'> compatible_observer\n", | |
" <class 'dict'> func\n", | |
" 4358150208 cycle, skipping\n", | |
"--------------------------------- Starting over\n", | |
" 4363443376 cycle, skipping\n", | |
"------- Starting over\n", | |
" 5780551616 cycle, skipping\n", | |
" 4308431616 cycle, skipping\n", | |
"----- Starting over\n", | |
" 4308431616 cycle, skipping\n", | |
"----- Starting over\n", | |
" <class 'traitlets.traitlets.MetaHasTraits'> ZMQInteractiveShell\n", | |
" 4308432320 cycle, skipping\n", | |
" <class 'dict'> ZMQInteractiveShell\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'cell'> 4358149008\n", | |
" 4358460208 cycle, skipping\n", | |
" <class 'tuple'> 0\n", | |
" notfound <class 'tuple'>\n", | |
" notfound <class 'tuple'>\n", | |
" <class 'function'> init_magics\n", | |
" <class 'dict'> init_magics\n", | |
" 4349431632 cycle, skipping\n", | |
"-------- Starting over\n", | |
" 4358449024 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.ObserveHandler'> 4358149728\n", | |
" 4352566976 cycle, skipping\n", | |
" <class 'list'> 0\n", | |
" <class 'dict'> change\n", | |
" 4358454272 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.DefaultHandler'> 4358149632\n", | |
" 4352566976 cycle, skipping\n", | |
" <class 'dict'> exiter\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Instance'> 4358149584\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.CBool'> 4358149488\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.CBool'> 4358149392\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.DefaultHandler'> 4358149296\n", | |
" 4352566976 cycle, skipping\n", | |
" 4352183680 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358149248\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358149200\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Any'> 4358149152\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Type'> 4358149104\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" <class 'traitlets.traitlets.Type'> 4358149056\n", | |
" 4352566976 cycle, skipping\n", | |
"------- Starting over\n", | |
" 4346563792 cycle, skipping\n", | |
"------- Starting over\n", | |
" 4352560320 cycle, skipping\n", | |
"------- Starting over\n", | |
" 4308431616 cycle, skipping\n", | |
"------ Starting over\n", | |
" module ipykernel.zmqshell\n", | |
" <class 'function'> set_parent\n", | |
" <class 'function'> _flush_streams\n", | |
" <class 'function'> publish\n", | |
" <class 'function'> clear_output\n", | |
" <class 'function'> register_hook\n", | |
" <class 'function'> unregister_hook\n", | |
" <class 'function'> edit\n", | |
" <class 'function'> clear\n", | |
" <class 'function'> less\n", | |
" <class 'function'> man\n", | |
" <class 'function'> connect_info\n", | |
" <class 'function'> qtconsole\n", | |
" <class 'function'> autosave\n", | |
" <class 'function'> _hooks\n", | |
" <class 'function'> _default_thread_local\n", | |
" <class 'function'> enable_gui\n", | |
" <class 'function'> init_environment\n", | |
" <class 'function'> init_hooks\n", | |
" <class 'function'> init_data_pub\n", | |
" <class 'function'> ask_exit\n", | |
" <class 'function'> run_cell\n", | |
" <class 'function'> _showtraceback\n", | |
" <class 'function'> set_next_input\n", | |
" <class 'function'> set_parent\n", | |
" <class 'function'> get_parent\n", | |
" 4358260768 cycle, skipping\n", | |
" <class 'function'> init_virtualenv\n", | |
" <class 'function'> system_piped\n", | |
" <class 'function'> data_pub\n", | |
" <class 'function'> data_pub\n", | |
" <class 'function'> _default_banner1\n", | |
" <class 'function'> _default_exiter\n", | |
" <class 'function'> _update_exit_now\n", | |
" <class 'dict'> func\n", | |
" 4358149728 cycle, skipping\n", | |
" Starting over\n", | |
"5072358848 cycle, skipping\n", | |
"done\n", | |
"<class 'list'> 1\n", | |
" <class 'list_iterator'> 5072358848\n", | |
" Starting over\n", | |
"traceback <cell line: 1> 4364014912\n", | |
" traceback run_code 4479959872\n", | |
" <class 'Exception'> 4808676016\n", | |
" <class 'dict'> error_in_exec\n", | |
" <class 'IPython.core.interactiveshell.ExecutionResult'> 5067852240\n", | |
" frame run_code\n", | |
" frame <cell line: 1>\n", | |
" 4479959872 cycle, skipping\n", | |
" frame test_exception_raise\n", | |
" 4364014912 cycle, skipping\n", | |
" frame allocate_tensor\n", | |
" traceback allocate_tensor 4807687872\n", | |
" 4358453760 cycle, skipping\n", | |
" 4814807616 cycle, skipping\n", | |
" traceback test_exception_raise 4802244864\n", | |
" <class 'tuple'> 1\n", | |
" 4364014912 cycle, skipping\n", | |
" <class 'list'> 0\n", | |
"------- Starting over\n", | |
" 4364014912 cycle, skipping\n", | |
"done\n" | |
] | |
} | |
], | |
"source": [ | |
"def print_ref_graph(obj):\n", | |
" \"\"\"Returns a list of references keep this object alive\"\"\"\n", | |
" orig_obj = obj\n", | |
" seen = set()\n", | |
" \n", | |
" gc.collect()\n", | |
" level = 0\n", | |
" branches = []\n", | |
" while obj is not None:\n", | |
" nobj = None\n", | |
" path_printed = False\n", | |
" for nobj in gc.get_referrers(obj):\n", | |
" if path_printed and id(nobj) not in seen and isinstance(nobj, (list, dict, types.FrameType, types.TracebackType)):\n", | |
" branches.append((level-1, nobj))\n", | |
" continue\n", | |
" print(' '*level, end='')\n", | |
" if id(nobj) in seen: \n", | |
" print(f'{id(nobj)} cycle, skipping')\n", | |
" nobj = None\n", | |
" continue\n", | |
" else: \n", | |
" seen.add(id(nobj))\n", | |
"\n", | |
" if isinstance(nobj, dict) and 'hiddenref' in nobj: \n", | |
" nobj = None\n", | |
" continue\n", | |
" elif isinstance(nobj, types.FrameType): \n", | |
" print('frame', nobj.f_code.co_name)\n", | |
" elif isinstance(nobj, types.TracebackType): \n", | |
" print('traceback', nobj.tb_frame.f_code.co_name, id(nobj))\n", | |
" elif isinstance(nobj, (tuple,list)):\n", | |
" for i in range(len(nobj)):\n", | |
" if nobj[i] is obj:\n", | |
" print(type(nobj), i)\n", | |
" break\n", | |
" else:\n", | |
" print('notfound', type(nobj))\n", | |
" elif isinstance(nobj, dict):\n", | |
" for k in nobj:\n", | |
" if nobj[k] is obj:\n", | |
" print(type(nobj), k)\n", | |
" break\n", | |
" else:\n", | |
" print('notfound', type(nobj))\n", | |
" elif isinstance(nobj, types.ModuleType):\n", | |
" print('module', nobj.__name__)\n", | |
" else:\n", | |
" print(type(nobj), nobj.__name__ if hasattr(nobj, '__name__') else id(nobj))\n", | |
" \n", | |
" path_printed = True # effectively break\n", | |
" obj = nobj\n", | |
" level += 1\n", | |
" \n", | |
" \n", | |
" if not path_printed:\n", | |
" if branches: \n", | |
" \n", | |
" level, obj = branches.pop()\n", | |
" print(\"-\"*(level-1),\"Starting over\")\n", | |
" else:\n", | |
" print('done')\n", | |
" obj = None\n", | |
" else: \n", | |
" pass\n", | |
" \n", | |
"for tb in find_tracebacks(*list(tensors())):\n", | |
" print_ref_graph(tb)\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"after allocation\n", | |
"5780611024 torch.Size([10000, 10000]) 2\n", | |
"Finally block\n", | |
"5780611024 torch.Size([10000, 10000]) 3\n" | |
] | |
}, | |
{ | |
"ename": "Exception", | |
"evalue": "I am a bad function", | |
"output_type": "error", | |
"traceback": [ | |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | |
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 22\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m test_exception_raise(should_raise\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 22\u001b[0m in \u001b[0;36mtest_exception_raise\u001b[0;34m(should_raise)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mtest_exception_raise\u001b[39m(should_raise\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m):\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m allocate_tensor(should_raise)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m print_tensor_size(\u001b[39m'\u001b[39m\u001b[39mFinally block\u001b[39m\u001b[39m'\u001b[39m)\n", | |
"\u001b[1;32m/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb Cell 22\u001b[0m in \u001b[0;36mallocate_tensor\u001b[0;34m(should_raise)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m x \u001b[39m*\u001b[39m\u001b[39m=\u001b[39m \u001b[39m2\u001b[39m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39mif\u001b[39;00m should_raise:\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mException\u001b[39;00m(\u001b[39m'\u001b[39m\u001b[39mI am a bad function\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/pczapla/Workspace/fastai/gpumem/exception_handling_jupyter.ipynb#X31sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m \u001b[39mreturn\u001b[39;00m x\n", | |
"\u001b[0;31mException\u001b[0m: I am a bad function" | |
] | |
} | |
], | |
"source": [ | |
"test_exception_raise(should_raise=True)\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 160, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<traceback at 0x2ab91b080>" | |
] | |
}, | |
"execution_count": 160, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"def make_empty_traceback():\n", | |
" try: \n", | |
" raise Exception('Empty traceback')\n", | |
" except Exception as e:\n", | |
" return e.__traceback__\n", | |
"make_empty_traceback()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Before clean up\n", | |
"5780611024 torch.Size([10000, 10000]) 4\n", | |
"clear <class 'dict'> 4306726464\n", | |
"clear <class 'dict'> 4358720512\n", | |
"clear <class 'Exception'> 4802388560\n", | |
"None\n", | |
"None\n", | |
"After clean up\n" | |
] | |
} | |
], | |
"source": [ | |
"print_tensor_size('Before clean up')\n", | |
"agressive_clear_traceback()\n", | |
"clean_up()\n", | |
"print_tensor_size('After clean up')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 46, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"After clean up\n" | |
] | |
} | |
], | |
"source": [ | |
"print_tensor_size('After clean up')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3.10.4 ('sd')", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.10.4" | |
}, | |
"vscode": { | |
"interpreter": { | |
"hash": "89a5cca1a28eb213eb14abdad89b9eabded0d66f27b6c5a9aad0c68445338715" | |
} | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment