Skip to content

Instantly share code, notes, and snippets.

View Carreau's full-sized avatar
:octocat:

M Bussonnier Carreau

:octocat:
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Carreau
Carreau / LICENSE
Last active October 12, 2021 23:22
transform python AST
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@Carreau
Carreau / cartomap.py
Created May 27, 2021 15:30
PyShS demo Script
import sys
import geocoder
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import argparse
import wikipedia
import wptools
import flask
import io
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
~/miniconda3/envs/napari/lib/python3.9/site-packages/vispy/app/backends/_qt.py in keyPressEvent(self=<vispy.app.backends._qt.CanvasBackendDesktop object>, ev=<PyQt5.QtGui.QKeyEvent object>)
500
501 def keyPressEvent(self, ev):
--> 502 self._keyEvent(self._vispy_canvas.events.key_press, ev)
self._keyEvent = <bound method QtBaseCanvasBackend._keyEvent of <vispy.app.backends._qt.CanvasBackendDesktop object at 0x7f98f79270d0>>
self._vispy_canvas.events.key_press = <vispy.util.event.EventEmitter object at 0x7f98f7919d90>
ev = <PyQt5.QtGui.QKeyEvent object at 0x7f98e048ea60>
503
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:605 in 'compute_new_doc' | distributed/cfexecutor.py:map
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:607 in 'compute_new_doc' | missing: {'**kwargs'}
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:609 in 'compute_new_doc' | extra: {'timeout', 'chunksize'}
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:605 in 'compute_new_doc' | distributed/client.py:gather
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:607 in 'compute_new_doc' | missing: {'asynchronous'}
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:605 in 'compute_new_doc' | distributed/client.py:scatter
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:607 in 'compute_new_doc' | missing: {'timeout', 'asynchronous'}
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:605 in 'compute_new_doc' | distributed/client.py:cancel
63027 ~/miniconda3/lib/python3.8/site-packages/velin/ref.py:607 in 'compute_new_doc'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
~/dev/papyri[master ✗] $ python jd.py
Traceback (most recent call last):
File "jd.py", line 10, in <module>
i.infer(4, 0)
File "/Users/bussonniermatthias/dev/jedi/jedi/api/helpers.py", line 488, in wrapper
return func(self, line, column, *args, **kwargs)
File "/Users/bussonniermatthias/dev/jedi/jedi/api/__init__.py", line 244, in infer
values = helpers.infer(self._inference_state, context, leaf)
File "/Users/bussonniermatthias/dev/jedi/jedi/api/helpers.py", line 167, in infer
return inference_state.infer(context, leaf)
Traceback (most recent call last):
File "/Users/bussonniermatthias/dev/jedi/jedi/cache.py", line 110, in wrapper
return dct[key]
KeyError: ((), frozenset())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/bussonniermatthias/dev/jedi/jedi/cache.py", line 110, in wrapper
return dct[key]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-42-e8051349cd43> in <module>
1 script = """x = np.linspace(-np.pi, 10)"""
2 #format_and_infer_types(script)
----> 3 jedi.Interpreter(script, [{'np':np}]).infer(1,0)
~/dev/jedi/jedi/api/helpers.py in validate_line_column.<locals>.wrapper(self, line, column, *args, **kwargs)
483 if not (0 <= column <= line_len):
484 raise ValueError('`column` parameter (%d) is not in a valid range '