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 any(a, axis=None, out=None, keepdims=False):
assert isinstance(a, cupy.ndarray)
return a.any(axis=axis, out=out, keepdims=keepdims)
| def any(a, axis=None, out=None, keepdims=False):
# TODO(okuta): check type
return a.any(axis=axis, out=out, keepdims=keepdims)
| https://github.com/cupy/cupy/issues/266 | np.empty((0, 1)).argmax(axis=1) # array([], dtype=int64)
cupy.empty((0, 1)).argmax(axis=1)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-9-a5737d72bcba> in <module>()
----> 1 cupy.empty((0, 1)).argm... | ValueError |
def nonzero(a):
"""Return the indices of the elements that are non-zero.
Returns a tuple of arrays, one for each dimension of a,
containing the indices of the non-zero elements in that dimension.
Args:
a (cupy.ndarray): array
Returns:
tuple of arrays: Indices of elements that are ... | def nonzero(a):
"""Return the indices of the elements that are non-zero.
Returns a tuple of arrays, one for each dimension of a,
containing the indices of the non-zero elements in that dimension.
Args:
a (cupy.ndarray): array
Returns:
tuple of arrays: Indices of elements that are ... | https://github.com/cupy/cupy/issues/252 | numpy
shape=() => (array([0]),)
shape=(0,) => (array([], dtype=int64),)
shape=(1,) => (array([0]),)
shape=(0, 2) => (array([], dtype=int64), array([], dtype=int64))
shape=(0, 0, 2, 0) => (array([], dtype=int64), array([], dtype=int64), array([], dtype=int64), array([], dty... | cupy.cuda.driver.CUDADriverError |
def flatnonzero(a):
"""Return indices that are non-zero in the flattened version of a.
This is equivalent to a.ravel().nonzero()[0].
Args:
a (cupy.ndarray): input array
Returns:
cupy.ndarray: Output array,
containing the indices of the elements of a.ravel() that are non-zero.
... | def flatnonzero(a):
"""Return indices that are non-zero in the flattened version of a.
This is equivalent to a.ravel().nonzero()[0].
Args:
a (cupy.ndarray): input array
Returns:
cupy.ndarray: Output array,
containing the indices of the elements of a.ravel() that are non-zero.
... | https://github.com/cupy/cupy/issues/252 | numpy
shape=() => (array([0]),)
shape=(0,) => (array([], dtype=int64),)
shape=(1,) => (array([0]),)
shape=(0, 2) => (array([], dtype=int64), array([], dtype=int64))
shape=(0, 0, 2, 0) => (array([], dtype=int64), array([], dtype=int64), array([], dtype=int64), array([], dty... | cupy.cuda.driver.CUDADriverError |
def _get_positive_axis(ndim, axis):
a = axis
if a < 0:
a += ndim
if a < 0 or a >= ndim:
raise core.core._AxisError("axis {} out of bounds [0, {})".format(axis, ndim))
return a
| def _get_positive_axis(ndim, axis):
a = axis
if a < 0:
a += ndim
if a < 0 or a >= ndim:
raise IndexError("axis {} out of bounds [0, {})".format(axis, ndim))
return a
| https://github.com/cupy/cupy/issues/342 | import cupy
cupy.cumprod
<function cumprod at 0x7f9a460b4c80>
cupy.cumprod(cupy.ndarray(()), axis=-10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/cupy/math/sumprod.py", line 206, in cumprod
raise numpy.AxisError('axis(={}) out of bounds'.format(axis))
AttributeError: module... | AttributeError |
def roll(a, shift, axis=None):
"""Roll array elements along a given axis.
Args:
a (~cupy.ndarray): Array to be rolled.
shift (int): The number of places by which elements are shifted.
axis (int or None): The axis along which elements are shifted.
If ``axis`` is ``None``, the... | def roll(a, shift, axis=None):
"""Roll array elements along a given axis.
Args:
a (~cupy.ndarray): Array to be rolled.
shift (int): The number of places by which elements are shifted.
axis (int or None): The axis along which elements are shifted.
If ``axis`` is ``None``, the... | https://github.com/cupy/cupy/issues/342 | import cupy
cupy.cumprod
<function cumprod at 0x7f9a460b4c80>
cupy.cumprod(cupy.ndarray(()), axis=-10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/cupy/math/sumprod.py", line 206, in cumprod
raise numpy.AxisError('axis(={}) out of bounds'.format(axis))
AttributeError: module... | AttributeError |
def cumsum(a, axis=None, dtype=None, out=None):
"""Returns the cumulative sum of an array along a given axis.
Args:
a (cupy.ndarray): Input array.
axis (int): Axis along which the cumulative sum is taken. If it is not
specified, the input is flattened.
dtype: Data type specifier... | def cumsum(a, axis=None, dtype=None, out=None):
"""Returns the cumulative sum of an array along a given axis.
Args:
a (cupy.ndarray): Input array.
axis (int): Axis along which the cumulative sum is taken. If it is not
specified, the input is flattened.
dtype: Data type specifier... | https://github.com/cupy/cupy/issues/342 | import cupy
cupy.cumprod
<function cumprod at 0x7f9a460b4c80>
cupy.cumprod(cupy.ndarray(()), axis=-10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/cupy/math/sumprod.py", line 206, in cumprod
raise numpy.AxisError('axis(={}) out of bounds'.format(axis))
AttributeError: module... | AttributeError |
def cumprod(a, axis=None, dtype=None, out=None):
"""Returns the cumulative product of an array along a given axis.
Args:
a (cupy.ndarray): Input array.
axis (int): Axis along which the cumulative product is taken. If it is
not specified, the input is flattened.
dtype: Data type ... | def cumprod(a, axis=None, dtype=None, out=None):
"""Returns the cumulative product of an array along a given axis.
Args:
a (cupy.ndarray): Input array.
axis (int): Axis along which the cumulative product is taken. If it is
not specified, the input is flattened.
dtype: Data type ... | https://github.com/cupy/cupy/issues/342 | import cupy
cupy.cumprod
<function cumprod at 0x7f9a460b4c80>
cupy.cumprod(cupy.ndarray(()), axis=-10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/cupy/math/sumprod.py", line 206, in cumprod
raise numpy.AxisError('axis(={}) out of bounds'.format(axis))
AttributeError: module... | AttributeError |
def bincount(x, weights=None, minlength=None):
"""Count number of occurrences of each value in array of non-negative ints.
Args:
x (cupy.ndarray): Input array.
weights (cupy.ndarray): Weights array which has the same shape as
``x``.
minlength (int): A minimum number of bins ... | def bincount(x, weights=None, minlength=None):
"""Count number of occurrences of each value in array of non-negative ints.
Args:
x (cupy.ndarray): Input array.
weights (cupy.ndarray): Weights array which has the same shape as
``x``.
minlength (int): A minimum number of bins ... | https://github.com/cupy/cupy/issues/342 | import cupy
cupy.cumprod
<function cumprod at 0x7f9a460b4c80>
cupy.cumprod(cupy.ndarray(()), axis=-10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/cupy/math/sumprod.py", line 206, in cumprod
raise numpy.AxisError('axis(={}) out of bounds'.format(axis))
AttributeError: module... | AttributeError |
def _convert_from_ufunc(ufunc):
nin = ufunc.nin
nout = ufunc.nout
def get_mem(args):
for i in args:
if type(i) == _FusionRef:
return i._mem
raise Exception("number of ndarray arguments must be more than 0")
def can_cast1(args, ty_ins):
for i in six.m... | def _convert_from_ufunc(ufunc):
nin = ufunc.nin
nout = ufunc.nout
def get_mem(args):
for i in args:
if type(i) == _FusionRef:
return i._mem
raise Exception("number of ndarray arguments must be more than 0")
def can_cast1(args, ty_ins):
for i in six.m... | https://github.com/cupy/cupy/issues/209 | Traceback (most recent call last):
File "test-out.py", line 13, in <module>
func(a, b, z)
File "/repos/cupy/cupy/core/fusion.py", line 602, in __call__
return self._call(*args, **kwargs)
File "/repos/cupy/cupy/core/fusion.py", line 628, in _call
self.post_map, self.identity, types)
File "/repos/cupy/cupy/core/fusion.py... | AttributeError |
def res(*args, **kwargs):
mem = get_mem(args)
var_list = [_normalize_arg(_, mem) for _ in args]
if "out" in kwargs:
var_list.append(_normalize_arg(kwargs.pop("out"), mem))
if kwargs:
raise TypeError("Wrong arguments %s" % kwargs)
assert nin <= len(var_list) <= nin + nout
in_vars ... | def res(*args, **kwargs):
mem = get_mem(args)
var_list = [_normalize_arg(_, mem) for _ in args]
if "out" in kwargs:
var_list.append(_normalize_arg.pop("out"))
if kwargs:
raise TypeError("Wrong arguments %s" % kwargs)
assert nin <= len(var_list) and len(var_list) <= nin + nout
in_... | https://github.com/cupy/cupy/issues/209 | Traceback (most recent call last):
File "test-out.py", line 13, in <module>
func(a, b, z)
File "/repos/cupy/cupy/core/fusion.py", line 602, in __call__
return self._call(*args, **kwargs)
File "/repos/cupy/cupy/core/fusion.py", line 628, in _call
self.post_map, self.identity, types)
File "/repos/cupy/cupy/core/fusion.py... | AttributeError |
def _get_fusion(func, nin, reduce, post_map, identity, input_types, name=None):
in_vars = [_FusionVar(i, t) for i, t in enumerate(input_types)]
mem = _FusionMem(in_vars)
in_refs = [_FusionRef(_, mem) for _ in in_vars]
out_refs = func(*in_refs)
out_refs = list(out_refs) if type(out_refs) == tuple els... | def _get_fusion(func, nin, reduce, post_map, identity, input_types, name=None):
in_vars = [_FusionVar(i, t) for i, t in enumerate(input_types)]
mem = _FusionMem(in_vars)
in_refs = [_FusionRef(_, mem) for _ in in_vars]
out_refs = func(*in_refs)
out_refs = list(out_refs) if type(out_refs) == tuple els... | https://github.com/cupy/cupy/issues/209 | Traceback (most recent call last):
File "test-out.py", line 13, in <module>
func(a, b, z)
File "/repos/cupy/cupy/core/fusion.py", line 602, in __call__
return self._call(*args, **kwargs)
File "/repos/cupy/cupy/core/fusion.py", line 628, in _call
self.post_map, self.identity, types)
File "/repos/cupy/cupy/core/fusion.py... | AttributeError |
def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]:
"""Return a list of :class:`ProtoComment` objects parsed from the given `prefix`."""
result: List[ProtoComment] = []
if not prefix or "#" not in prefix:
return result
consumed = 0
nlines = 0
ignored_lines = 0
... | def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]:
"""Return a list of :class:`ProtoComment` objects parsed from the given `prefix`."""
result: List[ProtoComment] = []
if not prefix or "#" not in prefix:
return result
consumed = 0
nlines = 0
ignored_lines = 0
... | https://github.com/psf/black/issues/1913 | fuzz run-test: commands[2] | coverage run fuzz.py
<string>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
<string>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
<string>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
<string>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
<s... | libcst._nodes.base.CSTValidationError |
def mark(self, leaf: Leaf) -> None:
"""Mark `leaf` with bracket-related metadata. Keep track of delimiters.
All leaves receive an int `bracket_depth` field that stores how deep
within brackets a given leaf is. 0 means there are no enclosing brackets
that started on this line.
If a leaf is itself a... | def mark(self, leaf: Leaf) -> None:
"""Mark `leaf` with bracket-related metadata. Keep track of delimiters.
All leaves receive an int `bracket_depth` field that stores how deep
within brackets a given leaf is. 0 means there are no enclosing brackets
that started on this line.
If a leaf is itself a... | https://github.com/psf/black/issues/1597 | $ cat author.py
class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
def xxxxxxx_xxxxxx(xxxx):
assert xxxxxxx_xxxx in [
x.xxxxx.xxxxxx.xxxxx.xxxxxx,
x.xxxxx.xxxxxx.xxxxx.xxxx,
], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
$ black -v author.py
Using configuration from /Users/jelle/py/black/pyproj... | KeyError |
def do_transform(self, line: Line, string_idx: int) -> Iterator[TResult[Line]]:
LL = line.leaves
string_parser = StringParser()
rpar_idx = string_parser.parse(LL, string_idx)
for leaf in (LL[string_idx - 1], LL[rpar_idx]):
if line.comments_after(leaf):
yield TErr(
"... | def do_transform(self, line: Line, string_idx: int) -> Iterator[TResult[Line]]:
LL = line.leaves
string_parser = StringParser()
rpar_idx = string_parser.parse(LL, string_idx)
for leaf in (LL[string_idx - 1], LL[rpar_idx]):
if line.comments_after(leaf):
yield TErr(
"... | https://github.com/psf/black/issues/1597 | $ cat author.py
class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
def xxxxxxx_xxxxxx(xxxx):
assert xxxxxxx_xxxx in [
x.xxxxx.xxxxxx.xxxxx.xxxxxx,
x.xxxxx.xxxxxx.xxxxx.xxxx,
], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
$ black -v author.py
Using configuration from /Users/jelle/py/black/pyproj... | KeyError |
def append_leaves(
new_line: Line, old_line: Line, leaves: List[Leaf], preformatted: bool = False
) -> None:
"""
Append leaves (taken from @old_line) to @new_line, making sure to fix the
underlying Node structure where appropriate.
All of the leaves in @leaves are duplicated. The duplicates are the... | def append_leaves(new_line: Line, old_line: Line, leaves: List[Leaf]) -> None:
"""
Append leaves (taken from @old_line) to @new_line, making sure to fix the
underlying Node structure where appropriate.
All of the leaves in @leaves are duplicated. The duplicates are then
appended to @new_line and us... | https://github.com/psf/black/issues/1597 | $ cat author.py
class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
def xxxxxxx_xxxxxx(xxxx):
assert xxxxxxx_xxxx in [
x.xxxxx.xxxxxx.xxxxx.xxxxxx,
x.xxxxx.xxxxxx.xxxxx.xxxx,
], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
$ black -v author.py
Using configuration from /Users/jelle/py/black/pyproj... | KeyError |
def __validate_msg(line: Line, string_idx: int) -> TResult[None]:
"""Validate (M)erge (S)tring (G)roup
Transform-time string validation logic for __merge_string_group(...).
Returns:
* Ok(None), if ALL validation checks (listed below) pass.
OR
* Err(CannotTransform), if any of t... | def __validate_msg(line: Line, string_idx: int) -> TResult[None]:
"""Validate (M)erge (S)tring (G)roup
Transform-time string validation logic for __merge_string_group(...).
Returns:
* Ok(None), if ALL validation checks (listed below) pass.
OR
* Err(CannotTransform), if any of t... | https://github.com/psf/black/issues/1596 | $ cat xxx.py
xxxxxxx_xxxxxx_xxxxxxx = xxx(
[
xxxxxxxxxxxx(
xxxxxx_xxxxxxx=(
'((x.xxxxxxxxx = "xxxxxx.xxxxxxxxxxxxxxxxxxxxx") || (x.xxxxxxxxx = "xxxxxxxxxxxx")) && '
# xxxxx xxxxxxxxxxxx xxxx xxx (xxxxxxxxxxxxxxxx) xx x xxxxxxxxx xx xxxxxx.
"(x.xxxxxxxxxxxx.xxx != "
'"xxx:xxx:xxx::xxxxxxxxxxxx:xxxxxxx-xxxx/xxxxx... | AssertionError |
def normalize_path_maybe_ignore(
path: Path, root: Path, report: "Report"
) -> Optional[str]:
"""Normalize `path`. May return `None` if `path` was ignored.
`report` is where "path ignored" output goes.
"""
try:
abspath = path if path.is_absolute() else Path.cwd() / path
normalized_p... | def normalize_path_maybe_ignore(
path: Path, root: Path, report: "Report"
) -> Optional[str]:
"""Normalize `path`. May return `None` if `path` was ignored.
`report` is where "path ignored" output goes.
"""
try:
normalized_path = path.resolve().relative_to(root).as_posix()
except OSError... | https://github.com/psf/black/issues/1631 | root@2d592a60ac50:/# /opt/conda/envs/lib3to6_py38/bin/black src/
Traceback (most recent call last):
File "/opt/conda/envs/lib3to6_py38/bin/black", line 8, in <module>
sys.exit(patched_main())
File "/opt/conda/envs/lib3to6_py38/lib/python3.8/site-packages/black/__init__.py", line 6607, in patched_main
main()
File "/opt/... | ValueError |
def parse_pyproject_toml(path_config: str) -> Dict[str, Any]:
"""Parse a pyproject toml file, pulling out relevant parts for Black
If parsing fails, will raise a toml.TomlDecodeError
"""
pyproject_toml = toml.load(path_config)
config = pyproject_toml.get("tool", {}).get("black", {})
return {k.r... | def parse_pyproject_toml(path_config: str) -> Dict[str, Any]:
"""Parse a pyproject toml file, pulling out relevant parts for Black
If parsing fails, will raise a toml.TomlDecodeError
"""
pyproject_toml = toml.load(path_config)
config = pyproject_toml.get("tool", {}).get("black", {})
return {
... | https://github.com/psf/black/issues/1496 | $ python -m unittest
E....[2020-06-14 14:22:15,341] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,342] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,680] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,682] DEBU... | ImportError |
def read_pyproject_toml(
ctx: click.Context, param: click.Parameter, value: Optional[str]
) -> Optional[str]:
"""Inject Black configuration from "pyproject.toml" into defaults in `ctx`.
Returns the path to a successfully found and read configuration file, None
otherwise.
"""
if not value:
... | def read_pyproject_toml(
ctx: click.Context, param: click.Parameter, value: Optional[str]
) -> Optional[str]:
"""Inject Black configuration from "pyproject.toml" into defaults in `ctx`.
Returns the path to a successfully found and read configuration file, None
otherwise.
"""
if not value:
... | https://github.com/psf/black/issues/1496 | $ python -m unittest
E....[2020-06-14 14:22:15,341] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,342] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,680] DEBUG: Using selector: EpollSelector (selector_events.py:59)
.[2020-06-14 14:22:15,682] DEBU... | ImportError |
def reformat_many(
sources: Set[Path], fast: bool, write_back: WriteBack, mode: Mode, report: "Report"
) -> None:
"""Reformat multiple files using a ProcessPoolExecutor."""
loop = asyncio.get_event_loop()
worker_count = os.cpu_count()
if sys.platform == "win32":
# Work around https://bugs.py... | def reformat_many(
sources: Set[Path], fast: bool, write_back: WriteBack, mode: Mode, report: "Report"
) -> None:
"""Reformat multiple files using a ProcessPoolExecutor."""
loop = asyncio.get_event_loop()
worker_count = os.cpu_count()
if sys.platform == "win32":
# Work around https://bugs.py... | https://github.com/psf/black/issues/776 | |Traceback (most recent call last):
| File "/usr/local/lib/XXX/virtualenv/bin/black", line 11, in <module>
| sys.exit(patched_main())
| File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/black.py", line 3754, in patched_main
| main()
| File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-package... | OSError |
async def schedule_formatting(
sources: Set[Path],
fast: bool,
write_back: WriteBack,
mode: Mode,
report: "Report",
loop: asyncio.AbstractEventLoop,
executor: Optional[Executor],
) -> None:
"""Run formatting of `sources` in parallel using the provided `executor`.
(Use ProcessPoolExe... | async def schedule_formatting(
sources: Set[Path],
fast: bool,
write_back: WriteBack,
mode: Mode,
report: "Report",
loop: asyncio.AbstractEventLoop,
executor: Executor,
) -> None:
"""Run formatting of `sources` in parallel using the provided `executor`.
(Use ProcessPoolExecutors for... | https://github.com/psf/black/issues/776 | |Traceback (most recent call last):
| File "/usr/local/lib/XXX/virtualenv/bin/black", line 11, in <module>
| sys.exit(patched_main())
| File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/black.py", line 3754, in patched_main
| main()
| File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-package... | OSError |
def main(
ctx: click.Context,
code: Optional[str],
line_length: int,
target_version: List[TargetVersion],
check: bool,
diff: bool,
fast: bool,
pyi: bool,
py36: bool,
skip_string_normalization: bool,
quiet: bool,
verbose: bool,
include: str,
exclude: str,
src: ... | def main(
ctx: click.Context,
code: Optional[str],
line_length: int,
target_version: List[TargetVersion],
check: bool,
diff: bool,
fast: bool,
pyi: bool,
py36: bool,
skip_string_normalization: bool,
quiet: bool,
verbose: bool,
include: str,
exclude: str,
src: ... | https://github.com/psf/black/issues/564 | Exception in thread QueueManagerThread:
Traceback (most recent call last):
File "c:\python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "c:\python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "c:\python37\lib\concurrent\futures\process.py", line 354, in _que... | ValueError |
def gen_python_files_in_dir(
path: Path,
root: Path,
include: Pattern[str],
exclude: Pattern[str],
report: "Report",
) -> Iterator[Path]:
"""Generate all files under `path` whose paths are not excluded by the
`exclude` regex, but are included by the `include` regex.
Symbolic links point... | def gen_python_files_in_dir(
path: Path,
root: Path,
include: Pattern[str],
exclude: Pattern[str],
report: "Report",
) -> Iterator[Path]:
"""Generate all files under `path` whose paths are not excluded by the
`exclude` regex, but are included by the `include` regex.
`report` is where ou... | https://github.com/psf/black/issues/338 | Traceback (most recent call last):
File "/home/neraste/.virtualenvs/test_black/bin/black", line 11, in <module>
sys.exit(main())
File "/home/neraste/.virtualenvs/test_black/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/neraste/.virtualenvs/test_black/lib... | ValueError |
def dump_to_file(*output: str) -> str:
"""Dump `output` to a temporary file. Return path to the file."""
import tempfile
with tempfile.NamedTemporaryFile(
mode="w", prefix="blk_", suffix=".log", delete=False, encoding="utf8"
) as f:
for lines in output:
f.write(lines)
... | def dump_to_file(*output: str) -> str:
"""Dump `output` to a temporary file. Return path to the file."""
import tempfile
with tempfile.NamedTemporaryFile(
mode="w", prefix="blk_", suffix=".log", delete=False
) as f:
for lines in output:
f.write(lines)
if lines an... | https://github.com/psf/black/issues/124 | ERROR: test_expression_diff (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\zsolz\documents\github\black\tests\test_black.py", line 165, in test_expression_diff
tmp_file = Path(black.dump_to_file(source))
File "c:\... | UnicodeEncodeError |
def add_graph(
self,
adjacency_matrix,
node_coords,
node_color="auto",
node_size=50,
edge_cmap=cm.bwr,
edge_vmin=None,
edge_vmax=None,
edge_threshold=None,
edge_kwargs=None,
node_kwargs=None,
colorbar=False,
):
"""Plot undirected graph on each of the axes
Paramet... | def add_graph(
self,
adjacency_matrix,
node_coords,
node_color="auto",
node_size=50,
edge_cmap=cm.bwr,
edge_vmin=None,
edge_vmax=None,
edge_threshold=None,
edge_kwargs=None,
node_kwargs=None,
colorbar=False,
):
"""Plot undirected graph on each of the axes
Paramet... | https://github.com/nilearn/nilearn/issues/2303 | ValueError Traceback (most recent call last)
<ipython-input-23-1935b6c630f1> in <module>()
----> 1 plotting.plot_connectome(connetome, coords, node_color=np.array(['red','seagreen','blue']))
/home/xiakon/.conda/envs/bigpype/lib/python2.7/site-packages/nilearn/plotting/img_plotting.pyc in... | ValueError |
def view_stat_map(stat_map_img, threshold=None, bg_img=None, vmax=None):
"""
Insert a surface plot of a surface map into an HTML page.
Parameters
----------
stat_map_img : Niimg-like object
See http://nilearn.github.io/manipulating_images/input_output.html
The statistical map image.... | def view_stat_map(stat_map_img, threshold=None, bg_img=None, vmax=None):
"""
Insert a surface plot of a surface map into an HTML page.
Parameters
----------
stat_map_img : Niimg-like object
See http://nilearn.github.io/manipulating_images/input_output.html
The statistical map image
... | https://github.com/nilearn/nilearn/issues/1725 | plotting.view_stat_map(decoder.coef_img_, bg_img=haxby_dataset.anat[0])
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-30-dde0b99b81f1> in <module>()
----> 1 plotting.view_stat_map(decoder.coef_img_, ... | ValueError |
def add_markers(self, marker_coords, marker_color="r", marker_size=30, **kwargs):
"""Add markers to the plot.
Parameters
----------
marker_coords: array of size (n_markers, 3)
Coordinates of the markers to plot. For each slice, only markers
that are 2 millimeters away from the slice are... | def add_markers(self, marker_coords, marker_color="r", marker_size=30, **kwargs):
"""Add markers to the plot.
Parameters
----------
marker_coords: array of size (n_markers, 3)
Coordinates of the markers to plot. For each slice, only markers
that are 2 millimeters away from the slice are... | https://github.com/nilearn/nilearn/issues/1595 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-10-8bfe69e50628> in <module>()
4 # and third argument `marker_size` denotes size of the sphere
5 coords = [(-34, -39, -9)]
----> 6 fig.add_markers(coords... | TypeError |
def fast_abs_percentile(data, percentile=80):
"""A fast version of the percentile of the absolute value.
Parameters
==========
data: ndarray, possibly masked array
The input data
percentile: number between 0 and 100
The percentile that we are asking for
Returns
=======
... | def fast_abs_percentile(data, percentile=80):
"""A fast version of the percentile of the absolute value.
Parameters
==========
data: ndarray, possibly masked array
The input data
percentile: number between 0 and 100
The percentile that we are asking for
Returns
=======
... | https://github.com/nilearn/nilearn/issues/872 | IndexError Traceback (most recent call last)
<ipython-input-29-094589b8fe4e> in <module>()
----> 1 fast_abs_percentile(arange(4))
/home/elvis/CODE/FORKED/nilearn/nilearn/_utils/extmath.pyc in fast_abs_percentile(data, percentile)
43 if partition is not None:
44 # Partial sort... | IndexError |
def _log_started_message(self, listeners: List[socket.SocketType]) -> None:
config = self.config
if config.fd is not None:
sock = listeners[0]
logger.info(
"Uvicorn running on socket %s (Press CTRL+C to quit)",
sock.getsockname(),
)
elif config.uds is not No... | def _log_started_message(self, listeners: List[socket.SocketType]) -> None:
config = self.config
if config.fd is not None:
sock = listeners[0]
logger.info(
"Uvicorn running on socket %s (Press CTRL+C to quit)",
sock.getsockname(),
)
elif config.uds is not No... | https://github.com/encode/uvicorn/issues/974 | [12:03:58] D:\sand\uvicorn-port-error
λ venv\win32-3.8\Scripts\uvicorn example:app --port=0
INFO: Started server process [31268]
INFO: Waiting for application startup.
INFO: ASGI 'lifespan' protocol appears unsupported.
INFO: Application startup complete.
Traceback (most recent call last):
File "C:\Prog... | OSError |
async def asgi_send(self, message):
message_type = message["type"]
if not self.handshake_started_event.is_set():
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self.scope["root_... | async def asgi_send(self, message):
message_type = message["type"]
if not self.handshake_started_event.is_set():
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self.scope["root_... | https://github.com/encode/uvicorn/issues/244 | Traceback (most recent call last):
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
result = await asgi(self.asgi_receive, self.asgi_send)
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/channels/ses... | TypeError |
async def asgi_receive(self):
if not self.connect_sent:
self.connect_sent = True
return {"type": "websocket.connect"}
await self.handshake_completed_event.wait()
if self.closed_event.is_set():
# If the client disconnected: WebSocketServerProtocol set self.close_code.
# If t... | async def asgi_receive(self):
if not self.connect_sent:
self.connect_sent = True
return {"type": "websocket.connect"}
await self.handshake_completed_event.wait()
try:
data = await self.recv()
except websockets.ConnectionClosed as exc:
return {"type": "websocket.disconnec... | https://github.com/encode/uvicorn/issues/244 | Traceback (most recent call last):
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
result = await asgi(self.asgi_receive, self.asgi_send)
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/channels/ses... | TypeError |
async def send(self, message):
await self.writable.wait()
message_type = message["type"]
if not self.handshake_complete:
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self... | async def send(self, message):
await self.writable.wait()
message_type = message["type"]
if not self.handshake_complete:
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self... | https://github.com/encode/uvicorn/issues/244 | Traceback (most recent call last):
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
result = await asgi(self.asgi_receive, self.asgi_send)
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/channels/ses... | TypeError |
async def asgi_send(self, message):
message_type = message["type"]
if not self.handshake_started_event.is_set():
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self.scope["root_... | async def asgi_send(self, message):
message_type = message["type"]
if not self.handshake_started_event.is_set():
if message_type == "websocket.accept":
self.logger.info(
'%s - "WebSocket %s" [accepted]',
self.scope["client"],
self.scope["root_... | https://github.com/encode/uvicorn/issues/244 | Traceback (most recent call last):
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
result = await asgi(self.asgi_receive, self.asgi_send)
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/channels/ses... | TypeError |
async def asgi_receive(self):
if not self.connect_sent:
self.connect_sent = True
return {"type": "websocket.connect"}
await self.handshake_completed_event.wait()
try:
await self.ensure_open()
data = await self.recv()
except websockets.ConnectionClosed as exc:
ret... | async def asgi_receive(self):
if not self.connect_sent:
self.connect_sent = True
return {"type": "websocket.connect"}
await self.handshake_completed_event.wait()
if self.closed_event.is_set():
# If the client disconnected: WebSocketServerProtocol set self.close_code.
# If t... | https://github.com/encode/uvicorn/issues/244 | Traceback (most recent call last):
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
result = await asgi(self.asgi_receive, self.asgi_send)
File "/home/ossi/src/channels-examples/.venv/lib/python3.7/site-packages/channels/ses... | TypeError |
def connection_lost(self, exc):
if self.access_logs:
self.logger.debug("%s - Disconnected", self.server[0])
if self.cycle and not self.cycle.response_complete:
self.cycle.disconnected = True
if self.conn.our_state != h11.ERROR:
event = h11.ConnectionClosed()
try:
... | def connection_lost(self, exc):
if self.access_logs:
self.logger.debug("%s - Disconnected", self.server[0])
if self.cycle and self.cycle.more_body:
self.cycle.disconnected = True
if self.conn.our_state != h11.ERROR:
event = h11.ConnectionClosed()
self.conn.send(event)
se... | https://github.com/encode/uvicorn/issues/111 | ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 196, in run_asgi
result = await asgi(self.receive, self.send)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/chann... | RuntimeError |
async def send(self, message):
global DEFAULT_HEADERS
protocol = self.protocol
message_type = message["type"]
if self.disconnected:
return
if not protocol.writable:
await protocol.writable_event.wait()
if not self.response_started:
# Sending response status line and h... | async def send(self, message):
global DEFAULT_HEADERS
protocol = self.protocol
message_type = message["type"]
if not protocol.writable:
await protocol.writable_event.wait()
if not self.response_started:
# Sending response status line and headers
if message_type != "http.re... | https://github.com/encode/uvicorn/issues/111 | ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 196, in run_asgi
result = await asgi(self.receive, self.send)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/chann... | RuntimeError |
def connection_lost(self, exc):
if self.access_logs:
self.logger.debug("%s - Disconnected", self.server[0])
if self.cycle and not self.cycle.response_complete:
self.cycle.disconnected = True
self.client_event.set()
| def connection_lost(self, exc):
if self.access_logs:
self.logger.debug("%s - Disconnected", self.server[0])
if self.cycle and self.cycle.more_body:
self.cycle.disconnected = True
self.client_event.set()
| https://github.com/encode/uvicorn/issues/111 | ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 196, in run_asgi
result = await asgi(self.receive, self.send)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/chann... | RuntimeError |
async def send(self, message):
protocol = self.protocol
message_type = message["type"]
if self.disconnected:
return
if not protocol.writable:
await protocol.writable_event.wait()
if not self.response_started:
# Sending response status line and headers
if message_ty... | async def send(self, message):
protocol = self.protocol
message_type = message["type"]
if not protocol.writable:
await protocol.writable_event.wait()
if not self.response_started:
# Sending response status line and headers
if message_type != "http.response.start":
m... | https://github.com/encode/uvicorn/issues/111 | ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 196, in run_asgi
result = await asgi(self.receive, self.send)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/chann... | RuntimeError |
def _get_server_start_message(is_ipv6_message: bool = False) -> Tuple[str, str]:
if is_ipv6_message:
ip_repr = "%s://[%s]:%d"
else:
ip_repr = "%s://%s:%d"
message = f"Uvicorn running on {ip_repr} (Press CTRL+C to quit)"
color_message = (
"Uvicorn running on "
+ click.styl... | def _get_server_start_message(
host_ip_version: _IPKind = _IPKind.IPv4,
) -> Tuple[str, str]:
if host_ip_version is _IPKind.IPv6:
ip_repr = "%s://[%s]:%d"
else:
ip_repr = "%s://%s:%d"
message = f"Uvicorn running on {ip_repr} (Press CTRL+C to quit)"
color_message = (
"Uvicorn ... | https://github.com/encode/uvicorn/issues/825 | .py thon/debugpy/launcher 61232 -- /Users/paulafernandez/Sandbox/test/test/start
INFO: Started server process [43171]
INFO: Waiting for application startup.
INFO: ASGI 'lifespan' protocol appears unsupported.
INFO: Application startup complete.
Traceback (most recent call last):
File "/usr/local/Cellar/... | ValueError |
def bind_socket(self):
family, sockettype, proto, canonname, sockaddr = socket.getaddrinfo(
self.host, self.port, type=socket.SOCK_STREAM
)[0]
sock = socket.socket(family=family, type=sockettype)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
try:
sock.bind((self.host, se... | def bind_socket(self):
family, sockettype, proto, canonname, sockaddr = socket.getaddrinfo(
self.host, self.port, type=socket.SOCK_STREAM
)[0]
sock = socket.socket(family=family, type=sockettype)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
try:
sock.bind((self.host, se... | https://github.com/encode/uvicorn/issues/825 | .py thon/debugpy/launcher 61232 -- /Users/paulafernandez/Sandbox/test/test/start
INFO: Started server process [43171]
INFO: Waiting for application startup.
INFO: ASGI 'lifespan' protocol appears unsupported.
INFO: Application startup complete.
Traceback (most recent call last):
File "/usr/local/Cellar/... | ValueError |
async def startup(self, sockets=None):
await self.lifespan.startup()
if self.lifespan.should_exit:
self.should_exit = True
return
config = self.config
create_protocol = functools.partial(
config.http_protocol_class, config=config, server_state=self.server_state
)
loop ... | async def startup(self, sockets=None):
await self.lifespan.startup()
if self.lifespan.should_exit:
self.should_exit = True
return
config = self.config
create_protocol = functools.partial(
config.http_protocol_class, config=config, server_state=self.server_state
)
loop ... | https://github.com/encode/uvicorn/issues/825 | .py thon/debugpy/launcher 61232 -- /Users/paulafernandez/Sandbox/test/test/start
INFO: Started server process [43171]
INFO: Waiting for application startup.
INFO: ASGI 'lifespan' protocol appears unsupported.
INFO: Application startup complete.
Traceback (most recent call last):
File "/usr/local/Cellar/... | ValueError |
async def startup(self, sockets=None):
await self.lifespan.startup()
if self.lifespan.should_exit:
self.should_exit = True
return
config = self.config
create_protocol = functools.partial(
config.http_protocol_class, config=config, server_state=self.server_state
)
loop ... | async def startup(self, sockets=None):
await self.lifespan.startup()
if self.lifespan.should_exit:
self.should_exit = True
return
config = self.config
create_protocol = functools.partial(
config.http_protocol_class, config=config, server_state=self.server_state
)
loop ... | https://github.com/encode/uvicorn/issues/683 | INFO: Uvicorn running on http://127.0.0.1:9000 (Press CTRL+C to quit)
INFO: Started parent process [17696]
INFO: Started server process [20428]
INFO: Started server process [15476]
INFO: Waiting for application startup.
INFO: Waiting for application startup.
INFO: ASGI 'lifespan' protocol ap... | OSError |
def data_received(self, data):
try:
self.parser.feed_data(data)
except httptools.parser.errors.HttpParserError:
msg = "Invalid HTTP request received."
self.logger.warn(msg)
self.transport.close()
except httptools.HttpParserUpgrade:
websocket_upgrade(self)
| def data_received(self, data):
try:
self.parser.feed_data(data)
except httptools.HttpParserUpgrade:
websocket_upgrade(self)
| https://github.com/encode/uvicorn/issues/75 | uvicorn[7423]: Unhandled exception in event loop
uvicorn[7423]: Traceback (most recent call last):
uvicorn[7423]: File "uvloop/handles/stream.pyx", line 784, in uvloop.loop.__uv_stream_on_read_impl
uvicorn[7423]: File "uvloop/handles/stream.pyx", line 563, in uvloop.loop.UVStream._on_read
uvicorn[7423]: File "/ho... | httptools.parser.errors.HttpParserInvalidMethodError |
def analyze(
problem,
X,
Y,
num_resamples=1000,
conf_level=0.95,
print_to_console=False,
grid_jump=2,
num_levels=4,
):
"""Perform Morris Analysis on model outputs.
Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
'mu_star_conf', where each entry is a list of para... | def analyze(
problem,
X,
Y,
num_resamples=1000,
conf_level=0.95,
print_to_console=False,
grid_jump=2,
num_levels=4,
):
"""Perform Morris Analysis on model outputs.
Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
'mu_star_conf', where each entry is a list of para... | https://github.com/SALib/SALib/issues/153 | Traceback (most recent call last):
File "postproc.py", line 239, in <module>
postproc(dir)
File "postproc.py", line 54, in postproc
calcDistances(dir, config)
File "postproc.py", line 207, in calcDistances
grid_jump=config['info']['jump'])
File "/home/buck06191/anaconda3/envs/bcmd/lib/python2.7/site-packages/SALib/anal... | TypeError |
def sample(problem, N, M=4):
"""Generate model inputs for the Fourier Amplitude Sensitivity Test (FAST).
Returns a NumPy matrix containing the model inputs required by the Fourier
Amplitude sensitivity test. The resulting matrix contains N rows and D
columns, where D is the number of parameters. The ... | def sample(problem, N, M=4):
"""Generate model inputs for the Fourier Amplitude Sensitivity Test (FAST).
Returns a NumPy matrix containing the model inputs required by the Fourier
Amplitude sensitivity test. The resulting matrix contains N rows and D
columns, where D is the number of parameters. The ... | https://github.com/SALib/SALib/issues/99 | SALib\sample\fast_sampler.py:39: RuntimeWarning: invalid value encountered in remainder
omega[1:] = np.arange(D - 1) % m + 1
\SALib\analyze\fast.py:70: RuntimeWarning: invalid value encountered in remainder
omega[1:] = np.arange(D - 1) % m + 1
\SALib\analyze\fast.py:88: RuntimeWarning: invalid value encountered in powe... | IndexError |
def analyze(
problem: Dict,
X: np.array,
Y: np.array,
num_resamples: int = 100,
conf_level: float = 0.95,
print_to_console: bool = False,
seed: int = None,
) -> Dict:
"""Perform Delta Moment-Independent Analysis on model outputs.
Returns a dictionary with keys 'delta', 'delta_conf',... | def analyze(
problem, X, Y, num_resamples=10, conf_level=0.95, print_to_console=False, seed=None
):
"""Perform Delta Moment-Independent Analysis on model outputs.
Returns a dictionary with keys 'delta', 'delta_conf', 'S1', and 'S1_conf',
where each entry is a list of size D (the number of parameters) c... | https://github.com/SALib/SALib/issues/5 | Traceback (most recent call last):
File "sobol.py", line 13, in <module>
param_values = saltelli.sample(1000, param_file, calc_second_order = True)
File "../../SALib/sample/saltelli.py", line 19, in sample
base_sequence = sobol_sequence.sample(N + skip_values, 2*D)
File "../../SALib/sample/sobol_sequence.py", line 47, ... | ValueError |
def calc_delta(Y, Ygrid, X, m):
"""Plischke et al. (2013) delta index estimator (eqn 26) for d_hat."""
N = len(Y)
fy = gaussian_kde(Y, bw_method="silverman")(Ygrid)
abs_fy = np.abs(fy)
xr = rankdata(X, method="ordinal")
d_hat = 0
for j in range(len(m) - 1):
ix = np.where((xr > m[j])... | def calc_delta(Y, Ygrid, X, m):
N = len(Y)
fy = gaussian_kde(Y, bw_method="silverman")(Ygrid)
abs_fy = np.abs(fy)
xr = rankdata(X, method="ordinal")
d_hat = 0
for j in range(len(m) - 1):
ix = np.where((xr > m[j]) & (xr <= m[j + 1]))[0]
nm = len(ix)
Y_ix = Y[ix]
... | https://github.com/SALib/SALib/issues/5 | Traceback (most recent call last):
File "sobol.py", line 13, in <module>
param_values = saltelli.sample(1000, param_file, calc_second_order = True)
File "../../SALib/sample/saltelli.py", line 19, in sample
base_sequence = sobol_sequence.sample(N + skip_values, 2*D)
File "../../SALib/sample/sobol_sequence.py", line 47, ... | ValueError |
def analyze(
problem,
X,
Y,
num_resamples=100,
conf_level=0.95,
print_to_console=False,
num_levels=4,
seed=None,
):
"""Perform Morris Analysis on model outputs.
Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
'mu_star_conf', where each entry is a list of paramet... | def analyze(
problem,
X,
Y,
num_resamples=100,
conf_level=0.95,
print_to_console=False,
num_levels=4,
seed=None,
):
"""Perform Morris Analysis on model outputs.
Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
'mu_star_conf', where each entry is a list of paramet... | https://github.com/SALib/SALib/issues/5 | Traceback (most recent call last):
File "sobol.py", line 13, in <module>
param_values = saltelli.sample(1000, param_file, calc_second_order = True)
File "../../SALib/sample/saltelli.py", line 19, in sample
base_sequence = sobol_sequence.sample(N + skip_values, 2*D)
File "../../SALib/sample/sobol_sequence.py", line 47, ... | ValueError |
def sample(problem, N, seed=None):
"""Generate model inputs using Latin hypercube sampling (LHS).
Returns a NumPy matrix containing the model inputs generated by Latin
hypercube sampling. The resulting matrix contains N rows and D columns,
where D is the number of parameters.
Parameters
-----... | def sample(problem, N, seed=None):
"""Generate model inputs using Latin hypercube sampling (LHS).
Returns a NumPy matrix containing the model inputs generated by Latin
hypercube sampling. The resulting matrix contains N rows and D columns,
where D is the number of parameters.
Parameters
-----... | https://github.com/SALib/SALib/issues/5 | Traceback (most recent call last):
File "sobol.py", line 13, in <module>
param_values = saltelli.sample(1000, param_file, calc_second_order = True)
File "../../SALib/sample/saltelli.py", line 19, in sample
base_sequence = sobol_sequence.sample(N + skip_values, 2*D)
File "../../SALib/sample/sobol_sequence.py", line 47, ... | ValueError |
def _initAttributes(self):
self._avatar_url = github.GithubObject.NotSet
self._bio = github.GithubObject.NotSet
self._blog = github.GithubObject.NotSet
self._collaborators = github.GithubObject.NotSet
self._company = github.GithubObject.NotSet
self._contributions = github.GithubObject.NotSet
... | def _initAttributes(self):
self._avatar_url = github.GithubObject.NotSet
self._bio = github.GithubObject.NotSet
self._blog = github.GithubObject.NotSet
self._collaborators = github.GithubObject.NotSet
self._company = github.GithubObject.NotSet
self._contributions = github.GithubObject.NotSet
... | https://github.com/PyGithub/PyGithub/issues/713 | Traceback (most recent call last):
File "protected_test.py", line 27, in <module>
print(collab.site_admin)
AttributeError: 'NamedUser' object has no attribute 'site_admin' | AttributeError |
def _useAttributes(self, attributes):
if "avatar_url" in attributes: # pragma no branch
self._avatar_url = self._makeStringAttribute(attributes["avatar_url"])
if "bio" in attributes: # pragma no branch
self._bio = self._makeStringAttribute(attributes["bio"])
if "blog" in attributes: # pra... | def _useAttributes(self, attributes):
if "avatar_url" in attributes: # pragma no branch
self._avatar_url = self._makeStringAttribute(attributes["avatar_url"])
if "bio" in attributes: # pragma no branch
self._bio = self._makeStringAttribute(attributes["bio"])
if "blog" in attributes: # pra... | https://github.com/PyGithub/PyGithub/issues/713 | Traceback (most recent call last):
File "protected_test.py", line 27, in <module>
print(collab.site_admin)
AttributeError: 'NamedUser' object has no attribute 'site_admin' | AttributeError |
def __structuredFromJson(self, data):
if len(data) == 0:
return None
else:
if atLeastPython3 and isinstance(data, bytes):
data = data.decode("utf-8")
return json.loads(data)
| def __structuredFromJson(self, data):
if len(data) == 0:
return None
else:
return json.loads(data)
| https://github.com/PyGithub/PyGithub/issues/142 | import github
gh_instance = github.Github('<my-token>')
user = gh_instance.get_user()
user.name
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-ec5376e00d61> in <module>()
----> 1 user.name
/usr/loc... | TypeError |
def __init__(self, login_or_token, password, base_url, timeout):
if password is not None:
login = login_or_token
self.__authorizationHeader = "Basic " + base64.b64encode(
login + ":" + password
).replace("\n", "")
elif login_or_token is not None:
token = login_or_toke... | def __init__(self, login_or_token, password, base_url, timeout):
if password is not None:
login = login_or_token
self.__authorizationHeader = "Basic " + base64.b64encode(
login + ":" + password
).replace("\n", "")
elif login_or_token is not None:
token = login_or_toke... | https://github.com/PyGithub/PyGithub/issues/80 | from github import Github
gh = Github( "login", "password", "base_url")
for repo in gh.get_user().get_repos():
... print repo.name
...
repo1
repo2
my-person-linux-kernel-repo
the-secret-macosx-repo
for repo in gh.get_organization( org_name ).get_repos():
... print repo.name
...
Traceback (most recent ... | AssertionError |
def requestRaw(self, verb, url, parameters, input):
assert verb in ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE"]
# URLs generated locally will be relative to __base_url
# URLs returned from the server will start with __base_url
if url.startswith("/"):
url = self.__prefix + url
else:
... | def requestRaw(self, verb, url, parameters, input):
assert verb in ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE"]
# URLs generated locally will be relative to __base_url
# URLs returned from the server will start with __base_url
if url.startswith(self.__base_url):
url = url[len(self.__base_u... | https://github.com/PyGithub/PyGithub/issues/80 | from github import Github
gh = Github( "login", "password", "base_url")
for repo in gh.get_user().get_repos():
... print repo.name
...
repo1
repo2
my-person-linux-kernel-repo
the-secret-macosx-repo
for repo in gh.get_organization( org_name ).get_repos():
... print repo.name
...
Traceback (most recent ... | AssertionError |
def forward_request(self, method, path, data, headers):
result = handle_special_request(method, path, data, headers)
if result is not None:
return result
if not data:
data = "{}"
data = json.loads(to_str(data))
ddb_client = aws_stack.connect_to_service("dynamodb")
action = heade... | def forward_request(self, method, path, data, headers):
result = handle_special_request(method, path, data, headers)
if result is not None:
return result
if not data:
data = "{}"
data = json.loads(to_str(data))
ddb_client = aws_stack.connect_to_service("dynamodb")
action = heade... | https://github.com/localstack/localstack/issues/3502 | localstack_main | 2021-01-22T22:14:37:WARNING:localstack.utils.server.http2_server: Error in proxy handler for request POST http://localhost:4566/: 'ProxyListenerDynamoDB' object has no attribute 'error_response_throughput' Traceback (most recent call last):
localstack_main | File "/opt/code/localstack/localstack/uti... | AttributeError |
def get_scheduled_rule_func(data):
def func(*args):
rule_name = data.get("Name")
client = aws_stack.connect_to_service("events")
targets = client.list_targets_by_rule(Rule=rule_name)["Targets"]
if targets:
LOG.debug(
"Notifying %s targets in response to tr... | def get_scheduled_rule_func(data):
def func(*args):
rule_name = data.get("Name")
client = aws_stack.connect_to_service("events")
targets = client.list_targets_by_rule(Rule=rule_name)["Targets"]
if targets:
LOG.debug(
"Notifying %s targets in response to tr... | https://github.com/localstack/localstack/issues/3402 | 2020-12-29T04:01:46:WARNING:bootstrap.py: Thread run method <function get_scheduled_rule_func.<locals>.func at 0x7f0ceb256e50>(None) failed: Traceback (most recent call last):
File "/opt/code/localstack/localstack/utils/bootstrap.py", line 514, in run
self.func(self.params)
File "/opt/code/localstack/localstack/service... | botocore.exceptions.ClientError |
def func(*args):
rule_name = data.get("Name")
client = aws_stack.connect_to_service("events")
targets = client.list_targets_by_rule(Rule=rule_name)["Targets"]
if targets:
LOG.debug(
"Notifying %s targets in response to triggered Events rule %s"
% (len(targets), rule_name)... | def func(*args):
rule_name = data.get("Name")
client = aws_stack.connect_to_service("events")
targets = client.list_targets_by_rule(Rule=rule_name)["Targets"]
if targets:
LOG.debug(
"Notifying %s targets in response to triggered Events rule %s"
% (len(targets), rule_name)... | https://github.com/localstack/localstack/issues/3402 | 2020-12-29T04:01:46:WARNING:bootstrap.py: Thread run method <function get_scheduled_rule_func.<locals>.func at 0x7f0ceb256e50>(None) failed: Traceback (most recent call last):
File "/opt/code/localstack/localstack/utils/bootstrap.py", line 514, in run
self.func(self.params)
File "/opt/code/localstack/localstack/service... | botocore.exceptions.ClientError |
def send_event_to_target(arn, event, target_attributes=None):
if ":lambda:" in arn:
from localstack.services.awslambda import lambda_api
lambda_api.run_lambda(event=event, context={}, func_arn=arn)
elif ":sns:" in arn:
sns_client = connect_to_service("sns")
sns_client.publish(T... | def send_event_to_target(arn, event):
if ":lambda:" in arn:
from localstack.services.awslambda import lambda_api
lambda_api.run_lambda(event=event, context={}, func_arn=arn)
elif ":sns:" in arn:
sns_client = connect_to_service("sns")
sns_client.publish(TopicArn=arn, Message=jso... | https://github.com/localstack/localstack/issues/3402 | 2020-12-29T04:01:46:WARNING:bootstrap.py: Thread run method <function get_scheduled_rule_func.<locals>.func at 0x7f0ceb256e50>(None) failed: Traceback (most recent call last):
File "/opt/code/localstack/localstack/utils/bootstrap.py", line 514, in run
self.func(self.params)
File "/opt/code/localstack/localstack/service... | botocore.exceptions.ClientError |
def __init__(self):
super(LambdaExecutorSeparateContainers, self).__init__()
self.max_port = LAMBDA_API_UNIQUE_PORTS
self.port_offset = LAMBDA_API_PORT_OFFSET
| def __init__(self):
super(LambdaExecutorSeparateContainers, self).__init__()
self.next_port = 1
self.max_port = LAMBDA_API_UNIQUE_PORTS
self.port_offset = LAMBDA_API_PORT_OFFSET
| https://github.com/localstack/localstack/issues/1892 | 2019-12-20T09:45:49:DEBUG:localstack.services.awslambda.lambda_executors: Using entrypoint "/var/rapid/init --bootstrap /var/runtime/bootstrap" for container "localstack_lambda_arn_aws_lambda_us-east-1_000000000000_function_rb-files-hub-service-dev-rb-files-hub" on network "host".
2019-12-20T09:45:49:DEBUG:localstack.s... | Exception |
def prepare_execution(self, func_arn, env_vars, runtime, command, handler, lambda_cwd):
entrypoint = ""
if command:
entrypoint = ' --entrypoint ""'
else:
command = '"%s"' % handler
# add Docker Lambda env vars
network = config.LAMBDA_DOCKER_NETWORK
network_str = '--network="%s"'... | def prepare_execution(self, func_arn, env_vars, runtime, command, handler, lambda_cwd):
entrypoint = ""
if command:
entrypoint = ' --entrypoint ""'
else:
command = '"%s"' % handler
# add Docker Lambda env vars
network = config.LAMBDA_DOCKER_NETWORK
network_str = '--network="%s"'... | https://github.com/localstack/localstack/issues/1892 | 2019-12-20T09:45:49:DEBUG:localstack.services.awslambda.lambda_executors: Using entrypoint "/var/rapid/init --bootstrap /var/runtime/bootstrap" for container "localstack_lambda_arn_aws_lambda_us-east-1_000000000000_function_rb-files-hub-service-dev-rb-files-hub" on network "host".
2019-12-20T09:45:49:DEBUG:localstack.s... | Exception |
def forward_request(self, method, path, data, headers):
if method == "OPTIONS":
return 200
if path.split("?")[0] == "/health":
return serve_health_endpoint(method, path, data)
# kill the process if we receive this header
headers.get(HEADER_KILL_SIGNAL) and os._exit(0)
target = hea... | def forward_request(self, method, path, data, headers):
if method == "OPTIONS":
return 200
# kill the process if we receive this header
headers.get(HEADER_KILL_SIGNAL) and os._exit(0)
target = headers.get("x-amz-target", "")
auth_header = headers.get("authorization", "")
host = headers... | https://github.com/localstack/localstack/issues/2534 | 2020-06-09T11:04:42:ERROR:localstack.services.dynamodb.dynamodb_starter: DynamoDB health check failed: an integer is required (got type NoneType) Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/dynamodb/dynamodb_starter.py", line 23, in check_dynamodb
wait_for_port_open(PORT_DYNAMODB_B... | TypeError |
def record_service_health(api, status):
data = {api: status}
health_url = "%s://%s:%s/health" % (
get_service_protocol(),
config.LOCALHOST,
config.EDGE_PORT,
)
try:
requests.put(health_url, data=json.dumps(data))
except Exception:
# ignore for now, if the serv... | def record_service_health(api, status):
data = {api: status}
health_url = "%s://%s:%s/health" % (
get_service_protocol(),
config.LOCALHOST,
config.PORT_WEB_UI,
)
try:
requests.put(health_url, data=json.dumps(data))
except Exception:
# ignore for now, if the se... | https://github.com/localstack/localstack/issues/2534 | 2020-06-09T11:04:42:ERROR:localstack.services.dynamodb.dynamodb_starter: DynamoDB health check failed: an integer is required (got type NoneType) Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/dynamodb/dynamodb_starter.py", line 23, in check_dynamodb
wait_for_port_open(PORT_DYNAMODB_B... | TypeError |
def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# add model mappings to moto
parsing.MODEL_MAP.update(MODEL_MAP)
# fix account ID
parsing.ACCOUNT_ID = TEST_AWS_ACC... | def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# add model mappings to moto
parsing.MODEL_MAP.update(MODEL_MAP)
# Patch clean_json in moto
def clean_json(resource... | https://github.com/localstack/localstack/issues/2083 | localstack_1 | 2020-02-24T14:57:32:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "MyTestSubscription": Parameter validation failed:
localstack_1 | Missing required parameter in input: "TopicArn" Traceback (most recent call last):
localstack_1 ... | ParamValidationError |
def _parse_and_create_resource(
logical_id,
resource_json,
resources_map,
region_name,
update=False,
force_create=False,
):
stack_name = resources_map.get("AWS::StackName")
resource_hash_key = (stack_name, logical_id)
props = resource_json["Properties"] = resource_json.get("Propertie... | def _parse_and_create_resource(
logical_id,
resource_json,
resources_map,
region_name,
update=False,
force_create=False,
):
stack_name = resources_map.get("AWS::StackName")
resource_hash_key = (stack_name, logical_id)
props = resource_json["Properties"] = resource_json.get("Propertie... | https://github.com/localstack/localstack/issues/2083 | localstack_1 | 2020-02-24T14:57:32:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "MyTestSubscription": Parameter validation failed:
localstack_1 | Missing required parameter in input: "TopicArn" Traceback (most recent call last):
localstack_1 ... | ParamValidationError |
def apply_patches():
s3_models.DEFAULT_KEY_BUFFER_SIZE = S3_MAX_FILE_SIZE_MB * 1024 * 1024
def init(
self,
name,
value,
storage="STANDARD",
etag=None,
is_versioned=False,
version_id=0,
max_buffer_size=None,
*args,
**kwargs,
):
... | def apply_patches():
s3_models.DEFAULT_KEY_BUFFER_SIZE = S3_MAX_FILE_SIZE_MB * 1024 * 1024
def init(
self,
name,
value,
storage="STANDARD",
etag=None,
is_versioned=False,
version_id=0,
max_buffer_size=None,
*args,
**kwargs,
):
... | https://github.com/localstack/localstack/issues/2164 | localstack_main | 2020-03-17T14:10:42:warning:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_main | 2020-03-17T14:10:47:warning:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:sample1-local-downloadFile
localstack_main | 2020-03-17T... | KeyError |
def get_bucket(self, bucket_name, *args, **kwargs):
bucket_name = s3_listener.normalize_bucket_name(bucket_name)
if bucket_name == BUCKET_MARKER_LOCAL:
return None
return get_bucket_orig(bucket_name, *args, **kwargs)
| def get_bucket(self, bucket_name, *args, **kwargs):
bucket_name = s3_listener.normalize_bucket_name(bucket_name)
return get_bucket_orig(bucket_name, *args, **kwargs)
| https://github.com/localstack/localstack/issues/2164 | localstack_main | 2020-03-17T14:10:42:warning:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_main | 2020-03-17T14:10:47:warning:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:sample1-local-downloadFile
localstack_main | 2020-03-17T... | KeyError |
def do_run(cmd, asynchronous, print_output=None, env_vars={}):
sys.stdout.flush()
if asynchronous:
if is_debug() and print_output is None:
print_output = True
outfile = subprocess.PIPE if print_output else None
t = ShellCommandThread(cmd, outfile=outfile, env_vars=env_vars)
... | def do_run(cmd, asynchronous, print_output=False, env_vars={}):
sys.stdout.flush()
if asynchronous:
if is_debug():
print_output = True
outfile = subprocess.PIPE if print_output else None
t = ShellCommandThread(cmd, outfile=outfile, env_vars=env_vars)
t.start()
... | https://github.com/localstack/localstack/issues/1723 | 2019-11-05T14:38:26:WARNING:localstack.utils.cloudformation.template_deployer: Error calling <bound method ClientCreator._create_api_method.<locals>._api_call of <botocore.client.SQS object at 0x7f3d9ab15a58>> with params: {'QueueName': 'A-DLQ', 'Attributes': {'MessageRetentionPeriod': '1209600'}, 'tags': [{'Key': 'Nam... | ParamValidationError |
def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# add model mappings to moto
parsing.MODEL_MAP.update(MODEL_MAP)
# Patch S3Backend.get_key method in moto to use S3 AP... | def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# add model mappings to moto
parsing.MODEL_MAP.update(MODEL_MAP)
# Patch S3Backend.get_key method in moto to use S3 AP... | https://github.com/localstack/localstack/issues/2020 | 2020-02-05T17:05:30:ERROR:flask.app: Exception on / [POST]
Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 1815, ... | TypeError |
def initialize_resources(self):
def set_status(status):
self._add_stack_event(status)
self.status = status
self.resource_map.create()
self.output_map.create()
def run_loop(*args):
# NOTE: We're adding this additional loop, as it seems that in some cases moto
# does no... | def initialize_resources(self):
def set_status(status):
self._add_stack_event(status)
self.status = status
self.resource_map.create()
self.output_map.create()
def run_loop(*args):
# NOTE: We're adding this additional loop, as it seems that in some cases moto
# does no... | https://github.com/localstack/localstack/issues/2020 | 2020-02-05T17:05:30:ERROR:flask.app: Exception on / [POST]
Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 1815, ... | TypeError |
def run_loop(*args):
# NOTE: We're adding this additional loop, as it seems that in some cases moto
# does not consider resource dependencies (e.g., if a "DependsOn" resource property
# is defined). This loop allows us to incrementally resolve such dependencies.
resource_map = self.resource_map
... | def run_loop(*args):
# NOTE: We're adding this additional loop, as it seems that in some cases moto
# does not consider resource dependencies (e.g., if a "DependsOn" resource property
# is defined). This loop allows us to incrementally resolve such dependencies.
resource_map = self.resource_map
... | https://github.com/localstack/localstack/issues/2020 | 2020-02-05T17:05:30:ERROR:flask.app: Exception on / [POST]
Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 1815, ... | TypeError |
def start_elasticsearch_instance():
# Note: keep imports here to avoid circular dependencies
from localstack.services.es import es_starter
from localstack.services.infra import check_infra, Plugin
api_name = "elasticsearch"
plugin = Plugin(
api_name,
start=es_starter.start_elasticse... | def start_elasticsearch_instance():
# Note: keep imports here to avoid circular dependencies
from localstack.services.es import es_starter
from localstack.services.infra import check_infra, Plugin
api_name = "elasticsearch"
plugin = Plugin(
api_name,
start=es_starter.start_elasticse... | https://github.com/localstack/localstack/issues/2020 | 2020-02-05T17:05:30:ERROR:flask.app: Exception on / [POST]
Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 1815, ... | TypeError |
def post_request():
action = request.headers.get("x-amz-target")
data = json.loads(to_str(request.data))
response = None
if action == "%s.ListDeliveryStreams" % ACTION_HEADER_PREFIX:
response = {
"DeliveryStreamNames": get_delivery_stream_names(),
"HasMoreDeliveryStreams"... | def post_request():
action = request.headers.get("x-amz-target")
data = json.loads(to_str(request.data))
response = None
if action == "%s.ListDeliveryStreams" % ACTION_HEADER_PREFIX:
response = {
"DeliveryStreamNames": get_delivery_stream_names(),
"HasMoreDeliveryStreams"... | https://github.com/localstack/localstack/issues/2020 | 2020-02-05T17:05:30:ERROR:flask.app: Exception on / [POST]
Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/code/localstack/.venv/lib/python3.7/site-packages/flask/app.py", line 1815, ... | TypeError |
def forward_request(self, method, path, data, headers):
if re.match(PATH_REGEX_USER_REQUEST, path):
search_match = re.search(PATH_REGEX_USER_REQUEST, path)
api_id = search_match.group(1)
stage = search_match.group(2)
relative_path_w_query_params = "/%s" % search_match.group(3)
... | def forward_request(self, method, path, data, headers):
data = data and json.loads(to_str(data))
if re.match(PATH_REGEX_USER_REQUEST, path):
search_match = re.search(PATH_REGEX_USER_REQUEST, path)
api_id = search_match.group(1)
stage = search_match.group(2)
relative_path_w_query... | https://github.com/localstack/localstack/issues/1743 | 2019-11-08T18:53:53:ERROR:localstack.services.generic_proxy: Exception running proxy on port 8081: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 384, in run_cmd
combined_file, cert_file_name, key_... | PermissionError |
def __init__(self, name, start, check=None, listener=None, priority=0):
self.plugin_name = name
self.start_function = start
self.listener = listener
self.check_function = check
self.priority = priority
| def __init__(self, name, start, check=None, listener=None):
self.plugin_name = name
self.start_function = start
self.listener = listener
self.check_function = check
| https://github.com/localstack/localstack/issues/1743 | 2019-11-08T18:53:53:ERROR:localstack.services.generic_proxy: Exception running proxy on port 8081: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 384, in run_cmd
combined_file, cert_file_name, key_... | PermissionError |
def register_plugin(plugin):
existing = SERVICE_PLUGINS.get(plugin.name())
if existing:
if existing.priority > plugin.priority:
return
SERVICE_PLUGINS[plugin.name()] = plugin
| def register_plugin(plugin):
SERVICE_PLUGINS[plugin.name()] = plugin
| https://github.com/localstack/localstack/issues/1743 | 2019-11-08T18:53:53:ERROR:localstack.services.generic_proxy: Exception running proxy on port 8081: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 384, in run_cmd
combined_file, cert_file_name, key_... | PermissionError |
def generate_ssl_cert(
target_file=None,
overwrite=False,
random=False,
return_content=False,
serial_number=None,
):
# Note: Do NOT import "OpenSSL" at the root scope
# (Our test Lambdas are importing this file but don't have the module installed)
from OpenSSL import crypto
if targe... | def generate_ssl_cert(
target_file=None,
overwrite=False,
random=False,
return_content=False,
serial_number=None,
):
# Note: Do NOT import "OpenSSL" at the root scope
# (Our test Lambdas are importing this file but don't have the module installed)
from OpenSSL import crypto
if targe... | https://github.com/localstack/localstack/issues/1743 | 2019-11-08T18:53:53:ERROR:localstack.services.generic_proxy: Exception running proxy on port 8081: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 384, in run_cmd
combined_file, cert_file_name, key_... | PermissionError |
def event_type_matches(events, action, api_method):
"""check whether any of the event types in `events` matches the
given `action` and `api_method`, and return the first match."""
events = events or []
for event in events:
regex = event.replace("*", "[^:]*")
action_string = "s3:%s:%s" % ... | def event_type_matches(events, action, api_method):
"""check whether any of the event types in `events` matches the
given `action` and `api_method`, and return the first match."""
for event in events:
regex = event.replace("*", "[^:]*")
action_string = "s3:%s:%s" % (action, api_method)
... | https://github.com/localstack/localstack/issues/450 | 2017-11-06T16:27:30:ERROR:localstack.services.generic_proxy: Error forwarding request: 'list' object has no attribute 'get' Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 161, in forward
path=path, data=data, headers=forward_headers)
File "/us... | AttributeError |
def send_notifications(method, bucket_name, object_path, version_id):
for bucket, notifs in S3_NOTIFICATIONS.items():
if bucket == bucket_name:
action = {
"PUT": "ObjectCreated",
"POST": "ObjectCreated",
"DELETE": "ObjectRemoved",
}[met... | def send_notifications(method, bucket_name, object_path, version_id):
for bucket, b_cfg in iteritems(S3_NOTIFICATIONS):
if bucket == bucket_name:
action = {
"PUT": "ObjectCreated",
"POST": "ObjectCreated",
"DELETE": "ObjectRemoved",
}[m... | https://github.com/localstack/localstack/issues/450 | 2017-11-06T16:27:30:ERROR:localstack.services.generic_proxy: Error forwarding request: 'list' object has no attribute 'get' Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 161, in forward
path=path, data=data, headers=forward_headers)
File "/us... | AttributeError |
def handle_notification_request(bucket, method, data):
response = Response()
response.status_code = 200
response._content = ""
if method == "GET":
# TODO check if bucket exists
result = '<NotificationConfiguration xmlns="%s">' % XMLNS_S3
if bucket in S3_NOTIFICATIONS:
... | def handle_notification_request(bucket, method, data):
response = Response()
response.status_code = 200
response._content = ""
if method == "GET":
# TODO check if bucket exists
result = '<NotificationConfiguration xmlns="%s">' % XMLNS_S3
if bucket in S3_NOTIFICATIONS:
... | https://github.com/localstack/localstack/issues/450 | 2017-11-06T16:27:30:ERROR:localstack.services.generic_proxy: Error forwarding request: 'list' object has no attribute 'get' Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 161, in forward
path=path, data=data, headers=forward_headers)
File "/us... | AttributeError |
def _store_logs(self, func_details, log_output, invocation_time):
if not aws_stack.is_service_enabled("logs"):
return
logs_client = aws_stack.connect_to_service("logs")
log_group_name = "/aws/lambda/%s" % func_details.name()
time_str = time.strftime("%Y/%m/%d", time.gmtime(invocation_time))
... | def _store_logs(self, func_details, log_output, invocation_time):
if not aws_stack.is_service_enabled("logs"):
return
logs_client = aws_stack.connect_to_service("logs")
log_group_name = "/aws/lambda/%s" % func_details.name()
time_str = time.strftime("%Y/%m/%d", time.gmtime(invocation_time))
... | https://github.com/localstack/localstack/issues/1642 | {"Type": "Server", "message": "Error executing Lambda function arn:aws:lambda:ap-northeast-1:000000000000:function:service-stage-functionName: An error occurred (ResourceAlreadyExistsException) when calling the CreateLogGroup operation: The specified log group already exists Traceback (most recent call last):\n
File \"... | botocore.errorfactory.ResourceAlreadyExistsException |
def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# Patch S3Backend.get_key method in moto to use S3 API from LocalStack
def get_key(self, bucket_name, key_name, version_id=... | def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# Patch S3Backend.get_key method in moto to use S3 API from LocalStack
def get_key(self, bucket_name, key_name, version_id=... | https://github.com/localstack/localstack/issues/1642 | {"Type": "Server", "message": "Error executing Lambda function arn:aws:lambda:ap-northeast-1:000000000000:function:service-stage-functionName: An error occurred (ResourceAlreadyExistsException) when calling the CreateLogGroup operation: The specified log group already exists Traceback (most recent call last):\n
File \"... | botocore.errorfactory.ResourceAlreadyExistsException |
def _parse_and_create_resource(
logical_id, resource_json, resources_map, region_name, update=False
):
stack_name = resources_map.get("AWS::StackName")
resource_hash_key = (stack_name, logical_id)
# If the current stack is being updated, avoid infinite recursion
updating = CURRENTLY_UPDATING_RESOUR... | def _parse_and_create_resource(logical_id, resource_json, resources_map, region_name):
stack_name = resources_map.get("AWS::StackName")
resource_hash_key = (stack_name, logical_id)
# If the current stack is being updated, avoid infinite recursion
updating = CURRENTLY_UPDATING_RESOURCES.get(resource_has... | https://github.com/localstack/localstack/issues/1642 | {"Type": "Server", "message": "Error executing Lambda function arn:aws:lambda:ap-northeast-1:000000000000:function:service-stage-functionName: An error occurred (ResourceAlreadyExistsException) when calling the CreateLogGroup operation: The specified log group already exists Traceback (most recent call last):\n
File \"... | botocore.errorfactory.ResourceAlreadyExistsException |
def _send_cors_headers(self, response=None):
headers = response and response.headers or {}
if "Access-Control-Allow-Origin" not in headers:
self.send_header("Access-Control-Allow-Origin", "*")
if "Access-Control-Allow-Methods" not in headers:
self.send_header("Access-Control-Allow-Methods", ... | def _send_cors_headers(self, response=None):
headers = response and response.headers or {}
if "Access-Control-Allow-Origin" not in headers:
self.send_header("Access-Control-Allow-Origin", "*")
if "Access-Control-Allow-Methods" not in headers:
self.send_header("Access-Control-Allow-Methods", ... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def start_infra(asynchronous=False, apis=None):
try:
is_in_docker = in_docker()
# print a warning if we're not running in Docker but using Docker based LAMBDA_EXECUTOR
if not is_in_docker and "docker" in config.LAMBDA_EXECUTOR and not is_linux():
print(
(
... | def start_infra(asynchronous=False, apis=None):
try:
# load plugins
load_plugins()
event_publisher.fire_event(
event_publisher.EVENT_START_INFRA,
{"d": in_docker() and 1 or 0, "c": in_ci() and 1 or 0},
)
# set up logging
setup_logging()
... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def forward_request(self, method, path, data, headers):
if method == "OPTIONS":
return 200
req_data = self.parse_request_data(method, path, data)
if req_data:
action = req_data.get("Action", [None])[0]
if action == "SendMessage":
new_response = self._send_message(path, ... | def forward_request(self, method, path, data, headers):
if method == "OPTIONS":
return 200
req_data = self.parse_request_data(method, path, data)
if req_data:
action = req_data.get("Action", [None])[0]
if action == "SendMessage":
new_response = self._send_message(path, ... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def return_response(self, method, path, data, headers, response, request_handler):
if method == "OPTIONS" and path == "/":
# Allow CORS preflight requests to succeed.
return 200
if method != "POST":
return
region_name = extract_region_from_auth_header(headers)
req_data = urlpar... | def return_response(self, method, path, data, headers, response, request_handler):
if method == "OPTIONS" and path == "/":
# Allow CORS preflight requests to succeed.
return 200
if method == "POST" and path == "/":
region_name = extract_region_from_auth_header(headers)
req_data ... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def _send_message(self, path, data, req_data, headers):
queue_url = self._queue_url(path, req_data, headers)
queue_name = queue_url[queue_url.rindex("/") + 1 :]
message_body = req_data.get("MessageBody", [None])[0]
message_attributes = self.format_message_attributes(req_data)
region_name = extract_r... | def _send_message(self, path, data, req_data, headers):
queue_url = req_data.get("QueueUrl", [path.partition("?")[0]])[0]
queue_name = queue_url[queue_url.rindex("/") + 1 :]
message_body = req_data.get("MessageBody", [None])[0]
message_attributes = self.format_message_attributes(req_data)
region_nam... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def _set_queue_attributes(self, path, req_data, headers):
queue_url = self._queue_url(path, req_data, headers)
attrs = self._format_attributes(req_data)
# select only the attributes in UNSUPPORTED_ATTRIBUTE_NAMES
attrs = dict([(k, v) for k, v in attrs.items() if k in UNSUPPORTED_ATTRIBUTE_NAMES])
QU... | def _set_queue_attributes(self, req_data):
queue_url = req_data["QueueUrl"][0]
attrs = self._format_attributes(req_data)
# select only the attributes in UNSUPPORTED_ATTRIBUTE_NAMES
attrs = dict([(k, v) for k, v in attrs.items() if k in UNSUPPORTED_ATTRIBUTE_NAMES])
QUEUE_ATTRIBUTES[queue_url] = QUEU... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def _add_queue_attributes(self, path, req_data, content_str, headers):
flags = re.MULTILINE | re.DOTALL
queue_url = self._queue_url(path, req_data, headers)
regex = r"(.*<GetQueueAttributesResult>)(.*)(</GetQueueAttributesResult>.*)"
attrs = re.sub(regex, r"\2", content_str, flags=flags)
for key, va... | def _add_queue_attributes(self, req_data, content_str):
flags = re.MULTILINE | re.DOTALL
queue_url = req_data["QueueUrl"][0]
regex = r"(.*<GetQueueAttributesResult>)(.*)(</GetQueueAttributesResult>.*)"
attrs = re.sub(regex, r"\2", content_str, flags=flags)
for key, value in QUEUE_ATTRIBUTES.get(queu... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def generate_ssl_cert(
target_file=None,
overwrite=False,
random=False,
return_content=False,
serial_number=None,
):
# Note: Do NOT import "OpenSSL" at the root scope
# (Our test Lambdas are importing this file but don't have the module installed)
from OpenSSL import crypto
if targe... | def generate_ssl_cert(
target_file=None,
overwrite=False,
random=False,
return_content=False,
serial_number=None,
):
# Note: Do NOT import "OpenSSL" at the root scope
# (Our test Lambdas are importing this file but don't have the module installed)
from OpenSSL import crypto
if targe... | https://github.com/localstack/localstack/issues/1551 | localstack_1 | 2019-09-09T10:46:22:ERROR:localstack.services.generic_proxy: Error forwarding request: 'QueueUrl' Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1 | path=path, data=data, header... | KeyError |
def forward_request(self, method, path, data, headers):
data = data and json.loads(to_str(data))
if re.match(PATH_REGEX_USER_REQUEST, path):
search_match = re.search(PATH_REGEX_USER_REQUEST, path)
api_id = search_match.group(1)
stage = search_match.group(2)
relative_path_w_query... | def forward_request(self, method, path, data, headers):
data = data and json.loads(to_str(data))
if re.match(PATH_REGEX_USER_REQUEST, path):
search_match = re.search(PATH_REGEX_USER_REQUEST, path)
api_id = search_match.group(1)
stage = search_match.group(2)
relative_path_w_query... | https://github.com/localstack/localstack/issues/438 | 2017-11-02T15:45:03:ERROR:localstack.services.generic_proxy: Error forwarding request: An error occurred (ValidationError) when calling the DescribeStackResources operation: Stack with id foo does not exist Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 185, in... | ClientError |
def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# Patch S3Backend.get_key method in moto to use S3 API from LocalStack
def get_key(self, bucket_name, key_name, version_id=... | def apply_patches():
"""Apply patches to make LocalStack seamlessly interact with the moto backend.
TODO: Eventually, these patches should be contributed to the upstream repo!"""
# Patch S3Backend.get_key method in moto to use S3 API from LocalStack
def get_key(self, bucket_name, key_name, version_id=... | https://github.com/localstack/localstack/issues/438 | 2017-11-02T15:45:03:ERROR:localstack.services.generic_proxy: Error forwarding request: An error occurred (ValidationError) when calling the DescribeStackResources operation: Stack with id foo does not exist Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 185, in... | ClientError |
def return_response(self, method, path, data, headers, response):
action = headers.get("X-Amz-Target")
data = json.loads(to_str(data))
records = []
if action in (ACTION_CREATE_STREAM, ACTION_DELETE_STREAM):
event_type = (
event_publisher.EVENT_KINESIS_CREATE_STREAM
if ac... | def return_response(self, method, path, data, headers, response):
action = headers.get("X-Amz-Target")
data = json.loads(to_str(data))
records = []
if action in (ACTION_CREATE_STREAM, ACTION_DELETE_STREAM):
event_type = (
event_publisher.EVENT_KINESIS_CREATE_STREAM
if ac... | https://github.com/localstack/localstack/issues/753 | Starting mock Kinesis (http port 4568)...
Starting mock S3 (http port 4572)...
Starting mock Firehose service (http port 4573)...
Starting mock Lambda service (http port 4574)...
Listening at http://:::4565
* Running on http://0.0.0.0:4563/ (Press CTRL+C to quit)
127.0.0.1 - - [08/May/2018 13:52:25] "GET / HTTP/1.1" 20... | KeyError |
def forward(self, method):
path = self.path
if "://" in path:
path = "/" + path.split("://", 1)[1].split("/", 1)[1]
proxy_url = "%s%s" % (self.proxy.forward_url, path)
target_url = self.path
if "://" not in target_url:
target_url = "%s%s" % (self.proxy.forward_url, target_url)
da... | def forward(self, method):
path = self.path
if "://" in path:
path = "/" + path.split("://", 1)[1].split("/", 1)[1]
proxy_url = "%s%s" % (self.proxy.forward_url, path)
target_url = self.path
if "://" not in target_url:
target_url = "%s%s" % (self.proxy.forward_url, target_url)
da... | https://github.com/localstack/localstack/issues/639 | localstack_1 | 2018-03-06 09:33:15,386 INFO spawned: 'infra' with pid 7848
localstack_1 | (. .venv/bin/activate; exec bin/localstack start)
localstack_1 | Starting local dev environment. CTRL-C to quit.
localstack_1 | Starting mock DynamoDB (https port 12000)...
localstack_1 | Starting mock S3 ... | SSLError |
def replay_command(command):
function = getattr(requests, command["m"].lower())
data = command["d"]
if data:
data = base64.b64decode(data)
endpoint = aws_stack.get_local_service_url(command["a"])
full_url = (endpoint[:-1] if endpoint.endswith("/") else endpoint) + command["p"]
result = f... | def replay_command(command):
function = getattr(requests, command["m"].lower())
data = command["d"]
if data:
data = base64.b64decode(data)
endpoint = aws_stack.get_local_service_url(command["a"])
full_url = (endpoint[:-1] if endpoint.endswith("/") else endpoint) + command["p"]
result = f... | https://github.com/localstack/localstack/issues/639 | localstack_1 | 2018-03-06 09:33:15,386 INFO spawned: 'infra' with pid 7848
localstack_1 | (. .venv/bin/activate; exec bin/localstack start)
localstack_1 | Starting local dev environment. CTRL-C to quit.
localstack_1 | Starting mock DynamoDB (https port 12000)...
localstack_1 | Starting mock S3 ... | SSLError |
def forward_request(self, method, path, data, headers):
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(to_str(data))
req_action = req_data["Action"][0]
topic_arn = req_data.get("TargetArn") or req_data.get("TopicArn")
if topic_arn:
topic_arn = topic_ar... | def forward_request(self, method, path, data, headers):
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(to_str(data))
req_action = req_data["Action"][0]
topic_arn = req_data.get("TargetArn") or req_data.get("TopicArn")
if topic_arn:
topic_arn = topic_ar... | https://github.com/localstack/localstack/issues/510 | 2017-12-13T18:10:44:ERROR:localstack.services.generic_proxy: Error forwarding request: list index out of range Traceback (most recent call last):
File "/Users/mpandit/work/localstack/localstack/services/generic_proxy.py", line 181, in forward
path=path, data=data, headers=forward_headers)
File "/Users/mpandit/work/loca... | IndexError |
def strip_chunk_signatures(data):
# For clients that use streaming v4 authentication, the request contains chunk signatures
# in the HTTP body (see example below) which we need to strip as moto cannot handle them
#
# 17;chunk-signature=6e162122ec4962bea0b18bc624025e6ae4e9322bdc632762d909e87793ac5921
... | def strip_chunk_signatures(data):
# For clients that use streaming v4 authentication, the request contains chunk signatures
# in the HTTP body (see example below) which we need to strip as moto cannot handle them
#
# 17;chunk-signature=6e162122ec4962bea0b18bc624025e6ae4e9322bdc632762d909e87793ac5921
... | https://github.com/localstack/localstack/issues/455 | 2017-11-10T12:42:51:ERROR:localstack.services.generic_proxy: Error forwarding request: string index out of range Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 162, in forward
path=path, data=data, headers=forward_headers)
File "/opt/code/localstack/localstac... | IndexError |
def send_notifications(method, bucket_name, object_path):
for bucket, config in iteritems(S3_NOTIFICATIONS):
if bucket == bucket_name:
action = {"PUT": "ObjectCreated", "DELETE": "ObjectRemoved"}[method]
# TODO: support more detailed methods, e.g., DeleteMarkerCreated
# h... | def send_notifications(method, bucket_name, object_path):
for bucket, config in iteritems(S3_NOTIFICATIONS):
if bucket == bucket_name:
action = {"PUT": "ObjectCreated", "DELETE": "ObjectRemoved"}[method]
# TODO: support more detailed methods, e.g., DeleteMarkerCreated
# h... | https://github.com/localstack/localstack/issues/462 | 2017-11-15T01:23:19:ERROR:localstack.services.generic_proxy: Error forwarding request: 'Config' object has no attribute '__getitem__' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 196, in forward
updated_response = self.proxy.update_listener.return_response(**... | TypeError |
def get_elasticsearch_domains(filter=".*", pool={}, env=None):
result = []
try:
out = cmd_es("list-domain-names", env)
out = json.loads(out)
def handle(domain):
domain = domain["DomainName"]
if re.match(filter, domain):
details = cmd_es(
... | def get_elasticsearch_domains(filter=".*", pool={}, env=None):
result = []
try:
out = cmd_es("list-domain-names", env)
out = json.loads(out)
def handle(domain):
domain = domain["DomainName"]
if re.match(filter, domain):
details = cmd_es(
... | https://github.com/localstack/localstack/issues/395 | 2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET / HTTP/1.1" 200 -
2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET //192.168.99.103:8080/swagger.json HTTP/1.1" 200 -
2017-10-11T05:49:48:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:48] "GET /img/locals... | KeyError |
def handle(domain):
domain = domain["DomainName"]
if re.match(filter, domain):
details = cmd_es("describe-elasticsearch-domain --domain-name %s" % domain, env)
details = json.loads(details)["DomainStatus"]
arn = details["ARN"]
es = ElasticSearch(arn)
es.endpoint = details... | def handle(domain):
domain = domain["DomainName"]
if re.match(filter, domain):
details = cmd_es("describe-elasticsearch-domain --domain-name %s" % domain, env)
details = json.loads(details)["DomainStatus"]
arn = details["ARN"]
es = ElasticSearch(arn)
es.endpoint = details... | https://github.com/localstack/localstack/issues/395 | 2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET / HTTP/1.1" 200 -
2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET //192.168.99.103:8080/swagger.json HTTP/1.1" 200 -
2017-10-11T05:49:48:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:48] "GET /img/locals... | KeyError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.