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 __init__(self, *args, **kwargs):
"""
Keywords:
filename (str) : a path to a Jupyter notebook (".ipynb") file
"""
nbformat = import_required(
"nbformat",
"The Bokeh notebook application handler requires Jupyter Notebook to be installed.",
)
nbconvert = import_require... | def __init__(self, *args, **kwargs):
"""
Keywords:
filename (str) : a path to a Jupyter notebook (".ipynb") file
"""
nbformat = import_required(
"nbformat",
"The Bokeh notebook application handler requires Jupyter Notebook to be installed.",
)
nbconvert = import_require... | https://github.com/bokeh/bokeh/issues/8034 | (venv) $ bokeh serve myapp.py
2018-06-27 12:59:45,343 Starting Bokeh server version 0.13.0 (running on Tornado 5.0.1)
2018-06-27 12:59:45,345 Bokeh app running at: http://localhost:5006/myapp
2018-06-27 12:59:45,345 Starting Bokeh server with process id: 13979
0.5604607908584933
2018-06-27 13:00:06,274 200 GET /myapp (... | Exception |
def bk_worker():
asyncio.set_event_loop(asyncio.new_event_loop())
bokeh_tornado = BokehTornado(
{"/bkapp": bkapp}, extra_websocket_origins=["localhost:8000"]
)
bokeh_http = HTTPServer(bokeh_tornado)
bokeh_http.add_sockets(sockets)
server = BaseServer(IOLoop.current(), bokeh_tornado, bo... | def bk_worker():
io_loop = IOLoop.current()
server = BaseServer(io_loop, bokeh_tornado, bokeh_http)
server.start()
server.io_loop.start()
| https://github.com/bokeh/bokeh/issues/7904 | Exception in thread Thread-1:
Traceback (most recent call last):
File "/Users/bryanv/anaconda/envs/01216/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/Users/bryanv/anaconda/envs/01216/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/Users/brya... | RuntimeError |
def check_origin(self, origin):
"""Implement a check_origin policy for Tornado to call.
The suplied origin will be compared to the Bokeh server whitelist. If the
origin is not allow, an error will be logged and ``False`` will be returned.
Args:
origin (str) :
The URL of the connect... | def check_origin(self, origin):
from ..util import check_whitelist
parsed_origin = urlparse(origin)
origin_host = parsed_origin.netloc.lower()
allowed_hosts = self.application.websocket_origins
allowed = check_whitelist(origin_host, allowed_hosts)
if allowed:
return True
else:
... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def open(self):
"""Initialize a connection to a client.
Returns:
None
"""
log.info("WebSocket connection opened")
proto_version = self.get_argument("bokeh-protocol-version", default=None)
if proto_version is None:
self.close()
raise ProtocolError("No bokeh-protocol-ver... | def open(self):
"""Initialize a connection to a client."""
log.info("WebSocket connection opened")
proto_version = self.get_argument("bokeh-protocol-version", default=None)
if proto_version is None:
self.close()
raise ProtocolError("No bokeh-protocol-version specified")
session_id ... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def _async_open(self, session_id, proto_version):
"""Perform the specific steps needed to open a connection to a Bokeh session
Sepcifically, this method coordinates:
* Getting a session for a session ID (creating a new one if needed)
* Creating a protocol receiver and hander
* Opening a new Server... | def _async_open(self, session_id, proto_version):
try:
yield self.application_context.create_session_if_needed(
session_id, self.request
)
session = self.application_context.get_session(session_id)
protocol = Protocol(proto_version)
self.receiver = Receiver(proto... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def on_message(self, fragment):
"""Process an individual wire protocol fragment.
The websocket RFC specifies opcodes for distinguishing text frames
from binary frames. Tornado passes us either a text or binary string
depending on that opcode, we have to look at the type of the fragment
to see what ... | def on_message(self, fragment):
"""Process an individual wire protocol fragment.
The websocket RFC specifies opcodes for distinguishing
text frames from binary frames. Tornado passes us either
a text or binary string depending on that opcode, we have
to look at the type of the fragm... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def send_message(self, message):
"""Send a Bokeh Server protocol message to the connected client.
Args:
message (Message) : a message to send
"""
try:
yield message.send(self)
except (
WebSocketClosedError,
StreamClosedError,
): # Tornado 4.x may raise StreamCl... | def send_message(self, message):
"""Send a Bokeh Server protocol message to the connected client.
Args:
message (Message) : a message to send
"""
try:
yield message.send(self)
except WebSocketClosedError:
# on_close() is / will be called anyway
log.warn("Failed send... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def write_message(self, message, binary=False, locked=True):
"""Override parent write_message with a version that acquires a
write lock before writing.
"""
if locked:
with (yield self.write_lock.acquire()):
yield super(WSHandler, self).write_message(message, binary)
else:
... | def write_message(self, message, binary=False, locked=True):
"""Override parent write_message with a version that acquires a
write lock before writing.
"""
def write_message_unlocked():
future = super(WSHandler, self).write_message(message, binary)
# don't yield this future or we're bl... | https://github.com/bokeh/bokeh/issues/7619 | 2018-03-12 09:05:56,504 200 GET /gapminder (::1) 134.13ms
2018-03-12 09:05:56,506 Sending pull-doc-reply from session 'c13X3Xet3szgUeNWFMzrL86pmFq77b8q04pGAUD8WUFJ'
2018-03-12 09:05:56,513 Failed sending message as connection was closed
2018-03-12 09:05:56,514 WebSocket connection closed: code=None, reason=None
2018-03... | tornado.iostream.StreamClosedError |
def env_before_read_docs(app, env, docnames):
docnames.sort(key=lambda x: 0 if "examples" in x else 1)
for name in [x for x in docnames if env.doc2path(x).endswith(".py")]:
if not name.startswith(tuple(env.app.config.bokeh_plot_pyfile_include_dirs)):
env.found_docs.remove(name)
d... | def env_before_read_docs(app, env, docnames):
docnames.sort(key=lambda x: 2 if "extension" in x else 0 if "examples" in x else 1)
for name in [x for x in docnames if env.doc2path(x).endswith(".py")]:
if not name.startswith(tuple(env.app.config.bokeh_plot_pyfile_include_dirs)):
env.found_docs... | https://github.com/bokeh/bokeh/issues/4965 | 2016-08-16 15:16:51,365 error handling message Message 'PATCH-DOC' (revision 1): ValueError('Unknown string format',)
2016-08-16 15:16:51,365 message header {'msgid': '8B5BE6EBF7044F8793268769745D6C7A', 'msgtype': 'PATCH-DOC'} content {'events': [{'new': 'Mon Aug 01 2016 00:00:00 GMT-0400 (Eastern Daylight Time)', 'm... | ValueError |
def bundle_all_models():
key = calc_cache_key()
bundle = _bundle_cache.get(key, None)
if bundle is None:
_bundle_cache[key] = bundle = (
bundle_models(Model.model_class_reverse_map.values()) or ""
)
return bundle
| def bundle_all_models():
return bundle_models(Model.model_class_reverse_map.values()) or ""
| https://github.com/bokeh/bokeh/issues/4965 | 2016-08-16 15:16:51,365 error handling message Message 'PATCH-DOC' (revision 1): ValueError('Unknown string format',)
2016-08-16 15:16:51,365 message header {'msgid': '8B5BE6EBF7044F8793268769745D6C7A', 'msgtype': 'PATCH-DOC'} content {'events': [{'new': 'Mon Aug 01 2016 00:00:00 GMT-0400 (Eastern Daylight Time)', 'm... | ValueError |
def check_session_id_signature(
session_id, secret_key=settings.secret_key_bytes(), signed=settings.sign_sessions()
):
"""Check the signature of a session ID, returning True if it's valid.
The server uses this function to check whether a session ID
was generated with the correct secret key. If signed s... | def check_session_id_signature(
session_id, secret_key=settings.secret_key_bytes(), signed=settings.sign_sessions()
):
"""Check the signature of a session ID, returning True if it's valid.
The server uses this function to check whether a session ID
was generated with the correct secret key. If signed s... | https://github.com/bokeh/bokeh/issues/6653 | 2017-07-21 00:23:58,161 Uncaught exception GET /sliders?bokeh-session-id=4RJKVrnFVe60gB5urh9sE3jUnSGDkJAfCwvoaDsoMB8f-W6QAfyDoxORtN7mb6DHAzftAhpfnxVdzC-6gIT13uV0 (::1)
HTTPServerRequest(protocol='http', host='localhost:5006', method='GET', uri='/sliders?bokeh-session-id=4RJKVrnFVe60gB5urh9sE3jUnSGDkJAfCwvoaDsoMB8f-W6QA... | TypeError |
def _build_docstring():
global __doc__
from . import subcommands
for cls in subcommands.all:
# running python with -OO will discard docstrings -> __doc__ is None
if __doc__ is None:
__doc__ = ""
__doc__ += "%8s : %s\n" % (cls.name, cls.help)
| def _build_docstring():
global __doc__
from . import subcommands
for cls in subcommands.all:
__doc__ += "%8s : %s\n" % (cls.name, cls.help)
| https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def abstract(cls):
"""A decorator to mark abstract base classes derived from |HasProps|."""
if not issubclass(cls, HasProps):
raise TypeError("%s is not a subclass of HasProps" % cls.__name__)
# running python with -OO will discard docstrings -> __doc__ is None
if cls.__doc__ is not None:
... | def abstract(cls):
"""A decorator to mark abstract base classes derived from |HasProps|."""
if not issubclass(cls, HasProps):
raise TypeError("%s is not a subclass of HasProps" % cls.__name__)
cls.__doc__ += _ABSTRACT_ADMONITION
return cls
| https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def __new__(meta_cls, class_name, bases, class_dict):
""" """
names_with_refs = set()
container_names = set()
# Now handle all the Override
overridden_defaults = {}
for name, prop in class_dict.items():
if not isinstance(prop, Override):
continue
if prop.default_over... | def __new__(meta_cls, class_name, bases, class_dict):
""" """
names_with_refs = set()
container_names = set()
# Now handle all the Override
overridden_defaults = {}
for name, prop in class_dict.items():
if not isinstance(prop, Override):
continue
if prop.default_over... | https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def autoload_server(
model=None, app_path=None, session_id=None, url="default", relative_urls=False
):
"""Return a script tag that embeds content from a Bokeh server session.
Bokeh apps embedded using ``autoload_server`` will NOT set the browser
window title.
.. note::
Typically you will n... | def autoload_server(
model=None, app_path=None, session_id=None, url="default", relative_urls=False
):
"""Return a script tag that embeds content from a Bokeh server session.
Bokeh apps embedded using ``autoload_server`` will NOT set the browser
window title.
.. note::
Typically you will n... | https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def _get_argspecs(glyphclass):
argspecs = OrderedDict()
for arg in glyphclass._args:
spec = {}
prop = getattr(glyphclass, arg)
# running python with -OO will discard docstrings -> __doc__ is None
if prop.__doc__:
spec["desc"] = " ".join(
x.strip() for... | def _get_argspecs(glyphclass):
argspecs = OrderedDict()
for arg in glyphclass._args:
spec = {}
prop = getattr(glyphclass, arg)
spec["desc"] = " ".join(
x.strip() for x in prop.__doc__.strip().split("\n\n")[0].split("\n")
)
spec["default"] = prop.class_default(... | https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def array_encoding_disabled(array):
"""Determine whether an array may be binary encoded.
The NumPy array dtypes that can be encoded are:
{binary_array_types}
Args:
array (np.ndarray) : the array to check
Returns:
bool
"""
# disable binary encoding for non-supported dtyp... | def array_encoding_disabled(array):
"""Determine whether an array may be binary encoded.
The NumPy array dtypes that can be encoded are:
%s
Args:
array (np.ndarray) : the array to check
Returns:
bool
"""
# disable binary encoding for non-supported dtypes
return arra... | https://github.com/bokeh/bokeh/issues/6156 | 2017-04-18 16:51:23 ERROR Error on request:
Traceback (most recent call last):
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/data/projects/python/server-monitoring/env/lib/python2.7/site-packages/werkzeug/serv... | TypeError |
def modify_doc(doc):
x = np.linspace(0, 10, 1000)
y = np.log(x) * np.sin(x)
source = ColumnDataSource(data=dict(x=x, y=y))
plot = figure(title="Simple plot with slider")
plot.line("x", "y", source=source)
slider = Slider(start=1, end=10, value=1, step=0.1)
def callback(attr, old, new):
... | def modify_doc(doc):
x = np.linspace(0, 10, 1000)
y = np.log(x) * np.sin(x)
source = ColumnDataSource(data=dict(x=x, y=y))
plot = figure()
plot.line("x", "y", source=source)
slider = Slider(start=1, end=10, value=1, step=0.1)
def callback(attr, old, new):
y = np.log(x) * np.sin(x... | https://github.com/bokeh/bokeh/issues/5742 | $ python flask_embed.py
Opening Flask app with embedded Bokeh application on http://localhost:8080/
[2017-01-16 21:29:37,150] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/home/juanlu/.miniconda3/envs/py35/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.f... | jinja2.exceptions.TemplateNotFound |
def bkapp_page():
script = autoload_server(model=None, url="http://localhost:5006/bkapp")
return render_template("embed.html", script=script, template="Flask")
| def bkapp_page():
script = autoload_server(model=None, url="http://localhost:5006/bkapp")
return render_template("embed.html", script=script)
| https://github.com/bokeh/bokeh/issues/5742 | $ python flask_embed.py
Opening Flask app with embedded Bokeh application on http://localhost:8080/
[2017-01-16 21:29:37,150] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/home/juanlu/.miniconda3/envs/py35/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.f... | jinja2.exceptions.TemplateNotFound |
def get(self):
template = env.get_template("embed.html")
script = autoload_server(model=None, url="http://localhost:5006/bkapp")
self.write(template.render(script=script, template="Tornado"))
| def get(self):
template = env.get_template("embed.html")
script = autoload_server(model=None, url="http://localhost:5006/bkapp")
self.write(template.render(script=script))
| https://github.com/bokeh/bokeh/issues/5742 | $ python flask_embed.py
Opening Flask app with embedded Bokeh application on http://localhost:8080/
[2017-01-16 21:29:37,150] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/home/juanlu/.miniconda3/envs/py35/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.f... | jinja2.exceptions.TemplateNotFound |
def _run_nodejs(script, input):
if _nodejs is None:
raise RuntimeError(
"node.js is needed to allow compilation of custom models "
+ '("conda install -c bokeh nodejs" or follow https://nodejs.org/en/download/)'
)
proc = Popen([_nodejs, script], stdout=PIPE, stderr=PIPE, ... | def _run_nodejs(script, input):
if _nodejs is None:
raise RuntimeError(
"node.js is needed to allow compilation of custom models "
+ '("conda install -c bokeh nodejs" or follow https://nodejs.org/en/download/)'
)
proc = Popen([_nodejs, script], stdout=PIPE, stderr=PIPE, ... | https://github.com/bokeh/bokeh/issues/5645 | [bryan:...xamples/custom/font-awesome]$ BOKEH_RESOURCES=inline python font-awesome.py (bryanv/5626_properties_py)
Traceback (most recent call last):
File "font-awesome.py", line 10, in <module>
show(column(btn))
File "/Users/bryan/work/bokeh/bokeh/io.py", line 300, in show
return _show... | RuntimeError |
def _run_npm(argv):
if _nodejs is None:
raise RuntimeError(
"node.js is needed to allow compilation of custom models "
+ '("conda install -c bokeh nodejs" or follow https://nodejs.org/en/download/)'
)
_npm = join(dirname(_nodejs), "npm")
proc = Popen([_npm] + argv, s... | def _run_npm(argv):
if _nodejs is None:
raise RuntimeError(
"node.js is needed to allow compilation of custom models "
+ '("conda install -c bokeh nodejs" or follow https://nodejs.org/en/download/)'
)
_npm = join(dirname(_nodejs), "npm")
proc = Popen([_npm] + argv, s... | https://github.com/bokeh/bokeh/issues/5645 | [bryan:...xamples/custom/font-awesome]$ BOKEH_RESOURCES=inline python font-awesome.py (bryanv/5626_properties_py)
Traceback (most recent call last):
File "font-awesome.py", line 10, in <module>
show(column(btn))
File "/Users/bryan/work/bokeh/bokeh/io.py", line 300, in show
return _show... | RuntimeError |
def __init__(self, source, path, argv):
self._failed = False
self._error = None
self._error_detail = None
import ast
self._code = None
try:
nodes = ast.parse(source, path)
self._code = compile(nodes, filename=path, mode="exec", dont_inherit=True)
except SyntaxError as e:
... | def __init__(self, source, path, argv):
self._failed = False
self._error = None
self._error_detail = None
import ast
self._code = None
try:
nodes = ast.parse(source, path)
self._code = compile(nodes, filename=path, mode="exec")
except SyntaxError as e:
self._failed... | https://github.com/bokeh/bokeh/issues/5590 | 2016-12-20 07:52:02,473 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x10bb20f50>: invalid syntax (step3.py, line 41)
File "step4.py", line 3, in <module>:
execfile("step3.py") Traceback (most recent call last):
File "/Users/pwang/anaconda/envs/bokehdemo/lib/python2.7/sit... | SyntaxError |
def _load_stock(filename):
data = {
"date": [],
"open": [],
"high": [],
"low": [],
"close": [],
"volume": [],
"adj_close": [],
}
with _open_csv_file(filename) as f:
next(f)
reader = csv.reader(f, delimiter=",")
for row in reader... | def _load_stock(filename):
data = {
"date": [],
"open": [],
"high": [],
"low": [],
"close": [],
"volume": [],
"adj_close": [],
}
with open(filename) as f:
next(f)
reader = csv.reader(f, delimiter=",")
for row in reader:
... | https://github.com/bokeh/bokeh/issues/5029 | ---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-6-a97873fe504b> in <module>()
2 from bokeh.palettes import Viridis6
3 from bokeh.plotting import figure, show, output_file, ColumnDataSource
----> 4 from... | UnicodeDecodeError |
def __init__(
self, session_id=None, websocket_url=DEFAULT_SERVER_WEBSOCKET_URL, io_loop=None
):
"""
A connection which attaches to a particular named session on the server.
Always call either pull() or push() immediately after creating the session
(until these are called session.document will be N... | def __init__(
self, session_id=None, websocket_url=DEFAULT_SERVER_WEBSOCKET_URL, io_loop=None
):
"""
A connection which attaches to a particular named session on the server.
Always call either pull() or push() immediately after creating the session
(until these are called session.document will be N... | https://github.com/bokeh/bokeh/issues/5119 | $ python -c 'import bokeh.io'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "bokeh/io.py", line 29, in <module>
from .core.state import State
File "bokeh/core/state.py", line 46, in <module>
from ..client import DEFAULT_SESSION_ID
File "bokeh/client/__init__.py", line 6, in <module>
from ... | ImportError |
def _generate_items(self, df, columns):
"""Produce list of unique tuples that identify each item."""
if not self.bin:
super(ColorAttr, self)._generate_items(df, columns)
else:
if len(columns) == 1 and ChartDataSource.is_number(df[columns[0]]):
self.bins = Bins(
so... | def _generate_items(self, df, columns):
"""Produce list of unique tuples that identify each item."""
if not self.bin:
super(ColorAttr, self)._generate_items(df, columns)
else:
if len(columns) == 1 and ChartDataSource.is_number(df[columns[0]]):
self.bins = Bins(
so... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def HeatMap(
data,
x=None,
y=None,
values=None,
stat="count",
xscale="categorical",
yscale="categorical",
xgrid=False,
ygrid=False,
**kw,
):
"""Create a HeatMap chart using :class:`HeatMapBuilder <bokeh.charts.builder.heatmap_builder.HeatMapBuilder>`
to render the geometr... | def HeatMap(
data,
x=None,
y=None,
values=None,
stat="count",
xscale="categorical",
yscale="categorical",
xgrid=False,
ygrid=False,
**kw,
):
"""Create a HeatMap chart using :class:`HeatMapBuilder <bokeh.charts.builder.heatmap_builder.HeatMapBuilder>`
to render the geometr... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def process_data(self):
"""Take the CategoricalHeatMap data from the input **value.
It calculates the chart properties accordingly. Then build a dict
containing references to all the calculated points to be used by
the rect glyph inside the ``_yield_renderers`` method.
"""
for op in self._data... | def process_data(self):
"""Take the CategoricalHeatMap data from the input **value.
It calculates the chart properties accordingly. Then build a dict
containing references to all the calculated points to be used by
the rect glyph inside the ``_yield_renderers`` method.
"""
for op in self._data... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def yield_renderers(self):
"""Use the rect glyphs to display the categorical heatmap.
Takes reference points from data loaded at the ColumnDataSurce.
"""
for group in self._data.groupby(**self.attributes):
glyph = HeatmapGlyph(
x=group.get_values(self.x.selection),
y=gro... | def yield_renderers(self):
"""Use the rect glyphs to display the categorical heatmap.
Takes reference points from data loaded at the ColumnDataSurce.
"""
for group in self._data.groupby(**self.attributes):
glyph = HeatmapGlyph(
x=group.get_values(self.x.selection),
y=gro... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def __init__(
self,
x,
y,
values,
column=None,
stat="count",
glyph="rect",
width=1,
height=1,
**kwargs,
):
kwargs["x"] = x
kwargs["y"] = y
kwargs["values"] = values
kwargs["column"] = column
kwargs["stat"] = stat
kwargs["glyph_name"] = glyph
kwargs["he... | def __init__(
self, x, y, column=None, stat="count", glyph="rect", width=1, height=1, **kwargs
):
kwargs["x"] = x
kwargs["y"] = y
kwargs["column"] = column
kwargs["stat"] = stat
kwargs["glyph_name"] = glyph
kwargs["height"] = height
kwargs["width"] = width
super(XyGlyph, self).__init... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def build_source(self):
return {"x": self.x, "y": self.y, "values": self.values}
| def build_source(self):
return {"x": self.x, "y": self.y}
| https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def calc_num_bins(self, values):
"""Calculate optimal number of bins using IQR.
From: http://stats.stackexchange.com/questions/114490/optimal-bin-width-for-two-dimensional-histogram
"""
iqr = self.q3.value - self.q1.value
if iqr == 0:
self.bin_width = np.sqrt(values.size)
else:
... | def calc_num_bins(self, values):
iqr = self.q3.value - self.q1.value
self.bin_width = 2 * iqr * (len(values) ** -(1.0 / 3.0))
self.bin_count = int(np.ceil((values.max() - values.min()) / self.bin_width))
| https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def __init__(
self,
values=None,
column=None,
dimensions=None,
bins=None,
stat="count",
source=None,
**properties,
):
if isinstance(stat, str):
stat = stats[stat]()
bin_count = properties.get("bin_count")
if bin_count is not None and not isinstance(bin_count, list):
... | def __init__(
self,
values=None,
column=None,
dimensions=None,
bins=None,
stat="count",
source=None,
**properties,
):
if isinstance(stat, str):
stat = stats[stat]()
# explicit dimensions are handled as extra kwargs
if dimensions is None:
dimensions = properti... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def _get_stat(self, dim):
stat_kwargs = {}
if self.source is not None:
stat_kwargs["source"] = self.source
if len(self.dimensions.keys()) > 0:
stat_kwargs["column"] = self.dimensions[dim]
elif self.column is not None:
stat_kwargs["column"] = self.column
... | def _get_stat(self, dim):
stat_kwargs = {}
if self.source is not None:
stat_kwargs["source"] = self.source
if len(self.dimensions.keys()) > 0:
stat_kwargs["column"] = self.dimensions[dim]
elif self.column is not None:
stat_kwargs["column"] = self.column
... | https://github.com/bokeh/bokeh/issues/3124 | Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values', legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, ... | OverflowError |
def _iter_path_collection(paths, path_transforms, offsets, styles):
"""Build an iterator over the elements of the path collection"""
N = max(len(paths), len(offsets))
if len(path_transforms) == 0:
path_transforms = [np.eye(3)]
edgecolor = styles["edgecolor"]
if np.size(edgecolor) == 0:
... | def _iter_path_collection(paths, path_transforms, offsets, styles):
"""Build an iterator over the elements of the path collection"""
N = max(len(paths), len(offsets))
if not path_transforms:
path_transforms = [np.eye(3)]
edgecolor = styles["edgecolor"]
if np.size(edgecolor) == 0:
e... | https://github.com/bokeh/bokeh/issues/2643 | Traceback (most recent call last):
File "violin.py", line 29, in <module>
show(mpl.to_bokeh())
File "/Users/mmari/Desktop/continuum/bokeh/bokeh/compat/mpl.py", line 77, in to_bokeh
exporter.run(fig)
File "/Users/mmari/Desktop/continuum/bokeh/bokeh/compat/mplexporter/exporter.py", line 51, in run
self.crawl_fig(fig)
Fil... | ValueError |
def setup_events(self):
## hack - what we want to do is execute the update callback once
## and only if some properties in the graph have changed
## so we set should_update to be True in setup_events, and
## set it to be false as soon as the callback is done
if not self.name:
return
to_d... | def setup_events(self):
## hack - what we want to do is execute the update callback once
## and only if some properties in the graph have changed
## so we set should_update to be True in setup_events, and
## set it to be false as soon as the callback is done
if not self.name:
return
for ... | https://github.com/bokeh/bokeh/issues/2124 | Traceback (most recent call last):
File "/home/till/programming/miniconda3/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/till/programming/miniconda3/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_use... | RuntimeError |
def transform(self, value):
value = super(DashPattern, self).transform(value)
if isinstance(value, string_types):
try:
return self._dash_patterns[value]
except KeyError:
return [int(x) for x in value.split()]
else:
return value
| def transform(self, value):
value = super(DashPattern, self).transform(value)
if isinstance(value, string_types):
try:
return self._dash_patterns[value]
except KeyError:
return map(int, value.split())
else:
return value
| https://github.com/bokeh/bokeh/issues/527 | ======================================================================
FAIL: test_string (bokeh.tests.test_properties.TestDashPattern)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/bryan/work/bokeh/bokeh/tests/test_properties.py", line 305, in tes... | AssertionError |
def __query_and_simplify(searchTerm: str, apiKey: str = ytmApiKey) -> List[dict]:
"""
`str` `searchTerm` : the search term you would type into YTM's search bar
RETURNS `list<dict>`
For structure of dict, see comment at function declaration
"""
#! For dict structure, see end of this function (... | def __query_and_simplify(searchTerm: str, apiKey: str = ytmApiKey) -> List[dict]:
"""
`str` `searchTerm` : the search term you would type into YTM's search bar
RETURNS `list<dict>`
For structure of dict, see comment at function declaration
"""
#! For dict structure, see end of this function (... | https://github.com/spotDL/spotify-downloader/issues/1038 | Fetching Playlist...
Traceback (most recent call last):
File "/root/envspotdl/bin/spotdl", line 8, in <module>
sys.exit(console_entry_point())
File "/root/envspotdl/lib/python3.8/site-packages/spotdl/__main__.py", line 114, in console_entry_point
songObjList = get_playlist_tracks(request)
File "/root/envspotdl/lib/pyth... | KeyError |
def _is_video(self, result):
# ensure result is not a channel
not_video = (
result.find("channel") is not None
or "yt-lockup-channel" in result.parent.attrs["class"]
or "yt-lockup-channel" in result.attrs["class"]
)
# ensure result is not a mix/playlist
not_video = not_video... | def _is_video(self, result):
# ensure result is not a channel
not_video = (
result.find("channel") is not None
or "yt-lockup-channel" in result.parent.attrs["class"]
or "yt-lockup-channel" in result.attrs["class"]
)
# ensure result is not a mix/playlist
not_video = not_video... | https://github.com/spotDL/spotify-downloader/issues/733 | INFO: 2. Downloading "https://open.spotify.com/track/5dPwLIsgL4gklXWAAM1VZY"
Traceback (most recent call last):
File "/usr/local/bin/spotdl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/spotdl/command_line/__main__.py", line 48, in main
spotdl.match_arguments()
File "/usr/local/li... | AttributeError |
def fetch_albums_from_artist(artist_url, album_type=None):
"""
This funcction returns all the albums from a give artist_url using the US
market
:param artist_url - spotify artist url
:param album_type - the type of album to fetch (ex: single) the default is
all albums
:pa... | def fetch_albums_from_artist(artist_url, album_type="album"):
"""
This funcction returns all the albums from a give artist_url using the US
market
:param artist_url - spotify artist url
:param album_type - the type of album to fetch (ex: single) the default is
a standard albu... | https://github.com/spotDL/spotify-downloader/issues/473 | Traceback (most recent call last):
File "/usr/local/bin/spotdl", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 62, in main
match_args()
File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 44, in match_args
spotify_tools.write_all_albums_from_... | IndexError |
def write_all_albums_from_artist(artist_url, text_file=None):
"""
This function gets all albums from an artist and writes it to a file in the
current working directory called [ARTIST].txt, where [ARTIST] is the artist
of the album
:param artist_url - spotify artist url
:param text_file - file to... | def write_all_albums_from_artist(artist_url, text_file=None):
"""
This function gets all albums from an artist and writes it to a file in the
current working directory called [ARTIST].txt, where [ARTIST] is the artist
of the album
:param artist_url - spotify artist url
:param text_file - file to... | https://github.com/spotDL/spotify-downloader/issues/473 | Traceback (most recent call last):
File "/usr/local/bin/spotdl", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 62, in main
match_args()
File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 44, in match_args
spotify_tools.write_all_albums_from_... | IndexError |
def scrape(self, bestmatch=True, tries_remaining=5):
"""Search and scrape YouTube to return a list of matching videos."""
# prevents an infinite loop but allows for a few retries
if tries_remaining == 0:
log.debug("No tries left. I quit.")
return
search_url = generate_search_url(self.s... | def scrape(self, bestmatch=True, tries_remaining=5):
"""Search and scrape YouTube to return a list of matching videos."""
# prevents an infinite loop but allows for a few retries
if tries_remaining == 0:
log.debug("No tries left. I quit.")
return
search_url = generate_search_url(self.s... | https://github.com/spotDL/spotify-downloader/issues/276 | Traceback (most recent call last):
File "C:\Users\User\spotify-downloader-master\core\youtube_tools.py", line 187, in scrape
videotime = x.find('span', class_="video-time").get_text()
AttributeError: 'NoneType' object has no attribute 'get_text'
During handling of the above exception, another exception occurred:
Trac... | AttributeError |
def override_config(config_file, parser, raw_args=None):
"""Override default dict with config dict passed as comamnd line argument."""
config_file = os.path.realpath(config_file)
config = merge(default_conf["spotify-downloader"], get_config(config_file))
parser.set_defaults(manual=config["manual"])
... | def override_config(config_file, parser, raw_args=None):
"""Override default dict with config dict passed as comamnd line argument."""
config_file = os.path.realpath(config_file)
config = merge(default_conf["spotify-downloader"], get_config(config_file))
parser.set_defaults(avconv=config["avconv"])
... | https://github.com/spotDL/spotify-downloader/issues/246 | $ python ./spotdl.py -l ./playlist.txt -f /d/Music\ 02/ --log-level DEBUG
DEBUG: Python version: 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
DEBUG: Platform: Windows-10-10.0.14393-SP0
DEBUG: {'album': None,
'avconv': False,
'config': None,
'download_only_metadata': Fals... | urllib.error.HTTPError |
def get_arguments(raw_args=None, to_group=True, to_merge=True):
parser = argparse.ArgumentParser(
description="Download and convert songs from Spotify, Youtube etc.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
if to_merge:
config_file = os.path.join(sys.path[0], "conf... | def get_arguments(raw_args=None, to_group=True, to_merge=True):
parser = argparse.ArgumentParser(
description="Download and convert songs from Spotify, Youtube etc.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
if to_merge:
config_file = os.path.join(sys.path[0], "conf... | https://github.com/spotDL/spotify-downloader/issues/246 | $ python ./spotdl.py -l ./playlist.txt -f /d/Music\ 02/ --log-level DEBUG
DEBUG: Python version: 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
DEBUG: Platform: Windows-10-10.0.14393-SP0
DEBUG: {'album': None,
'avconv': False,
'config': None,
'download_only_metadata': Fals... | urllib.error.HTTPError |
def generate_youtube_url(raw_song, meta_tags):
url_fetch = GenerateYouTubeURL(raw_song, meta_tags)
if const.args.youtube_api_key:
url = url_fetch.api()
else:
url = url_fetch.scrape()
return url
| def generate_youtube_url(raw_song, meta_tags, tries_remaining=5):
"""Search for the song on YouTube and generate a URL to its video."""
# prevents an infinite loop but allows for a few retries
if tries_remaining == 0:
log.debug("No tries left. I quit.")
return
query = {"part": "snippet"... | https://github.com/spotDL/spotify-downloader/issues/246 | $ python ./spotdl.py -l ./playlist.txt -f /d/Music\ 02/ --log-level DEBUG
DEBUG: Python version: 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
DEBUG: Platform: Windows-10-10.0.14393-SP0
DEBUG: {'album': None,
'avconv': False,
'config': None,
'download_only_metadata': Fals... | urllib.error.HTTPError |
def feed_playlist(username):
# fetch all user playlists
playlists = spotify.user_playlists(username)
links = []
check = 1
# iterate over user playlists
while True:
for playlist in playlists["items"]:
# In rare cases, playlists may not be found, so playlists['next'] is
... | def feed_playlist(username):
# fetch all user playlists
playlists = spotify.user_playlists(username)
links = []
check = 1
# iterate over user playlists
while True:
for playlist in playlists["items"]:
print(
str(check)
+ ". "
+ m... | https://github.com/spotDL/spotify-downloader/issues/91 | linus@sony-vaio ~/spotify-downloader $ python3 spotdl.py -u spotify
1. Today's Top Hits (50 tracks)
2. RapCaviar (63 tracks)
...
276. Disco Fever (50 tracks)
277. Tegan and Sara: Pride (27 tracks)
Traceback (most recent call last):
File "spotdl.py", line 303, in <module>
feed_playlist(username=args.username)
File "spot... | TypeError |
def escape_xpath_value(value: str):
value = str(value)
if '"' in value and "'" in value:
parts_wo_apos = value.split("'")
escaped = "', \"'\", '".join(parts_wo_apos)
return f"concat('{escaped}')"
if "'" in value:
return f'"{value}"'
return f"'{value}'"
| def escape_xpath_value(value):
if '"' in value and "'" in value:
parts_wo_apos = value.split("'")
escaped = "', \"'\", '".join(parts_wo_apos)
return f"concat('{escaped}')"
if "'" in value:
return f'"{value}"'
return f"'{value}'"
| https://github.com/robotframework/SeleniumLibrary/issues/1021 | 18:35:00.405 FAIL TypeError: argument of type 'int' is not iterable
18:35:00.405 DEBUG Traceback (most recent call last):
File "c:\python27\lib\site-packages\SeleniumLibrary\__init__.py", line 360, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "c:\python27\lib\site-packages\Sel... | TypeError |
def get_cookie(self, name):
"""Returns information of cookie with ``name`` as an object.
If no cookie is found with ``name``, keyword fails. The cookie object
contains details about the cookie. Attributes available in the object
are documented in the table below.
| = Attribute = | = Ex... | def get_cookie(self, name):
"""Returns information of cookie with ``name`` as an object.
If no cookie is found with ``name``, keyword fails. The cookie object
contains details about the cookie. Attributes available in the object
are documented in the table below.
| = Attribute = | = Ex... | https://github.com/robotframework/SeleniumLibrary/issues/1307 | 20190212 16:54:43.113 : FAIL : TypeError: __init__() got an unexpected keyword argument 'hCode'
20190212 16:54:43.113 : DEBUG :
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\SeleniumLibrary\__init__.py", line 369, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "C:... | TypeError |
def __init__(
self,
name,
value,
path=None,
domain=None,
secure=False,
httpOnly=False,
expiry=None,
**extra,
):
self.name = name
self.value = value
self.path = path
self.domain = domain
self.secure = secure
self.httpOnly = httpOnly
self.expiry = datetime.f... | def __init__(
self, name, value, path=None, domain=None, secure=False, httpOnly=False, expiry=None
):
self.name = name
self.value = value
self.path = path
self.domain = domain
self.secure = secure
self.httpOnly = httpOnly
self.expiry = datetime.fromtimestamp(expiry) if expiry else None
| https://github.com/robotframework/SeleniumLibrary/issues/1307 | 20190212 16:54:43.113 : FAIL : TypeError: __init__() got an unexpected keyword argument 'hCode'
20190212 16:54:43.113 : DEBUG :
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\SeleniumLibrary\__init__.py", line 369, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "C:... | TypeError |
def __str__(self):
items = "name value path domain secure httpOnly expiry".split()
string = "\n".join("%s=%s" % (item, getattr(self, item)) for item in items)
if self.extra:
string = "%s%s=%s\n" % (string, "extra", self.extra)
return string
| def __str__(self):
items = "name value path domain secure httpOnly expiry".split()
return "\n".join("%s=%s" % (item, getattr(self, item)) for item in items)
| https://github.com/robotframework/SeleniumLibrary/issues/1307 | 20190212 16:54:43.113 : FAIL : TypeError: __init__() got an unexpected keyword argument 'hCode'
20190212 16:54:43.113 : DEBUG :
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\SeleniumLibrary\__init__.py", line 369, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "C:... | TypeError |
def __str__(self):
items = "name value path domain secure httpOnly expiry".split()
string = "\n".join("%s=%s" % (item, getattr(self, item)) for item in items)
if self.extra:
string = "%s\n%s=%s\n" % (string, "extra", self.extra)
return string
| def __str__(self):
items = "name value path domain secure httpOnly expiry".split()
string = "\n".join("%s=%s" % (item, getattr(self, item)) for item in items)
if self.extra:
string = "%s%s=%s\n" % (string, "extra", self.extra)
return string
| https://github.com/robotframework/SeleniumLibrary/issues/1307 | 20190212 16:54:43.113 : FAIL : TypeError: __init__() got an unexpected keyword argument 'hCode'
20190212 16:54:43.113 : DEBUG :
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\SeleniumLibrary\__init__.py", line 369, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "C:... | TypeError |
def _internal_call(self, method, url, payload, params):
args = dict(params=params)
if not url.startswith("http"):
url = self.prefix + url
headers = self._auth_headers()
if "content_type" in args["params"]:
headers["Content-Type"] = args["params"]["content_type"]
del args["params... | def _internal_call(self, method, url, payload, params):
args = dict(params=params)
if not url.startswith("http"):
url = self.prefix + url
headers = self._auth_headers()
if "content_type" in args["params"]:
headers["Content-Type"] = args["params"]["content_type"]
del args["params... | https://github.com/plamere/spotipy/issues/581 | Max Retries reached
Traceback (most recent call last):
File "../project/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 817, in urlopen
return self.urlopen(
File "../project/venv/lib/python3... | urllib3.exceptions.MaxRetryError |
def _internal_call(self, method, url, payload, params):
args = dict(params=params)
if not url.startswith("http"):
url = self.prefix + url
headers = self._auth_headers()
if "content_type" in args["params"]:
headers["Content-Type"] = args["params"]["content_type"]
del args["params... | def _internal_call(self, method, url, payload, params):
args = dict(params=params)
if not url.startswith("http"):
url = self.prefix + url
headers = self._auth_headers()
if "content_type" in args["params"]:
headers["Content-Type"] = args["params"]["content_type"]
del args["params... | https://github.com/plamere/spotipy/issues/581 | Max Retries reached
Traceback (most recent call last):
File "../project/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 817, in urlopen
return self.urlopen(
File "../project/venv/lib/python3... | urllib3.exceptions.MaxRetryError |
def get_rates(self):
rates = requests.get(self.api_url).json()["rates"]
rates[self.no_currency] = 1.0
return rates
| def get_rates(self):
rates = requests.get(self.api_url).json()["rates"]
rates[self.default] = 1.0
return rates
| https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def get_currencies(self, with_no_currency=True):
rates = [
rate
for rate in self.get_rates()
if with_no_currency or rate != self.no_currency
]
rates.sort(key=lambda rate: "" if rate == self.no_currency else rate)
return rates
| def get_currencies(self):
rates = [rate for rate in self.get_rates()]
rates.sort(key=lambda rate: "" if rate == self.default else rate)
return rates
| https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def exchange_currency(self, amount, source_currency, dest_currency):
if (
source_currency == dest_currency
or source_currency == self.no_currency
or dest_currency == self.no_currency
):
return amount
rates = self.get_rates()
source_rate = rates[source_currency]
dest_... | def exchange_currency(self, amount, source_currency, dest_currency):
if (
source_currency == dest_currency
or source_currency == self.default
or dest_currency == self.default
):
return amount
rates = self.get_rates()
source_rate = rates[source_currency]
dest_rate = r... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def get_billform_for(project, set_default=True, **kwargs):
"""Return an instance of BillForm configured for a particular project.
:set_default: if set to True, on GET methods (usually when we want to
display the default form, it will call set_default on it.
"""
form = BillForm(**kwar... | def get_billform_for(project, set_default=True, **kwargs):
"""Return an instance of BillForm configured for a particular project.
:set_default: if set to True, on GET methods (usually when we want to
display the default form, it will call set_default on it.
"""
form = BillForm(**kwar... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def fake_form(self, bill, project):
bill.payer_id = self.payer
bill.amount = self.amount
bill.what = self.what
bill.external_link = ""
bill.date = self.date
bill.owers = [Person.query.get(ower, project) for ower in self.payed_for]
bill.original_currency = CurrencyConverter.no_currency
bi... | def fake_form(self, bill, project):
bill.payer_id = self.payer
bill.amount = self.amount
bill.what = self.what
bill.external_link = ""
bill.date = self.date
bill.owers = [Person.query.get(ower, project) for ower in self.payed_for]
bill.original_currency = CurrencyConverter.default
bill.c... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def fill(self, bill, project):
self.payer.data = bill.payer_id
self.amount.data = bill.amount
self.what.data = bill.what
self.external_link.data = bill.external_link
self.original_currency.data = bill.original_currency
self.date.data = bill.date
self.payed_for.data = [int(ower.id) for ower i... | def fill(self, bill):
self.payer.data = bill.payer_id
self.amount.data = bill.amount
self.what.data = bill.what
self.external_link.data = bill.external_link
self.original_currency.data = bill.original_currency
self.date.data = bill.date
self.payed_for.data = [int(ower.id) for ower in bill.ow... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("bill", sa.Column("converted_amount", sa.Float(), nullable=True))
op.add_column(
"bill",
sa.Column(
"original_currency",
sa.String(length=3),
server_default=Currency... | def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("bill", sa.Column("converted_amount", sa.Float(), nullable=True))
op.add_column(
"bill",
sa.Column(
"original_currency",
sa.String(length=3),
server_default=Currency... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def create_app(
configuration=None, instance_path="/etc/ihatemoney", instance_relative_config=True
):
app = Flask(
__name__,
instance_path=instance_path,
instance_relative_config=instance_relative_config,
)
# If a configuration object is passed, use it. Otherwise try to find one... | def create_app(
configuration=None, instance_path="/etc/ihatemoney", instance_relative_config=True
):
app = Flask(
__name__,
instance_path=instance_path,
instance_relative_config=instance_relative_config,
)
# If a configuration object is passed, use it. Otherwise try to find one... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def edit_project():
edit_form = EditProjectForm()
import_form = UploadForm()
# Import form
if import_form.validate_on_submit():
try:
import_project(import_form.file.data.stream, g.project)
flash(_("Project successfully uploaded"))
return redirect(url_for("mai... | def edit_project():
edit_form = get_editprojectform_for(g.project)
import_form = UploadForm()
# Import form
if import_form.validate_on_submit():
try:
import_project(import_form.file.data.stream, g.project)
flash(_("Project successfully uploaded"))
return redi... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def edit_bill(bill_id):
# FIXME: Test this bill belongs to this project !
bill = Bill.query.get(g.project, bill_id)
if not bill:
raise NotFound()
form = get_billform_for(g.project, set_default=False)
if request.method == "POST" and form.validate():
form.save(bill, g.project)
... | def edit_bill(bill_id):
# FIXME: Test this bill belongs to this project !
bill = Bill.query.get(g.project, bill_id)
if not bill:
raise NotFound()
form = get_billform_for(g.project, set_default=False)
if request.method == "POST" and form.validate():
form.save(bill, g.project)
... | https://github.com/spiral-project/ihatemoney/issues/601 | INFO [alembic.runtime.migration] Running upgrade cb038f79982e -> 927ed575acbd, Add currencies
Traceback (most recent call last):
File "/home/zorun/tmp/venv3-ihatemoney/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
self.dialect.do_execute(
File "/home/zorun/tmp/venv3-ihatemoney/... | sqlalchemy.exc.DataError |
def clear_screen() -> None: # pragma: no cover
command = "clear"
if platform.system() == "Windows":
command = "cls"
os.system(command)
| def clear_screen() -> None: # pragma: no cover
subprocess.call(["clear"])
| https://github.com/Yelp/detect-secrets/issues/333 | C:\Files\Source\dataops-infra>detect-secrets audit .secrets.baseline
Traceback (most recent call last):
File "c:\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python38\Scripts\de... | FileNotFoundError |
def get_parser_to_add_opt_out_options_to(parser):
"""
The pre-commit hook gets e.g. `--no-jwt-scan` type options
as well as the subparser for `detect-secrets scan`.
:rtype: argparse.ArgumentParser
:returns: argparse.ArgumentParser to pass into PluginOptions
"""
for action in parser._actions... | def get_parser_to_add_opt_out_options_to(parser):
"""
The pre-commit hook gets e.g. `--no-jwt-scan` type options
as well as the subparser for `detect-secrets scan`.
:rtype: argparse.ArgumentParser
:returns: argparse.ArgumentParser to pass into PluginOptions
"""
if parser.prog == "detect-sec... | https://github.com/Yelp/detect-secrets/issues/320 | Detect secrets...........................................................Failed
- hook id: detect-secrets
- exit code: 1
Traceback (most recent call last):
File "c:\users\john.neville\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
Fi... | AttributeError |
def _set_debug_level(self, debug_level):
"""
:type debug_level: int, between 0-2
:param debug_level: configure verbosity of log
"""
mapping = {
0: logging.ERROR,
1: logging.INFO,
2: logging.DEBUG,
}
self.setLevel(
mapping[min(debug_level, 2)],
)
| def _set_debug_level(self, debug_level):
"""
:type debug_level: int, between 0-2
:param debug_level: configure verbosity of log
"""
mapping = {
0: logging.ERROR,
1: logging.INFO,
2: logging.DEBUG,
}
self.setLevel(mapping[debug_level])
| https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def __init__(
self,
typ,
filename,
lineno,
secret,
is_secret=None,
):
"""
:type typ: str
:param typ: human-readable secret type, defined by the plugin
that generated this PotentialSecret.
e.g. "High Entropy String"
:type filename: str
:param f... | def __init__(self, typ, filename, lineno, secret):
"""
:type typ: str
:param typ: human-readable secret type, defined by the plugin
that generated this PotentialSecret.
Eg. "High Entropy String"
:type filename: str
:param filename: name of file that this secret was f... | https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def json(self):
"""Custom JSON encoder"""
attributes = {
"type": self.type,
"filename": self.filename,
"line_number": self.lineno,
"hashed_secret": self.secret_hash,
}
if self.is_secret is not None:
attributes["is_secret"] = self.is_secret
return attributes
| def json(self):
"""Custom JSON encoder"""
attributes = {
"type": self.type,
"filename": self.filename,
"line_number": self.lineno,
"hashed_secret": self.secret_hash,
}
return attributes
| https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def __str__(self): # pragma: no cover
return ("Secret Type: %s\nLocation: %s:%d\n") % (
self.type,
self.filename,
self.lineno,
)
| def __str__(self): # pragma: no cover
return (
"Secret Type: %s\nLocation: %s:%d\n"
# "Hash: %s\n"
) % (
self.type,
self.filename,
self.lineno,
# self.secret_hash
)
| https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def _load_baseline_from_dict(cls, data):
"""Initializes a SecretsCollection object from dictionary.
:type data: dict
:param data: properly formatted dictionary to load SecretsCollection from.
:rtype: SecretsCollection
:raises: IOError
"""
result = SecretsCollection()
if not all(
... | def _load_baseline_from_dict(cls, data):
"""Initializes a SecretsCollection object from dictionary.
:type data: dict
:param data: properly formatted dictionary to load SecretsCollection from.
:rtype: SecretsCollection
:raises: IOError
"""
result = SecretsCollection()
if not all(
... | https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def scan_diff(
self,
diff,
baseline_filename="",
last_commit_hash="",
repo_name="",
):
"""For optimization purposes, our scanning strategy focuses on looking
at incremental differences, rather than re-scanning the codebase every time.
This function supports this, and adds information to ... | def scan_diff(
self,
diff,
baseline_filename="",
last_commit_hash="",
repo_name="",
):
"""For optimization purposes, our scanning strategy focuses on looking
at incremental differences, rather than re-scanning the codebase every time.
This function supports this, and adds information to ... | https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def _get_value_and_line_offset(self, key, values):
"""Returns the index of the location of key, value pair in lines.
:type key: str
:param key: key, in config file.
:type values: str
:param values: values for key, in config file. This is plural,
because you can have multiple values per key... | def _get_value_and_line_offset(self, key, values):
"""Returns the index of the location of key, value pair in lines.
:type key: str
:param key: key, in config file.
:type values: str
:param values: values for key, in config file. This is plural,
because you can have multiple values per key... | https://github.com/Yelp/detect-secrets/issues/61 | Traceback (most recent call last):
File "/hey/three_six/bin/detect-secrets", line 11, in <module>
sys.exit(main())
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/main.py", line 27, in main
log.set_debug_level(args.verbose)
File "/hey/three_six/lib/python3.6/site-packages/detect_secrets/core/log.py", li... | KeyError |
def __gt__(self, other):
return -self <= -(other + 1)
| def __gt__(self, other):
return (other + 1) <= self
| https://github.com/OpenMined/PySyft/issues/4705 | AttributeError Traceback (most recent call last)
<ipython-input-10-c55d3fcd7179> in <module>
2 t2 = torch.tensor([1.2, 1]).fix_precision()#.share(*workers, crypto_provider=crypto_provider, protocol="fss", requires_grad=True)
3
----> 4 t1 > t2
~/code/PySyft/syft/generic/frameworks/hook/hook.p... | AttributeError |
def __str__(self):
"""Return a human readable version of this message"""
return f"({type(self).__name__} {self.object_id, self.user, self.reason})"
| def __str__(self):
"""Return a human readable version of this message"""
return f"({type(self).__name__} {(self.obj_id, self.user, self.reason)})"
| https://github.com/OpenMined/PySyft/issues/3496 | Traceback (most recent call last):
File "/home/juanmixp/Documentos/PySyft/fii.py", line 12, in <module>
y = (x @ x).get().float_prec()
File "/home/juanmixp/Documentos/PySyft/syft/generic/frameworks/hook/hook.py", line 466, in overloaded_native_method
response = method(*new_args, **new_kwargs)
File "/home/juanmixp/Docum... | AttributeError |
def __init__(
self,
hook: "FrameworkHook",
id: Union[int, str] = 0,
data: Union[List, tuple] = None,
is_client_worker: bool = False,
log_msgs: bool = False,
verbose: bool = None,
auto_add: bool = True,
message_pending_time: Union[int, float] = 0,
):
"""Initializes a BaseWorker.""... | def __init__(
self,
hook: "FrameworkHook",
id: Union[int, str] = 0,
data: Union[List, tuple] = None,
is_client_worker: bool = False,
log_msgs: bool = False,
verbose: bool = False,
auto_add: bool = True,
message_pending_time: Union[int, float] = 0,
):
"""Initializes a BaseWorker."... | https://github.com/OpenMined/PySyft/issues/3496 | Traceback (most recent call last):
File "/home/juanmixp/Documentos/PySyft/fii.py", line 12, in <module>
y = (x @ x).get().float_prec()
File "/home/juanmixp/Documentos/PySyft/syft/generic/frameworks/hook/hook.py", line 466, in overloaded_native_method
response = method(*new_args, **new_kwargs)
File "/home/juanmixp/Docum... | AttributeError |
def select_share(alpha_sh, x_sh, y_sh):
"""Performs select share protocol
If the bit alpha_sh is 0, x_sh is returned
If the bit alpha_sh is 1, y_sh is returned
Args:
x_sh (AdditiveSharingTensor): the first share to select
y_sh (AdditiveSharingTensor): the second share to select
... | def select_share(alpha_sh, x_sh, y_sh):
"""Performs select share protocol
If the bit alpha_sh is 0, x_sh is returned
If the bit alpha_sh is 1, y_sh is returned
Args:
x_sh (AdditiveSharingTensor): the first share to select
y_sh (AdditiveSharingTensor): the second share to select
... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def private_compare(x_bit_sh, r, beta, L):
"""
Perform privately x > r
args:
x (AdditiveSharedTensor): the private tensor
r (MultiPointerTensor): the threshold commonly held by the workers
beta (MultiPointerTensor): a boolean commonly held by the workers to
hide the resu... | def private_compare(x_bit_sh, r, beta, L):
"""
Perform privately x > r
args:
x (AdditiveSharedTensor): the private tensor
r (MultiPointerTensor): the threshold commonly held by alice and bob
beta (MultiPointerTensor): a boolean commonly held by alice and bob to
hide the ... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def msb(a_sh):
"""
Compute the most significant bit in a_sh, this is an implementation of the
SecureNN paper https://eprint.iacr.org/2018/442.pdf
Args:
a_sh (AdditiveSharingTensor): the tensor of study
Return:
the most significant bit
"""
workers = a_sh.locations
crypto... | def msb(a_sh):
"""
Compute the most significant bit in a_sh, this is an implementation of the
SecureNN paper https://eprint.iacr.org/2018/442.pdf
Args:
a_sh (AdditiveSharingTensor): the tensor of study
Return:
the most significant bit
"""
alice, bob = a_sh.locations
cry... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def share_convert(a_sh):
"""
Convert shares of a in field L to shares of a in field L - 1
Args:
a_sh (AdditiveSharingTensor): the additive sharing tensor who owns
the shares in field L to convert
Return:
An additive sharing tensor with shares in field L-1
"""
assert... | def share_convert(a_sh):
"""
Convert shares of a in field L to shares of a in field L - 1
Args:
a_sh (AdditiveSharingTensor): the additive sharing tensor who owns
the shares in field L to convert
Return:
An additive sharing tensor with shares in field L-1
"""
assert... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def relu_deriv(a_sh):
"""
Compute the derivative of Relu
Args:
a_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
0 if Dec(a_sh) < 0
1 if Dec(a_sh) > 0
encrypted in an AdditiveSharingTensor
"""
assert a_sh.dtype != "custom", (
... | def relu_deriv(a_sh):
"""
Compute the derivative of Relu
Args:
a_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
0 if Dec(a_sh) < 0
1 if Dec(a_sh) > 0
encrypted in an AdditiveSharingTensor
"""
assert a_sh.dtype != "custom", (
... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def relu(a_sh):
"""
Compute Relu
Args:
a_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
Dec(a_sh) > 0
encrypted in an AdditiveSharingTensor
"""
assert a_sh.dtype != "custom", (
"`custom` dtype shares are unsupported in SecureNN, ... | def relu(a_sh):
"""
Compute Relu
Args:
a_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
Dec(a_sh) > 0
encrypted in an AdditiveSharingTensor
"""
assert a_sh.dtype != "custom", (
"`custom` dtype shares are unsupported in SecureNN, ... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def division(x_sh, y_sh, bit_len_max=None):
"""Performs division of encrypted numbers
Args:
x_sh, y_sh (AdditiveSharingTensor): the private tensors on which the op applies
Returns:
element-wise integer division of x_sh by y_sh
"""
assert x_sh.dtype == y_sh.dtype != "custom", (
... | def division(x_sh, y_sh, bit_len_max=None):
"""Performs division of encrypted numbers
Args:
x_sh, y_sh (AdditiveSharingTensor): the private tensors on which the op applies
Returns:
element-wise integer division of x_sh by y_sh
"""
assert x_sh.dtype == y_sh.dtype != "custom", (
... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def maxpool(x_sh):
"""Compute MaxPool: returns fresh shares of the max value in the input tensor
and the index of this value in the flattened tensor
Args:
x_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
maximum value as an AdditiveSharingTensor
... | def maxpool(x_sh):
"""Compute MaxPool: returns fresh shares of the max value in the input tensor
and the index of this value in the flattened tensor
Args:
x_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
maximum value as an AdditiveSharingTensor
... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def maxpool_deriv(x_sh):
"""Compute derivative of MaxPool
Args:
x_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
an AdditiveSharingTensor of the same shape as x_sh full of zeros except for
a 1 at the position of the max value
"""
assert x_sh... | def maxpool_deriv(x_sh):
"""Compute derivative of MaxPool
Args:
x_sh (AdditiveSharingTensor): the private tensor on which the op applies
Returns:
an AdditiveSharingTensor of the same shape as x_sh full of zeros except for
a 1 at the position of the max value
"""
assert x_sh... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def maxpool2d(a_sh, kernel_size: int = 1, stride: int = 1, padding: int = 0):
"""Applies a 2D max pooling over an input signal composed of several input planes.
This interface is similar to torch.nn.MaxPool2D.
Args:
kernel_size: the size of the window to take a max over
stride: the stride of... | def maxpool2d(a_sh, kernel_size: int = 1, stride: int = 1, padding: int = 0):
"""Applies a 2D max pooling over an input signal composed of several input planes.
This interface is similar to torch.nn.MaxPool2D.
Args:
kernel_size: the size of the window to take a max over
stride: the stride of... | https://github.com/OpenMined/PySyft/issues/2631 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-902fb9b77716> in <module>
12 x = th.tensor([1.1,2.0,3.2,4.0]).fix_precision().share(*workers, crypto_provider=sw, requires_grad=True)
13 m=th.nn.Linear... | TypeError |
def create_wrapper(cls, wrapper_type):
# Note this overrides FrameworkHook.create_wrapper, so it must conform to
# that classmethod's signature
if wrapper_type is None or wrapper_type == torch.Tensor:
return torch.Tensor()
elif isinstance(wrapper_type, torch.dtype):
return torch.tensor([... | def create_wrapper(cls, wrapper_type):
# Note this overrides FrameworkHook.create_wrapper, so it must conform to
# that classmethod's signature
assert wrapper_type is None or wrapper_type == torch.Tensor, (
"TorchHook only uses torch.Tensor wrappers"
)
return torch.Tensor()
| https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def _hook_module(self):
"""Overloading torch.nn.Module with PySyft functionality, the primary module
responsible for core ML functionality such as Neural network layers and
loss functions.
It is important to note that all the operations are actually in-place.
"""
self.element_iter_dict = {}
... | def _hook_module(self):
"""Overloading torch.nn.Module with PySyft functionality, the primary module
responsible for core ML functionality such as Neural network layers and
loss functions.
It is important to note that all the operations are actually in-place.
"""
self.element_iter_dict = {}
... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def module_get_(nn_self):
"""overloads torch.nn instances with get method so that parameters could be sent back to owner"""
for element_iter in tensor_iterator(nn_self):
for p in element_iter():
p.get_()
if isinstance(nn_self.forward, Plan):
nn_self.forward.get()
return nn_... | def module_get_(nn_self):
"""overloads torch.nn instances with get method so that parameters could be sent back to owner"""
for p in nn_self.parameters():
p.get_()
if isinstance(nn_self.forward, Plan):
nn_self.forward.get()
return nn_self
| https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def module_share_(nn_self, *args, **kwargs):
"""Overloads fix_precision for torch.nn.Module."""
if module_is_missing_grad(nn_self):
create_grad_objects(nn_self)
for element_iter in tensor_iterator(nn_self):
for p in element_iter():
p.share_(*args, **kwargs)
return nn_self
| def module_share_(nn_self, *args, **kwargs):
"""Overloads fix_precision for torch.nn.Module."""
# TODO: add .data and .grad to syft tensors
if module_is_missing_grad(nn_self):
create_grad_objects(nn_self)
for p in nn_self.parameters():
p.share_(*args, **kwargs)
return nn_self
| https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def module_fix_precision_(nn_self, *args, **kwargs):
"""Overloads fix_precision for torch.nn.Module."""
if module_is_missing_grad(nn_self):
create_grad_objects(nn_self)
for element_iter in tensor_iterator(nn_self):
for p in element_iter():
p.fix_precision_(*args, **kwargs)
... | def module_fix_precision_(nn_self, *args, **kwargs):
"""Overloads fix_precision for torch.nn.Module."""
if module_is_missing_grad(nn_self):
create_grad_objects(nn_self)
for p in nn_self.parameters():
p.fix_precision_(*args, **kwargs)
return nn_self
| https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def module_float_precision_(nn_self):
"""Overloads float_precision for torch.nn.Module, convert fix_precision
parameters to normal float parameters"""
# TODO: add .data and .grad to syft tensors
# if module_is_missing_grad(nn_self):
# create_grad_objects(nn_self)
for element_iter in tensor_i... | def module_float_precision_(nn_self):
"""Overloads float_precision for torch.nn.Module, convert fix_precision
parameters to normal float parameters"""
# TODO: add .data and .grad to syft tensors
# if module_is_missing_grad(nn_self):
# create_grad_objects(nn_self)
for p in nn_self.parameters(... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def create_pointer(
self,
location: BaseWorker = None,
id_at_location: (str or int) = None,
owner: BaseWorker = None,
ptr_id: (str or int) = None,
garbage_collect_data: bool = True,
shape=None,
**kwargs,
) -> PointerTensor:
"""Creates a pointer to the "self" torch.Tensor object.
... | def create_pointer(
self,
location: BaseWorker = None,
id_at_location: (str or int) = None,
register: bool = False,
owner: BaseWorker = None,
ptr_id: (str or int) = None,
garbage_collect_data: bool = True,
shape=None,
**kwargs,
) -> PointerTensor:
"""Creates a pointer to the "sel... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def _get_hooked_method(cls, tensor_type, method_name):
"""
Hook a method in order to replace all args/kwargs syft/torch tensors with
their child attribute if they exist
If so, forward this method with the new args and new self, get response
and "rebuild" the torch tensor wrapper upon all tensors fou... | def _get_hooked_method(cls, tensor_type, method_name):
"""
Hook a method in order to replace all args/kwargs syft/torch tensors with
their child attribute if they exist
If so, forward this method with the new args and new self, get response
and "rebuild" the torch tensor wrapper upon all tensors fou... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def overloaded_native_method(self, *args, **kwargs):
"""
Operate the hooking
"""
if not hasattr(self, "child"): # means that it's not a wrapper
# if self is a natural tensor but the first argument isn't,
# wrap self with the appropriate type and re-run
if len(args) > 0 and hasa... | def overloaded_native_method(self, *args, **kwargs):
"""
Operate the hooking
"""
if not hasattr(self, "child"): # means that it's not a wrapper
# if self is a natural tensor but the first argument isn't,
# wrap self with the appropriate type and re-run
if len(args) > 0 and hasa... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def create_pointer(
tensor,
location: Union[AbstractWorker, str] = None,
id_at_location: (str or int) = None,
owner: Union[AbstractWorker, str] = None,
ptr_id: (str or int) = None,
garbage_collect_data=None,
shape=None,
) -> "PointerTensor":
"""Creates a pointer to the "self" FrameworkTe... | def create_pointer(
tensor,
location: Union[AbstractWorker, str] = None,
id_at_location: (str or int) = None,
register: bool = False,
owner: Union[AbstractWorker, str] = None,
ptr_id: (str or int) = None,
garbage_collect_data=None,
shape=None,
) -> "PointerTensor":
"""Creates a point... | https://github.com/OpenMined/PySyft/issues/2498 | WARNING: Logging before flag parsing goes to stderr.
W0813 08:46:34.190028 140520788572032 secure_random.py:26] Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was '/usr/local/lib/python3.6/dist-p... | PureTorchTensorFoundError |
def _hook_module(self):
"""Overloading torch.nn.Module with PySyft functionality, the primary module
responsible for core ML functionality such as Neural network layers and
loss functions.
It is important to note that all the operations are actually in-place.
"""
def module_is_missing_grad(mode... | def _hook_module(self):
"""Overloading torch.nn.Module with PySyft functionality, the primary module
responsible for core ML functionality such as Neural network layers and
loss functions.
It is important to note that all the operations are actually in-place.
"""
def module_is_missing_grad(mode... | https://github.com/OpenMined/PySyft/issues/3180 | import syft
import torch
from torchvision import models
import torch.nn as nn
hook = syft.TorchHook(torch)
worker = syft.VirtualWorker(hook, id="worker")
model = models.alexnet(pretrained=True)
for param in model.parameters():
param.requires_grad=False
model.classifier[6] = nn.Linear(model.classifier[6].in_features, ... | RuntimeError |
def create_grad_objects(model):
"""Assigns gradient to model parameters if not assigned"""
for p in model.parameters():
if p.requires_grad: # check if the object requires a grad object
o = p.sum()
o.backward()
if p.grad is not None:
p.grad -= p.grad
| def create_grad_objects(model):
"""Assigns gradient to model parameters if not assigned"""
for p in model.parameters():
o = p.sum()
o.backward()
if p.grad is not None:
p.grad -= p.grad
| https://github.com/OpenMined/PySyft/issues/3180 | import syft
import torch
from torchvision import models
import torch.nn as nn
hook = syft.TorchHook(torch)
worker = syft.VirtualWorker(hook, id="worker")
model = models.alexnet(pretrained=True)
for param in model.parameters():
param.requires_grad=False
model.classifier[6] = nn.Linear(model.classifier[6].in_features, ... | RuntimeError |
def get(self):
"""Just a pass through. This is most commonly used when calling .get() on a
AutogradTensor which has also been shared."""
tensor = self.child.get()
if isinstance(tensor, torch.Tensor):
# Remove the autograd node if a simple tensor is received
if not tensor.is_wrapper:
... | def get(self):
"""Just a pass through. This is most commonly used when calling .get() on a
AutogradTensor which has also been shared."""
self.child = self.child.get()
# Remove the autograd node if a simple tensor is received
if isinstance(self.child, torch.Tensor) and not self.child.is_wrapper:
... | https://github.com/OpenMined/PySyft/issues/2503 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-db6dbbeffaa2> in <module>()
100 # Breaks
101 federated()
--> 102 encrypted() # breaks here - something about loss2.backward() causes the fe... | AttributeError |
def simplify(tensor: "AdditiveSharingTensor") -> tuple:
"""
This function takes the attributes of a AdditiveSharingTensor and saves them in a tuple
Args:
tensor (AdditiveSharingTensor): a AdditiveSharingTensor
Returns:
tuple: a tuple holding the unique attributes of the additive shared t... | def simplify(tensor: "AdditiveSharingTensor") -> tuple:
"""
This function takes the attributes of a AdditiveSharingTensor and saves them in a tuple
Args:
tensor (AdditiveSharingTensor): a AdditiveSharingTensor
Returns:
tuple: a tuple holding the unique attributes of the additive shared t... | https://github.com/OpenMined/PySyft/issues/2352 | ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/code/PySyft/syft/frameworks/torch/hook/hook_args.py in register_response(attr, response, response_ids, owner)
656 # Load the utility function to register the ... | KeyError |
def fix_prec(self, *args, **kwargs):
if self.is_wrapper:
self.child = self.child.fix_prec(*args, **kwargs)
return self
else:
base = kwargs.get("base", 10)
prec_fractional = kwargs.get("precision_fractional", 3)
max_precision = _get_maximum_precision()
if self._req... | def fix_prec(self, *args, **kwargs):
base = kwargs.get("base", 10)
prec_fractional = kwargs.get("precision_fractional", 3)
max_precision = _get_maximum_precision()
if self._requires_large_precision(max_precision, base, prec_fractional):
return (
syft.LargePrecisionTensor(*args, **kwa... | https://github.com/OpenMined/PySyft/issues/2352 | ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/code/PySyft/syft/frameworks/torch/hook/hook_args.py in register_response(attr, response, response_ids, owner)
656 # Load the utility function to register the ... | KeyError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.