Skip to content

Instantly share code, notes, and snippets.

View Carreau's full-sized avatar
:octocat:

M Bussonnier Carreau

:octocat:
View GitHub Profile
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
File ~/miniconda3-intel/envs/napari/lib/python3.9/site-packages/vispy/app/backends/_qt.py:512, in QtBaseCanvasBackend.mouseReleaseEvent(self=<vispy.app.backends._qt.CanvasBackendDesktop object>, ev=<PyQt5.QtGui.QMouseEvent object>)
510 if self._vispy_canvas is None:
511 return
--> 512 self._vispy_mouse_release(
self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x7fb2419960d0>
ev = <PyQt5.QtGui.QMouseEvent object at 0x7fb254e5f790>
BUTTONMAP = {0: 0, 1: 1, 2: 2, 4: 3, 8: 4, 16: 5}
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
@Carreau
Carreau / kernel.js
Created December 13, 2012 20:09
A node.js kernel for IPython notebook. You can see the explanation of the ipynb rendered in http://nbviewer.ipython.org
zmq = require("zmq")
fs = require("fs")
var config = JSON.parse(fs.readFileSync(process.argv[2]))
var connexion = "tcp://"+config.ip+":"
var shell_conn = connexion+config.shell_port
var pub_conn = connexion+config.iopub_port
var hb_conn = connexion+config.hb_port
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)
@Carreau
Carreau / rstify.py
Created December 25, 2016 19:14
use to convert txt peps to rst.
from textwrap import indent, wrap
from more_itertools import peekable
WRAPL_LENGHT = 70
indent_level = lambda line: len(line) - len(line.lstrip())
import re