after_merge stringlengths 64 17k | before_merge stringlengths 60 17k | source code and errors stringlengths 236 32.3k | full_traceback stringlengths 170 17.7k | traceback_type stringclasses 60
values |
|---|---|---|---|---|
def authenticate(self, *args, **kwargs):
if self.global_params["authentication_type"] == "ldap":
return super(LDAPBackend, self).authenticate(*args, **kwargs)
return None | def authenticate(self, username, password):
if self.global_params["authentication_type"] == "ldap":
return super(LDAPBackend, self).authenticate(
username=username, password=password)
return None | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /accounts/login/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner\\nresponse = get_response(request)\\nFile "/srv/modoboa/env/lib/python2.7/site-packag... | Internal Server Error: /accounts/login/
Traceback (most recent call last):
File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_respons... | TypeError |
def handle(self, *args, **options):
exts_pool.load_all()
self.csvwriter = csv.writer(
self.stdout, delimiter=smart_text(options["sepchar"]))
getattr(self, "export_{}".format(options["objtype"]))() | def handle(self, *args, **options):
exts_pool.load_all()
self.csvwriter = csv.writer(sys.stdout, delimiter=options["sepchar"])
getattr(self, "export_{}".format(options["objtype"]))() | [{'piece_type': 'other', 'piece_content': 'sudo -u <modoboa_user> -i\\nsource <virtualenv_path>/bin/activate\\npython <virtualenv_path>/instance/manage.py modo export --sepchar , domains\\n# or the equivalent (gives same result)\\npython <virtualenv_path>/instance/manage.py modo export domains'}, {'piece_type': 'error ... | Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/modoboa/env/local/lib/python2.7/site-packages/dj... | TypeError |
def ready(self):
load_core_settings()
# Import these to force registration of checks and signals
from . import checks # noqa:F401
from . import handlers
signals.post_migrate.connect(handlers.create_local_config, sender=self) | def ready(self):
load_core_settings()
from . import handlers
signals.post_migrate.connect(handlers.create_local_config, sender=self) | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/srv/modoboa/instance/manage.py", line 10, in <module>\\nexecute_from_command_line(sys.argv)\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.9.12-py2.7.egg/django/core/management/__init__.py", line 353, in ... | Traceback (most recent call last):
File "/srv/modoboa/instance/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.9.12-py2.7.egg/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/srv/mo... | pytz.exceptions.NonExistentTimeError |
def store_dnsbl_result(self, domain, provider, results, **options):
"""Store DNSBL provider results for domain."""
alerts = {}
to_create = []
for mx, result in list(results.items()):
if not result:
result = ""
dnsbl_result = models.DNSBLResult.... | def store_dnsbl_result(self, domain, provider, results, **options):
"""Store DNSBL provider results for domain."""
alerts = {}
to_create = []
for mx in results.keys():
result = "" if not results[mx] else results[mx]
dnsbl_result = models.DNSBLResult.objects.fi... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/srv/modoboa/instance/manage.py", line 22, in <module>\\nexecute_from_command_line(sys.argv)\\nFile "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line\\nut... | Traceback (most recent call last):
File "/srv/modoboa/instance/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/srv/modoboa/env/lib/python2.7/site-p... | django.db.utils.IntegrityError |
def on_mailbox_modified(mailbox):
"""Update amavis records if address has changed."""
if parameters.get_admin("MANUAL_LEARNING") == "no" or \\
not hasattr(mailbox, "old_full_address") or \\
mailbox.full_address == mailbox.old_full_address:
return
user = Users.objects.select_related().g... | def on_mailbox_modified(mailbox):
"""Update amavis records if address has changed."""
if parameters.get_admin("MANUAL_LEARNING") == "no" or \\
not hasattr(mailbox, "old_full_address") or \\
mailbox.full_address == mailbox.old_full_address:
return
user = Users.objects.select_related.get... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/python-envs/service/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/python-envs/service/lib... | Traceback (most recent call last):
File "/srv/python-envs/service/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/python-envs/service/lib/python2.7/site-packages/django/contrib/auth/decorators.py", ... | AttributeError |
def get_mail_content(self, mailid):
"""Retrieve the content of a message."""
content = "".join([
str(qmail.mail_text)
for qmail in Quarantine.objects.filter(mail=mailid)
])
if isinstance(content, unicode):
content = content.encode("utf-8")
... | def get_mail_content(self, mailid):
"""Retrieve the content of a message.
"""
return Quarantine.objects.filter(mail=mailid) | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/extension... | DataError |
def get_mail_content(self, mailid):
"""Retrieve the content of a message."""
content = "".join([
str(qmail.mail_text)
for qmail in Quarantine.objects.filter(mail=mailid)
])
if isinstance(content, unicode):
content = content.encode("utf-8")
... | def get_mail_content(self, mailid):
"""Retrieve the content of a message."""
return Quarantine.objects.filter(mail=mailid).extra(
select={'mail_text': "convert_from(mail_text, 'UTF8')"}
) | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/extension... | DataError |
def msg(self):
"""Get message's content."""
import email
if self._msg is None:
mail_text = get_connector().get_mail_content(self.mailid)
self._msg = email.message_from_string(mail_text)
self._parse(self._msg)
return self._msg | def msg(self):
"""Get message's content."""
import email
if self._msg is None:
qmails = get_connector().get_mail_content(self.mailid)
mail_text = "".join([qm.mail_text for qm in qmails])
if type(mail_text) is unicode:
mail_text = mail_text... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/extension... | DataError |
def viewheaders(request, mail_id):
"""Display message headers."""
content = get_connector().get_mail_content(mail_id)
msg = email.message_from_string(content)
headers = []
for name, value in msg.items():
if value:
result = chardet.detect(value)
if result["encoding"] i... | def viewheaders(request, mail_id):
"""Display message headers."""
content = ""
for qm in get_connector().get_mail_content(mail_id):
content += qm.mail_text
if type(content) is unicode:
content = content.encode("utf-8")
msg = email.message_from_string(content)
headers = []
for... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/extension... | DataError |
def mark_messages(request, selection, mtype, recipient_db=None):
"""Mark a selection of messages as spam.
:param str selection: message unique identifier
:param str mtype: type of marking (spam or ham)
"""
if not manual_learning_enabled(request.user):
return render_to_json_response({"status... | def mark_messages(request, selection, mtype, recipient_db=None):
"""Mark a selection of messages as spam.
:param str selection: message unique identifier
:param str mtype: type of marking (spam or ham)
"""
if not manual_learning_enabled(request.user):
return render_to_json_response({"status... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/extension... | DataError |
def list_quotas(request):
from modoboa.lib.dbutils import db_type
sort_order, sort_dir = get_sort_order(request.GET, "address")
mboxes = Mailbox.objects.get_for_admin(
request.user, request.GET.get("searchquery", None)
)
mboxes = mboxes.exclude(quota=0)
if sort_order in ["address", "quo... | def list_quotas(request):
from modoboa.lib.dbutils import db_type
sort_order, sort_dir = get_sort_order(request.GET, "address")
mboxes = Mailbox.objects.get_for_admin(
request.user, request.GET.get("searchquery", None)
)
mboxes = mboxes.exclude(quota=0)
if sort_order in ["address", "quo... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response\\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/mo... | Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.6.8-py2.... | FieldError |
def messages_count(self, **kwargs):
if self.count is None:
filter = Q(chunk_ind=1)
if self.mail_ids is not None:
filter &= Q(mail__in=self.mail_ids)
if self.filter:
filter &= self.filter
self.messages = Quarantine.objects.filter... | def messages_count(self, **kwargs):
if self.count is None:
filter = Q(chunk_ind=1)
if self.mail_ids is not None:
filter &= Q(mail__in=self.mail_ids)
if self.filter:
filter &= self.filter
self.messages = Quarantine.objects.filter... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def fetch(self, start=None, stop=None, **kwargs):
emails = []
for qm in self.messages[start - 1:stop]:
m = {"from": qm["mail__from_addr"],
"to": qm["mail__msgrcpt__rid__email"],
"subject": qm["mail__subject"],
"mailid": qm["mail__mail_id... | def fetch(self, start=None, stop=None, **kwargs):
emails = []
for qm in self.messages[start - 1:stop]:
m = {"from": qm["mail__from_addr"],
"to": qm["mail__msgrcpt__rid__email"],
"subject": qm["mail__subject"],
"mailid": qm["mail__mail_id... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def viewmail(request, mail_id):
rcpt = request.GET["rcpt"]
if request.user.mailbox_set.count():
mb = Mailbox.objects.get(user=request.user)
if rcpt in mb.alias_addresses:
get_wrapper().set_msgrcpt_status(rcpt, mail_id, 'V')
content = Template("""
<iframe src="{{ url }}" id="mail... | def viewmail(request, mail_id):
rcpt = request.GET["rcpt"]
if request.user.mailbox_set.count():
mb = Mailbox.objects.get(user=request.user)
if rcpt in mb.alias_addresses:
msgrcpt = get_wrapper().get_recipient_message(rcpt, mail_id)
msgrcpt.rs = 'V'
msgrcpt.sav... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def delete_selfservice(request, mail_id):
rcpt = request.GET.get("rcpt", None)
if rcpt is None:
raise BadRequest(_("Invalid request"))
try:
get_wrapper().set_msgrcpt_status(rcpt, mail_id, 'D')
except Msgrcpt.DoesNotExist:
raise BadRequest(_("Invalid request"))
return render_t... | def delete_selfservice(request, mail_id):
rcpt = request.GET.get("rcpt", None)
if rcpt is None:
raise BadRequest(_("Invalid request"))
try:
msgrcpt = get_wrapper().get_recipient_message(rcpt, mail_id)
msgrcpt.rs = 'D'
msgrcpt.save()
except Msgrcpt.DoesNotExist:
ra... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def delete(request, mail_id):
"""Delete message selection.
:param str mail_id: message unique identifier
"""
mail_id = check_mail_id(request, mail_id)
wrapper = get_wrapper()
mb = Mailbox.objects.get(user=request.user) \\
if request.user.group == 'SimpleUsers' else None
for mid in m... | def delete(request, mail_id):
"""Delete message selection.
:param str mail_id: message unique identifier
"""
mail_id = check_mail_id(request, mail_id)
wrapper = get_wrapper()
mb = Mailbox.objects.get(user=request.user) \\
if request.user.group == 'SimpleUsers' else None
for mid in m... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def release_selfservice(request, mail_id):
rcpt = request.GET.get("rcpt", None)
secret_id = request.GET.get("secret_id", None)
if rcpt is None or secret_id is None:
raise BadRequest(_("Invalid request"))
wrapper = get_wrapper()
try:
msgrcpt = wrapper.get_recipient_message(rcpt, mail_... | def release_selfservice(request, mail_id):
rcpt = request.GET.get("rcpt", None)
secret_id = request.GET.get("secret_id", None)
if rcpt is None or secret_id is None:
raise BadRequest(_("Invalid request"))
try:
msgrcpt = get_wrapper().get_recipient_message(rcpt, mail_id)
except Msgrcpt... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def release(request, mail_id):
"""Release message selection.
:param str mail_id: message unique identifier
"""
mail_id = check_mail_id(request, mail_id)
msgrcpts = []
wrapper = get_wrapper()
mb = Mailbox.objects.get(user=request.user) \\
if request.user.group == 'SimpleUsers' else N... | def release(request, mail_id):
"""Release message selection.
:param str mail_id: message unique identifier
"""
mail_id = check_mail_id(request, mail_id)
msgrcpts = []
wrapper = get_wrapper()
mb = Mailbox.objects.get(user=request.user) \\
if request.user.group == 'SimpleUsers' else N... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /quarantine/process/\\nTraceback (most recent call last):\\nFile "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_arg... | Internal Server Error: /quarantine/process/
Traceback (most recent call last):
File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/python-virtualen... | IntegrityError |
def get_password_hasher(scheme):
"""Retrieve the hasher corresponding to :keyword:`scheme`.
If no class is found, `PLAINHasher` is returned.
:param str scheme: a valid scheme name
:rtype: PasswordHasher sub class
:return: The hasher class
"""
try:
scheme = scheme.replace('-', '')
... | def get_password_hasher(scheme):
"""Retrieve the hasher corresponding to :keyword:`scheme`.
If no class is found, `PLAINHasher` is returned.
:param str scheme: a valid scheme name
:rtype: PasswordHasher sub class
:return: The hasher class
"""
try:
scheme = scheme.replace('-', '')
... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/srv/python-envs/service/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response\\nresponse = callback(request, *callback_args, **callback_kwargs)\\n\\nFile "/srv/python-envs/service/lib/python2... | Traceback (most recent call last):
File "/srv/python-envs/service/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/python-envs/service/lib/python2.7/site-packages/django/views/decorators/cache.py", line 89, ... | KeyError |
def print_summary(samples, prob=0.9, group_by_chain=True):
"""
Prints a summary table displaying diagnostics of ``samples`` from the
posterior. The diagnostics displayed are mean, standard deviation, median,
the 90% Credibility Interval, :func:`~pyro.ops.stats.effective_sample_size`,
:func:`~pyro.op... | def print_summary(samples, prob=0.9, group_by_chain=True):
"""
Prints a summary table displaying diagnostics of ``samples`` from the
posterior. The diagnostics displayed are mean, standard deviation, median,
the 90% Credibility Interval, :func:`~pyro.ops.stats.effective_sample_size`,
:func:`~pyro.op... | [{'piece_type': 'other', 'piece_content': 'import torch\\nimport pyro\\nimport pyro.distributions as dist\\nimport pyro.poutine as poutine\\nfrom pyro.infer import MCMC, NUTS\\n#pyro.set_rng_seed(101)\\n\\n# This works if I set it to True\\nuse_gaussian = False\\n\\ndef model(prior_elves):\\nprint(\\'prior:\\', prior_e... | Sample: 100%|██████████| 15/15 [00:00, 1853.70it/s, step size=1.00e+00, acc. prob=1.000]
prior: tensor([0.2000, 0.2000, 0.2000, 0.2000, 0.2000])
Num elves: tensor(4)
Rocks: 16, Logs: 24
Rocks obs: 4, Logs obs: 6
prior: tensor([0.2000, 0.2000, 0.2000, 0.2000, 0.2000])
Num elves: tensor([0, 1, 2, 3, 4])
Rocks: tensor([... | ValueError |
def get_dependent_plate_dims(sites):
"""
Return a list of dims for plates that are not common to all sites.
"""
plate_sets = [site["cond_indep_stack"]
for site in sites if site["type"] == "sample"]
all_plates = set().union(*plate_sets)
common_plates = all_plates.intersection(*p... | def get_dependent_plate_dims(sites):
"""
Return a list of dims for plates that are not common to all sites.
"""
plate_sets = [site["cond_indep_stack"]
for site in sites if site["type"] == "sample"]
all_plates = set().union(*plate_sets)
common_plates = all_plates.intersection(*p... | [{'piece_type': 'source code', 'piece_content': "import sys, torch, pyro\\nprint(sys.version, torch.__version__, pyro.__version__)\\n\\ndef model(data):\\nx = pyro.sample('x', pyro.distributions.Bernoulli(torch.tensor(0.5)))\\nfor i in pyro.plate('data_plate', len(data)):\\npyro.sample('data_{:d}'.format(i), pyro.distr... | 3.8.1 (default, Jan 8 2020, 16:15:59)
[Clang 4.0.1 (tags/RELEASE_401/final)] 1.4.0 1.3.0
2.4235687255859375
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-6865281f40fd> in <module>
15
16 elbo = pyr... | TypeError |
def run(self, *args, **kwargs):
self._args, self._kwargs = args, kwargs
num_samples = [0] * self.num_chains
z_flat_acc = [[] for _ in range(self.num_chains)]
with pyro.validation_enabled(not self.disable_validation):
for x, chain_id in self.sampler.run(*args, **kwargs):
... | def run(self, *args, **kwargs):
self._args, self._kwargs = args, kwargs
num_samples = [0] * self.num_chains
z_flat_acc = [[] for _ in range(self.num_chains)]
with pyro.validation_enabled(not self.disable_validation):
for x, chain_id in self.sampler.run(*args, **kwargs):
... | [{'piece_type': 'error message', 'piece_content': "AttributeError Traceback (most recent call last)\\n<ipython-input-13-5a1da811afef> in <module>()\\n8 mcmc = MCMC(nuts_kernel, num_samples=25, warmup_steps=100, num_chains=cpu_count)\\n9\\n---> 10 mcmc.run(y)\\n\\n~/anaconda3/envs/pytorch_p36/... | AttributeError Traceback (most recent call last)
<ipython-input-13-5a1da811afef> in <module>()
8 mcmc = MCMC(nuts_kernel, num_samples=25, warmup_steps=100, num_chains=cpu_count)
9
---> 10 mcmc.run(y)
~/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/pyro/poutine/messenger.py in _conte... | AttributeError |
def get_posterior(self, *args, **kwargs):
"""
Returns a MultivariateNormal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix), self._init_loc)
scale_tril = pyro.param("{}_scale_tril".format(self.prefix),
lambda: eye_like(... | def get_posterior(self, *args, **kwargs):
"""
Returns a MultivariateNormal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix),
lambda: torch.zeros(self.latent_dim))
scale_tril = pyro.param("{}_scale_tril".format(self.prefix),
... | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def get_posterior(self, *args, **kwargs):
"""
Returns a diagonal Normal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix), self._init_loc)
scale = pyro.param("{}_scale".format(self.prefix),
lambda: loc.new_ones(self.latent_di... | def get_posterior(self, *args, **kwargs):
"""
Returns a diagonal Normal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix),
lambda: torch.zeros(self.latent_dim))
scale = pyro.param("{}_scale".format(self.prefix),
... | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def __init__(self, model, prefix="auto", init_loc_fn=init_to_median, rank=1):
if not isinstance(rank, numbers.Number) or not rank > 0:
raise ValueError("Expected rank > 0 but got {}".format(rank))
self.rank = rank
super(AutoLowRankMultivariateNormal, self).__init__(
m... | def __init__(self, model, prefix="auto", rank=1):
if not isinstance(rank, numbers.Number) or not rank > 0:
raise ValueError("Expected rank > 0 but got {}".format(rank))
self.rank = rank
super(AutoLowRankMultivariateNormal, self).__init__(model, prefix) | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def get_posterior(self, *args, **kwargs):
"""
Returns a LowRankMultivariateNormal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix), self._init_loc)
factor = pyro.param("{}_cov_factor".format(self.prefix),
lambda: loc.new_em... | def get_posterior(self, *args, **kwargs):
"""
Returns a LowRankMultivariateNormal posterior distribution.
"""
loc = pyro.param("{}_loc".format(self.prefix),
lambda: torch.zeros(self.latent_dim))
factor = pyro.param("{}_cov_factor".format(self.prefix),... | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def __init__(self, model, hidden_dim=None, prefix="auto", init_loc_fn=init_to_median):
self.hidden_dim = hidden_dim
self.arn = None
super(AutoIAFNormal, self).__init__(model, prefix=prefix, init_loc_fn=init_loc_fn) | def __init__(self, model, hidden_dim=None, prefix="auto"):
self.hidden_dim = hidden_dim
self.arn = None
super(AutoIAFNormal, self).__init__(model, prefix) | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def get_posterior(self, *args, **kwargs):
"""
Returns a Delta posterior distribution for MAP inference.
"""
loc = pyro.param("{}_loc".format(self.prefix), self._init_loc)
return dist.Delta(loc).to_event(1) | def get_posterior(self, *args, **kwargs):
"""
Returns a Delta posterior distribution for MAP inference.
"""
loc = pyro.param("{}_loc".format(self.prefix),
lambda: torch.zeros(self.latent_dim))
return dist.Delta(loc).to_event(1) | [{'piece_type': 'source code', 'piece_content': 'import pyro\\nimport pyro.distributions as dist\\nimport torch\\nfrom pyro.contrib.autoguide import AutoDiagonalNormal\\nfrom pyro.infer import SVI, Trace_ELBO\\nfrom pyro.optim import Adam\\n\\n\\ndef model(xs, prior_loc, prior_scale):\\nmu = pyro.sample(\\'mu\\', dist.... | Traceback (most recent call last):
File "C:\\tools\\miniconda3\\envs\\scanner-pyro\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 3265, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-68d49e4377f9>", line 26, in <module>
train()
File "<ipython-input-6-68d49e4377f9>",... | RuntimeError |
def main(args):
baseball_dataset = pd.read_csv(DATA_URL, "\\t")
train, _, player_names = train_test_split(baseball_dataset)
at_bats, hits = train[:, 0], train[:, 1]
nuts_kernel = NUTS(conditioned_model)
logging.info("Original Dataset:")
logging.info(baseball_dataset)
# (1) Full Pooling Mode... | def main(args):
baseball_dataset = pd.read_csv(DATA_URL, "\\t")
train, _, player_names = train_test_split(baseball_dataset)
at_bats, hits = train[:, 0], train[:, 1]
nuts_kernel = NUTS(conditioned_model)
logging.info("Original Dataset:")
logging.info(baseball_dataset)
# (1) Full Pooling Mode... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum\\nlog_p = site["log_prob_sum"]\\nKeyError: \\'log_prob_sum\\'\\nDuring handling of the above exception, another exception occurred:\\nTraceb... | Traceback (most recent call last):
File "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum
log_p = site["log_prob_sum"]
KeyError: 'log_prob_sum'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/uber/pyro/e... | KeyError |
def main(args):
pyro.set_rng_seed(args.rng_seed)
baseball_dataset = pd.read_csv(DATA_URL, "\\t")
train, _, player_names = train_test_split(baseball_dataset)
at_bats, hits = train[:, 0], train[:, 1]
nuts_kernel = NUTS(conditioned_model)
logging.info("Original Dataset:")
logging.info(baseball_... | def main(args):
baseball_dataset = pd.read_csv(DATA_URL, "\\t")
train, _, player_names = train_test_split(baseball_dataset)
at_bats, hits = train[:, 0], train[:, 1]
nuts_kernel = NUTS(conditioned_model)
logging.info("Original Dataset:")
logging.info(baseball_dataset)
# (1) Full Pooling Mode... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum\\nlog_p = site["log_prob_sum"]\\nKeyError: \\'log_prob_sum\\'\\nDuring handling of the above exception, another exception occurred:\\nTraceb... | Traceback (most recent call last):
File "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum
log_p = site["log_prob_sum"]
KeyError: 'log_prob_sum'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/uber/pyro/e... | KeyError |
def _kinetic_energy(self, r):
# TODO: revert to `torch.dot` in pytorch==1.0
# See: https://github.com/uber/pyro/issues/1458
r_flat = torch.cat([r[site_name].reshape(-1) for site_name in sorted(r)])
if self.full_mass:
return 0.5 * (r_flat * (self._inverse_mass_matrix.matmu... | def _kinetic_energy(self, r):
r_flat = torch.cat([r[site_name].reshape(-1) for site_name in sorted(r)])
if self.full_mass:
return 0.5 * r_flat.dot(self._inverse_mass_matrix.matmul(r_flat))
else:
return 0.5 * self._inverse_mass_matrix.dot(r_flat ** 2) | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum\\nlog_p = site["log_prob_sum"]\\nKeyError: \\'log_prob_sum\\'\\nDuring handling of the above exception, another exception occurred:\\nTraceb... | Traceback (most recent call last):
File "/home/travis/build/uber/pyro/pyro/poutine/trace_struct.py", line 128, in log_prob_sum
log_p = site["log_prob_sum"]
KeyError: 'log_prob_sum'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/uber/pyro/e... | KeyError |
def model(self, xs, ys=None):
"""
The model corresponds to the following generative process:
p(z) = normal(0,I) # handwriting style (latent)
p(y|x) = categorical(I/10.) # which digit (semi-supervised)
p(x|y,z) = bernoulli(mu(y,z)) # an image
mu is g... | def model(self, xs, ys=None):
"""
The model corresponds to the following generative process:
p(z) = normal(0,I) # handwriting style (latent)
p(y|x) = categorical(I/10.) # which digit (semi-supervised)
p(x|y,z) = bernoulli(mu(y,z)) # an image
mu is g... | [{'piece_type': 'error message', 'piece_content': '$ python ss_vae_M2.py -enum\\nTraceback (most recent call last):\\nFile "ss_vae_M2.py", line 464, in <module>\\nrun_inference_ss_vae(args)\\nFile "ss_vae_M2.py", line 371, in run_inference_ss_vae\\nrun_inference_for_epoch(data_loaders, losses, periodic_interval_batches... | $ python ss_vae_M2.py -enum
Traceback (most recent call last):
File "ss_vae_M2.py", line 464, in <module>
run_inference_ss_vae(args)
File "ss_vae_M2.py", line 371, in run_inference_ss_vae
run_inference_for_epoch(data_loaders, losses, periodic_interval_batches)
File "ss_vae_M2.py", line 268, in run_inference_for_epoch
n... | NotImplementedError |
def guide(self, xs, ys=None):
"""
The guide corresponds to the following:
q(y|x) = categorical(alpha(x)) # infer digit from an image
q(z|x,y) = normal(mu(x,y),sigma(x,y)) # infer handwriting style from an image and the digit
mu, sigma are given by a neural ... | def guide(self, xs, ys=None):
"""
The guide corresponds to the following:
q(y|x) = categorical(alpha(x)) # infer digit from an image
q(z|x,y) = normal(mu(x,y),sigma(x,y)) # infer handwriting style from an image and the digit
mu, sigma are given by a neural ... | [{'piece_type': 'error message', 'piece_content': '$ python ss_vae_M2.py -enum\\nTraceback (most recent call last):\\nFile "ss_vae_M2.py", line 464, in <module>\\nrun_inference_ss_vae(args)\\nFile "ss_vae_M2.py", line 371, in run_inference_ss_vae\\nrun_inference_for_epoch(data_loaders, losses, periodic_interval_batches... | $ python ss_vae_M2.py -enum
Traceback (most recent call last):
File "ss_vae_M2.py", line 464, in <module>
run_inference_ss_vae(args)
File "ss_vae_M2.py", line 371, in run_inference_ss_vae
run_inference_for_epoch(data_loaders, losses, periodic_interval_batches)
File "ss_vae_M2.py", line 268, in run_inference_for_epoch
n... | NotImplementedError |
def model_sample(self, ys, batch_size=1):
# sample the handwriting style from the constant prior distribution
prior_mu = Variable(torch.zeros([batch_size, self.z_dim]))
prior_sigma = Variable(torch.ones([batch_size, self.z_dim]))
zs = pyro.sample("z", dist.normal, prior_mu, prior_sig... | def model_sample(self, ys, batch_size=1):
# sample the handwriting style from the constant prior distribution
prior_mu = Variable(torch.zeros([batch_size, self.z_dim]))
prior_sigma = Variable(torch.ones([batch_size, self.z_dim]))
zs = pyro.sample("z", dist.normal, prior_mu, prior_sig... | [{'piece_type': 'error message', 'piece_content': '$ python ss_vae_M2.py -enum\\nTraceback (most recent call last):\\nFile "ss_vae_M2.py", line 464, in <module>\\nrun_inference_ss_vae(args)\\nFile "ss_vae_M2.py", line 371, in run_inference_ss_vae\\nrun_inference_for_epoch(data_loaders, losses, periodic_interval_batches... | $ python ss_vae_M2.py -enum
Traceback (most recent call last):
File "ss_vae_M2.py", line 464, in <module>
run_inference_ss_vae(args)
File "ss_vae_M2.py", line 371, in run_inference_ss_vae
run_inference_for_epoch(data_loaders, losses, periodic_interval_batches)
File "ss_vae_M2.py", line 268, in run_inference_for_epoch
n... | NotImplementedError |
def torch_multinomial(input, num_samples, replacement=False):
"""
Like `torch.multinomial()` but works with cuda tensors.
Does not support keyword argument `out`.
"""
if input.is_cuda:
return torch.multinomial(input.cpu(), num_samples, replacement).cuda(input.get_device())
else:
... | def torch_multinomial(input, num_samples, replacement=False):
"""
Like `torch.multinomial()` but works with cuda tensors.
Does not support keyword argument `out`.
"""
if input.is_cuda:
return torch_multinomial(input.cpu(), num_samples, replacement).cuda()
else:
return torch.multi... | [{'piece_type': 'error message', 'piece_content': '---------------------------------------------------------------------------\\nRuntimeError Traceback (most recent call last)\\n<ipython-input-31-93fd337a0d5c> in <module>()\\n----> 1 train()\\n\\n<ipython-input-30-98110a9a9720> in train()\\... | ---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-31-93fd337a0d5c> in <module>()
----> 1 train()
<ipython-input-30-98110a9a9720> in train()
33
34 # Train and score
---> 35 train_... | RuntimeError |
def iter_discrete_traces(graph_type, fn, *args, **kwargs):
"""
Iterate over all discrete choices of a stochastic function.
When sampling continuous random variables, this behaves like `fn`.
When sampling discrete random variables, this iterates over all choices.
This yields `(scale, trace)` pairs,... | def iter_discrete_traces(graph_type, fn, *args, **kwargs):
"""
Iterate over all discrete choices of a stochastic function.
When sampling continuous random variables, this behaves like `fn`.
When sampling discrete random variables, this iterates over all choices.
This yields `(scale, trace)` pairs,... | [{'piece_type': 'error message', 'piece_content': '---------------------------------------------------------------------------\\nRuntimeError Traceback (most recent call last)\\n<ipython-input-31-93fd337a0d5c> in <module>()\\n----> 1 train()\\n\\n<ipython-input-30-98110a9a9720> in train()\\... | ---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-31-93fd337a0d5c> in <module>()
----> 1 train()
<ipython-input-30-98110a9a9720> in train()
33
34 # Train and score
---> 35 train_... | RuntimeError |
def loss(self, model, guide, *args, **kwargs):
"""
:returns: returns an estimate of the ELBO
:rtype: float
Evaluates the ELBO with an estimator that uses num_particles many samples/particles.
"""
elbo = 0.0
for weight, model_trace, guide_trace, log_r in self.... | def loss(self, model, guide, *args, **kwargs):
"""
:returns: returns an estimate of the ELBO
:rtype: float
Evaluates the ELBO with an estimator that uses num_particles many samples/particles.
"""
elbo = 0.0
for weight, model_trace, guide_trace, log_r in self.... | [{'piece_type': 'error message', 'piece_content': '---------------------------------------------------------------------------\\nRuntimeError Traceback (most recent call last)\\n<ipython-input-31-93fd337a0d5c> in <module>()\\n----> 1 train()\\n\\n<ipython-input-30-98110a9a9720> in train()\\... | ---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-31-93fd337a0d5c> in <module>()
----> 1 train()
<ipython-input-30-98110a9a9720> in train()
33
34 # Train and score
---> 35 train_... | RuntimeError |
def loss_and_grads(self, model, guide, *args, **kwargs):
"""
:returns: returns an estimate of the ELBO
:rtype: float
Computes the ELBO as well as the surrogate ELBO that is used to form the gradient estimator.
Performs backward on the latter. Num_particle many samples are us... | def loss_and_grads(self, model, guide, *args, **kwargs):
"""
:returns: returns an estimate of the ELBO
:rtype: float
Computes the ELBO as well as the surrogate ELBO that is used to form the gradient estimator.
Performs backward on the latter. Num_particle many samples are us... | [{'piece_type': 'error message', 'piece_content': '---------------------------------------------------------------------------\\nRuntimeError Traceback (most recent call last)\\n<ipython-input-31-93fd337a0d5c> in <module>()\\n----> 1 train()\\n\\n<ipython-input-30-98110a9a9720> in train()\\... | ---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-31-93fd337a0d5c> in <module>()
----> 1 train()
<ipython-input-30-98110a9a9720> in train()
33
34 # Train and score
---> 35 train_... | RuntimeError |
def resolve_is_lower_case(tokenizer):
if isinstance(tokenizer, transformers.BertTokenizer):
return tokenizer.basic_tokenizer.do_lower_case
if isinstance(tokenizer, transformers.AlbertTokenizer):
return tokenizer.do_lower_case
else:
return False | def resolve_is_lower_case(tokenizer):
if isinstance(tokenizer, (transformers.BertTokenizer, transformers.AlbertTokenizer)):
return tokenizer.basic_tokenizer.do_lower_case
else:
return False | [{'piece_type': 'other', 'piece_content': 'MODEL_NAME=albert-xxlarge-v2\\nTASK_NAME=qamr\\npython ${JIANT_PATH}/proj/main/tokenize_and_cache.py \\\\\\n--task_config_path ${DATA_DIR}/configs/${TASK_NAME}_config.json \\\\\\n--model_type ${MODEL_NAME} \\\\\\n--model_tokenizer_path ${MODELS_DIR}/${MODEL_NAME}/tokenizer \\\... | Traceback (most recent call last):
File "/scratch/pmh330/nyu-mll-jiant/jiant/jiant/proj/main/tokenize_and_cache.py", line 214, in <module>
main(args=RunConfiguration.run_cli_json_prepend())
File "/scratch/pmh330/nyu-mll-jiant/jiant/jiant/proj/main/tokenize_and_cache.py", line 168, in main
args=args,
File "/scratch/pmh3... | ValueError |
def tokenize(self, tokenizer):
passage = (
self.passage.lower()
if model_resolution.resolve_is_lower_case(tokenizer=tokenizer)
else self.passage
)
passage_tokens = tokenizer.tokenize(passage)
token_aligner = TokenAligner(source=passage, target=pass... | def tokenize(self, tokenizer):
passage = (
self.passage.lower() if resolve_is_lower_case(tokenizer=tokenizer) else self.passage
)
passage_tokens = tokenizer.tokenize(passage)
token_aligner = TokenAligner(source=passage, target=passage_tokens)
answer_token_span = t... | [{'piece_type': 'other', 'piece_content': 'MODEL_NAME=albert-xxlarge-v2\\nTASK_NAME=qamr\\npython ${JIANT_PATH}/proj/main/tokenize_and_cache.py \\\\\\n--task_config_path ${DATA_DIR}/configs/${TASK_NAME}_config.json \\\\\\n--model_type ${MODEL_NAME} \\\\\\n--model_tokenizer_path ${MODELS_DIR}/${MODEL_NAME}/tokenizer \\\... | Traceback (most recent call last):
File "/scratch/pmh330/nyu-mll-jiant/jiant/jiant/proj/main/tokenize_and_cache.py", line 214, in <module>
main(args=RunConfiguration.run_cli_json_prepend())
File "/scratch/pmh330/nyu-mll-jiant/jiant/jiant/proj/main/tokenize_and_cache.py", line 168, in main
args=args,
File "/scratch/pmh3... | ValueError |
def get_task_specific_params(args, task_name):
""" Search args for parameters specific to task.
Args:
args: main-program args, a config.Params object
task_name: (string)
Returns:
AllenNLP Params object of task-specific params.
"""
def _get_task_attr(attr_name, default=None):... | def get_task_specific_params(args, task_name):
""" Search args for parameters specific to task.
Args:
args: main-program args, a config.Params object
task_name: (string)
Returns:
AllenNLP Params object of task-specific params.
"""
def _get_task_attr(attr_name, default=None):... | [{'piece_type': 'other', 'piece_content': 'rm -r $JIANT_PROJECT_PREFIX/jiant-demo; python main.py --config config/demo.conf --overrides "target_tasks = winograd-coreference"'}, {'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "main.py", line 566, in <module>\\nmain(sys.argv[1... | Traceback (most recent call last):
File "main.py", line 566, in <module>
main(sys.argv[1:])
File "main.py", line 534, in main
phase="target_train",
File "/Users/srbowman/jiant/src/trainer.py", line 594, in train
output_dict = self._forward(batch, task=task)
File "/Users/srbowman/jiant/src/trainer.py", line 1035, in _fo... | ValueError |
def update_metrics(self, logits, labels, tagmask=None):
logits, labels = logits.detach(), labels.detach()
def make_one_hot(batch, depth=2):
"""
Creates a one-hot embedding of dimension 2.
Parameters:
batch: list of size batch_size of class predictions... | def update_metrics(self, logits, labels, tagmask=None):
logits, labels = logits.detach(), labels.detach()
def make_one_hot(batch, depth=2):
"""
Creates a one-hot embedding of dimension 2.
Parameters:
batch: list of size batch_size of class predictions... | [{'piece_type': 'other', 'piece_content': 'rm -r $JIANT_PROJECT_PREFIX/jiant-demo; python main.py --config config/demo.conf --overrides "target_tasks = winograd-coreference"'}, {'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "main.py", line 566, in <module>\\nmain(sys.argv[1... | Traceback (most recent call last):
File "main.py", line 566, in <module>
main(sys.argv[1:])
File "main.py", line 534, in main
phase="target_train",
File "/Users/srbowman/jiant/src/trainer.py", line 594, in train
output_dict = self._forward(batch, task=task)
File "/Users/srbowman/jiant/src/trainer.py", line 1035, in _fo... | ValueError |
def make_one_hot(batch, depth=2):
"""
Creates a one-hot embedding of dimension 2.
Parameters:
batch: list of size batch_size of class predictions
Returns:
one hot encoding of size [batch_size, 2]
"""
ones = torch.spa... | def make_one_hot(batch, depth=2):
"""
Creates a one-hot embedding of dimension 2.
Parameters:
batch: list of size batch_size of class predictions
Returns:
one hot encoding of size [batch_size, 2]
"""
ones = torch.spa... | [{'piece_type': 'other', 'piece_content': 'rm -r $JIANT_PROJECT_PREFIX/jiant-demo; python main.py --config config/demo.conf --overrides "target_tasks = winograd-coreference"'}, {'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "main.py", line 566, in <module>\\nmain(sys.argv[1... | Traceback (most recent call last):
File "main.py", line 566, in <module>
main(sys.argv[1:])
File "main.py", line 534, in main
phase="target_train",
File "/Users/srbowman/jiant/src/trainer.py", line 594, in train
output_dict = self._forward(batch, task=task)
File "/Users/srbowman/jiant/src/trainer.py", line 1035, in _fo... | ValueError |
def parse(self, file):
data = []
file = EncodedIO(file)
file = io.TextIOWrapper(file, encoding=file.encoding)
# Add check exception
field_parsers = {
"ne": lambda line, i: conllu.parser.parse_nullable_value(line[i]),
}
gen_parser = conllu.parse_... | def parse(self, file):
data = []
file = io.TextIOWrapper(file, encoding='utf-8')
# Add check exception
field_parsers = {
"ne": lambda line, i: conllu.parser.parse_nullable_value(line[i]),
}
gen_parser = conllu.parse_incr(
file,
f... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/app/server/views.py", line 121, in post\\ndocuments = self.csv_to_documents(project, file)\\nFile "/app/server/views.py", line 77, in csv_to_documents\\nmaybe_header = next(reader)\\nFile "/virtualenvs/doccano-HEgudFLz/bin/..... | Traceback (most recent call last):
File "/app/server/views.py", line 121, in post
documents = self.csv_to_documents(project, file)
File "/app/server/views.py", line 77, in csv_to_documents
maybe_header = next(reader)
File "/virtualenvs/doccano-HEgudFLz/bin/../lib/python3.6/codecs.py", line 321, in decode
(result, consu... | UnicodeDecodeError |
def parse(self, file):
file = EncodedIO(file)
file = io.TextIOWrapper(file, encoding=file.encoding)
while True:
batch = list(itertools.islice(file, settings.IMPORT_BATCH_SIZE))
if not batch:
break
yield [{'text': line.strip()} for line in b... | def parse(self, file):
file = io.TextIOWrapper(file, encoding='utf-8')
while True:
batch = list(itertools.islice(file, settings.IMPORT_BATCH_SIZE))
if not batch:
break
yield [{'text': line.strip()} for line in batch] | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/app/server/views.py", line 121, in post\\ndocuments = self.csv_to_documents(project, file)\\nFile "/app/server/views.py", line 77, in csv_to_documents\\nmaybe_header = next(reader)\\nFile "/virtualenvs/doccano-HEgudFLz/bin/..... | Traceback (most recent call last):
File "/app/server/views.py", line 121, in post
documents = self.csv_to_documents(project, file)
File "/app/server/views.py", line 77, in csv_to_documents
maybe_header = next(reader)
File "/virtualenvs/doccano-HEgudFLz/bin/../lib/python3.6/codecs.py", line 321, in decode
(result, consu... | UnicodeDecodeError |
def parse(self, file):
file = EncodedIO(file)
file = io.TextIOWrapper(file, encoding=file.encoding)
reader = csv.reader(file)
yield from ExcelParser.parse_excel_csv_reader(reader) | def parse(self, file):
file = io.TextIOWrapper(file, encoding='utf-8')
reader = csv.reader(file)
yield from ExcelParser.parse_excel_csv_reader(reader) | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/app/server/views.py", line 121, in post\\ndocuments = self.csv_to_documents(project, file)\\nFile "/app/server/views.py", line 77, in csv_to_documents\\nmaybe_header = next(reader)\\nFile "/virtualenvs/doccano-HEgudFLz/bin/..... | Traceback (most recent call last):
File "/app/server/views.py", line 121, in post
documents = self.csv_to_documents(project, file)
File "/app/server/views.py", line 77, in csv_to_documents
maybe_header = next(reader)
File "/virtualenvs/doccano-HEgudFLz/bin/../lib/python3.6/codecs.py", line 321, in decode
(result, consu... | UnicodeDecodeError |
def parse(self, file):
file = EncodedIO(file)
file = io.TextIOWrapper(file, encoding=file.encoding)
data = []
for i, line in enumerate(file, start=1):
if len(data) >= settings.IMPORT_BATCH_SIZE:
yield data
data = []
try:
... | def parse(self, file):
file = io.TextIOWrapper(file, encoding='utf-8')
data = []
for i, line in enumerate(file, start=1):
if len(data) >= settings.IMPORT_BATCH_SIZE:
yield data
data = []
try:
j = json.loads(line)
... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "/app/server/views.py", line 121, in post\\ndocuments = self.csv_to_documents(project, file)\\nFile "/app/server/views.py", line 77, in csv_to_documents\\nmaybe_header = next(reader)\\nFile "/virtualenvs/doccano-HEgudFLz/bin/..... | Traceback (most recent call last):
File "/app/server/views.py", line 121, in post
documents = self.csv_to_documents(project, file)
File "/app/server/views.py", line 77, in csv_to_documents
maybe_header = next(reader)
File "/virtualenvs/doccano-HEgudFLz/bin/../lib/python3.6/codecs.py", line 321, in decode
(result, consu... | UnicodeDecodeError |
def label_per_data(self, project):
annotation_class = project.get_annotation_class()
return annotation_class.objects.get_label_per_data(project=project) | def label_per_data(self, project):
label_count = Counter()
user_count = Counter()
annotation_class = project.get_annotation_class()
docs = project.documents.all()
annotations = annotation_class.objects.filter(document_id__in=docs.all())
for d in annotations.values('la... | [{'piece_type': 'error message', 'piece_content': 'Internal Server Error: /v1/projects/4/statistics\\nTraceback (most recent call last):\\nFile "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner\\nresponse = get_response(request)\\nFile "/usr/local/lib/python3.6/site-packages/... | Internal Server Error: /v1/projects/4/statistics
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
r... | django.core.exceptions.FieldError |
def get(cls, language):
try:
if PYCOUNTRY:
lang = (languages.get(alpha_2=language)
or languages.get(alpha_3=language)
or languages.get(bibliographic=language)
or languages.get(name=language))
... | def get(cls, language):
try:
if PYCOUNTRY:
# lookup workaround for alpha_2 language codes
lang = languages.get(alpha_2=language) if re.match(r"^[a-z]{2}$", language) else languages.lookup(language)
return Language(lang.alpha_2, lang.alpha_3, lang.n... | [{'piece_type': 'error message', 'piece_content': '$ streamlink --loglevel debug https://www.raiplay.it/dirette/rai1\\n[cli][debug] OS: Linux-5.4.80-gentoo-r1-2-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-glibc2.2.5\\n[cli][debug] Python: 3.8.7\\n[cli][debug] Streamlink: 2.0.0+25.g7a74e18\\n[cli]... | $ streamlink --loglevel debug https://www.raiplay.it/dirette/rai1
[cli][debug] OS: Linux-5.4.80-gentoo-r1-2-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-glibc2.2.5
[cli][debug] Python: 3.8.7
[cli][debug] Streamlink: 2.0.0+25.g7a74e18
[cli][debug] Requests(2.25.1), Socks(1.7.1), Websocket(0.57.0)
[... | AttributeError |
def close(self):
if self.closed:
return
log.debug("Closing ffmpeg thread")
if self.process:
# kill ffmpeg
self.process.kill()
self.process.stdout.close()
# close the streams
for stream in self.streams:
... | def close(self):
log.debug("Closing ffmpeg thread")
if self.process:
# kill ffmpeg
self.process.kill()
self.process.stdout.close()
# close the streams
for stream in self.streams:
if hasattr(stream, "close"):
... | [{'piece_type': 'other', 'piece_content': '$ streamlink "https://www.youtube.com/watch?v=VaU6GR8OHNU" -l trace\\n[16:50:38,702][cli][debug] OS: Linux-5.8.0-29-generic-x86_64-with-glibc2.32\\n[16:50:38,702][cli][debug] Python: 3.8.6\\n[16:50:38,702][cli][debug] Streamlink: 1.7.0+20.g9ac40cb\\n[16:50:38,702][... | $ streamlink "https://www.youtube.com/watch?v=VaU6GR8OHNU" -l trace
[16:51:11.763092][cli][debug] OS: Linux-5.8.0-29-generic-x86_64-with-glibc2.32
[16:51:11.763170][cli][debug] Python: 3.8.6
[16:51:11.763193][cli][debug] Streamlink: 1.7.0+21.g70dc809
[16:51:11.763212][cli][debug] Requests(2.25.0), Socks(1.7... | ImportError |
def authenticate(self):
try:
data = self._api_call("authenticate", {"auth": self.auth}, schema=_login_schema)
except CrunchyrollAPIError:
self.auth = None
self.cache.set("auth", None, expires_at=0)
log.warning("Saved credentials have expired")
... | def authenticate(self):
data = self._api_call("authenticate", {"auth": self.auth}, schema=_login_schema)
self.auth = data["auth"]
self.cache.set("auth", data["auth"], expires_at=data["expires"])
return data | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "runpy.py", line 193, in _run_module_as_main\\nFile "runpy.py", line 85, in _run_code\\nFile "C:\\\\Users\\\\kg\\\\AppData\\\\Local\\\\Streamlink\\\\bin\\\\streamlink.exe\\\\__main__.py", line 18, in <module>\\nFile "C:\\\\User... | Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\bin\\streamlink.exe\\__main__.py", line 18, in <module>
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\pkgs\\streamlink_cli\\main.py", line 1024,... | streamlink.plugin.crunchyroll.CrunchyrollAPIError |
def _get_streams(self):
api = self._create_api()
match = _url_re.match(self.url)
media_id = int(match.group("media_id"))
try:
# the media.stream_data field is required, no stream data is returned otherwise
info = api.get_info(media_id, fields=["media.stream_d... | def _get_streams(self):
api = self._create_api()
match = _url_re.match(self.url)
media_id = int(match.group("media_id"))
try:
# the media.stream_data field is required, no stream data is returned otherwise
info = api.get_info(media_id, fields=["media.stream_d... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "runpy.py", line 193, in _run_module_as_main\\nFile "runpy.py", line 85, in _run_code\\nFile "C:\\\\Users\\\\kg\\\\AppData\\\\Local\\\\Streamlink\\\\bin\\\\streamlink.exe\\\\__main__.py", line 18, in <module>\\nFile "C:\\\\User... | Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\bin\\streamlink.exe\\__main__.py", line 18, in <module>
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\pkgs\\streamlink_cli\\main.py", line 1024,... | streamlink.plugin.crunchyroll.CrunchyrollAPIError |
def _create_api(self):
"""Creates a new CrunchyrollAPI object, initiates it's session and
tries to authenticate it either by using saved credentials or the
user's username and password.
"""
if self.options.get("purge_credentials"):
self.cache.set("session_id", Non... | def _create_api(self):
"""Creates a new CrunchyrollAPI object, initiates it's session and
tries to authenticate it either by using saved credentials or the
user's username and password.
"""
if self.options.get("purge_credentials"):
self.cache.set("session_id", Non... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "runpy.py", line 193, in _run_module_as_main\\nFile "runpy.py", line 85, in _run_code\\nFile "C:\\\\Users\\\\kg\\\\AppData\\\\Local\\\\Streamlink\\\\bin\\\\streamlink.exe\\\\__main__.py", line 18, in <module>\\nFile "C:\\\\User... | Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\bin\\streamlink.exe\\__main__.py", line 18, in <module>
File "C:\\Users\\kg\\AppData\\Local\\Streamlink\\pkgs\\streamlink_cli\\main.py", line 1024,... | streamlink.plugin.crunchyroll.CrunchyrollAPIError |
def create_title(plugin=None):
if args.title and plugin:
title = LazyFormatter.format(
maybe_decode(args.title, get_filesystem_encoding()),
title=lambda: plugin.get_title() or DEFAULT_STREAM_METADATA["title"],
author=lambda: plugin.get_author() or DEFAULT_STREAM_METADATA[... | def create_title(plugin=None):
if args.title and plugin:
title = LazyFormatter.format(
maybe_encode(args.title),
title=lambda: plugin.get_title() or DEFAULT_STREAM_METADATA["title"],
author=lambda: plugin.get_author() or DEFAULT_STREAM_METADATA["author"],
cate... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def _create_arguments(self):
if self.namedpipe:
filename = self.namedpipe.path
elif self.filename:
filename = self.filename
elif self.http:
filename = self.http.url
else:
filename = "-"
extra_args = []
if self.title is ... | def _create_arguments(self):
if self.namedpipe:
filename = self.namedpipe.path
elif self.filename:
filename = self.filename
elif self.http:
filename = self.http.url
else:
filename = "-"
extra_args = []
if self.title is ... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def _open_call(self):
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
log.debug(u"Calling: {0}".format(fargs))
subprocess.call(maybe_encode(args, get_filesystem_encoding()),
... | def _open_call(self):
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
log.debug(u"Calling: {0}".format(maybe_decode(fargs)))
subprocess.call(args,
stdout=self.stdout,
... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def _open_subprocess(self):
# Force bufsize=0 on all Python versions to avoid writing the
# unflushed buffer when closing a broken input pipe
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
... | def _open_subprocess(self):
# Force bufsize=0 on all Python versions to avoid writing the
# unflushed buffer when closing a broken input pipe
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def maybe_encode(text, encoding="utf8"):
if is_py2:
if isinstance(text, unicode):
return text.encode(encoding)
else:
return text
else:
return text | def maybe_encode(text, encoding="utf8"):
if is_py2:
return text.encode(encoding)
else:
return text | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def _open_call(self):
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
log.debug(u"Calling: {0}".format(maybe_decode(fargs)))
subprocess.call(args,
stdout=self.stdout,
... | def _open_call(self):
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
log.debug(u"Calling: {0}".format(fargs))
subprocess.call(args,
stdout=self.stdout,
... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def _open_subprocess(self):
# Force bufsize=0 on all Python versions to avoid writing the
# unflushed buffer when closing a broken input pipe
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
... | def _open_subprocess(self):
# Force bufsize=0 on all Python versions to avoid writing the
# unflushed buffer when closing a broken input pipe
args = self._create_arguments()
if is_win32:
fargs = args
else:
fargs = subprocess.list2cmdline(args)
... | [{'piece_type': 'error message', 'piece_content': 'OS: macOS 10.14.2\\nPython: 2.7.14\\nStreamlink: 1.1.1\\nRequests(2.21.0), Socks(1.6.7), Websocket(0.47.0)\\nFound matching plugin twitch for URL twitch.tv/quickybaby\\nPlugin specific arguments:\\n--twitch-oauth-token=******** (oauth_token)\\n--twitch-disable-hosting=... | OS: macOS 10.14.2
Python: 2.7.14
Streamlink: 1.1.1
Requests(2.21.0), Socks(1.6.7), Websocket(0.47.0)
Found matching plugin twitch for URL twitch.tv/quickybaby
Plugin specific arguments:
--twitch-oauth-token=******** (oauth_token)
--twitch-disable-hosting=True (disable_hosting)
--twitch-disable-ads=True (disable_ads)
Ge... | UnicodeDecodeError |
def fetch(self, segment, retries=None):
if self.closed or not retries:
return
try:
request_args = copy.deepcopy(self.reader.stream.args)
headers = request_args.pop("headers", {})
now = datetime.datetime.now(tz=utc)
if segment.available_at ... | def fetch(self, segment, retries=None):
if self.closed or not retries:
return
try:
headers = {}
now = datetime.datetime.now(tz=utc)
if segment.available_at > now:
time_to_wait = (segment.available_at - now).total_seconds()
... | [{'piece_type': 'error message', 'piece_content': '$ streamlink https://www.tf1.fr/lci/direct 576p_dash\\n[cli][debug] OS: Linux\\n[cli][debug] Python: 3.6.7\\n[cli][debug] Streamlink: 1.0.0+3.g4100688.dirty\\n[cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.54.0)\\n[cli][info] Found matching plugin... | $ streamlink https://www.tf1.fr/lci/direct 576p_dash
[cli][debug] OS: Linux
[cli][debug] Python: 3.6.7
[cli][debug] Streamlink: 1.0.0+3.g4100688.dirty
[cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.54.0)
[cli][info] Found matching plugin tf1 for URL https://www.tf1.fr/lci/direct
[plugin.tf1][debug... | requests.exceptions.HTTPError |
def reload(self):
if self.closed:
return
self.reader.buffer.wait_free()
log.debug("Reloading manifest ({0}:{1})".format(self.reader.representation_id, self.reader.mime_type))
res = self.session.http.get(self.mpd.url, exception=StreamError, **self.stream.args)
ne... | def reload(self):
if self.closed:
return
self.reader.buffer.wait_free()
log.debug("Reloading manifest ({0}:{1})".format(self.reader.representation_id, self.reader.mime_type))
res = self.session.http.get(self.mpd.url, exception=StreamError)
new_mpd = MPD(self.ses... | [{'piece_type': 'error message', 'piece_content': '$ streamlink https://www.tf1.fr/lci/direct 576p_dash\\n[cli][debug] OS: Linux\\n[cli][debug] Python: 3.6.7\\n[cli][debug] Streamlink: 1.0.0+3.g4100688.dirty\\n[cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.54.0)\\n[cli][info] Found matching plugin... | $ streamlink https://www.tf1.fr/lci/direct 576p_dash
[cli][debug] OS: Linux
[cli][debug] Python: 3.6.7
[cli][debug] Streamlink: 1.0.0+3.g4100688.dirty
[cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.54.0)
[cli][info] Found matching plugin tf1 for URL https://www.tf1.fr/lci/direct
[plugin.tf1][debug... | requests.exceptions.HTTPError |
def _get_streams(self):
match = _url_re.match(self.url)
if not match:
return
channel, media_id = match.group("channel", "media_id")
self.logger.debug("Matched URL: channel={0}, media_id={1}".format(channel, media_id))
if not media_id:
res = http.get(L... | def _get_streams(self):
match = _url_re.match(self.url)
if not match:
return
channel, media_id = match.group("channel", "media_id")
self.logger.debug("Matched URL: channel={0}, media_id={1}".format(channel, media_id))
if not media_id:
res = http.get(L... | [{'piece_type': 'error message', 'piece_content': 'streamlink smashcast.tv/greatvaluesmash best\\n[cli][info] Found matching plugin hitbox for URL smashcast.tv/greatvaluesmash\\nTraceback (most recent call last):\\nFile "C:\\\\Program Files (x86)\\\\Streamlink\\\\bin\\\\streamlink-script.py", line 15, in\\n<module>\\nm... | streamlink smashcast.tv/greatvaluesmash best
[cli][info] Found matching plugin hitbox for URL smashcast.tv/greatvaluesmash
Traceback (most recent call last):
File "C:\\Program Files (x86)\\Streamlink\\bin\\streamlink-script.py", line 15, in
<module>
main()
File "C:\\Program Files (x86)\\Streamlink\\pkgs\\streamlink_cli... | KeyError |
def close(self, client_only=False):
if self.conn:
self.conn.close()
if not client_only:
try:
self.socket.shutdown(2)
except (OSError, socket.error):
pass
self.socket.close() | def close(self, client_only=False):
if self.conn:
self.conn.close()
if not client_only:
try:
self.socket.shutdown(2)
except OSError:
pass
self.socket.close() | [{'piece_type': 'error message', 'piece_content': '[cli][info] Closing currently open stream...\\nTraceback (most recent call last):\\nFile "/usr/local/bin/streamlink", line 11, in <module>\\nload_entry_point(\\'streamlink==0.6.0\\', \\'console_scripts\\', \\'streamlink\\')()\\nFile "/usr/local/lib/python2.7/site-packa... | [cli][info] Closing currently open stream...
Traceback (most recent call last):
File "/usr/local/bin/streamlink", line 11, in <module>
load_entry_point('streamlink==0.6.0', 'console_scripts', 'streamlink')()
File "/usr/local/lib/python2.7/site-packages/streamlink_cli/main.py", line 1027, in main
handle_url()
File "/usr... | socket.error |
def close(self, client_only=False):
if self.conn:
self.conn.close()
if not client_only:
try:
self.socket.shutdown(2)
except OSError:
pass
self.socket.close() | def close(self, client_only=False):
if self.conn:
self.conn.close()
if not client_only:
self.socket.shutdown(2)
self.socket.close() | [{'piece_type': 'error message', 'piece_content': '[cli][info] Player closed\\n[cli][info] Stream ended\\n[cli][info] Closing currently open stream...\\nTraceback (most recent call last):\\nFile "d:\\\\Program Files (x86)\\\\Streamlink\\\\bin\\\\streamlink-script.py", line 12, in\\n<module>\\nmain()\\nFile "d:\\\\Progr... | [cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...
Traceback (most recent call last):
File "d:\\Program Files (x86)\\Streamlink\\bin\\streamlink-script.py", line 12, in
<module>
main()
File "d:\\Program Files (x86)\\Streamlink\\pkgs\\streamlink_cli\\main.py", line 952
, in m... | OSError |
def write(self, sequence, res, chunk_size=8192, retries=None):
retries = retries or self.retries
if retries == 0:
self.logger.error("Failed to open segment {0}", sequence.num)
return
try:
if sequence.segment.key and sequence.segment.key.method != "NONE":
... | def write(self, sequence, res, chunk_size=8192):
if sequence.segment.key and sequence.segment.key.method != "NONE":
try:
decryptor = self.create_decryptor(sequence.segment.key,
sequence.num)
except StreamError as err:
... | [{'piece_type': 'error message', 'piece_content': 'Exception in thread Thread-1:\\nTraceback (most recent call last):\\nFile "/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 232, in _error_catcher\\nyield\\nFile "/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/respon... | Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 232, in _error_catcher
yield
File "/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py", line 314, in read
data = self._fp.read(amt)
File "/... | requests.packages.urllib3.exceptions.ReadTimeoutError |
def write(self, vals):
res = super(OpStudent, self).write(vals)
if vals.get('parent_ids', False):
user_ids = []
if self.parent_ids:
for parent in self.parent_ids:
if parent.user_id:
user_ids = [x.user_id.id for x in ... | def write(self, vals):
res = super(OpStudent, self).write(vals)
if vals.get('parent_ids', False):
user_ids = []
if self.parent_ids:
for parent in self.parent_ids:
if parent.user_id:
user_ids = [x.user_id.id for x in ... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\n\\nFile "/media/linux_data/progetti/odoo/odoo12-dev/OCB/odoo/models.py", line 4718, in ensure_one\\n\\n_id, = self._ids\\n\\nValueError: not enough values to unpack (expected 1, got 0)\\n\\n\\n\\nDuring handling of the above excepti... | Traceback (most recent call last):
File "/media/linux_data/progetti/odoo/odoo12-dev/OCB/odoo/models.py", line 4718, in ensure_one
_id, = self._ids
ValueError: not enough values to unpack (expected 1, got 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
... | ValueError |
def parse_exif_values(self, _path_file):
# Disable exifread log
logging.getLogger('exifread').setLevel(logging.CRITICAL)
with open(_path_file, 'rb') as f:
tags = exifread.process_file(f, details=False)
try:
if 'Image Make' in tags:
... | def parse_exif_values(self, _path_file):
# Disable exifread log
logging.getLogger('exifread').setLevel(logging.CRITICAL)
with open(_path_file, 'rb') as f:
tags = exifread.process_file(f, details=False)
try:
if 'Image Make' in tags:
... | [{'piece_type': 'error message', 'piece_content': '[INFO] Loading 4 images\\nTraceback (most recent call last):\\nFile "/code/opendm/photo.py", line 225, in parse_exif_values\\n], float)\\nFile "/code/opendm/photo.py", line 256, in set_attr_from_xmp_tag\\nsetattr(self, attr, cast(v))\\nValueError: could not convert ... | [INFO] Loading 4 images
Traceback (most recent call last):
File "/code/opendm/photo.py", line 225, in parse_exif_values
], float)
File "/code/opendm/photo.py", line 256, in set_attr_from_xmp_tag
setattr(self, attr, cast(v))
ValueError: could not convert string to float: '610/1000'
During handling of the above excep... | ValueError |
def set_attr_from_xmp_tag(self, attr, xmp_tags, tags, cast=None):
v = self.get_xmp_tag(xmp_tags, tags)
if v is not None:
if cast is None:
setattr(self, attr, v)
else:
# Handle fractions
if (cast == float or cast == int) and "/" ... | def set_attr_from_xmp_tag(self, attr, xmp_tags, tags, cast=None):
v = self.get_xmp_tag(xmp_tags, tags)
if v is not None:
if cast is None:
setattr(self, attr, v)
else:
setattr(self, attr, cast(v)) | [{'piece_type': 'error message', 'piece_content': '[INFO] Loading 4 images\\nTraceback (most recent call last):\\nFile "/code/opendm/photo.py", line 225, in parse_exif_values\\n], float)\\nFile "/code/opendm/photo.py", line 256, in set_attr_from_xmp_tag\\nsetattr(self, attr, cast(v))\\nValueError: could not convert ... | [INFO] Loading 4 images
Traceback (most recent call last):
File "/code/opendm/photo.py", line 225, in parse_exif_values
], float)
File "/code/opendm/photo.py", line 256, in set_attr_from_xmp_tag
setattr(self, attr, cast(v))
ValueError: could not convert string to float: '610/1000'
During handling of the above excep... | ValueError |
def process(self, args, outputs):
tree = outputs['tree']
reconstruction = outputs['reconstruction']
photos = reconstruction.photos
if not photos:
log.ODM_ERROR('Not enough photos in photos array to start OpenSfM')
exit(1)
octx = OSFMContext(tree.open... | def process(self, args, outputs):
tree = outputs['tree']
reconstruction = outputs['reconstruction']
photos = reconstruction.photos
if not photos:
log.ODM_ERROR('Not enough photos in photos array to start OpenSfM')
exit(1)
octx = OSFMContext(tree.open... | [{'piece_type': 'error message', 'piece_content': '[INFO] Finished dataset stage\\n[INFO] Running split stage\\n[INFO] Normal dataset, will process all at once.\\n[INFO] Finished split stage\\n[INFO] Running merge stage\\n[INFO] Normal dataset, nothing to merge.\\n[INFO] Finished merge stage\\n[INF... | [INFO] Finished dataset stage
[INFO] Running split stage
[INFO] Normal dataset, will process all at once.
[INFO] Finished split stage
[INFO] Running merge stage
[INFO] Normal dataset, nothing to merge.
[INFO] Finished merge stage
[INFO] Running opensfm stage
[WARNING] /datasets/project/submodels... | OSError |
def build_block_parser(md, **kwargs):
""" Build the default block parser used by Markdown. """
parser = BlockParser(md)
parser.blockprocessors.register(EmptyBlockProcessor(parser), 'empty', 100)
parser.blockprocessors.register(ListIndentProcessor(parser), 'indent', 90)
parser.blockprocessors.registe... | def build_block_parser(md, **kwargs):
""" Build the default block parser used by Markdown. """
parser = BlockParser(md)
parser.blockprocessors.register(EmptyBlockProcessor(parser), 'empty', 100)
parser.blockprocessors.register(ListIndentProcessor(parser), 'indent', 90)
parser.blockprocessors.registe... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def extendMarkdown(self, md):
""" Insert AbbrPreprocessor before ReferencePreprocessor. """
md.parser.blockprocessors.register(AbbrPreprocessor(md.parser), 'abbr', 16) | def extendMarkdown(self, md):
""" Insert AbbrPreprocessor before ReferencePreprocessor. """
md.preprocessors.register(AbbrPreprocessor(md), 'abbr', 12) | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, parent, blocks):
'''
Find and remove all Abbreviation references from the text.
Each reference is set as a new AbbrPattern in the markdown instance.
'''
block = blocks.pop(0)
m = self.RE.search(block)
if m:
abbr = m.group('abbr').str... | def run(self, lines):
'''
Find and remove all Abbreviation references from the text.
Each reference is set as a new AbbrPattern in the markdown instance.
'''
new_text = []
for line in lines:
m = ABBR_REF_RE.match(line)
if m:
ab... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def extendMarkdown(self, md):
""" Add pieces to Markdown. """
md.registerExtension(self)
self.parser = md.parser
self.md = md
# Insert a blockprocessor before ReferencePreprocessor
md.parser.blockprocessors.register(FootnoteBlockProcessor(self), 'footnote', 17)
... | def extendMarkdown(self, md):
""" Add pieces to Markdown. """
md.registerExtension(self)
self.parser = md.parser
self.md = md
# Insert a preprocessor before ReferencePreprocessor
md.preprocessors.register(FootnotePreprocessor(self), 'footnote', 15)
# Insert a... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def detectTabbed(self, blocks):
""" Find indented text and remove indent before further proccesing.
Returns: a list of blocks with indentation removed.
"""
fn_blocks = []
while blocks:
if blocks[0].startswith(' '*4):
block = blocks.pop(0)
... | def detectTabbed(self, lines):
""" Find indented text and remove indent before further proccesing.
Keyword arguments:
* lines: an array of strings
Returns: a list of post processed items and the index of last line.
"""
items = []
blank_line = False # have... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def detab(self, block):
""" Remove one level of indent from a block.
Preserve lazily indented blocks by only removing indent from indented lines.
"""
lines = block.split('\\n')
for i, line in enumerate(lines):
if line.startswith(' '*4):
lines[i] =... | def detab(line):
match = TABBED_RE.match(line)
if match:
return match.group(4) | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, parent, blocks):
m = util.HTML_PLACEHOLDER_RE.match(blocks[0])
if m:
index = int(m.group(1))
element = self.parser.md.htmlStash.rawHtmlBlocks[index]
if isinstance(element, etree.Element):
# We have a matched element. Process it.
... | def run(self, parent, blocks, tail=None, nest=False):
self._tag_data = self.parser.md.htmlStash.tag_data
self.parser.blockprocessors.tag_counter += 1
tag = self._tag_data[self.parser.blockprocessors.tag_counter]
# Create Element
markdown_value = tag['attrs'].pop('markdown')... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def extendMarkdown(self, md):
""" Register extension instances. """
# Replace raw HTML preprocessor
md.preprocessors.register(HtmlBlockPreprocessor(md), 'html_block', 20)
# Add blockprocessor which handles the placeholders for etree elements
md.parser.blockprocessors.registe... | def extendMarkdown(self, md):
""" Register extension instances. """
# Turn on processing of markdown text within raw html
md.preprocessors['html_block'].markdown_in_raw = True
md.parser.blockprocessors.register(
MarkdownInHtmlProcessor(md.parser), 'markdown_block', 105
... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, text):
""" Iterate over html stash and restore html. """
replacements = OrderedDict()
for i in range(self.md.htmlStash.html_counter):
html = self.md.htmlStash.rawHtmlBlocks[i]
if self.isblocklevel(html):
replacements["<p>{}</p>".format(
... | def run(self, text):
""" Iterate over html stash and restore html. """
replacements = OrderedDict()
for i in range(self.md.htmlStash.html_counter):
html = self.md.htmlStash.rawHtmlBlocks[i]
if self.isblocklevel(html):
replacements["<p>%s</p>" %
... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def build_preprocessors(md, **kwargs):
""" Build the default set of preprocessors used by Markdown. """
preprocessors = util.Registry()
preprocessors.register(NormalizeWhitespace(md), 'normalize_whitespace', 30)
preprocessors.register(HtmlBlockPreprocessor(md), 'html_block', 20)
return preprocessors | def build_preprocessors(md, **kwargs):
""" Build the default set of preprocessors used by Markdown. """
preprocessors = util.Registry()
preprocessors.register(NormalizeWhitespace(md), 'normalize_whitespace', 30)
preprocessors.register(HtmlBlockPreprocessor(md), 'html_block', 20)
preprocessors.regist... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, lines):
source = '\\n'.join(lines)
parser = HTMLExtractor(self.md)
parser.feed(source)
parser.close()
return ''.join(parser.cleandoc).split('\\n') | def run(self, lines):
text = "\\n".join(lines)
new_blocks = []
text = text.rsplit("\\n\\n")
items = []
left_tag = ''
right_tag = ''
in_tag = False # flag
while text:
block = text[0]
if block.startswith("\\n"):
... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, lines):
source = '\\n'.join(lines)
parser = HTMLExtractor(self.md)
parser.feed(source)
parser.close()
return ''.join(parser.cleandoc).split('\\n') | def run(self, lines):
new_text = []
while lines:
line = lines.pop(0)
m = self.RE.match(line)
if m:
id = m.group(1).strip().lower()
link = m.group(2).lstrip('<').rstrip('>')
t = m.group(5) or m.group(6) or m.group(7)
... | [{'piece_type': 'other', 'piece_content': '<div class="row" markdown="1">\\n<div class="col-md-6" markdown="1">\\n**SomeText**\\n</div>\\n\\n<div class="col-md-6" markdown="1">\\n\\n**blod text**\\n<small>(<i class="fa fa-arrow-left"></i> small)</small>\\n\\n<div class="barchart" markdown="1">\\n* item1\\n* item2\\n</d... | Traceback (most recent call last):
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/test_tools.py", line 117, in test
output = markdown(input, **kwargs)
File "/home/ikus060/workspace/PDSL/markdown.git/markdown/core.py", line 391, in markdown
return md.convert(text)
File "/home/ikus060/workspace/PDSL/markdown.gi... | IndexError |
def run(self, lines):
'''
Find and remove all Abbreviation references from the text.
Each reference is set as a new AbbrPattern in the markdown instance.
'''
new_text = []
for line in lines:
m = ABBR_REF_RE.match(line)
if m:
ab... | def run(self, lines):
'''
Find and remove all Abbreviation references from the text.
Each reference is set as a new AbbrPattern in the markdown instance.
'''
new_text = []
for line in lines:
m = ABBR_REF_RE.match(line)
if m:
ab... | [{'piece_type': 'other', 'piece_content': '<div markdown="1">\\n\\n[link]: a_link\\n\\n<div markdown="1">\\n\\n</div>\\n\\n</div>'}, {'piece_type': 'error message', 'piece_content': 'doc-pelican (0.7)$ python3 test.py\\nMarkdown 2.6.9\\nTraceback (most recent call last):\\nFile "test.py", line 22, in <module>\\nprint(m... | doc-pelican (0.7)$ python3 test.py
Markdown 2.6.9
Traceback (most recent call last):
File "test.py", line 22, in <module>
print(md.convert(text))
File "/usr/lib/python3/dist-packages/markdown/__init__.py", line 371, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/usr/lib/python3/dist-packages/m... | IndexError |
def run(self, lines):
"""
Loop through lines and find, set, and remove footnote definitions.
Keywords:
* lines: A list of lines of text
Return: A list of lines of text with footnote definitions removed.
"""
newlines = []
i = 0
while True:
... | def run(self, lines):
"""
Loop through lines and find, set, and remove footnote definitions.
Keywords:
* lines: A list of lines of text
Return: A list of lines of text with footnote definitions removed.
"""
newlines = []
i = 0
while True:
... | [{'piece_type': 'other', 'piece_content': '<div markdown="1">\\n\\n[link]: a_link\\n\\n<div markdown="1">\\n\\n</div>\\n\\n</div>'}, {'piece_type': 'error message', 'piece_content': 'doc-pelican (0.7)$ python3 test.py\\nMarkdown 2.6.9\\nTraceback (most recent call last):\\nFile "test.py", line 22, in <module>\\nprint(m... | doc-pelican (0.7)$ python3 test.py
Markdown 2.6.9
Traceback (most recent call last):
File "test.py", line 22, in <module>
print(md.convert(text))
File "/usr/lib/python3/dist-packages/markdown/__init__.py", line 371, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/usr/lib/python3/dist-packages/m... | IndexError |
def detectTabbed(self, lines):
""" Find indented text and remove indent before further proccesing.
Keyword arguments:
* lines: an array of strings
Returns: a list of post processed items and the index of last line.
"""
items = []
blank_line = False # have... | def detectTabbed(self, lines):
""" Find indented text and remove indent before further proccesing.
Keyword arguments:
* lines: an array of strings
Returns: a list of post processed items and the index of last line.
"""
items = []
blank_line = False # have... | [{'piece_type': 'other', 'piece_content': '<div markdown="1">\\n\\n[link]: a_link\\n\\n<div markdown="1">\\n\\n</div>\\n\\n</div>'}, {'piece_type': 'error message', 'piece_content': 'doc-pelican (0.7)$ python3 test.py\\nMarkdown 2.6.9\\nTraceback (most recent call last):\\nFile "test.py", line 22, in <module>\\nprint(m... | doc-pelican (0.7)$ python3 test.py
Markdown 2.6.9
Traceback (most recent call last):
File "test.py", line 22, in <module>
print(md.convert(text))
File "/usr/lib/python3/dist-packages/markdown/__init__.py", line 371, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/usr/lib/python3/dist-packages/m... | IndexError |
def run(self, lines):
new_text = []
while lines:
line = lines.pop(0)
m = self.RE.match(line)
if m:
id = m.group(1).strip().lower()
link = m.group(2).lstrip('<').rstrip('>')
t = m.group(5) or m.group(6) or m.group(7)
... | def run(self, lines):
new_text = []
while lines:
line = lines.pop(0)
m = self.RE.match(line)
if m:
id = m.group(1).strip().lower()
link = m.group(2).lstrip('<').rstrip('>')
t = m.group(5) or m.group(6) or m.group(7)
... | [{'piece_type': 'other', 'piece_content': '<div markdown="1">\\n\\n[link]: a_link\\n\\n<div markdown="1">\\n\\n</div>\\n\\n</div>'}, {'piece_type': 'error message', 'piece_content': 'doc-pelican (0.7)$ python3 test.py\\nMarkdown 2.6.9\\nTraceback (most recent call last):\\nFile "test.py", line 22, in <module>\\nprint(m... | doc-pelican (0.7)$ python3 test.py
Markdown 2.6.9
Traceback (most recent call last):
File "test.py", line 22, in <module>
print(md.convert(text))
File "/usr/lib/python3/dist-packages/markdown/__init__.py", line 371, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/usr/lib/python3/dist-packages/m... | IndexError |
def run(self, root):
""" Add linebreaks to ElementTree root object. """
self._prettifyETree(root)
# Do <br />'s seperately as they are often in the middle of
# inline content and missed by _prettifyETree.
brs = root.iter('br')
for br in brs:
if not br.tai... | def run(self, root):
""" Add linebreaks to ElementTree root object. """
self._prettifyETree(root)
# Do <br />'s seperately as they are often in the middle of
# inline content and missed by _prettifyETree.
brs = root.getiterator('br')
for br in brs:
if not... | [{'piece_type': 'error message', 'piece_content': 'Traceback (most recent call last):\\nFile "<string>", line 1, in <module>\\nFile "/tmp/pip-build-hiv4fz31/Markdown/setup.py", line 270, in <module>\\n\\'Topic :: Text Processing :: Markup :: HTML\\'\\nFile "/usr/local/lib/python3.6/distutils/core.py", line 148, in setu... | Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-hiv4fz31/Markdown/setup.py", line 270, in <module>
'Topic :: Text Processing :: Markup :: HTML'
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/... | SystemError |
def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def get_stash(m):
id = m.group(1)
if id in sta... | def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def get_stash(m):
id = m.group(1)
if id in sta... | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def get_stash(m):
id = m.group(1)
if id in stash:
text = stash.get(id)
if isinstance(text, basestring):
return text
else:
return self.markdown.serializer(text) | def get_stash(m):
id = m.group(1)
if id in stash:
return stash.get(id) | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def itertext(el):
' Reimplement Element.itertext for older... | def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def get_stash(m):
id = m.group(1)
if id in sta... | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def get_stash(m):
id = m.group(1)
value = stash.get(id)
if value is not None:
try:
return self.markdown.serializer(text)
except:
return '\\%s' % value | def get_stash(m):
id = m.group(1)
value = stash.get(id)
if value is not None:
try:
return self.markdown.serializer(value)
except:
return '\\%s' % value | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def get_stash(m):
id = m.group(1)
if id in stash:
value = stash.get(id)
if isinstance(value, basestring):
return value
else:
# An etree Element - return text content only
return ''... | def get_stash(m):
id = m.group(1)
if id in stash:
text = stash.get(id)
if isinstance(text, basestring):
return text
else:
return self.markdown.serializer(text) | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def get_stash(m):
id = m.group(1)
value = stas... | def unescape(self, text):
""" Return unescaped text given text with an inline placeholder. """
try:
stash = self.markdown.treeprocessors['inline'].stashed_nodes
except KeyError:
return text
def get_stash(m):
id = m.group(1)
value = stas... | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def makeTag(self, href, title, text):
el = util.etree.Element("img")
el.set("src", self.sanitize_url(href))
if title:
el.set("title", title)
el.set("alt", self.unescape(text))
return el | def makeTag(self, href, title, text):
el = util.etree.Element("img")
el.set("src", self.sanitize_url(href))
if title:
el.set("title", title)
el.set("alt", text)
return el | [{'piece_type': 'source code', 'piece_content': "markdown.Markdown(safe_mode='escape').convert('<@`x`>')"}, {'piece_type': 'error message', 'piece_content': 'In [1]: import markdown\\n\\nIn [2]: markdown.Markdown(safe_mode=\\'escape\\').convert(\\'<@`x`>\\')\\n-----------------------------------------------------------... | In [1]: import markdown
In [2]: markdown.Markdown(safe_mode='escape').convert('<@`x`>')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-1401fbb3dfde> in <module>()
----> 1 markdown.Markdown(safe_mod... | TypeError |
def _get_left_tag(self, block):
m = self.left_tag_re.match(block)
if m:
tag = m.group('tag')
raw_attrs = m.group('attrs')
attrs = {}
if raw_attrs:
for ma in self.attrs_re.finditer(raw_attrs):
if ma.group('attr'):
... | def _get_left_tag(self, block):
m = self.left_tag_re.match(block)
if m:
tag = m.group('tag')
raw_attrs = m.group('attrs')
attrs = {}
if raw_attrs:
for ma in self.attrs_re.finditer(raw_attrs):
if ma.group('attr'):
... | [{'piece_type': 'error message', 'piece_content': 'markdown.markdown(\\'<>\\')\\nTraceback (most recent call last):\\nFile "<stdin>", line 1, in <module>\\nFile "/Users/aaronsw/Code/infohacks/jottit/code/env/lib/python2.7/site-packages/markdown/__init__.py", line 386, in markdown\\nreturn md.convert(text)\\nFile "/User... | markdown.markdown('<>')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aaronsw/Code/infohacks/jottit/code/env/lib/python2.7/site-packages/markdown/__init__.py", line 386, in markdown
return md.convert(text)
File "/Users/aaronsw/Code/infohacks/jottit/code/env/lib/python2.7/site-packa... | IndexError |
def sort_imports(
file_name: str,
config: Config,
check: bool = False,
ask_to_apply: bool = False,
write_to_stdout: bool = False,
**kwargs: Any,
) -> Optional[SortAttempt]:
incorrectly_sorted: bool = False
skipped: bool = False
try:
if check:
try:
... | def sort_imports(
file_name: str,
config: Config,
check: bool = False,
ask_to_apply: bool = False,
write_to_stdout: bool = False,
**kwargs: Any,
) -> Optional[SortAttempt]:
incorrectly_sorted: bool = False
skipped: bool = False
try:
if check:
try:
... | [{'piece_type': 'error message', 'piece_content': 'ERROR: Unrecoverable exception thrown when parsing src/eduid_webapp/eidas/app.py! This should NEVER happen.\\nIf encountered, please open an issue: https://github.com/PyCQA/isort/issues/new\\nTraceback (most recent call last):\\nFile "/home/lundberg/python-environments... | ERROR: Unrecoverable exception thrown when parsing src/eduid_webapp/eidas/app.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
File "/home/lundberg/python-environments/eduid-webapp/bin/isort", line 8, in <module>
sys.exit(ma... | KeyError |
def __init__(
self,
filename: Union[str, Path],
):
super().__init__(f"Unknown or unsupported encoding in {filename}")
self.filename = filename | def __init__(self, unsupported_settings: Dict[str, Dict[str, str]]):
errors = "\\n".join(
self._format_option(name, **option) for name, option in unsupported_settings.items()
)
super().__init__(
"isort was provided settings that it doesn't support:\\n\\n"
... | [{'piece_type': 'error message', 'piece_content': 'ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.\\nIf encountered, please open an issue: https://github.com/PyCQA/isort/issues/new\\nTraceback (most recent call last):\\nFile "/usr/lib/python3.8/t... | ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
File "/usr/lib/python3.8/tokenize.py", line 342, in find_cookie
codec = lookup(enco... | LookupError |
def from_contents(contents: str, filename: str) -> "File":
encoding = File.detect_encoding(filename, BytesIO(contents.encode("utf-8")).readline)
return File(StringIO(contents), path=Path(filename).resolve(), encoding=encoding) | def from_contents(contents: str, filename: str) -> "File":
encoding, _ = tokenize.detect_encoding(BytesIO(contents.encode("utf-8")).readline)
return File(StringIO(contents), path=Path(filename).resolve(), encoding=encoding) | [{'piece_type': 'error message', 'piece_content': 'ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.\\nIf encountered, please open an issue: https://github.com/PyCQA/isort/issues/new\\nTraceback (most recent call last):\\nFile "/usr/lib/python3.8/t... | ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
File "/usr/lib/python3.8/tokenize.py", line 342, in find_cookie
codec = lookup(enco... | LookupError |
def _open(filename):
"""Open a file in read only mode using the encoding detected by
detect_encoding().
"""
buffer = open(filename, "rb")
try:
encoding = File.detect_encoding(filename, buffer.readline)
buffer.seek(0)
text = TextIOWrapper(bu... | def _open(filename):
"""Open a file in read only mode using the encoding detected by
detect_encoding().
"""
buffer = open(filename, "rb")
try:
encoding, _ = tokenize.detect_encoding(buffer.readline)
buffer.seek(0)
text = TextIOWrapper(buffe... | [{'piece_type': 'error message', 'piece_content': 'ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.\\nIf encountered, please open an issue: https://github.com/PyCQA/isort/issues/new\\nTraceback (most recent call last):\\nFile "/usr/lib/python3.8/t... | ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
File "/usr/lib/python3.8/tokenize.py", line 342, in find_cookie
codec = lookup(enco... | LookupError |
def __init__(self, incorrectly_sorted: bool, skipped: bool, supported_encoding: bool) -> None:
self.incorrectly_sorted = incorrectly_sorted
self.skipped = skipped
self.supported_encoding = supported_encoding | def __init__(self, incorrectly_sorted: bool, skipped: bool) -> None:
self.incorrectly_sorted = incorrectly_sorted
self.skipped = skipped | [{'piece_type': 'error message', 'piece_content': 'ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.\\nIf encountered, please open an issue: https://github.com/PyCQA/isort/issues/new\\nTraceback (most recent call last):\\nFile "/usr/lib/python3.8/t... | ERROR: Unrecoverable exception thrown when parsing tests/functional/u/unknown_encoding_py29.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
File "/usr/lib/python3.8/tokenize.py", line 342, in find_cookie
codec = lookup(enco... | LookupError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.