PK'eLPmnumbannotate/__init__.py"""Provide a simple magic that emits html annotated python code to find potential perf improvements """ __version__ = '0.0.3' from IPython.core.magic import cell_magic, register_cell_magic from tempfile import mkdtemp import numba @register_cell_magic def numba_annotate(line, cell): res = "Functions Ness to be called at least once." d = None try: d = mkdtemp() from pathlib import Path pd = Path(d) code_file = (pd /'code.py') html_file = (pd/'frebus23.html') with code_file.open('w') as f: f.write(cell) import subprocess subprocess.run(['numba','--annotate-html', str(html_file), str(code_file)]) if html_file.exists(): with html_file.open('r') as f: from IPython.display import HTML res = HTML(f.read()) res except Exception: import shutil shutil.rmtree(d) raise return res PKeLԙ>>$numbannotate-0.0.3.dist-info/LICENSEThe MIT License (MIT) Copyright (c) 2018 Matthias Bussonnier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!Hf$Wd"numbannotate-0.0.3.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q0343 /, (-JLR()*M ILR(4KM̫#DPK!HF(`%numbannotate-0.0.3.dist-info/METADATAUn@ E mwjMR)} A3RCE"u{|5)X|QL4(d/ҢAQܕO沈`Zx{2O#wHX8 n9=WuCI 2N0S T%<ȩVꖶTpm}|ʆԜ_rgPcLg+H' x|6V)At 7% P_4gmz}²*eN;NQ\¢#"(B\ pM2C)0'ԋF?Dxq Ԕ)󝉷;"I_PK'eLPmnumbannotate/__init__.pyPKeLԙ>>$numbannotate-0.0.3.dist-info/LICENSEPK!Hf$Wd"numbannotate-0.0.3.dist-info/WHEELPK!HF(`% numbannotate-0.0.3.dist-info/METADATAPK!H#K numbannotate-0.0.3.dist-info/RECORDPK