after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def from_lexer(cls, message, state, token):
lineno = None
colno = None
source = state.source
source_pos = token.getsourcepos()
if source_pos:
lineno = source_pos.lineno
colno = source_pos.colno
elif source:
# Use the end of the last line of source for `PrematureEndOfInpu... | def from_lexer(cls, message, state, token):
source_pos = token.getsourcepos()
if token.source_pos:
lineno = source_pos.lineno
colno = source_pos.colno
else:
lineno = -1
colno = -1
if state.source:
lines = state.source.splitlines()
if lines[-1] == "":
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def error_handler(state, token):
tokentype = token.gettokentype()
if tokentype == "$end":
raise PrematureEndOfInput.from_lexer("Premature end of input", state, token)
else:
raise LexException.from_lexer(
"Ran into a %s where it wasn't expected." % tokentype, state, token
... | def error_handler(state, token):
tokentype = token.gettokentype()
if tokentype == "$end":
source_pos = token.source_pos or token.getsourcepos()
source = state.source
if source_pos:
lineno = source_pos.lineno
colno = source_pos.colno
else:
linen... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def macro(name):
"""Decorator to define a macro called `name`."""
name = mangle(name)
def _(fn):
fn = rename_function(fn, name)
try:
fn._hy_macro_pass_compiler = has_kwargs(fn)
except Exception:
# An exception might be raised if fn has arguments with
... | def macro(name):
"""Decorator to define a macro called `name`."""
name = mangle(name)
def _(fn):
fn.__name__ = "({})".format(name)
try:
fn._hy_macro_pass_compiler = has_kwargs(fn)
except Exception:
# An exception might be raised if fn has arguments with
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def _(fn):
fn = rename_function(fn, name)
try:
fn._hy_macro_pass_compiler = has_kwargs(fn)
except Exception:
# An exception might be raised if fn has arguments with
# names that are invalid in Python.
fn._hy_macro_pass_compiler = False
module = inspect.getmodule(fn)
... | def _(fn):
fn.__name__ = "({})".format(name)
try:
fn._hy_macro_pass_compiler = has_kwargs(fn)
except Exception:
# An exception might be raised if fn has arguments with
# names that are invalid in Python.
fn._hy_macro_pass_compiler = False
module = inspect.getmodule(fn)
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def tag(name):
"""Decorator to define a tag macro called `name`."""
def _(fn):
_name = mangle("#{}".format(name))
if not PY3:
_name = _name.encode("UTF-8")
fn = rename_function(fn, _name)
module = inspect.getmodule(fn)
module_name = module.__name__
... | def tag(name):
"""Decorator to define a tag macro called `name`."""
def _(fn):
_name = mangle("#{}".format(name))
if not PY3:
_name = _name.encode("UTF-8")
fn.__name__ = _name
module = inspect.getmodule(fn)
module_name = module.__name__
if module_... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def _(fn):
_name = mangle("#{}".format(name))
if not PY3:
_name = _name.encode("UTF-8")
fn = rename_function(fn, _name)
module = inspect.getmodule(fn)
module_name = module.__name__
if module_name.startswith("hy.core"):
module_name = None
module_tags = module.__dict__.set... | def _(fn):
_name = mangle("#{}".format(name))
if not PY3:
_name = _name.encode("UTF-8")
fn.__name__ = _name
module = inspect.getmodule(fn)
module_name = module.__name__
if module_name.startswith("hy.core"):
module_name = None
module_tags = module.__dict__.setdefault("__t... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def require(source_module, target_module, assignments, prefix=""):
"""Load macros from one module into the namespace of another.
This function is called from the `require` special form in the compiler.
Parameters
----------
source_module: str or types.ModuleType
The module from which macro... | def require(source_module, target_module, assignments, prefix=""):
"""Load macros from one module into the namespace of another.
This function is called from the `require` special form in the compiler.
Parameters
----------
source_module: str or types.ModuleType
The module from which macro... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def macro_exceptions(module, macro_tree, compiler=None):
try:
yield
except HyLanguageError as e:
# These are user-level Hy errors occurring in the macro.
# We want to pass them up to the user.
reraise(type(e), e, sys.exc_info()[2])
except Exception as e:
if compiler:
... | def macro_exceptions(module, macro_tree, compiler=None):
try:
yield
except Exception as e:
try:
filename = inspect.getsourcefile(module)
source = inspect.getsource(module)
except TypeError:
if compiler:
filename = compiler.filename
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def macroexpand(tree, module, compiler=None, once=False):
"""Expand the toplevel macros for the given Hy AST tree.
Load the macros from the given `module`, then expand the (top-level) macros
in `tree` until we no longer can.
`HyExpression` resulting from macro expansions are assigned the module in
... | def macroexpand(tree, module, compiler=None, once=False):
"""Expand the toplevel macros for the given Hy AST tree.
Load the macros from the given `module`, then expand the (top-level) macros
in `tree` until we no longer can.
`HyExpression` resulting from macro expansions are assigned the module in
... | https://github.com/hylang/hy/issues/1486 | Traceback (most recent call last):
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/importer.py", line 180, in hy_eval
_ast, expr = hy_compile(hytree, module_name, get_expr=True)
File "/home/johnzhuang/.virtualenvs/hy/lib/python3.6/site-packages/hy/compiler.py", line 2213, in hy_compile
result = co... | hy.errors.HyCompileError |
def mangle(s):
"""Stringify the argument and convert it to a valid Python identifier
according to Hy's mangling rules."""
def unicode_char_to_hex(uchr):
# Covert a unicode char to hex string, without prefix
if len(uchr) == 1 and ord(uchr) < 128:
return format(ord(uchr), "x")
... | def mangle(s):
"""Stringify the argument and convert it to a valid Python identifier
according to Hy's mangling rules."""
def unicode_char_to_hex(uchr):
# Covert a unicode char to hex string, without prefix
return (
uchr.encode("unicode-escape")
.decode("utf-8")
... | https://github.com/hylang/hy/issues/1694 | => (mangle "\n")
'hyx_XUnX'
=> (unmangle (mangle "\n"))
Traceback (most recent call last):
…
ValueError: invalid literal for int() with base 16: 'n' | ValueError |
def unicode_char_to_hex(uchr):
# Covert a unicode char to hex string, without prefix
if len(uchr) == 1 and ord(uchr) < 128:
return format(ord(uchr), "x")
return (
uchr.encode("unicode-escape")
.decode("utf-8")
.lstrip("\\U")
.lstrip("\\u")
.lstrip("\\x")
... | def unicode_char_to_hex(uchr):
# Covert a unicode char to hex string, without prefix
return (
uchr.encode("unicode-escape")
.decode("utf-8")
.lstrip("\\U")
.lstrip("\\u")
.lstrip("0")
)
| https://github.com/hylang/hy/issues/1694 | => (mangle "\n")
'hyx_XUnX'
=> (unmangle (mangle "\n"))
Traceback (most recent call last):
…
ValueError: invalid literal for int() with base 16: 'n' | ValueError |
def __getattr__(self, name):
setattr(
Asty,
name,
staticmethod(
lambda x, **kwargs: getattr(ast, name)(
lineno=getattr(x, "start_line", getattr(x, "lineno", None)),
col_offset=getattr(x, "start_column", getattr(x, "col_offset", None)),
... | def __getattr__(self, name):
setattr(
Asty,
name,
lambda self, x, **kwargs: getattr(ast, name)(
lineno=getattr(x, "start_line", getattr(x, "lineno", None)),
col_offset=getattr(x, "start_column", getattr(x, "col_offset", None)),
**kwargs,
),
)
... | https://github.com/hylang/hy/issues/588 | => (list-comp (do (print n) (print n)) [n [1 2]])
print(n)
[print(n) for n in [1L, 2L]]
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'n' is not defined | NameError |
def compile_comprehension(self, expr, root, parts, final):
root = unmangle(ast_str(root))
node_class = {
"for": asty.For,
"lfor": asty.ListComp,
"dfor": asty.DictComp,
"sfor": asty.SetComp,
"gfor": asty.GeneratorExp,
}[root]
is_for = root == "for"
orel = []
... | def compile_comprehension(self, expr, form, expression, gen, cond):
# (list-comp expr [target iter] cond?)
if not isinstance(gen, HyList):
raise HyTypeError(gen, "Generator expression must be a list.")
gen_res, gen = self._compile_generator_iterables(
[gen] + ([] if cond is None else [cond... | https://github.com/hylang/hy/issues/588 | => (list-comp (do (print n) (print n)) [n [1 2]])
print(n)
[print(n) for n in [1L, 2L]]
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'n' is not defined | NameError |
def spoof_positions(obj):
if not isinstance(obj, HyObject):
return
if not hasattr(obj, "start_column"):
obj.start_column = 0
if not hasattr(obj, "start_line"):
obj.start_line = 0
if hasattr(obj, "__iter__") and not isinstance(obj, (string_types, bytes_type)):
for x in obj... | def spoof_positions(obj):
if not isinstance(obj, HyObject) or isinstance(obj, HyCons):
return
if not hasattr(obj, "start_column"):
obj.start_column = 0
if not hasattr(obj, "start_line"):
obj.start_line = 0
if hasattr(obj, "__iter__") and not isinstance(obj, (string_types, bytes_t... | https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def _render_quoted_form(self, form, level):
"""
Render a quoted form as a new HyExpression.
`level` is the level of quasiquoting of the current form. We can
unquote if level is 0.
Returns a three-tuple (`imports`, `expression`, `splice`).
The `splice` return value is used to mark `unquote-spl... | def _render_quoted_form(self, form, level):
"""
Render a quoted form as a new HyExpression.
`level` is the level of quasiquoting of the current form. We can
unquote if level is 0.
Returns a three-tuple (`imports`, `expression`, `splice`).
The `splice` return value is used to mark `unquote-spl... | https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def paren(p):
return HyExpression(p[1])
| def paren(p):
cont = p[1]
# Dotted lists are expressions of the form
# (a b c . d)
# that evaluate to nested cons cells of the form
# (a . (b . (c . d)))
if len(cont) >= 3 and isinstance(cont[-2], HySymbol) and cont[-2] == ".":
reject_spurious_dots(cont[:-2], cont[-1:])
if len(... | https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def replace(self, other):
for x in self:
replace_hy_obj(x, other)
HyObject.replace(self, other)
return self
| def replace(self, other):
if self.car is not None:
replace_hy_obj(self.car, other)
if self.cdr is not None:
replace_hy_obj(self.cdr, other)
HyObject.replace(self, other)
| https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __repr__(self):
return str(self) if PRETTY else super(HyList, self).__repr__()
| def __repr__(self):
if PRETTY:
return str(self)
else:
return "HyCons({}, {})".format(repr(self.car), repr(self.cdr))
| https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __new__(cls, real, imag=0, *args, **kwargs):
if isinstance(real, string_types):
value = super(HyComplex, cls).__new__(cls, strip_digit_separators(real))
p1, _, p2 = real.lstrip("+-").replace("-", "+").partition("+")
check_inf_nan_cap(p1, value.imag if "j" in p1 else value.real)
i... | def __new__(cls, car, cdr):
if isinstance(cdr, list):
# Keep unquotes in the cdr of conses
if type(cdr) == HyExpression:
if len(cdr) > 0 and type(cdr[0]) == HySymbol:
if cdr[0] in ("unquote", "unquote-splice"):
return super(HyCons, cls).__new__(cls)
... | https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __init__(self, value):
self.name = value
| def __init__(self, car, cdr):
self.car = wrap_value(car)
self.cdr = wrap_value(cdr)
| https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __str__(self):
with pretty():
g = colored.green
if self:
pairs = []
for k, v in zip(self[::2], self[1::2]):
k, v = repr_indent(k), repr_indent(v)
pairs.append(
("{0}{c}\n {1}\n " if "\n" in k + v else "{0}{c} {1}").for... | def __str__(self):
with pretty():
c = colored.yellow
lines = ["" + c("<HyCons (")]
while True:
lines.append(" " + repr_indent(self.car))
if not isinstance(self.cdr, HyCons):
break
self = self.cdr
lines.append("{} {}{}".format(c("."... | https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __eq__(self, other):
if not isinstance(other, HyKeyword):
return NotImplemented
return self.name == other.name
| def __eq__(self, other):
return (
isinstance(other, self.__class__)
and self.car == other.car
and self.cdr == other.cdr
)
| https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def __getitem__(self, item):
ret = super(HyList, self).__getitem__(item)
if isinstance(item, slice):
return self.__class__(ret)
return ret
| def __getitem__(self, n):
if n == 0:
return self.car
if n == slice(1, None):
return self.cdr
raise IndexError("Can only get the car ([0]) or the cdr ([1:]) of a HyCons")
| https://github.com/hylang/hy/issues/568 | => (setv c (cons {"a" 1} []))
from hy.core.language import cons
c = cons({u'a': 1L, }, [])
=> (type (car c))
type(c[0L])
<class 'hy.models.dict.HyDict'>
=> (get (car c) "a")
c[0L][u'a']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/maresp/workbench/cbf/venv/lib/python2.7/site-packag... | TypeError |
def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
try:
do = import_buffer_to_hst(source)
except PrematureEndOfInput:
return True
except LexException as e:
if e.source is None:
e.source = source
... | def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
try:
do = import_buffer_to_hst(source)
except PrematureEndOfInput:
return True
except LexException as e:
if e.source is None:
e.source = source
... | https://github.com/hylang/hy/issues/1389 | => (defclass BadRepr[] (defn __repr__ [self] (/ 0)))
class BadRepr:
def __repr__(self):
return (1 / 0)
None
=> (BadRepr)
BadRepr()
Traceback (most recent call last):
File "C:\Users\ME\workspace\hy36-gilch\Scripts\hy-script.py", line 11, in <module>
load_entry_point('hy', 'console_scripts', 'hy')()
File "c:\users\me\do... | ZeroDivisionError |
def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
try:
do = import_buffer_to_hst(source)
except PrematureEndOfInput:
return True
except LexException as e:
if e.source is None:
e.source = source
... | def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
try:
tokens = tokenize(source)
except PrematureEndOfInput:
return True
do = HyExpression([HySymbol("do")] + tokens)
do.start_line = do.end_line = do.start_colum... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def imports_as_stmts(self, expr):
"""Convert the Result's imports to statements"""
ret = Result()
for module, names in self.imports.items():
if None in names:
e = HyExpression(
[
HySymbol("import"),
HySymbol(module),
... | def imports_as_stmts(self, expr):
"""Convert the Result's imports to statements"""
ret = Result()
for module, names in self.imports.items():
if None in names:
ret += self.compile(
[
HyExpression(
[
Hy... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def compile_atom(self, atom_type, atom):
if atom_type in _compile_table:
ret = _compile_table[atom_type](self, atom)
if not isinstance(ret, Result):
ret = Result() + ret
return ret
if not isinstance(atom, HyObject):
atom = wrap_value(atom)
if isinstance(atom, ... | def compile_atom(self, atom_type, atom):
if atom_type in _compile_table:
ret = _compile_table[atom_type](self, atom)
if not isinstance(ret, Result):
ret = Result() + ret
return ret
| https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def _compile_maths_expression(self, expression):
ops = {
"+": ast.Add,
"/": ast.Div,
"//": ast.FloorDiv,
"*": ast.Mult,
"-": ast.Sub,
"%": ast.Mod,
"**": ast.Pow,
"<<": ast.LShift,
">>": ast.RShift,
"|": ast.BitOr,
"^": ast.BitX... | def _compile_maths_expression(self, expression):
ops = {
"+": ast.Add,
"/": ast.Div,
"//": ast.FloorDiv,
"*": ast.Mult,
"-": ast.Sub,
"%": ast.Mod,
"**": ast.Pow,
"<<": ast.LShift,
">>": ast.RShift,
"|": ast.BitOr,
"^": ast.BitX... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
"""
Compile a HyObject tree into a Python AST Module.
If `get_expr` is True, return a tuple (module, last_expression), where
`last_expression` is the.
"""
body = []
expr = None
if not isinstance(tree, HyObject):
... | def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
"""
Compile a HyObject tree into a Python AST Module.
If `get_expr` is True, return a tuple (module, last_expression), where
`last_expression` is the.
"""
body = []
expr = None
if not (isinstance(tree, HyObject) or ty... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def import_buffer_to_hst(buf):
"""Import content from buf and return a Hy AST."""
return HyExpression([HySymbol("do")] + tokenize(buf + "\n"))
| def import_buffer_to_hst(buf):
"""Import content from buf and return a Hy AST."""
return tokenize(buf + "\n")
| https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def hy_eval(hytree, namespace=None, module_name=None, ast_callback=None):
"""``eval`` evaluates a quoted expression and returns the value. The optional
second and third arguments specify the dictionary of globals to use and the
module name. The globals dictionary defaults to ``(local)`` and the module
n... | def hy_eval(hytree, namespace, module_name, ast_callback=None):
foo = HyObject()
foo.start_line = 0
foo.end_line = 0
foo.start_column = 0
foo.end_column = 0
replace_hy_obj(hytree, foo)
if not isinstance(module_name, string_types):
raise HyTypeError(foo, "Module name must be a string... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def macroexpand_1(tree, compiler):
"""Expand the toplevel macro from `tree` once, in the context of
`module_name`."""
if isinstance(tree, HyExpression):
if tree == []:
return tree
fn = tree[0]
if fn in ("quote", "quasiquote"):
return tree
ntree = HyEx... | def macroexpand_1(tree, compiler):
"""Expand the toplevel macro from `tree` once, in the context of
`module_name`."""
if isinstance(tree, HyExpression):
if tree == []:
return tree
fn = tree[0]
if fn in ("quote", "quasiquote"):
return tree
ntree = HyEx... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def tag_macroexpand(tag, tree, compiler):
"""Expand the tag macro "tag" with argument `tree`."""
load_macros(compiler.module_name)
tag_macro = _hy_tag[compiler.module_name].get(tag)
if tag_macro is None:
try:
tag_macro = _hy_tag[None][tag]
except KeyError:
raise ... | def tag_macroexpand(tag, tree, compiler):
"""Expand the tag macro "tag" with argument `tree`."""
load_macros(compiler.module_name)
tag_macro = _hy_tag[compiler.module_name].get(tag)
if tag_macro is None:
try:
tag_macro = _hy_tag[None][tag]
except KeyError:
raise ... | https://github.com/hylang/hy/issues/1174 | => (import numpy)
=> (= "." (get (name numpy) 0)))
False
=> (eval '(= "." (get (name numpy) 0)))
False
=> (eval `(= "." ~(get (name numpy) 0)))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/dg/anaconda3/lib/python3.5/site-packages/hy/importer.py", line 110, in hy_eval
hytree.repl... | TypeError |
def tokenize(buf):
"""
Tokenize a Lisp file or string buffer into internal Hy objects.
"""
try:
return parser.parse(lexer.lex(buf))
except LexingError as e:
pos = e.getsourcepos()
raise LexException(
"Could not identify the next token.", pos.lineno, pos.colno, buf... | def tokenize(buf):
"""
Tokenize a Lisp file or string buffer into internal Hy objects.
"""
try:
return parser.parse(lexer.lex(buf))
except LexingError as e:
pos = e.getsourcepos()
raise LexException("Could not identify the next token.", pos.lineno, pos.colno)
except LexEx... | https://github.com/hylang/hy/issues/1252 | Traceback (most recent call last):
File "<string>", line 1, in <module>
File "hy/cmdline.py", line 406, in hy2py_main
if stdin_text is None
File "hy/cmdline.py", line 186, in pretty_error
print(e, file=sys.stderr)
File "hy/lex/exceptions.py", line 43, in __str__
source = self.source.split("\n")
AttributeError: 'NoneTyp... | AttributeError |
def __init__(self, message, lineno, colno, source=None):
super(LexException, self).__init__(message)
self.message = message
self.lineno = lineno
self.colno = colno
self.source = source
self.filename = "<stdin>"
| def __init__(self, message, lineno, colno):
super(LexException, self).__init__(message)
self.message = message
self.lineno = lineno
self.colno = colno
self.source = None
self.filename = "<stdin>"
| https://github.com/hylang/hy/issues/1252 | Traceback (most recent call last):
File "<string>", line 1, in <module>
File "hy/cmdline.py", line 406, in hy2py_main
if stdin_text is None
File "hy/cmdline.py", line 186, in pretty_error
print(e, file=sys.stderr)
File "hy/lex/exceptions.py", line 43, in __str__
source = self.source.split("\n")
AttributeError: 'NoneTyp... | AttributeError |
def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
tokens = tokenize(source)
except PrematureEndOfInput:
return True
except LexException as e:
if e.source is None:
e.source = source
e.filename = filename
... | def runsource(self, source, filename="<input>", symbol="single"):
global SIMPLE_TRACEBACKS
try:
tokens = tokenize(source)
except PrematureEndOfInput:
return True
except LexException as e:
if e.source is None:
e.source = source
e.filename = filename
... | https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def pretty_error(func, *args, **kw):
try:
return func(*args, **kw)
except (HyTypeError, LexException) as e:
if SIMPLE_TRACEBACKS:
print(e, file=sys.stderr)
sys.exit(1)
raise
| def pretty_error(func, *args, **kw):
try:
return func(*args, **kw)
except (HyTypeError, LexException) as e:
if SIMPLE_TRACEBACKS:
sys.stderr.write(str(e))
sys.exit(1)
raise
| https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def run_module(mod_name):
from hy.importer import MetaImporter
pth = MetaImporter().find_on_path(mod_name)
if pth is not None:
sys.argv = [pth] + sys.argv
return run_file(pth)
print(
"{0}: module '{1}' not found.\n".format(hy.__appname__, mod_name),
file=sys.stderr,
... | def run_module(mod_name):
from hy.importer import MetaImporter
pth = MetaImporter().find_on_path(mod_name)
if pth is not None:
sys.argv = [pth] + sys.argv
return run_file(pth)
sys.stderr.write("{0}: module '{1}' not found.\n".format(hy.__appname__, mod_name))
return 1
| https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def cmdline_handler(scriptname, argv):
parser = argparse.ArgumentParser(
prog="hy",
usage=USAGE,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=EPILOG,
)
parser.add_argument("-c", dest="command", help="program passed in as a string")
parser.add_argument("-m"... | def cmdline_handler(scriptname, argv):
parser = argparse.ArgumentParser(
prog="hy",
usage=USAGE,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=EPILOG,
)
parser.add_argument("-c", dest="command", help="program passed in as a string")
parser.add_argument("-m"... | https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def hyc_main():
from hy.importer import write_hy_as_pyc
parser = argparse.ArgumentParser(prog="hyc")
parser.add_argument("files", metavar="FILE", nargs="+", help="file to compile")
parser.add_argument("-v", action="version", version=VERSION)
options = parser.parse_args(sys.argv[1:])
for file ... | def hyc_main():
from hy.importer import write_hy_as_pyc
parser = argparse.ArgumentParser(prog="hyc")
parser.add_argument("files", metavar="FILE", nargs="+", help="file to compile")
parser.add_argument("-v", action="version", version=VERSION)
options = parser.parse_args(sys.argv[1:])
for file ... | https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def __str__(self):
line = self.expression.start_line
start = self.expression.start_column
end = self.expression.end_column
source = []
if self.source is not None:
source = self.source.split("\n")[line - 1 : self.expression.end_line]
if line == self.expression.end_line:
... | def __str__(self):
line = self.expression.start_line
start = self.expression.start_column
end = self.expression.end_column
source = []
if self.source is not None:
source = self.source.split("\n")[line - 1 : self.expression.end_line]
if line == self.expression.end_line:
... | https://github.com/hylang/hy/issues/982 | Traceback (most recent call last):
File "/usr/bin/hy", line 9, in <module>
load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 347, in hy_main
sys.exit(cmdline_handler("hy", sys.argv))
File "/usr/lib/python2.7/site-packages/hy/cmdline.py", line 342, in c... | UnicodeEncodeError |
def _compile_assign(self, name, result, start_line, start_column):
str_name = "%s" % name
if _is_hy_builtin(str_name, self.module_name):
raise HyTypeError(name, "Can't assign to a builtin: `%s'" % str_name)
result = self.compile(result)
ld_name = self.compile(name)
if isinstance(ld_name.ex... | def _compile_assign(self, name, result, start_line, start_column):
str_name = "%s" % name
if _is_hy_builtin(str_name, self.module_name):
raise HyTypeError(name, "Can't assign to a builtin: `%s'" % str_name)
result = self.compile(result)
ld_name = self.compile(name)
if result.temp_variables... | https://github.com/hylang/hy/issues/532 | => (let [x 4] x)
Traceback (most recent call last):
File "/home/at/.local/lib/python2.7/site-packages/hy/compiler.py", line 2150, in hy_compile
result = compiler.compile(tree)
File "/home/at/.local/lib/python2.7/site-packages/hy/compiler.py", line 398, in compile
ret = self.compile_atom(_type, tree)
File "/home/at/.loc... | HyCompileError |
def compile_list_comprehension(self, expr):
# (list-comp expr (target iter) cond?)
expr.pop(0)
expression = expr.pop(0)
gen_gen = expr[0]
if not isinstance(gen_gen, HyList):
raise HyTypeError(gen_gen, "Generator expression must be a list.")
gen_res, gen = self._compile_generator_iterab... | def compile_list_comprehension(self, expr):
# (list-comp expr (target iter) cond?)
expr.pop(0)
expression = expr.pop(0)
gen_res, gen = self._compile_generator_iterables(expr)
compiled_expression = self.compile(expression)
ret = compiled_expression + gen_res
ret += ast.ListComp(
lin... | https://github.com/hylang/hy/issues/634 | ryan@DevPC-LX:~/stuff/hy$ ~/stuff/anaconda/bin/hy
hy 0.10.0 using CPython(default) 3.3.5 on Linux
=> (list-comp [x [1 2 3]] x)
Traceback (most recent call last):
File "/home/ryan/stuff/anaconda/lib/python3.3/site-packages/hy-0.10.0-py3.3.egg/hy/importer.py", line 42, in ast_compile
return compile(ast, filename, mode, f... | ValueError |
def __repr__(self):
return f"piid: {self.iid} ({self.description}): ({self.format}, unit: {self.unit}) (acc: {self.access})"
| def __repr__(self):
return f"piid: {self.iid} ({self.description}): ({self.format}, unit: {self.unit}) (acc: {self.access}, value-list: {self.value_list}, value-range: {self.value_range})"
| https://github.com/rytilahti/python-miio/issues/885 | Traceback (most recent call last):
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-gR-py3.9/lib/python3.9/site-packages/dataclasses_json/core.py", line 263, in _decode_generic
res = _get_type_cons(type_)(xs)
File "/Users/ihor_syerkov/Library/Caches/pypoetry/virtualenvs/python-miio-HruUc-... | AttributeError |
def other_package_info(info, desc):
"""Return information about another package supporting the device."""
return "Found %s at %s, check %s" % (info.name, get_addr_from_info(info), desc)
| def other_package_info(info, desc):
"""Return information about another package supporting the device."""
return "%s @ %s, check %s" % (info.name, ipaddress.ip_address(info.address), desc)
| https://github.com/rytilahti/python-miio/issues/891 | INFO:miio.discovery:Discovering devices with mDNS, press any key to quit...
Exception in thread zeroconf-ServiceBrowser__miio._udp.local._229705:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/home/user/.local/lib/python3.9/site-packages/zeroco... | AttributeError |
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
addr = get_addr_from_info(info)
if addr not in self.found_devices:
dev = self.check_and_create_device(info, addr)
self.found_devices[addr] = dev
| def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
addr = str(ipaddress.ip_address(info.address))
if addr not in self.found_devices:
dev = self.check_and_create_device(info, addr)
self.found_devices[addr] = dev
| https://github.com/rytilahti/python-miio/issues/891 | INFO:miio.discovery:Discovering devices with mDNS, press any key to quit...
Exception in thread zeroconf-ServiceBrowser__miio._udp.local._229705:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/home/user/.local/lib/python3.9/site-packages/zeroco... | AttributeError |
def timezone(self):
"""Get the timezone."""
res = self.send("get_timezone")[0]
if isinstance(res, dict):
# Xiaowa E25 example
# {'olson': 'Europe/Berlin', 'posix': 'CET-1CEST,M3.5.0,M10.5.0/3'}
if "olson" not in res:
raise VacuumException("Unsupported timezone format: %s"... | def timezone(self):
"""Get the timezone."""
return self.send("get_timezone")[0]
| https://github.com/rytilahti/python-miio/issues/759 | Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src... | AttributeError |
def last_clean_details(self) -> Optional[CleaningDetails]:
"""Return details from the last cleaning.
Returns None if there has been no cleanups."""
history = self.clean_history()
if not history.ids:
return None
last_clean_id = history.ids.pop(0)
return self.clean_details(last_clean_id,... | def last_clean_details(self) -> CleaningDetails:
"""Return details from the last cleaning."""
last_clean_id = self.clean_history().ids.pop(0)
return self.clean_details(last_clean_id, return_list=False)
| https://github.com/rytilahti/python-miio/issues/457 | Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
await ... | IndexError |
def info(vac: miio.Vacuum):
"""Return device information."""
try:
res = vac.info()
click.echo("%s" % res)
_LOGGER.debug("Full response: %s", pf(res.raw))
except TypeError:
click.echo(
"Unable to fetch info, this can happen when the vacuum "
"is not co... | def info(vac: miio.Vacuum):
"""Return device information."""
res = vac.info()
click.echo("%s" % res)
_LOGGER.debug("Full response: %s", pf(res.raw))
| https://github.com/rytilahti/python-miio/issues/156 | INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 645, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 10.0.11.100 with token xxxxxxxxxxxxx
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container:
data = Container:
dat... | TypeError |
def batching(
func: Callable[[Any], np.ndarray] = None,
batch_size: Union[int, Callable] = None,
num_batch: Optional[int] = None,
split_over_axis: int = 0,
merge_over_axis: int = 0,
slice_on: int = 1,
label_on: Optional[int] = None,
ordinal_idx_arg: Optional[int] = None,
) -> Any:
""... | def batching(
func: Callable[[Any], np.ndarray] = None,
batch_size: Union[int, Callable] = None,
num_batch: Optional[int] = None,
split_over_axis: int = 0,
merge_over_axis: int = 0,
slice_on: int = 1,
label_on: Optional[int] = None,
ordinal_idx_arg: Optional[int] = None,
) -> Any:
""... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def _batching(func):
@wraps(func)
def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1] (self needs to be taken into account)
data = args[slice_on]
args = list(args)
b_size = (batch_size(data) if callable(batch_size) el... | def _batching(func):
@wraps(func)
def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1] (self needs to be taken into account)
data = args[slice_on]
args = list(args)
b_size = (batch_size(data) if callable(batch_size) el... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def arg_wrapper(*args, **kwargs):
data = args[slice_on]
# priority: decorator > class_attribute
# by default data is in args[1:] (self needs to be taken into account)
b_size = batch_size or getattr(args[0], "batch_size", None)
# no batching if b_size is None
if b_size is None or data is None:
... | def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1:] (self needs to be taken into account)
b_size = batch_size or getattr(args[0], "batch_size", None)
# no batching if b_size is None
if b_size is None:
return func(*args, **kwargs)
ar... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1] (self needs to be taken into account)
data = args[slice_on]
args = list(args)
b_size = (batch_size(data) if callable(batch_size) else batch_size) or getattr(
args[0], "batch_size", None... | def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1] (self needs to be taken into account)
data = args[slice_on]
args = list(args)
b_size = (batch_size(data) if callable(batch_size) else batch_size) or getattr(
args[0], "batch_size", None... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def batching_multi_input(
func: Callable[[Any], np.ndarray] = None,
batch_size: Union[int, Callable] = None,
num_batch: Optional[int] = None,
split_over_axis: int = 0,
merge_over_axis: int = 0,
slice_on: int = 1,
num_data: int = 1,
) -> Any:
"""Split the input of a function into small ba... | def batching_multi_input(
func: Callable[[Any], np.ndarray] = None,
batch_size: Union[int, Callable] = None,
num_batch: Optional[int] = None,
split_over_axis: int = 0,
merge_over_axis: int = 0,
slice_on: int = 1,
num_data: int = 1,
) -> Any:
"""Split the input of a function into small ba... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def _batching(func):
@wraps(func)
def arg_wrapper(*args, **kwargs):
data = args[slice_on]
# priority: decorator > class_attribute
# by default data is in args[1:] (self needs to be taken into account)
b_size = batch_size or getattr(args[0], "batch_size", None)
# no batchi... | def _batching(func):
@wraps(func)
def arg_wrapper(*args, **kwargs):
# priority: decorator > class_attribute
# by default data is in args[1:] (self needs to be taken into account)
b_size = batch_size or getattr(args[0], "batch_size", None)
# no batching if b_size is None
i... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def query(
self, keys: "np.ndarray", top_k: int, *args, **kwargs
) -> Tuple[Optional["np.ndarray"], Optional["np.ndarray"]]:
"""Find the top-k vectors with smallest ``metric`` and return their ids in ascending order.
:return: a tuple of two ndarray.
The first is ids in shape B x K (`dtype=int`), th... | def query(
self, keys: "np.ndarray", top_k: int, *args, **kwargs
) -> Tuple["np.ndarray", "np.ndarray"]:
"""Find the top-k vectors with smallest ``metric`` and return their ids in ascending order.
:return: a tuple of two ndarray.
The first is ids in shape B x K (`dtype=int`), the second is metric i... | https://github.com/jina-ai/jina/issues/1229 | Traceback (most recent call last):
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 292, in msg_callback
self.zmqlet.send_message(self._callback(msg))
File "/home/cristian/envs/lyrics/lib/python3.7/site-packages/jina/peapods/pea.py", line 266, in _callback
self.pre_hook(msg).handl... | TypeError |
def resolve_filter_field(
self, auto_schema, model, filterset_class, field_name, filter_field
):
from django_filters.rest_framework import filters
unambiguous_mapping = {
filters.CharFilter: OpenApiTypes.STR,
filters.BooleanFilter: OpenApiTypes.BOOL,
filters.DateFilter: OpenApiTypes... | def resolve_filter_field(
self, auto_schema, model, filterset_class, field_name, filter_field
):
from django_filters.rest_framework import filters
unambiguous_mapping = {
filters.CharFilter: OpenApiTypes.STR,
filters.BooleanFilter: OpenApiTypes.BOOL,
filters.DateFilter: OpenApiTypes... | https://github.com/tfranzel/drf-spectacular/issues/323 | Warning #1: could not resolve field on model <class 'test_spectacular.models.TestModel'> with path "reltd_set". this is likely a custom field that does some unknown magic. maybe consider annotating the field/property? defaulting to "string". (Exception: TestModel has no field named 'reltd_set')
Traceback (most recent c... | AssertionError |
def _map_serializer_field(self, field, direction, collect_meta=True):
if collect_meta:
meta = self._get_serializer_field_meta(field)
else:
meta = {}
if has_override(field, "field"):
override = get_override(field, "field")
if is_basic_type(override):
schema = buil... | def _map_serializer_field(self, field, direction, collect_meta=True):
if collect_meta:
meta = self._get_serializer_field_meta(field)
else:
meta = {}
if has_override(field, "field"):
override = get_override(field, "field")
if is_basic_type(override):
schema = buil... | https://github.com/tfranzel/drf-spectacular/issues/323 | Warning #1: could not resolve field on model <class 'test_spectacular.models.TestModel'> with path "reltd_set". this is likely a custom field that does some unknown magic. maybe consider annotating the field/property? defaulting to "string". (Exception: TestModel has no field named 'reltd_set')
Traceback (most recent c... | AssertionError |
def _follow_field_source(model, path: List[str]):
"""
navigate through root model via given navigation path. supports forward/reverse relations.
"""
field_or_property = getattr(model, path[0], None)
if len(path) == 1:
# end of traversal
if isinstance(field_or_property, property):
... | def _follow_field_source(model, path: List[str]):
"""
navigate through root model via given navigation path. supports forward/reverse relations.
"""
field_or_property = getattr(model, path[0], None)
if len(path) == 1:
# end of traversal
if isinstance(field_or_property, property):
... | https://github.com/tfranzel/drf-spectacular/issues/323 | Warning #1: could not resolve field on model <class 'test_spectacular.models.TestModel'> with path "reltd_set". this is likely a custom field that does some unknown magic. maybe consider annotating the field/property? defaulting to "string". (Exception: TestModel has no field named 'reltd_set')
Traceback (most recent c... | AssertionError |
def get_schema_operation_parameters(self, auto_schema, *args, **kwargs):
if issubclass(self.target_class, SpectacularDjangoFilterBackendMixin):
warn(
"DEPRECATED - Spectacular's DjangoFilterBackend is superseded by extension. you "
"can simply restore this to the original class, exte... | def get_schema_operation_parameters(self, auto_schema, *args, **kwargs):
if issubclass(self.target_class, SpectacularDjangoFilterBackendMixin):
warn(
"DEPRECATED - Spectacular's DjangoFilterBackend is superseded by extension. you "
"can simply restore this to the original class, exte... | https://github.com/tfranzel/drf-spectacular/issues/252 | Environment:
Request Method: GET
Request URL: http://localhost:8000/api/schema/
Django Version: 3.1.5
Python Version: 3.8.2
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djang... | AssertionError |
def _map_model_field(self, model_field, direction):
assert isinstance(model_field, models.Field)
# to get a fully initialized serializer field we use DRF's own init logic
try:
field_cls, field_kwargs = serializers.ModelSerializer().build_field(
field_name=model_field.name,
in... | def _map_model_field(self, model_field, direction):
assert isinstance(model_field, models.Field)
# to get a fully initialized serializer field we use DRF's own init logic
try:
field_cls, field_kwargs = serializers.ModelSerializer().build_field(
field_name=model_field.name,
in... | https://github.com/tfranzel/drf-spectacular/issues/258 | Internal Server Error: /api/schema/
Traceback (most recent call last):
File "/home/alex/.cache/pypoetry/virtualenvs/foobarbaz-6qdzD22P-py3.9/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/alex/.cache/pypoetry/virtualenvs/foobarbaz-6qdzD22P-... | AttributeError |
def run(self, evidence, result):
"""Run the sshd_config analysis worker.
Args:
evidence (Evidence object): The evidence we will process.
result (TurbiniaTaskResult): The object to place task results into.
Returns:
TurbiniaTaskResult object.
"""
# Where to store the resulti... | def run(self, evidence, result):
"""Run the sshd_config analysis worker.
Args:
evidence (Evidence object): The evidence we will process.
result (TurbiniaTaskResult): The object to place task results into.
Returns:
TurbiniaTaskResult object.
"""
# Where to store the resulti... | https://github.com/google/turbinia/issues/522 | Traceback (most recent call last):
File "/turbinia/turbinia/workers/__init__.py", line 719, in run_wrapper
self.result = self.run(evidence, self.result)
File "/turbinia/turbinia/workers/sshd.py", line 58, in run
fh.write(output_evidence.text_data.encode('utf-8'))
TypeError: write() argument must be str, not bytes | TypeError |
def format_record(self, frame, file, lnum, func, lines, index):
"""Format a single stack frame"""
Colors = self.Colors # just a shorthand + quicker name lookup
ColorsNormal = Colors.Normal # used a lot
col_scheme = self.color_scheme_table.active_scheme_name
indent = " " * INDENT_SIZE
em_normal... | def format_record(self, frame, file, lnum, func, lines, index):
"""Format a single stack frame"""
Colors = self.Colors # just a shorthand + quicker name lookup
ColorsNormal = Colors.Normal # used a lot
col_scheme = self.color_scheme_table.active_scheme_name
indent = " " * INDENT_SIZE
em_normal... | https://github.com/ipython/ipython/issues/6864 | ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))
---------------------------------------------------------------------------
Exception Traceback (most recent call las... | Exception |
def _run_with_debugger(self, code, code_ns, filename=None, bp_line=None, bp_file=None):
"""
Run `code` in debugger with a break point.
Parameters
----------
code : str
Code to execute.
code_ns : dict
A namespace in which `code` is executed.
filename : str
`code` is r... | def _run_with_debugger(self, code, code_ns, filename=None, bp_line=None, bp_file=None):
"""
Run `code` in debugger with a break point.
Parameters
----------
code : str
Code to execute.
code_ns : dict
A namespace in which `code` is executed.
filename : str
`code` is r... | https://github.com/ipython/ipython/issues/10028 | ~/Workspace/puzzles/FiveThirtyEightRiddler $ ipython
Python 3.4.2 (default, Jun 20 2016, 14:25:19)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Pyt... | AttributeError |
def reload(
module, exclude=("sys", "os.path", builtin_mod_name, "__main__", "numpy._globals")
):
"""Recursively reload all modules used in the given module. Optionally
takes a list of modules to exclude from reloading. The default exclude
list contains sys, __main__, and __builtin__, to prevent, e.g.... | def reload(module, exclude=("sys", "os.path", builtin_mod_name, "__main__")):
"""Recursively reload all modules used in the given module. Optionally
takes a list of modules to exclude from reloading. The default exclude
list contains sys, __main__, and __builtin__, to prevent, e.g., resetting
display,... | https://github.com/ipython/ipython/issues/9983 | ======================================================================
ERROR: Test that NumPy can be deep reloaded.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/jenkins/shiningpanda/jobs/65e9266d/virtualenvs/d41d8cd9/lib/python3.4/site-packages... | nose.proxy.RuntimeError |
def global_matches(self, text):
"""Compute matches when text is a simple name.
Return a list of all keywords, built-in functions and names currently
defined in self.namespace or self.global_namespace that match.
"""
# print 'Completer->global_matches, txt=%r' % text # dbg
matches = []
matc... | def global_matches(self, text):
"""Compute matches when text is a simple name.
Return a list of all keywords, built-in functions and names currently
defined in self.namespace or self.global_namespace that match.
"""
# print 'Completer->global_matches, txt=%r' % text # dbg
matches = []
matc... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def attr_matches(self, text):
"""Compute matches when text contains a dot.
Assuming the text is of the form NAME.NAME....[NAME], and is
evaluatable in self.namespace or self.global_namespace, it will be
evaluated and its attributes (as revealed by dir()) are used as
possible completions. (For clas... | def attr_matches(self, text):
"""Compute matches when text contains a dot.
Assuming the text is of the form NAME.NAME....[NAME], and is
evaluatable in self.namespace or self.global_namespace, it will be
evaluated and its attributes (as revealed by dir()) are used as
possible completions. (For clas... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def get__all__entries(obj):
"""returns the strings in the __all__ attribute"""
try:
words = getattr(obj, "__all__")
except:
return []
return [cast_unicode_py2(w) for w in words if isinstance(w, string_types)]
| def get__all__entries(obj):
"""returns the strings in the __all__ attribute"""
try:
words = getattr(obj, "__all__")
except:
return []
return [w for w in words if isinstance(w, string_types)]
| https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def file_matches(self, text):
"""Match filenames, expanding ~USER type strings.
Most of the seemingly convoluted logic in this completer is an
attempt to handle filenames with spaces in them. And yet it's not
quite perfect, because Python's readline doesn't expose all of the
GNU readline details n... | def file_matches(self, text):
"""Match filenames, expanding ~USER type strings.
Most of the seemingly convoluted logic in this completer is an
attempt to handle filenames with spaces in them. And yet it's not
quite perfect, because Python's readline doesn't expose all of the
GNU readline details n... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def magic_matches(self, text):
"""Match magics"""
# print 'Completer->magic_matches:',text,'lb',self.text_until_cursor # dbg
# Get all shell magics now rather than statically, so magics loaded at
# runtime show up too.
lsm = self.shell.magics_manager.lsmagic()
line_magics = lsm["line"]
cell_... | def magic_matches(self, text):
"""Match magics"""
# print 'Completer->magic_matches:',text,'lb',self.text_until_cursor # dbg
# Get all shell magics now rather than statically, so magics loaded at
# runtime show up too.
lsm = self.shell.magics_manager.lsmagic()
line_magics = lsm["line"]
cell_... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def python_func_kw_matches(self, text):
"""Match named parameters (kwargs) of the last open function"""
if "." in text: # a parameter cannot be dotted
return []
try:
regexp = self.__funcParamsRegex
except AttributeError:
regexp = self.__funcParamsRegex = re.compile(
... | def python_func_kw_matches(self, text):
"""Match named parameters (kwargs) of the last open function"""
if "." in text: # a parameter cannot be dotted
return []
try:
regexp = self.__funcParamsRegex
except AttributeError:
regexp = self.__funcParamsRegex = re.compile(
... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def dispatch_custom_completer(self, text):
line = self.line_buffer
if not line.strip():
return None
# Create a little structure to pass all the relevant information about
# the current completion to any custom completer.
event = Bunch()
event.line = line
event.symbol = text
cmd ... | def dispatch_custom_completer(self, text):
# io.rprint("Custom! '%s' %s" % (text, self.custom_completers)) # dbg
line = self.line_buffer
if not line.strip():
return None
# Create a little structure to pass all the relevant information about
# the current completion to any custom completer.
... | https://github.com/ipython/ipython/issues/9379 | Python 2.7.11+ (default, Mar 30 2016, 21:00:42)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details abo... | TypeError |
def head(self, kernel_name, path):
return self.get(kernel_name, path, include_body=False)
| def head(self, kernel_name, path):
self.get(kernel_name, path, include_body=False)
| https://github.com/ipython/ipython/issues/7237 | [E 16:39:08.471 NotebookApp] Uncaught exception HEAD /kernelspecs/python3/kernel.css (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='HEAD', uri='/kernelspecs/python3/kernel.css', version='HTTP/1.1', remote_ip='::1', headers={'Content-Length': '0', 'Accept-Language': 'en-US,en;q=0.8,gl;q=0.6,sq;q... | AttributeError |
def enable(self, app=None):
"""Enable event loop integration with PyQt4.
Parameters
----------
app : Qt Application, optional.
Running application to use. If not given, we probe Qt for an
existing application object, and create a new one if none is found.
Notes
-----
This ... | def enable(self, app=None):
"""Enable event loop integration with PyQt4.
Parameters
----------
app : Qt Application, optional.
Running application to use. If not given, we probe Qt for an
existing application object, and create a new one if none is found.
Notes
-----
This ... | https://github.com/ipython/ipython/issues/6804 | In [4]: Traceback (most recent call last):
File "/Users/ehvatum/Desktop/ipython_git/IPython/lib/inputhookqt4.py", line 123, in inputhook_qt4
event_loop.exec_()
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 277,... | AttributeError |
def safe_execfile(self, fname, *where, **kw):
"""A safe version of the builtin execfile().
This version will never throw an exception, but instead print
helpful error messages to the screen. This only works on pure
Python files with the .py extension.
Parameters
----------
fname : string
... | def safe_execfile(self, fname, *where, **kw):
"""A safe version of the builtin execfile().
This version will never throw an exception, but instead print
helpful error messages to the screen. This only works on pure
Python files with the .py extension.
Parameters
----------
fname : string
... | https://github.com/ipython/ipython/issues/4835 | root@8e0bcc11822a:~# ipython test.py
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
173 else:
174 f... | ZeroDivisionError |
def check_pid(self, pid):
if os.name == "nt":
try:
import ctypes
# returns 0 if no such process (of ours) exists
# positive int otherwise
p = ctypes.windll.kernel32.OpenProcess(1, 0, pid)
except Exception:
self.log.warn(
"C... | def check_pid(self, pid):
if os.name == "nt":
try:
import ctypes
# returns 0 if no such process (of ours) exists
# positive int otherwise
p = ctypes.windll.kernel32.OpenProcess(1, 0, pid)
except Exception:
self.log.warn(
"C... | https://github.com/ipython/ipython/issues/4602 | Traceback (most recent call last):
File "/work/bin/ipcluster3", line 9, in <module>
load_entry_point('ipython==1.1.0', 'console_scripts', 'ipcluster3')()
File "/work/lib/python3.3/site-packages/IPython/config/application.py", line 545, in launch_instance
app.start()
File "/work/lib/python3.3/site-packages/IPython/paral... | TypeError |
def _run_with_debugger(self, code, code_ns, filename=None, bp_line=None, bp_file=None):
"""
Run `code` in debugger with a break point.
Parameters
----------
code : str
Code to execute.
code_ns : dict
A namespace in which `code` is executed.
filename : str
`code` is r... | def _run_with_debugger(self, code, code_ns, filename=None, bp_line=None, bp_file=None):
"""
Run `code` in debugger with a break point.
Parameters
----------
code : str
Code to execute.
code_ns : dict
A namespace in which `code` is executed.
filename : str
`code` is r... | https://github.com/ipython/ipython/issues/3043 | In [1]: %run -d ~/t.py
Breakpoint 1 at /home/sk/t.py:1
NOTE: Enter 'c' at the ipdb> prompt to start your script.
/home/sk/t.py(1)<module>()
1---> 1 from sympy import *
2 x = Symbol('x')
3 #bessely(0,x).series(x)
ipdb> n
/home/sk/t.py(2)<module>()
1 1 from sympy import *
----> 2 x = Symbol('x')
3 #bessely(0,x).ser... | AttributeError |
def win32_clipboard_get():
"""Get the current clipboard's text on Windows.
Requires Mark Hammond's pywin32 extensions.
"""
try:
import win32clipboard
except ImportError:
raise TryNext(
"Getting text from the clipboard requires the pywin32 "
"extensions: http:... | def win32_clipboard_get():
"""Get the current clipboard's text on Windows.
Requires Mark Hammond's pywin32 extensions.
"""
try:
import win32clipboard
except ImportError:
raise TryNext(
"Getting text from the clipboard requires the pywin32 "
"extensions: http:... | https://github.com/ipython/ipython/issues/3386 | In [1]: %paste
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-86b9186405a3> in <module>()
----> 1 get_ipython().magic('paste')
/usr/local/lib/python3.3/site-packages/IPython/core/interactiveshell.p... | TypeError |
def tkinter_clipboard_get():
"""Get the clipboard's text using Tkinter.
This is the default on systems that are not Windows or OS X. It may
interfere with other UI toolkits and should be replaced with an
implementation that uses that toolkit.
"""
try:
from tkinter import Tk, TclError #... | def tkinter_clipboard_get():
"""Get the clipboard's text using Tkinter.
This is the default on systems that are not Windows or OS X. It may
interfere with other UI toolkits and should be replaced with an
implementation that uses that toolkit.
"""
try:
from tkinter import Tk # Py 3
... | https://github.com/ipython/ipython/issues/3386 | In [1]: %paste
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-86b9186405a3> in <module>()
----> 1 get_ipython().magic('paste')
/usr/local/lib/python3.3/site-packages/IPython/core/interactiveshell.p... | TypeError |
def paste(self, parameter_s=""):
"""Paste & execute a pre-formatted code block from clipboard.
The text is pulled directly from the clipboard without user
intervention and printed back on the screen before execution (unless
the -q flag is given to force quiet mode).
The block is dedented prior to ... | def paste(self, parameter_s=""):
"""Paste & execute a pre-formatted code block from clipboard.
The text is pulled directly from the clipboard without user
intervention and printed back on the screen before execution (unless
the -q flag is given to force quiet mode).
The block is dedented prior to ... | https://github.com/ipython/ipython/issues/3386 | In [1]: %paste
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-86b9186405a3> in <module>()
----> 1 get_ipython().magic('paste')
/usr/local/lib/python3.3/site-packages/IPython/core/interactiveshell.p... | TypeError |
def tunnel_to_kernel(connection_info, sshserver, sshkey=None):
"""tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the
ports associated with the kernel. They can be either direct
localhost-localhost tunnels, or if an intermediate server is necess... | def tunnel_to_kernel(connection_info, sshserver, sshkey=None):
"""tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the
ports associated with the kernel. They can be either direct
localhost-localhost tunnels, or if an intermediate server is necess... | https://github.com/ipython/ipython/issues/1824 | [IPythonQtConsoleApp] Could not setup tunnels
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\IPython\frontend\consoleapp.py", line 289, in init_ssh
newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
File "C:\Python27\lib\site-packages\IPython\lib\kernel.py", line 248, in tunnel_to_ke... | TypeError |
def init_kernel(self):
"""Create the Kernel object itself"""
shell_stream = ZMQStream(self.shell_socket)
control_stream = ZMQStream(self.control_socket)
kernel_factory = import_item(str(self.kernel_class))
kernel = kernel_factory(
parent=self,
session=self.session,
shell_st... | def init_kernel(self):
"""Create the Kernel object itself"""
shell_stream = ZMQStream(self.shell_socket)
control_stream = ZMQStream(self.control_socket)
kernel_factory = import_item(str(self.kernel_class))
kernel = kernel_factory(
parent=self,
session=self.session,
shell_st... | https://github.com/ipython/ipython/issues/4005 | In [24]: IPython.start_kernel()
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-24-3a50fd41fe8b> in <module>()
----> 1 IPython.start_kernel()
/usr/local/lib/python2.7/site-packages/IPython/__init__.py... | ImportError |
def init_profile_dir(self):
"""initialize the profile dir"""
self._in_init_profile_dir = True
if self.profile_dir is not None:
# already ran
return
try:
# location explicitly specified:
location = self.config.ProfileDir.location
except AttributeError:
# locati... | def init_profile_dir(self):
"""initialize the profile dir"""
try:
# location explicitly specified:
location = self.config.ProfileDir.location
except AttributeError:
# location not specified, find by profile name
try:
p = ProfileDir.find_profile_dir_by_name(
... | https://github.com/ipython/ipython/issues/3837 | $ ipython notebook --NotebookApp.mathjax_url='foo'
Traceback (most recent call last):
File "/usr/local/share/python/ipython", line 9, in <module>
load_entry_point('ipython==1.0.dev', 'console_scripts', 'ipython')()
File "/Users/bussonniermatthias/ipython/IPython/__init__.py", line 118, in start_ipython
return launch_ne... | catch_config_error |
def from_filename(self, filename, resources=None, **kw):
"""
Convert a notebook from a notebook file.
Parameters
----------
filename : str
Full filename of the notebook file to open and convert.
"""
# Pull the metadata from the filesystem.
if resources is None:
resource... | def from_filename(self, filename, resources=None, **kw):
"""
Convert a notebook from a notebook file.
Parameters
----------
filename : str
Full filename of the notebook file to open and convert.
"""
# Pull the metadata from the filesystem.
if resources is None:
resource... | https://github.com/ipython/ipython/issues/3719 | C:\Users\jorgenst\notebooks> ipython nbconvert --format=basic_html .\Simple_pylab.ipynb
Traceback (most recent call last):
File "c:\Python27\Scripts\ipython-script.py", line 8, in <module>
load_entry_point('ipython==1.0dev', 'console_scripts', 'ipython')()
File "c:\python27\lib\site-packages\ipython-1.0dev-py2.7.egg\IP... | ValueError |
def interaction(self, frame, traceback):
self.shell.set_completer_frame(frame)
while True:
try:
OldPdb.interaction(self, frame, traceback)
except KeyboardInterrupt:
self.shell.write("\nKeyboardInterrupt\n")
else:
break
| def interaction(self, frame, traceback):
self.shell.set_completer_frame(frame)
OldPdb.interaction(self, frame, traceback)
| https://github.com/ipython/ipython/issues/3786 | ipdb> ---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-2-51af4340c641> in <module>()
----> 1 get_ipython().magic(u'debug ')
/home/fperez/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.py... | EOFError |
def open(self, kernel_id):
self.kernel_id = cast_unicode(kernel_id, "ascii")
self.session = Session(config=self.config)
self.save_on_message = self.on_message
self.on_message = self.on_first_message
| def open(self, kernel_id):
self.kernel_id = kernel_id.decode("ascii")
self.session = Session(config=self.config)
self.save_on_message = self.on_message
self.on_message = self.on_first_message
| https://github.com/ipython/ipython/issues/3494 | ---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-1-9b8a430d8199> in <module>()
----> 1 a = input()
/home/thomas/Code/virtualenvs/ipy-3/lib/python3.3/site-packages/ipython-1.0.dev-py3.3.egg/IPython/kern... | zmq.ZMQError |
def _inject_cookie_message(self, msg):
"""Inject the first message, which is the document cookie,
for authentication."""
if not PY3 and isinstance(msg, unicode):
# Cookie constructor doesn't accept unicode strings
# under Python 2.x for some reason
msg = msg.encode("utf8", "replace")... | def _inject_cookie_message(self, msg):
"""Inject the first message, which is the document cookie,
for authentication."""
if not PY3 and isinstance(msg, unicode):
# Cookie constructor doesn't accept unicode strings
# under Python 2.x for some reason
msg = msg.encode("utf8", "replace")... | https://github.com/ipython/ipython/issues/3494 | ---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-1-9b8a430d8199> in <module>()
----> 1 a = input()
/home/thomas/Code/virtualenvs/ipy-3/lib/python3.3/site-packages/ipython-1.0.dev-py3.3.egg/IPython/kern... | zmq.ZMQError |
def open(self, kernel_id):
self.kernel_id = kernel_id.decode("ascii")
self.session = Session(config=self.config)
self.save_on_message = self.on_message
self.on_message = self.on_first_message
| def open(self, kernel_id):
self.kernel_id = kernel_id.decode("ascii")
self.session = Session(parent=self)
self.save_on_message = self.on_message
self.on_message = self.on_first_message
| https://github.com/ipython/ipython/issues/3502 | ERROR:root:Uncaught exception in /kernels/3c8b14ec-662f-4360-bc2a-4706c67f8513/shell
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 254, in wrapper
return callback(*args, **kwargs)
File "/Users/bgranger/Documents/Computin... | TraitError |
def _handle_kernel_died(self, kernel_id):
"""notice that a kernel died"""
self.log.warn("Kernel %s died, removing from map.", kernel_id)
self.delete_mapping_for_kernel(kernel_id)
self.remove_kernel(kernel_id)
| def _handle_kernel_died(self, kernel_id):
"""notice that a kernel died"""
self.log.warn("Kernel %s died, removing from map.", kernel_id)
self.delete_mapping_for_kernel(kernel_id)
self.remove_kernel(kernel_id, now=True)
| https://github.com/ipython/ipython/issues/3474 | Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/restarter.py", line 85, in _fire_callbacks
callback()
File "/usr/local/lib/python2.7/dist-packages/IPython/frontend/html/notebook/services/kernels/kernelmanager.py", line 92, in <lambda>
lambda : self._handle_kernel_died(kern... | TypeError |
def check_startup_dir(self):
if not os.path.isdir(self.startup_dir):
os.mkdir(self.startup_dir)
readme = os.path.join(self.startup_dir, "README")
src = os.path.join(get_ipython_package_dir(), "config", "profile", "README_STARTUP")
if not os.path.exists(src):
self.log.warn(
"... | def check_startup_dir(self):
if not os.path.isdir(self.startup_dir):
os.mkdir(self.startup_dir)
readme = os.path.join(self.startup_dir, "README")
src = os.path.join(get_ipython_package_dir(), "config", "profile", "README_STARTUP")
if not os.path.exists(readme):
shutil.copy(src, readme)
| https://github.com/ipython/ipython/issues/2563 | Traceback (most recent call last):
[--snip--]
File "IPython\core\profiledir.pyc", line 106, in check_startup_dir
File "shutil.pyc", line 116, in copy
File "shutil.pyc", line 81, in copyfile
IOError: [Errno 2] No such file or directory: u'C:\\Documents and Settings\\User\\My Documents\\sofware\\dist\\library.zip\\IPytho... | IOError |
def __init__(self, parent, lexer=None):
super(PygmentsHighlighter, self).__init__(parent)
self._document = self.document()
self._formatter = HtmlFormatter(nowrap=True)
self._lexer = lexer if lexer else PythonLexer()
self.set_style("default")
| def __init__(self, parent, lexer=None):
super(PygmentsHighlighter, self).__init__(parent)
self._document = QtGui.QTextDocument()
self._formatter = HtmlFormatter(nowrap=True)
self._lexer = lexer if lexer else PythonLexer()
self.set_style("default")
| https://github.com/ipython/ipython/issues/3084 | if 1:
print 1
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/IPython/frontend/qt/console/frontend_widget.py", line 59, in highlightBlock
super(FrontendHighlighter, self).highlightBlock(string)
File "/usr/lib/python2.7/dist-packages/IPython/frontend/qt/console/pygments_highlighter.py", line 1... | AttributeError |
def launch_kernel(
cmd,
stdin=None,
stdout=None,
stderr=None,
independent=False,
cwd=None,
ipython_kernel=True,
**kw,
):
"""Launches a localhost kernel, binding to the specified ports.
Parameters
----------
cmd : Popen list,
A string of Python code that imports a... | def launch_kernel(
cmd,
stdin=None,
stdout=None,
stderr=None,
independent=False,
cwd=None,
ipython_kernel=True,
**kw,
):
"""Launches a localhost kernel, binding to the specified ports.
Parameters
----------
cmd : Popen list,
A string of Python code that imports a... | https://github.com/ipython/ipython/issues/3039 | C:\python\ipydevel\notebooks\åäö> ipython notebook
[NotebookApp] Using existing profile dir: u'C:\\Users\\jstenar\\.ipython\\profile_default'
[NotebookApp] Serving notebooks from local directory: C:\python\ipydevel\notebooks\åäö
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
[NotebookApp] Use ... | UnicodeEncodeError |
def osx_clipboard_get():
"""Get the clipboard's text on OS X."""
p = subprocess.Popen(["pbpaste", "-Prefer", "ascii"], stdout=subprocess.PIPE)
text, stderr = p.communicate()
# Text comes in with old Mac \r line endings. Change them to \n.
text = text.replace(b"\r", b"\n")
text = py3compat.cast_u... | def osx_clipboard_get():
"""Get the clipboard's text on OS X."""
p = subprocess.Popen(["pbpaste", "-Prefer", "ascii"], stdout=subprocess.PIPE)
text, stderr = p.communicate()
# Text comes in with old Mac \r line endings. Change them to \n.
text = text.replace("\r", "\n")
text = py3compat.cast_uni... | https://github.com/ipython/ipython/issues/2637 | In [1]: %paste
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-86b9186405a3> in <module>()
----> 1 get_ipython().magic('paste')
/sw/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/core/... | TypeError |
def osx_clipboard_get():
"""Get the clipboard's text on OS X."""
p = subprocess.Popen(["pbpaste", "-Prefer", "ascii"], stdout=subprocess.PIPE)
text, stderr = p.communicate()
# Text comes in with old Mac \r line endings. Change them to \n.
text = text.replace(b"\r", b"\n")
return text
| def osx_clipboard_get():
"""Get the clipboard's text on OS X."""
p = subprocess.Popen(["pbpaste", "-Prefer", "ascii"], stdout=subprocess.PIPE)
text, stderr = p.communicate()
# Text comes in with old Mac \r line endings. Change them to \n.
text = text.replace("\r", "\n")
return text
| https://github.com/ipython/ipython/issues/2637 | In [1]: %paste
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-86b9186405a3> in <module>()
----> 1 get_ipython().magic('paste')
/sw/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/core/... | TypeError |
def __init__(self, session, pub_socket, name):
self.encoding = "UTF-8"
self.session = session
self.pub_socket = pub_socket
self.name = name
self.parent_header = {}
self._new_buffer()
| def __init__(self, session, pub_socket, name):
self.session = session
self.pub_socket = pub_socket
self.name = name
self.parent_header = {}
self._new_buffer()
| https://github.com/ipython/ipython/issues/2220 | % ./ipython.py console
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
Type "copyright", "credits" or "license" for more information.
IPython 0.14.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
obj... | AttributeError |
def write(self, string):
if self.pub_socket is None:
raise ValueError("I/O operation on closed file")
else:
# Make sure that we're handling unicode
if not isinstance(string, unicode):
string = string.decode(self.encoding, "replace")
self._buffer.write(string)
... | def write(self, string):
if self.pub_socket is None:
raise ValueError("I/O operation on closed file")
else:
# Make sure that we're handling unicode
if not isinstance(string, unicode):
enc = encoding.DEFAULT_ENCODING
string = string.decode(enc, "replace")
... | https://github.com/ipython/ipython/issues/2220 | % ./ipython.py console
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
Type "copyright", "credits" or "license" for more information.
IPython 0.14.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
obj... | AttributeError |
def __init__(self, profile="default", hist_file="", config=None, **traits):
"""Create a new history accessor.
Parameters
----------
profile : str
The name of the profile from which to open history.
hist_file : str
Path to an SQLite history database stored by IPython. If specified,
... | def __init__(self, profile="default", hist_file="", config=None, **traits):
"""Create a new history accessor.
Parameters
----------
profile : str
The name of the profile from which to open history.
hist_file : str
Path to an SQLite history database stored by IPython. If specified,
... | https://github.com/ipython/ipython/issues/2097 | (master)dreamweaver[nbconvert]> ip
Traceback (most recent call last):
File "/home/fperez/usr/bin/ipython", line 7, in <module>
launch_new_instance()
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 388, in launch_new_instance
app.initialize()
File "<string>", line 2, in initi... | DatabaseError |
def format_stack_entry(self, frame_lineno, lprefix=": ", context=3):
import repr
ret = []
Colors = self.color_scheme_table.active_colors
ColorsNormal = Colors.Normal
tpl_link = "%s%%s%s" % (Colors.filenameEm, ColorsNormal)
tpl_call = "%s%%s%s%%s%s" % (Colors.vName, Colors.valEm, ColorsNormal)
... | def format_stack_entry(self, frame_lineno, lprefix=": ", context=3):
import linecache, repr
ret = []
Colors = self.color_scheme_table.active_colors
ColorsNormal = Colors.Normal
tpl_link = "%s%%s%s" % (Colors.filenameEm, ColorsNormal)
tpl_call = "%s%%s%s%%s%s" % (Colors.vName, Colors.valEm, Col... | https://github.com/ipython/ipython/issues/1688 | In [1]: %run err.py
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
C:\python\ipydevel\VENV\Py27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
166 ... | ZeroDivisionError |
def print_list_lines(self, filename, first, last):
"""The printing (as opposed to the parsing part of a 'list'
command."""
try:
Colors = self.color_scheme_table.active_colors
ColorsNormal = Colors.Normal
tpl_line = "%%s%s%%s %s%%s" % (Colors.lineno, ColorsNormal)
tpl_line_em ... | def print_list_lines(self, filename, first, last):
"""The printing (as opposed to the parsing part of a 'list'
command."""
try:
Colors = self.color_scheme_table.active_colors
ColorsNormal = Colors.Normal
tpl_line = "%%s%s%%s %s%%s" % (Colors.lineno, ColorsNormal)
tpl_line_em ... | https://github.com/ipython/ipython/issues/1688 | In [1]: %run err.py
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
C:\python\ipydevel\VENV\Py27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
166 ... | ZeroDivisionError |
def getdoc(obj):
"""Stable wrapper around inspect.getdoc.
This can't crash because of attribute problems.
It also attempts to call a getdoc() method on the given object. This
allows objects which provide their docstrings via non-standard mechanisms
(like Pyro proxies) to still be inspected by ipy... | def getdoc(obj):
"""Stable wrapper around inspect.getdoc.
This can't crash because of attribute problems.
It also attempts to call a getdoc() method on the given object. This
allows objects which provide their docstrings via non-standard mechanisms
(like Pyro proxies) to still be inspected by ipy... | https://github.com/ipython/ipython/issues/1688 | In [1]: %run err.py
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
C:\python\ipydevel\VENV\Py27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
166 ... | ZeroDivisionError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.