commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
775bf625488ed7900caacd4af9a87a99bd383388 | Print more detailed error output in non-interactive mode | export_layers.py | export_layers.py | #! /usr/bin/env python
#
# Export Layers - GIMP plug-in that exports layers as separate images
#
# Copyright (C) 2013-2015 khalim19 <khalim19@gmail.com>
#
# Export Layers is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... | Python | 0 | @@ -6338,33 +6338,30 @@
print(
-e.message
+str(e)
)%0A except
@@ -6414,17 +6414,14 @@
int(
-e.message
+str(e)
)%0A
|
001ed5120b8541abe66753102e907c35e9432a59 | fix regression with TaskComplete | lib/magic.py | lib/magic.py | #! /usr/bin/env python
'''main python API for make-magic
This is where most of the magic happens. Any APIs you write (e.g. for HTTP)
may very well just call this much of the time
'''
import config
from core.store import Store
from core.marshal import ItemConverter,TaskConverter
from lib.loaders import JSONItemLoade... | Python | 0 | @@ -3830,17 +3830,8 @@
te',
- %7B'data':
%7B's
@@ -3850,11 +3850,9 @@
LETE
-D'%7D
+'
%7D)%0A%09
|
5ed78b3e71a1095a81249334479c0da9c719a789 | Stop sleeping on 429 response | tradegecko/api.py | tradegecko/api.py | import logging
import requests
import json
import time
import math
logger = logging.getLogger(__name__)
class TGRequestFailure(Exception):
pass
class ApiEndpoint(object):
def __init__(self, base_data, access_token):
self.base_data = base_data
self.access_token = access_token
self.h... | Python | 0.000001 | @@ -146,16 +146,121 @@
pass%0A%0A%0A
+class TGAuthFailure(TGRequestFailure):%0A pass%0A%0A%0Aclass TGRateLimitFailure(TGRequestFailure):%0A pass%0A%0A%0A
class Ap
@@ -972,55 +972,8 @@
e):%0A
- fails = 0%0A while fails %3C 2:%0A
@@ -1064,20 +1064,16 @@
params)%0A
-
@@ -12... |
3357e6b13d62614f423d0264bd016457d90c0f24 | Update account_move_budget/models/account_move_budget.py | account_move_budget/models/account_move_budget.py | account_move_budget/models/account_move_budget.py | # Copyright 2019 ACSONE SA/NV
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
class AccountMoveBudget(models.Model):
_name = "account.move.budget"
_description = "Account Move Budget"
... | Python | 0 | @@ -965,16 +965,21 @@
ring='To
+ Date
',%0A
|
cac0958c331961e2e073756f914ecf66cb3c40f6 | fix hetero_nn local benchmark | examples/benchmark_quality/hetero_nn/local-hetero_nn.py | examples/benchmark_quality/hetero_nn/local-hetero_nn.py | import argparse
import numpy as np
import keras
import pandas
import tensorflow as tf
from keras.utils import np_utils
from tensorflow.keras import optimizers
from sklearn import metrics
from pipeline.utils.tools import JobConfig
from sklearn.preprocessing import LabelEncoder
def build(param, shape1, shape2):
in... | Python | 0 | @@ -2340,12 +2340,11 @@
fle=
-Fals
+Tru
e)%0A%0A
|
bd23729658b333ec87ff4af0e5b61114f3e0db96 | Remove whitespace from file generation | export_layers.py | export_layers.py | #! /usr/bin/env python
import sys
sys.path.append('/usr/share/inkscape/extensions')
import inkex
import os
import subprocess
import tempfile
import shutil
class PNGExport(inkex.Effect):
def __init__(self):
"""init the effetc library and get options from gui"""
inkex.Effect.__init__(self)
... | Python | 0.000948 | @@ -1241,19 +1241,17 @@
ath, %22%25s
- -
+_
%25s.png%22
@@ -1559,11 +1559,9 @@
%22%25s
- -
+_
%25s.j
|
0444a2d5a046b12b69a5ace46c33b6f394a124d1 | fix py2toml with dashes | pipenv/patched/prettytoml/tokens/py2toml.py | pipenv/patched/prettytoml/tokens/py2toml.py |
"""
A converter of python values to TOML Token instances.
"""
import codecs
import datetime
import six
import strict_rfc3339
import timestamp
from prettytoml import tokens
import re
from prettytoml.elements.metadata import NewlineElement
from prettytoml.errors import TOMLError
from prettytoml.tokens import Token
from ... | Python | 0.000001 | @@ -2234,16 +2234,18 @@
%5E%5Ba-zA-Z
+_-
%5D*$')%0A%0A%0A
|
d155accc10802c9c5167059ff0923e6087c7bf77 | Use sale_ok and purchase_ok instead of tweaking payment type | account_payment_purchase/models/purchase_order.py | account_payment_purchase/models/purchase_order.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Purchase module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ca... | Python | 0 | @@ -1633,105 +1633,33 @@
n=%22%5B
-'%7C', ('payment_order_type', '=', 'payment'), %22%0A %22('payment_order_type', '=', 'both'
+('purchase_ok', '=', True
)%5D%22)
|
daba62c8019c22c817ce9007ae15e10e5616f1b4 | remove dead code | shop/payment/workflows.py | shop/payment/workflows.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from django_fsm import transition, RETURN_VALUE
from shop.models.order import BaseOrder
''' check if this is somewhere else
from shop.models.o... | Python | 0.999454 | @@ -263,776 +263,8 @@
er%0A%0A
-''' check if this is somewhere else%0Afrom shop.models.order import BaseOrder, OrderModel%0Afrom .base import PaymentProvider%0A%0A%0Aclass ForwardFundPayment(PaymentProvider):%0A %22%22%22%0A Provides a simple prepayment payment provider.%0A %22%22%22%0A namespace = 'forwar... |
54636e8ce0aaf893238568c5ae664d37894bac78 | Use maxDepth of 1 for listing urls | src/diamond/collectors/jolokia/cassandra_jolokia.py | src/diamond/collectors/jolokia/cassandra_jolokia.py | # coding=utf-8
"""
Collects Cassandra JMX metrics from the Jolokia Agent. Extends the
JolokiaCollector to interpret Histogram beans with information about the
distribution of request latencies.
#### Example Configuration
CassandraJolokiaCollector uses a regular expression to determine which
attributes represent hist... | Python | 0 | @@ -840,16 +840,50 @@
ector):%0A
+ LIST_URL = %22/list?maxDepth=1%22%0A
# ov
|
6673faab453ccfc1f9f2aae67c1e99433ee0ee5e | Resolve #21 | translators/ut.py | translators/ut.py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import time
import socket
import sys
def ut_translation(queue, text, translate_from='et', translate_to='en'):
try:
__HOST__ = "booster2.hpc.ut.ee"
__PORT__ = 50007
__BUFFER_SIZE__ = 4096
delimiter = "|||"
text_for_translation ... | Python | 0 | @@ -824,83 +824,8 @@
-print %3E%3E sys.stderr, %22text-for-translation%22, text_for_translation%0A%0A
s.se
@@ -847,16 +847,32 @@
nslation
+.encode('utf-8')
)%0A%0A
|
49c75994ab53c97444ff2ffdacda1d132cf50b24 | fix reading rebalance_settings attribute | perfrunner/tests/__init__.py | perfrunner/tests/__init__.py | import exceptions as exc
import glob
import shutil
import time
from logger import logger
from perfrunner.helpers.cbmonitor import CbAgent
from perfrunner.helpers.experiments import ExperimentHelper
from perfrunner.helpers.memcached import MemcachedHelper
from perfrunner.helpers.metrics import MetricHelper
from perfru... | Python | 0.000001 | @@ -2746,18 +2746,10 @@
gs')
- and %5C%0A
+:%0A
@@ -2752,32 +2752,34 @@
+if
self.rebalance_
@@ -2801,16 +2801,20 @@
er or %5C%0A
+
@@ -2868,16 +2868,20 @@
ilover:%0A
+
|
8a6c6b0b3b4a2d641941c4f682757831c90565ce | Add https to test URLs (#1569) (#1570) | gslib/tests/test_wrapped_credentials.py | gslib/tests/test_wrapped_credentials.py | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Python | 0.000674 | @@ -2628,37 +2628,32 @@
st(uri=%22https://
-fake.
sts.googleapis.c
@@ -2657,16 +2657,16 @@
s.com%22)%0A
+
self
@@ -2861,37 +2861,32 @@
e_with(%22https://
-fake.
sts.googleapis.c
@@ -3505,37 +3505,32 @@
%22url%22: %22https://
-fake.
sts.googleapis.c
@@ -4200,37 +4200,32 @@
%22https://
-fake.
sts.goo... |
1d0d7774f00d62bfc3eb16aa642a34da1a69879d | update test data | src/unittest/python/template_manager_tests.py | src/unittest/python/template_manager_tests.py | import os
import tempfile
from infra_buddy.template.template_manager import TemplateManager
from infra_buddy.aws.s3 import CloudFormationDeployS3Buddy
from infra_buddy.context.service_definition import ServiceDefinition
from infra_buddy.deploy.cloudformation_deploy import CloudFormationDeploy
from testcase_parent imp... | Python | 0 | @@ -2223,24 +2223,19 @@
%22: %22
-service-template
+infra-buddy
-vpc
|
e374abeba61df8290f3634146014ac726d8185de | handle attachments of the template. | addons/account_product_template/models/invoice.py | addons/account_product_template/models/invoice.py | # -*- coding: utf-8 -*-
from openerp.osv import osv
class account_invoice(osv.Model):
_inherit = 'account.invoice'
def invoice_validate_send_email(self, cr, uid, ids, context=None):
Composer = self.pool['mail.compose.message']
for invoice in self.browse(cr, uid, ids, context=context):
... | Python | 0.000001 | @@ -1210,71 +1210,56 @@
-Composer.write(%0A cr, uid, %5Bcomposer_id%5D,
+template_values = Composer.onchange_template_id(
%0A
@@ -1283,38 +1283,8 @@
-Composer.onchange_template_id(
cr,
@@ -1379,16 +1379,37 @@
voice.id
+%0A
)%5B'value
@@ -1431,16 +1431,207 @... |
cebadda2312d1b969474dfc8ded743d1cbd4ce0d | update vep to 91.1 | pynnotator/settings.py | pynnotator/settings.py | import os
###MAIN SETTINGS
snpEff_memory = "40G"
snpsift_merge_memory = "40G"
vep_cores = 4
vcf_annotator_cores = 4
dbnsfp_cores = 4
# server settings
# snpeff configs
# snpEff_memory = "60G"
# snpsift_merge_memory ="60G"
# # #vep configs
# vep_cores = 8
# vcf_annotator_cores = 8
# func_pred_cores = 8
# LIBS SETTIN... | Python | 0 | @@ -1591,16 +1591,18 @@
se = '91
+.1
'%0Avep_so
|
1fb1c79a356923ab0f32e50a55d71b31f35b1f03 | Add small delay to polling loop | ext/killmails.py | ext/killmails.py | '''
Killmail posting cog for antinub-gregbot project.
Monitors zKillboard's redisQ api and posts killmails relevant to your corp in
the given channel.
'''
from asyncio import CancelledError, sleep
from datetime import datetime
from socket import AF_INET
import logging
from traceback import format_exception
from aioht... | Python | 0 | @@ -2327,16 +2327,49 @@
ckage')%0A
+ await sleep(0.1)%0A
|
2537029f18df951b9234953452290a5172f5886f | fix send_mail() when no HTML content was given In commit "remove print from subscription" the EMAIL_DEBUG setting was removed from send_mail(). The msg.send() was mistakingly moved inside the if html: body. | djangobb_forum/subscription.py | djangobb_forum/subscription.py | from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.html import strip_tags
from djangobb_forum import settings as forum_settings
from djangobb_forum.util import absolute_url
if "mailer" in settings.INSTALLED_APPS:
from... | Python | 0.000001 | @@ -664,28 +664,24 @@
l%22)%0A
-
msg.send(fai
|
ab0a170cfb2e81762b3ec1bb7c9e89781df19f21 | add topics.create wrapper | pynodebb/api/topics.py | pynodebb/api/topics.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pynodebb/api/topics.py
Copyright (c) 2015 David Vuong <david.vuong256@gmail.com>
Licensed MIT
"""
from __future__ import unicode_literals
from pynodebb.api import Resource
from pynodebb.api.mixins import ResourceListMixin
from pynodebb.iterables import TopicIterable
... | Python | 0.000002 | @@ -736,33 +736,496 @@
-raise NotImplementedError
+%22%22%22Creates a new topic under a category given the category %60cid%60.%0A%0A Args:%0A cid (str): The category id we want to create the new topic under.%0A title (str): The title of the new topic.%0A content (str): The ... |
d6ff089060f0e338a57a323a5391339b0a3fbd5b | Fix recipients list. | djrill/mail/backends/djrill.py | djrill/mail/backends/djrill.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.utils import simplejson as json
import requests
class DjrillBackend(BaseEmailBackend):
"""
Man... | Python | 0.000002 | @@ -2340,20 +2340,16 @@
mail%22: e
-mail
, %22name%22
@@ -2355,170 +2355,57 @@
%22: n
-ame
%7D for
-email,name in parseaddr(recipients_list%5B:%5D)%5D%0A #recipients = %5B%7B%22email%22: sanitize_address(addr, message.encoding)%7D%0A #
+n,e in %5B%0A parseaddr(r)
for
-add
r in
-me... |
c3c73d4f7752ec41888438b3294a423b12776a37 | Update bau.py | ezclimate/bau.py | ezclimate/bau.py | import numpy as np
from abc import ABCMeta, abstractmethod
class BusinessAsUsual(object):
"""Abstract BAU class for the EZ-Climate model.
Parameters
----------
ghg_start : float
today's GHG-level
ghg_end : float
GHG-level in the last period
Attributes
----------
gh... | Python | 0.000001 | @@ -4402,19 +4402,46 @@
%5Bn-1
-:n%5D.mean())
+%5D + self.emission_by_decisions%5Bn%5D) / 2
%0A%0A
|
7d06bb57168cd18a73ab19aa28a6fa6fa4413d43 | Remove redundant --wish-from-installed option. | pytest_nodev/plugin.py | pytest_nodev/plugin.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015-2016 Alessandro Amici
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... | Python | 0 | @@ -1593,145 +1593,8 @@
on(%0A
- '--wish-from-installed', action='store_true',%0A help=%22Collects objects form all installed packages.%22)%0A group.addoption(%0A
@@ -1728,16 +1728,67 @@
ackages.
+ %22%0A %22Disabled by default, see the docs.
%22)%0A g
@@ -3015,67 +3015,10 @@
... |
5e19f86c313e16045621dc8fcdc682135765963e | fix for psql 7.4 | doc/migrate/3.4.0-4.0.0/pre.py | doc/migrate/3.4.0-4.0.0/pre.py | ##############################################################################
#
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences result... | Python | 0 | @@ -4493,16 +4493,59 @@
BOOLEAN
+%22,%0A%09%09%22ALTER TABLE ir_module_module SET demo
DEFAULT
|
13dac91fa6025e41e5ce56aebfde59be20fddf4a | remove blank line | homeassistant/components/notify/file.py | homeassistant/components/notify/file.py | """
homeassistant.components.notify.file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File notification service.
Configuration:
To use the File notifier you will need to add something like the following
to your config/configuration.yaml
notify:
platform: file
filename: FILENAME
timestamp: 1 or 0
Variables:
filename... | Python | 0.999999 | @@ -2196,9 +2196,8 @@
e(text)%0A
-%0A
|
df2bf7cc95f38d9e6605dcc91e56b28502063b6a | Fix usage of `url_title` in CategoryAdmin. | apps/faqs/admin.py | apps/faqs/admin.py | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Category, Faq
@admin.register(Faq)
class FaqAdmin(SearchMetaBaseAdmin):
""" Admin settings for the Faq model """
prepopulated_fields = {"url_title": ("question",)}
filter_horizontal = ("categorie... | Python | 0 | @@ -380,185 +380,74 @@
s%22:
-(%0A %22page%22,%0A %22question%22,%0A %22url_title%22,%0A %22answer%22,%0A %22categories%22,%0A %22order%22,%0A )
+%5B%22page%22, %22question%22, %22url_title%22, %22answer%22, %22catego... |
2dcd9d94c8e80347b81ebfd07ea8d25ae1f43ebb | Allow all success status codes in REST notify response (#22011) | homeassistant/components/notify/rest.py | homeassistant/components/notify/rest.py | """
RESTful platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.rest/
"""
import logging
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEF... | Python | 0 | @@ -4571,16 +4571,91 @@
ut=10)%0A%0A
+ success_codes = (200, 201, 202, 203, 204, 205, 206, 207, 208, 226)%0A
@@ -4689,23 +4689,21 @@
in
-(200, 201, 202)
+success_codes
:%0A
|
8f02e80df367ccd3870110c069898969f20924da | Fix stupid bug | python/busmap/fetch.py | python/busmap/fetch.py | # -*- coding: utf-8 -*
import horarios, linhas, env, dias
def get_linha_hor(idhor, nome):
c = env.db.cursor()
# look for id horario
r = c.select_onerow('linhas', ['id'], 'idhor=%s', [idhor])
if r:
c.close()
return r[0]
# not found. look for a similar name, but with no idhor set
r = c.select_onerow('linha... | Python | 0.000008 | @@ -1114,17 +1114,16 @@
pto,dia
-s
,apartir
@@ -1204,17 +1204,16 @@
pto, dia
-s
)%0A%09%09idpo
@@ -1259,17 +1259,16 @@
dias(dia
-s
)%0A%09%09c.in
|
7581aded7aa68e7c7c42db0493e6e694f45ca74d | Remove tracking of jobs | plugins/SliceInfoPlugin/SliceInfo.py | plugins/SliceInfoPlugin/SliceInfo.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Extension import Extension
from UM.Application import Application
from UM.Preferences import Preferences
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Scene.SceneNode import SceneNode
f... | Python | 0 | @@ -507,20 +507,8 @@
ob%0A%0A
-import time%0A
impo
@@ -2693,431 +2693,8 @@
()%0A%0A
- self.runningJobs = %5B%5D%0A%0A def __del__(self):%0A for job in self.runningJobs:%0A while not job.isFinished():%0A time.sleep(1) # Wait for threads - shouldn't take much more time than t... |
29fbfa2bd5eff4eec2ed3f38799586978a8ddcb8 | support for new style url patterns (django 1.8+) | feedjack/urls.py | feedjack/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import patterns
from feedjack import views
import itertools as it, operator as op, functools as ft
from types import StringTypes, NoneType
specs = dict(feed=('feed', r'\d+'), tag=r'[^/]+', since=r'[^/]+', asc=None)
specs_deprecated = dict(user=('feed', r'\d+'), tag=r'[^... | Python | 0 | @@ -55,16 +55,21 @@
patterns
+, url
%0Afrom fe
@@ -2676,16 +2676,17 @@
view))%0A%0A
+#
urlpatte
@@ -2718,8 +2718,110 @@
tterns)%0A
+# new django way. TODO: cleanup the creation of the urls%0Aurlpatterns = %5Burl(*x) for x in urlpatterns%5D%0A
|
21c2fdb4b026636693c8a122635892c411ebfe0a | fix document create form validation | apps/wiki/forms.py | apps/wiki/forms.py | # -*- coding: utf-8 -*-
#
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django import forms
from wiki.constants import DOCUMENT_TAGS, DOCUMENT_STAGES
from django.utils.translation import ugettext_lazy as _... | Python | 0.000001 | @@ -737,11 +737,33 @@
=ur%22
-%5Cw+
+%5E%5B%5Cw%C4%85%C4%87%C4%99%C5%82%C5%84%C3%B3%C5%9B%C5%BA%C5%BC%C4%84%C4%86%C4%98%C5%81%C5%83%C3%93%C5%9A%C5%B9%C5%BB%5D+$
%22)%0A
|
bbc3bc25be1d2d19e6cd0a72dba6e7e5b821cd41 | Bump version | base_geoengine/__openerp__.py | base_geoengine/__openerp__.py | # -*- coding: utf-8 -*-
# © 2011-2015 Nicolas Bessi (Camptocamp SA)
# © 2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{'name': 'Geospatial support for Odoo',
'version': '9.0.1.2.2',
'category': 'GeoBI',
'author': "Camptocamp,ACSONE SA/NV,Odoo Community Asso... | Python | 0 | @@ -232,17 +232,17 @@
9.0.1.2.
-2
+5
',%0A 'cat
|
a9afa7b856a158a8606e0650f518559a69d78034 | fix relative import path | planetpy/pdstools/indices.py | planetpy/pdstools/indices.py | """Support tools to work with PDS ISS indexfiles.
The main user interface is the IndexLabel class which is able to load the table file for you.
"""
from pathlib import Path
import pandas as pd
try:
import progressbar
except ImportError:
PROGRESSBAR_EXISTS = False
else:
PROGRESSBAR_EXISTS = True
import pvl... | Python | 0.000003 | @@ -321,16 +321,17 @@
%0A%0Afrom .
+.
import
|
77ac5ccab368f9389cea2efd3cda6191d0e8d482 | Remove unused import. | fileapi/views.py | fileapi/views.py | import json
from django import forms
from django.core.files.storage import FileSystemStorage
from django.core.urlresolvers import reverse
from django.http import JsonResponse, HttpResponseNotFound, HttpResponse
from django.views.generic import View, TemplateView
from jwt_auth.mixins import JSONWebTokenAuthMixin
sto... | Python | 0 | @@ -1,17 +1,4 @@
-import json%0A%0A
from
|
3801a070ec2f5381c6ad06137d1c3d260621e3cb | Remove useless strip parameter | better_exceptions/__init__.py | better_exceptions/__init__.py | """Beautiful and helpful exceptions
Just `import better_exceptions` somewhere. It handles the rest.
Name: better_exceptions
Author: Josh Junon
Email: josh@junon.me
URL: github.com/qix-/better-exceptions
License: Copyright (c) 2017 Josh Junon, licensed under the MIT licens
"""
from __future__ import absolu... | Python | 0.000001 | @@ -3640,13 +3640,8 @@
rip(
-'%5Cn '
)%0A%0A
|
96a46473b3c060075826c1c72e2bec1eb62d8655 | update docstring of commit | plenum/server/req_handler.py | plenum/server/req_handler.py | from binascii import unhexlify
from plenum.common.types import f
from plenum.common.request import Request
from typing import List
from plenum.common.ledger import Ledger
from plenum.common.state import PruningState
class RequestHandler:
"""
Base class for request handlers
Declares methods for validation... | Python | 0 | @@ -1089,136 +1089,299 @@
-Commit a number of transactions%0A%0A :param txnCount: %0A :param stateRoot: expected state root%0A :param txnRoot:
+:param txnCount: The number of requests to commit (The actual requests are%0A picked up from the uncommitted list from the ledger)%0A :... |
2e3c2604fc49eafec85ad852c3e2243933503c3e | fix typo and add test log file | pytimelog/pytimelog.py | pytimelog/pytimelog.py |
# wdw 30 july '15.
# translation of time.c, for the lx95/100, from 1994 !
# wanted: an example, existing data file...
# why are the V lines a mix of hex and decimal ???
from collections import deque
NLIST = 100
HEIGHT = 11
class Timelog(object):
def __init__(self):
self.changed = False
sel... | Python | 0.000001 | @@ -74,105 +74,8 @@
!%0A%0A
-# wanted: an example, existing data file...%0A%0A# why are the V lines a mix of hex and decimal ???%0A%0A
from
@@ -874,34 +874,32 @@
in self.timelist
-()
:%0A li
@@ -1922,18 +1922,16 @@
timelist
-()
:%0A
@@ -2399,10 +2399,69 @@
melog()%0A
+ t.load_file('test01.lo... |
6050b32ddb812e32da08fd15f210d9d9ee794a42 | Print Hello World in Python | first-program.py | first-program.py | # Python program for Programming for Everybody (Getting Started with Python) by University of Michigan - Charles Severance
# Task 1 Python code with single print statement but not print hello world
print "It is a great feeling to code in Python"
| Python | 0.999999 | @@ -239,8 +239,29 @@
Python%22%0A
+print %22Hello World!%22%0A
|
b203e94205eb7d614d5133f937da302c941a2b4d | check 'NotFreezed' on all transform nodes | plugins/Tester/notFreezed.py | plugins/Tester/notFreezed.py | import medic
from maya import OpenMaya
class NotFreezed(medic.PyTester):
Identity = OpenMaya.MMatrix()
def __init__(self):
super(NotFreezed, self).__init__()
def Name(self):
return "NotFreezed"
def Description(self):
return "Not freezed mesh(s)"
def Match(self, node):
... | Python | 0 | @@ -279,12 +279,17 @@
zed
-mesh
+trasnform
(s)%22
@@ -370,12 +370,17 @@
Fn.k
-Mesh
+Transform
)%0A%0A
@@ -470,80 +470,8 @@
ne%0A%0A
- iden = OpenMaya.MMatrix()%0A%0A for p in node.parents():%0A
@@ -486,17 +486,20 @@
sform =
-p
+node
.dag().t
@@ -532,18 +532,10 @@
-
- if not
+i... |
7182a635d270d9b816dc3f09ba6c541cc7a88b8a | Fix typo | aac_to_mp3.py | aac_to_mp3.py | #!/usr/bin/env python
import os
import os.path
import sys
import subprocess
#OUTPUT_DIR = '/Users/matt/Desktop/mp3/'
OUTPUT_DIR = 'c:/test/'
def covert_and_save(path):
filenames = [
filename
for filename
in os.listdir(path)
if filename.endswith('.m4a')
]
... | Python | 0.999999 | @@ -153,16 +153,17 @@
%0D%0Adef co
+n
vert_and
|
6753d66e2cfe47e64090388983190f5403e0a841 | Move some code around. | fixlib/engine.py | fixlib/engine.py | # Copyright (C) 2010 KenTyde BV
# All rights reserved.
#
# This software is licensed as described in the file LICENSE,
# which you should have received as part of this distribution.
from datetime import datetime
import fix42
import asyncore
class Engine(asyncore.dispatcher):
@property
def next(self):
return se... | Python | 0 | @@ -589,94 +589,8 @@
gs:%0A
-%09%09%09type = 'admin' if msg%5B'MsgType'%5D in fix42.ADMIN else 'app'%0A%09%09%09self.hook(type, msg)%0A
%09%09%09s
@@ -1909,32 +1909,116 @@
ess(self, msg):%0A
+%09%09type = 'admin' if msg%5B'MsgType'%5D in fix42.ADMIN else 'app'%0A%09%09self.hook(type, msg)%0A
%09%09if msg%5B'MsgSeq
|
e2bc4aaffba2ca8bd6bd58e93b172bac1fb8ade9 | dsError is red | qutepart/ColorTheme.py | qutepart/ColorTheme.py | class TextFormat:
"""Text format definition.
Public attributes:
color : Font color, #rrggbb or #rgb
background : Font background, #rrggbb or #rgb
selectionColor : Color of selected text
italic : Italic font, bool
bold : Bold font, bool
... | Python | 0.999995 | @@ -2139,15 +2139,31 @@
r='#
-e1eaf8'
+bf0303', underline=True
)%0A
|
586015286093585221fdcbdb8cd0fce5b6aa0f2f | Remove verbose warning message due to verify=False in requests. | rabbitmq_management.py | rabbitmq_management.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Quentin Kaiser <kaiserquentin@gmail.com>
#
# let's disable 'too many public methods'
# pylint: disable=R0904
"""
rabbitmq-management HTTP API client.
Example:
rbmq = RabbitMQManagementClient('localhost')
rbmq.whoami()
.. _Google Python Style Guide:
... | Python | 0 | @@ -406,16 +406,155 @@
requests
+%0Afrom requests.packages.urllib3.exceptions import InsecureRequestWarning%0Arequests.packages.urllib3.disable_warnings(InsecureRequestWarning)
%0A%0Aclass
|
9404fd886c3fbdb180083b55cdd69788b24049e4 | Add new value_types to VALUE_TYPE_CHOICES | rdmo/core/constants.py | rdmo/core/constants.py | from django.utils.translation import gettext_lazy as _
VALUE_TYPE_TEXT = 'text'
VALUE_TYPE_URL = 'url'
VALUE_TYPE_INTEGER = 'integer'
VALUE_TYPE_FLOAT = 'float'
VALUE_TYPE_BOOLEAN = 'boolean'
VALUE_TYPE_DATETIME = 'datetime'
VALUE_TYPE_OPTIONS = 'option'
VALUE_TYPE_EMAIL = 'email'
VALUE_TYPE_PHONE = 'phone'
VALUE_TYPE... | Python | 0.999936 | @@ -571,24 +571,96 @@
atetime')),%0A
+ (VALUE_TYPE_EMAIL, _('Email')),%0A (VALUE_TYPE_PHONE, _('Phone')),%0A
(VALUE_T
|
e11169bf85d752054563f22cfe9659b19b76299b | test for Store.get_file | fsstore/tests.py | fsstore/tests.py | # -*- coding: utf-8 -*-
import unittest
from tempfile import mkdtemp
from fsstore.core import Store
class TestInterface(unittest.TestCase):
def setUp(self):
"Initialize a Store with a temporary directory."
self.tempdir = mkdtemp()
self.fs = Store(self.tempdir)
def test_save_string(se... | Python | 0.000001 | @@ -1735,8 +1735,168 @@
tant%22%5D)%0A
+%0A def test_get_file(self):%0A self.fs%5B%22x%22%5D = %22yz%22%0A with self.fs.get_file(%22x%22) as f:%0A self.assertEquals(f.read(), self.fs%5B%22x%22%5D, %22yz%22)%0A%0A
|
6ddaac15ddb94821d12a1dd73b2a0ec3f9b8a884 | Fix minor bug in gammcat/info.py | gammacat/info.py | gammacat/info.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import subprocess
import os
from pathlib import Path
import urllib.parse
__all__ = [
'gammacat_info',
'gammacat_tag',
]
class GammaCatInfo:
"""Gather basic info about gammacat.
"""
def __init__(self):
# Git version: http://s... | Python | 0 | @@ -727,33 +727,28 @@
-self.internal
+hgps_analysis
_dir =
-Path(
os.e
@@ -774,16 +774,101 @@
ALYSIS')
+%0A if hgps_analysis_dir:%0A self.internal_dir = Path(hgps_analysis_dir
) / 'dat
|
d775b546812e995cdd8b3eff5b8245f8ed05e9c7 | add CONN_MAX_AGE to lesson overhead | nthuoj/settings.py | nthuoj/settings.py | """
Django settings for nthuoj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# -*- encoding=UTF-8 -*-
# Build paths inside the project like this: os.pat... | Python | 0.000019 | @@ -2229,16 +2229,45 @@
%7D,%0A
+ 'CONN_MAX_AGE': 120,%0A
%7D%0A%7D%0A
|
477c02946b05c80a11bad6c9c20464ee2e82eab4 | Add constants | number_to_words.py | number_to_words.py | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
| Python | 0.000002 | @@ -167,16 +167,466 @@
999999.%0A %22%22%22%0A
+%0A MAX = 999999999%0A SMALL_NUMBERS = %5B'', 'one', 'two', 'three', 'four', 'five', 'six',%0A 'seven', 'eight', 'nine', 'ten', 'eleven',%0A 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',%0A 's... |
eb2020e52d207b6d81742222fae0971ef8a62ade | Update XssPy.py | XssPy.py | XssPy.py | import mechanize
import sys
br = mechanize.Browser() #initiating the browser
br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11)Gecko/20071127 Firefox/2.0.0.11')]
br.set_handle_robots(False)
br.set_handle_refresh(False)
class color:
RED = '\033[91m'
BOLD = '\033[1m'
UN... | Python | 0 | @@ -2045,16 +2045,17 @@
website
+
%22 + str(
|
c9a5f5a542712fdc3ef41dd84889af9619f93822 | print original filename in flask example | examples/flask/upload-test.py | examples/flask/upload-test.py | #!/usr/bin/python3
from flask import Flask, request
import time
import os
import tempfile
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTarget
app = Flask(__name__)
page = '''
<!doctype html>
<title>Upload new File</title>
<h1>Upload new File</h1>
<form method=p... | Python | 0.00001 | @@ -1100,17 +1100,45 @@
return
-%22
+file.multipart_filename + %22:
upload d
|
0487f13c765020195384ad2ca737a8142970cca9 | update border_fill property setting to border_fill_color | examples/glyphs/choropleth.py | examples/glyphs/choropleth.py | from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Patches
from bokeh.models import (
Plot, DataRange1d, ColumnDataSource, ResizeTool
)
from bokeh.resources import INLINE
from bokeh.sampledata... | Python | 0.000001 | @@ -1601,16 +1601,22 @@
der_fill
+_color
=%22white%22
|
88abdf5365977a47abaa0d0a8f3275e4635c8378 | Fix OAuth integration for all wiki families | singleuser/user-config.py | singleuser/user-config.py | import os
mylang = 'test'
family = 'wikipedia'
custom_path = os.path.expanduser('~/user-config.py')
if os.path.exists(custom_path):
with open(custom_path, 'rb') as f:
exec(compile(f.read(), custom_path, 'exec'), globals())
del f
# Clean up temp variables, since pwb issues a warning otherwise
# to he... | Python | 0 | @@ -409,16 +409,212 @@
ridable%0A
+for fam in (%0A 'wikipedia', 'commons', 'meta', 'wikiboots', 'wikimedia',%0A 'wikiquote', 'wikisource', 'wikisource', 'wiktionary', 'wikiversity',%0A 'wikidata', 'mediawiki'%0A):%0A
username
@@ -618,19 +618,16 @@
ames%5Bfam
-ily
%5D%5B'*'%5D =
@@ -651,16 +... |
bc427c25320b93b9a29d32271c50c99700a700e2 | Use click.secho instead of print | packages/pegasus-python/src/Pegasus/cli/pegasus-remove.py | packages/pegasus-python/src/Pegasus/cli/pegasus-remove.py | #!/usr/bin/env python3
import os
import re
import shutil
import subprocess
from pathlib import Path
import click
from Pegasus.tools.utils import slurp_braindb
@click.command()
@click.pass_context
@click.option(
# TODO: Remove `--dagid` as it is replaced with `--dag-id`
"--dag-id",
"--dagid",
"-d",
... | Python | 0.000001 | @@ -994,22 +994,100 @@
-print(%22ERROR:
+click.secho(%0A click.style(%22Error: %22, fg=%22red%22, bold=True)%0A + %22
Cann
@@ -1117,32 +1117,45 @@
%25s%22 %25 submit_dir
+%0A
)%0A ct
@@ -1200,32 +1200,241 @@
ndb(submit_dir)%0A
+ if not config:%0A ... |
75b18c9aa7ed0c3a5a7bb806c91af390b3e37992 | remove download status check, it might be ready or unready | hs_core/tests/api/rest/test_folder_download_zip.py | hs_core/tests/api/rest/test_folder_download_zip.py | import json
import os
import tempfile
from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
from datetime import date
class TestPublicZipEndpoint(HSRESTTestCase):
def setUp(self):
super(TestPublicZipEndpoint, self).setUp()
self.tmp_dir = temp... | Python | 0 | @@ -2281,64 +2281,8 @@
h%22%5D%0A
- self.assertTrue(%22task_status%22 in response_json)%0A
|
a0454467dee6f1e2e0b501a63828c50e14891bef | Add multichannel audio support to tfds.features.Audio. | tensorflow_datasets/core/features/audio_feature.py | tensorflow_datasets/core/features/audio_feature.py | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0 | @@ -1708,12 +1708,11 @@
pe)
-!= 1
+%3E 2
:%0A
@@ -1753,50 +1753,66 @@
dio
-feature currently only supports 1-D values
+shape should be either (length,) or (length, num_channels)
, go
@@ -4449,102 +4449,66 @@
)%0A
-if len(data.shape) %3E 1:%0A raise ValueError('encoding of stereo PCM signals are unsupporte... |
46a9b688c7ad04ec946d223c03fd06de5ebba80a | add module comment | pprof/experiments/polyjit.py | pprof/experiments/polyjit.py | #!/usr/bin/env python
# encoding: utf-8
from pprof import likwid
from pprof.experiment import step, substep, RuntimeExperiment
from pprof.settings import config
from pprof.experiments.raw import RawResult
from plumbum import local
from os import path
class PolyJIT(RuntimeExperiment):
""" The polyjit experiment... | Python | 0 | @@ -34,16 +34,165 @@
utf-8%0A%0A
+%22%22%22%0AThe 'polyjit' experiment. This experiment uses likwid to measure the%0Aperformance of all binaries when running with polyjit support enabled.%0A%22%22%22%0A%0A
from ppr
|
81323aa798770577fede8627591757aa1cee37e9 | add entities (hashtags, ...) | preprocess/twitter2eumssi.py | preprocess/twitter2eumssi.py | #!/usr/bin/env python
import datetime
from eumssi_converter import EumssiConverter
import click
def transf_date(x):
if x.__class__ == datetime.datetime:
return x
else:
# Twitter's weird date format
return datetime.datetime.strptime(x, '%a %b %d %X +0000 %Y')
def transf_coordinates(x... | Python | 0.000001 | @@ -382,16 +382,256 @@
rectly%0A%0A
+def transf_hashtag(tag_list):%0A return %5Btag%5B'text'%5D for tag in tag_list%5D%0A%0Adef transf_url(url_list):%0A return %5Burl%5B'expanded_url'%5D for url in url_list%5D%0A%0Adef transf_user(user_list):%0A return %5Buser%5B'screen_name'%5D for user in user_list%5D%0A%0A... |
8040fff1a2c82b0912923e5b7844a179b1b3f8fa | path is None bug | about.py | about.py | # coding: utf-8
"""
About - Metadata for Setuptools
"""
# Python 2.7 Standard Library
import importlib
import os
import re
import sys
# Metadata
__project__ = "about"
__author__ = u"Sébastien Boisgérault <Sebastien.Boisgerault@gmail.com>"
__version__ = "0.1.1-alpha.1"
__license__ = "MIT License"
def get_metadata(n... | Python | 0.999967 | @@ -254,17 +254,17 @@
= %220.1.
-1
+2
-alpha.1
@@ -398,36 +398,32 @@
%0A if path is
-not
None:%0A pa
|
725a82a56bd6fca6942f5d5148bf1fd2572131ef | Refactor the main module | addon.py | addon.py | # Copyright 2016 Flavien Charlon
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | Python | 0.000015 | @@ -573,16 +573,26 @@
cense.%0A%0A
+import os%0A
import x
@@ -614,27 +614,16 @@
xbmcgui
-%0A%0Aimport os
%0Aimport
@@ -649,50 +649,15 @@
ee%0A%0A
-%0A# Install all required addons%0Adef execute
+def run
():%0A
@@ -695,21 +695,8 @@
ath(
-os.path.join(
%22spe
@@ -714,12 +714,8 @@
ile/
-%22, %22
buil
@@ -721,1... |
72afe77189da67625e3f2d644bdc3734d3096745 | Add namespace to feedme | onlineweb4/urls.py | onlineweb4/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.http import HttpResponse
from django.views.generic import TemplateView
from django_nyt.urls import get_pattern as get_noti... | Python | 0 | @@ -4860,24 +4860,44 @@
feedme.urls'
+, namespace='feedme'
)))%0A%0Aif 'app
|
cb674c7867c627611768420cf86cfb818ef4a04c | Update agent.py | agent.py | agent.py | import requests
import json
import socket
import json
import datetime
import re
import sys
from subprocess import check_output
from os import path
history_file_path = path.join(path.dirname(path.abspath(__file__)), 'history.json')
settings = {}
history = {}
def update_number_widget(dashboard_name, widget, value):
w... | Python | 0 | @@ -2070,16 +2070,237 @@
at(data)
+%0A %0Adef convert_hash(data):%0A if settings.get('hash-units') == 'KH/s':%0A data = data * 1000%0A if settings.get('hash-units') == 'GH/s':%0A data = data / 1000%0A return data
%0A%0Adef ge
@@ -2626,28 +2626,24 @@
ry%0A%0Ad... |
07c828a846d5567c1d924959924f21e7f3860e63 | Update trns_transform_KBaseGenomes.GBK.py | plugins/scripts/upload/trns_transform_KBaseGenomes.GBK.py | plugins/scripts/upload/trns_transform_KBaseGenomes.GBK.py | #!/usr/bin/env python
import argparse
import sys
import os
import time
import traceback
import sys
import ctypes
import subprocess
from subprocess import Popen, PIPE
import shutil
from optparse import OptionParser
from biokbase.workspace.client import Workspace
import urllib
import urllib2
import re
import json
desc1... | Python | 0 | @@ -1165,24 +1165,23 @@
orm/
-GenBankT
+kbase_t
ransform
.jar
@@ -1176,16 +1176,21 @@
ransform
+_deps
.jar:$KB
|
fb75e9777c449b6d31a22850238bf2f75ca6f0b2 | fix bingmurls parser | intelmq/bots/parsers/microsoft/parser_bingmurls.py | intelmq/bots/parsers/microsoft/parser_bingmurls.py | # -*- coding: utf-8 -*-
"""
Parses BingMURLs data in JSON format.
"""
import json
from intelmq.lib.bot import ParserBot
MAPPING = {"Attributable": "extra.attributable",
"Description": "event_description.text",
"IndicatorThreatType": "classification.identifier", # MaliciousUrl
"TLPLev... | Python | 0.003279 | @@ -279,16 +279,17 @@
tifier%22,
+
# Malic
|
8f5378a5d2ccca9d8af76e552d7eb0f9605d0917 | add more tests | molo/core/content_import/tests/test_content_import.py | molo/core/content_import/tests/test_content_import.py | import pytest
from elasticgit.tests.base import ModelBaseTest
from molo.core.models import SiteLanguage, SectionPage, ArticlePage
from molo.core.tests.base import MoloTestCaseMixin
from molo.core.content_import.tests.base import ElasticGitTestMixin
from molo.core.content_import.helper import ContentImportHelper
from... | Python | 0 | @@ -584,16 +584,103 @@
)%0A
+ self.spanish = SiteLanguage.objects.create(%0A locale='es',%0A )%0A
@@ -2353,32 +2353,44 @@
gory.')%0A%0A
+ en_pages1 =
self.create_pag
@@ -2493,32 +2493,44 @@
1.uuid)%0A%0A
+ en_pages2 =
self.create_pag
@@ -2633,32 +2633,179 @@... |
12eb1511f1857aec5526ce5275e4e196ea521151 | Rename --gir-directory to --gir-files | generator.py | generator.py | #!/usr/bin/env python3
from os import listdir
from os.path import isfile, isdir, join
import argparse
import subprocess
import sys
NOTHING_TO_BE_DONE = 0
NEED_UPDATE = 1
FAILURE = 2
DEFAULT_GIR_DIRECTORY = 'gir-files'
DEFAULT_GIR_PATH = './gir/target/release/gir'
def run_command(command, folder=None):
if fold... | Python | 0 | @@ -183,32 +183,38 @@
2%0A%0ADEFAULT_GIR_
+FILES_
DIRECTORY = 'gir
@@ -210,16 +210,18 @@
TORY = '
+./
gir-file
@@ -235,20 +235,25 @@
ULT_GIR_
-PATH
+DIRECTORY
= './gi
@@ -254,16 +254,62 @@
'./gir/
+'%0ADEFAULT_GIR_PATH = DEFAULT_GIR_DIRECTORY + '
target/r
@@ -2560,25 +2560,26 @@
onf.gir_
-directory
+files_p... |
f90533d3be8f89234a0b7cc02ab80814f0071024 | fix typo | monolithe/specsvalidator/apispecificationvalidator.py | monolithe/specsvalidator/apispecificationvalidator.py | # -*- coding: utf-8 -*-
import os
import difflib
from exceptions import *
IGNORED_ATTRIBUTES = ["parentType", "lastUpdatedBy", "externalID", "lastUpdatedDate", "parentID", "owner", "creationDate", "ID"]
class APISpecificationValidator:
""" Valdidate a candidate spec file against a spec file
"""
def __... | Python | 0.999991 | @@ -6701,35 +6701,38 @@
chException(
-declaration
+characteristic
_name=%22metho
|
97c80d07466928cc4c41406efbf36f6e198002f7 | Convert PosixPath to str for Python 3.7 asyncio | generator.py | generator.py | #!/usr/bin/env python3
from pathlib import Path
import argparse
import subprocess
import sys
import asyncio
DEFAULT_GIR_FILES_DIRECTORY = Path("./gir-files")
DEFAULT_GIR_DIRECTORY = Path("./gir/")
DEFAULT_GIR_PATH = DEFAULT_GIR_DIRECTORY / "target/release/gir"
def run_command(command, folder=None):
return subpr... | Python | 0.00624 | @@ -448,19 +448,24 @@
+str(
exe
+)
,%0A
@@ -467,20 +467,42 @@
*
+(str(arg) for arg in
args
+)
,%0A
|
5f3c4e6bd9a35f029e9e3241e241466cff843d6c | fix Point lookup | geo/views.py | geo/views.py | import datetime
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.db.models import Q
from opencivicdata.core.models import Division
DATE_FORMAT = "%Y-%m-%d"
def division_list(request):
today = datetime.datetime.strftime(datetime.datetime.now(), DATE_FORMAT)
lat ... | Python | 0 | @@ -124,16 +124,58 @@
mport Q%0A
+from django.contrib.gis.geos import Point%0A
from ope
@@ -946,75 +946,43 @@
ins=
-'POINT(%7B%7D %7B%7D)'.form
+Point(flo
at(lon
+)
,
-lat)%0A )%0A divisions = divisions%5B:2%5D
+float(lat))%0A )
%0A%0A
|
38e2352dd5a6daa89df4bf3bc13f908f9d557133 | Update models.py | orentapp/models.py | orentapp/models.py | import decimal
from decimal import Decimal
from django.db import models, transaction
from django.contrib.auth.models import User, Group
from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
"""
User Product
Profil ... | Python | 0 | @@ -458,16 +458,20 @@
e%0Aclass
+Base
Balance(
@@ -485,16 +485,16 @@
Model):%0A
-
%0A%09class
@@ -649,32 +649,33 @@
it(self, credit)
+:
%0A %09self.curre
@@ -801,16 +801,17 @@
credit)
+:
%0A %09se
@@ -1329,32 +1329,36 @@
s ProfilBalance(
+Base
Balance):%0A%0A c
@@ -1912,32 +1912,32 @@
Product Fin... |
8db0cc8df919d0b9456636ab2bf3695f95ad4dfd | Use requests sessions for automatic connection pooling | src/jupyter_spark/spark.py | src/jupyter_spark/spark.py | import json
import requests
import tornado
from bs4 import BeautifulSoup
from notebook.base.handlers import IPythonHandler
from notebook.utils import url_path_join
# try importing lxml and use it as the BeautifulSoup builder if available
try:
import lxml # noqa
except ImportError:
BEAUTIFULSOUP_BUILDER = 'ht... | Python | 0 | @@ -604,16 +604,58 @@
oint_url
+%0A self.session = requests.Session()
%0A%0A de
@@ -1225,24 +1225,28 @@
ponse =
-requests
+self.session
.get(spa
|
8210ba7a557a44c322ff3adddcbc98072a978e11 | Replace assertEqual(None, *) with assertIsNone(*) | openstackclient/tests/common/test_parseractions.py | openstackclient/tests/common/test_parseractions.py | # Copyright 2012-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0.000003 | @@ -3486,20 +3486,15 @@
sert
-Equal(
+Is
None
-,
+(
fail
|
e1af389a28b5c6a7aca2766418ab14d044596b05 | add base_vat to depends | l10n_be_partner_kbo_bce/__manifest__.py | l10n_be_partner_kbo_bce/__manifest__.py | # Copyright 2009-2020 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Belgium - KBO/BCE numbers",
"category": "Localization",
"version": "13.0.1.0.1",
"license": "AGPL-3",
"author": "Noviat,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/... | Python | 0 | @@ -368,16 +368,28 @@
ication%22
+, %22base_vat%22
%5D,%0A %22
|
4dedebe76d2ec112013595dd8f72b83b3ba28abb | update to fit utf8 | examples/black-whitelist/whitelist_generator.py | examples/black-whitelist/whitelist_generator.py | """
instabot example
Whitelist generator: generates a list of users which
will not be unfollowed.
"""
import sys
import os
import random
sys.path.append(os.path.join(sys.path[0], '../../'))
from instabot import Bot
bot = Bot()
bot.login()
print ("This script will generate whitelist.txt file with users"... | Python | 0 | @@ -759,17 +759,16 @@
print
-
(user_in
@@ -785,19 +785,24 @@
me%22%5D
- + %22 - %22 +
+)%0A print(
user
@@ -823,15 +823,8 @@
me%22%5D
- + %22%5Cr%22
)%0A%0A
|
bc43d899487bc5e872884c020b17da87ce01418a | Use cache in celery task | APITaxi/tasks/send_request_operator.py | APITaxi/tasks/send_request_operator.py | #coding: utf-8
from flask import current_app
from flask.ext.restplus import marshal
from ..models.hail import Hail
from ..models.security import User
from ..descriptors.hail import hail_model
from ..extensions import db, celery
import requests, json
@celery.task()
def send_request_operator(hail_id, operateur_id, env):... | Python | 0.000057 | @@ -330,21 +330,21 @@
= Hail.
-query
+cache
.get(hai
|
d1fd36c7b26a4fc86d6e9584eab00c9f2d481462 | fix typo and add parse_list() | twink/ofp4/oxm.py | twink/ofp4/oxm.py | from __future__ import absolute_import
import struct
from collections import namedtuple
from . import _enum_base
ofp_oxm_class = type("ofp_oxm_class", (_enum_base,), {
"prefix": "OFPXMC",
"numbers": {
"NXM_0": 0x0000,
"NXM_1": 0x0001,
"OPENFLOW_BASIC": 0x8000,
"EXPERIMENTER": 0... | Python | 0.000001 | @@ -1306,16 +1306,19 @@
in (OXM_
+OF_
METADATA
@@ -1323,16 +1323,19 @@
TA, OXM_
+OF_
TUNNEL_I
@@ -1373,24 +1373,27 @@
eld in (OXM_
+OF_
ETH_DST, OXM
@@ -1389,24 +1389,27 @@
TH_DST, OXM_
+OF_
ETH_SRC, OXM
@@ -1522,16 +1522,19 @@
in (OXM_
+OF_
ETH_TYPE
@@ -2748,24 +2748,194 @@
offset))%0D%0A%0D%0A
+def parse_l... |
1f029ff27c5cc8d44597789ae3db95acf608d556 | Fix for command palette call (ensures file was saved first) | txt2pynb_build.py | txt2pynb_build.py | import sublime_plugin, sublime, json, re
class txt2pynbCommand(sublime_plugin.WindowCommand):
def run(self, cmd="", file_regex="", path=""):
view = self.window.active_view()
root = view.file_name()
if root is None:
sublime.error_message("ERROR: Current buffer must be s... | Python | 0 | @@ -241,24 +241,43 @@
root is None
+ or view.is_dirty()
:%0A
@@ -371,16 +371,30 @@
notebook
+ with TXT2PYNB
%22)%0A
|
7fe95164a1b7ac64c76a7d934dd5d3b6e45bad46 | fix logic in code review comment handler when handling cases of no code review comments versus no code review comments matching this file | jupyterlab_comments/jupyterlab_comments/git_commands.py | jupyterlab_comments/jupyterlab_comments/git_commands.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.000003 | @@ -2587,22 +2587,103 @@
%0A%0A%09%09
-Returns None o
+The value of key %22comments%22 is modified to only include comments for the requested file path. I
f th
@@ -2693,16 +2693,21 @@
are no
+code
review c
@@ -2722,25 +2722,87 @@
for the
-file path
+requested file path, the value of key %22comments%22 will be ... |
294dabd8cc6bfc7e004a1a0dde9b40e9535d4b19 | Raise 404 Error if no Tag exists. | organizer/views.py | organizer/views.py | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | Python | 0 | @@ -25,16 +25,31 @@
e import
+ (%0A Http404,
HttpRes
@@ -53,16 +53,17 @@
Response
+)
%0Afrom dj
@@ -402,16 +402,29 @@
slug):%0A
+ try:%0A
tag
@@ -460,16 +460,67 @@
t=slug)%0A
+ except Tag.DoesNotExist:%0A raise Http404%0A
temp
|
5767d512eb7a0834ea934fdee0e7b4574fb23c8e | add python-setuptools as a deps for RPM | ArchipelAgent/archipel-core/setup.py | ArchipelAgent/archipel-core/setup.py | #
# setup.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your opti... | Python | 0 | @@ -1161,16 +1161,35 @@
PS = %22
+python-setuptools,
python-x
|
8f687a451142dee09b0c872c84d814304df39808 | Use public_url rather than media_link for report status html so that it loads as a webpage. | .buildkite/upload_artifacts.py | .buildkite/upload_artifacts.py | """
# Requirements:
* Generate access token in your Github account, then create environment variable GITHUB_ACCESS_TOKEN.
- e.g export GITHUB_ACCESS_TOKEN=1ns3rt-my-t0k3n-h3re.
* Generate a service account key for your Google API credentials, then create environment variable GOOGLE_APPLICATION_CREDENTI... | Python | 0 | @@ -6236,26 +6236,26 @@
us(blob.
-media_link
+public_url
)%0A%0A i
|
741b0e2ebad363097473c7f3750b2b852a61dcff | bump version to v3.7.3 | osmaxx/__init__.py | osmaxx/__init__.py | __version__ = 'v3.7.2'
__all__ = [
'__version__',
]
| Python | 0 | @@ -17,9 +17,9 @@
3.7.
-2
+3
'%0A%0A_
|
9aa2c49ae84ab024b9baf8ee46f755e2a1563306 | Ensure canonical lowercase form | modoboa_dmarc/views.py | modoboa_dmarc/views.py | """DMARC views."""
import collections
import datetime
import tldextract
from dns import resolver, reversename
from django.db.models import Q
from django.utils import timezone
from django.views import generic
from django.contrib.auth import mixins as auth_mixins
from modoboa.admin import models as admin_models
from... | Python | 0.999996 | @@ -759,16 +759,24 @@
suffix))
+.lower()
%0A
|
8045c0016e6607d80687613535b5036cb826b711 | Add group_hidden | smile_base/__openerp__.py | smile_base/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | Python | 0.000001 | @@ -2008,24 +2008,62 @@
%22data%22: %5B%0A
+ %22security/base_security.xml%22,%0A
%22sec
|
7da6f9bc00f669d945dd1f132cf588420d23dbe5 | move to a 3 column layout | tests/dash/app_editor_with_configurable_options.py | tests/dash/app_editor_with_configurable_options.py | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
import pprint
import dash_table
from index import app
df = pd.read_csv("./datasets/gapminder.csv")
df_small = pd.read_csv("./datasets/gapminder-small.csv")
CONTROLS = [... | Python | 0 | @@ -1985,21 +1985,20 @@
ssName=%22
-eight
+four
columns
@@ -2377,32 +2377,75 @@
),%0A
+ %5D%0A ),%0A ),%0A
html.
@@ -2431,32 +2431,33 @@
),%0A
+
html.Div(%0A
@@ -2458,32 +2458,101 @@
+className=%22four columns%22,%0A ... |
cd4789a394524061e7d5729b201cf349d5df6548 | fix indentation | doodle.py | doodle.py | import pygame
import time
# todo
# wrap round off edge of screen
# make screen scrolling smoother?
# add audio?
# new character
# simple character animation?
# tune movement to make it feel good
# add more platforms
# add more items and different types
# fall down to a crisis
# remove platforms that scroll off the bot... | Python | 0.000358 | @@ -4819,17 +4819,16 @@
HEIGHT:%0A
-%0A
pr
|
ac3a51d013dd2e4b7dcaa8a51493cbd852dcec3c | Remove staticmethod tag to be able to use logger of instance (#9086) | tests/kafkatest/tests/streams/base_streams_test.py | tests/kafkatest/tests/streams/base_streams_test.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Python | 0.000001 | @@ -4530,34 +4530,16 @@
ount))%0A%0A
- @staticmethod%0A
def
@@ -4547,32 +4547,38 @@
erify_from_file(
+self,
processor, messa
|
3c0a181ac54f5017ace8c02ea8a3982f4e62bed4 | read correct env variables | githubtakeout.py | githubtakeout.py | import logging
import os
import shutil
import tarfile
import git
from github import Github
logging.basicConfig(level=logging.INFO, format='%(message)s')
logger = logging.getLogger(__name__)
try:
USER = os.environ['USER']
PASSWORD = os.environ['PASSWORD']
except KeyError as e:
raise SystemExit('USER and... | Python | 0.000024 | @@ -216,16 +216,22 @@
nviron%5B'
+GITHUB
USER'%5D%0A
@@ -256,16 +256,22 @@
nviron%5B'
+GITHUB
PASSWORD
@@ -317,16 +317,22 @@
emExit('
+GITHUB
USER and
@@ -332,16 +332,22 @@
SER and
+GITHUB
PASSWORD
@@ -358,16 +358,40 @@
ironment
+'%0A '
variabl
@@ -1720,20 +1720,20 @@
th.join(
-gist
+r... |
a65b385769d33b606ea4b7c11c5542ea7d9394b9 | Disable redirect_state in strava backend. Fixes #259 | social/backends/strava.py | social/backends/strava.py | """
Strava OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/strava.html
"""
from social.backends.oauth import BaseOAuth2
class StravaOAuth(BaseOAuth2):
name = 'strava'
AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token... | Python | 0 | @@ -347,16 +347,295 @@
= 'POST'
+%0A # Strava doesn't check for parameters in redirect_uri and directly appends%0A # the auth parameters to it, ending with an URL like:%0A # http://example.com/complete/strava?redirect_state=xxx?code=xxx&state=xxx%0A # Check issue #259 for details.%0A REDIRECT_STATE = Fa... |
a95c3bff0065ed5612a0786e7d8fd3e43fe71ff7 | Declare immutable fields in SuperMessageNode | src/som/interpreter/ast/nodes/message/super_node.py | src/som/interpreter/ast/nodes/message/super_node.py | from .abstract_node import AbstractMessageNode
class SuperMessageNode(AbstractMessageNode):
def __init__(self, selector, receiver, args, super_class, source_section = None):
AbstractMessageNode.__init__(self, selector, None, receiver, args, source_section)
self._method = None
self._super_c... | Python | 0 | @@ -83,24 +83,93 @@
ssageNode):%0A
+%0A _immutable_fields_ = %5B'_method?', '_super_class', '_selector'%5D%0A%0A
def __in
|
116f74ec0bfd574d13837ce6831bde91e8504562 | simplify option handling | lava_scheduler_app/management/commands/__init__.py | lava_scheduler_app/management/commands/__init__.py | import logging
from optparse import make_option
import sys
from django.core.management.base import BaseCommand
NOTSET = object()
class SchedulerCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-l', '--loglevel',
action='store',
defaul... | Python | 0.000119 | @@ -111,28 +111,8 @@
d%0A%0A%0A
-NOTSET = object()%0A%0A%0A
clas
@@ -288,37 +288,35 @@
default=N
-OTSET
+one
,%0A
@@ -477,21 +477,19 @@
efault=N
-OTSET
+one
,%0A
@@ -765,37 +765,35 @@
gfile'%5D is not N
-OTSET
+one
:%0A da
@@ -886,13 +886,11 @@
ot N
-OTSET
+one
:%0A
@@ ... |
3f46081c54946494f74527fb188c15d29d3621e0 | Add an underscore, find_egg_info is an internal | src/pip/_internal/operations/generate_metadata.py | src/pip/_internal/operations/generate_metadata.py | """Metadata generation logic for source distributions.
"""
import logging
import os
from pip._internal.exceptions import InstallationError
from pip._internal.utils.misc import ensure_dir
from pip._internal.utils.setuptools_build import make_setuptools_shim_args
from pip._internal.utils.subprocess import call_subproce... | Python | 0.999997 | @@ -1085,16 +1085,17 @@
a%0A%0A%0Adef
+_
find_egg
@@ -4385,16 +4385,17 @@
return
+_
find_egg
|
87eb78133de6925d84cfe76b928b1401ceffc9e3 | Allow SeekSets to refuse walking subsets. | src/puzzle/heuristics/acrostics/_acrostic_iter.py | src/puzzle/heuristics/acrostics/_acrostic_iter.py | import heapq
from rx import Observable
from data import meta
from puzzle.heuristics import _base_acrostic
_EMPTY = (None, 0)
# Try to average 3 letters per word.
_TARGET_WORD_LEN = 4
# Target score per letter.
# Emperically determined from 1 sample:
# (64649558 + 4705743816 + 46688059 + 495684) /
# len(''.join('... | Python | 0 | @@ -942,91 +942,163 @@
= %5B
+%5D
%0A
- self._trie.walk(self._words%5Bi:%5D) for i in range(0, self._solution_len)%0A %5D
+for i in range(0, self._solution_len):%0A try:%0A self._walks.append(self._trie.walk(self._words%5Bi:%5D))%0A except IndexError:%0A break
%0A%0A
@@ -2551,24 +2... |
9d428b4315fb7ca7ff79d9b046e77e02939bee45 | Add timeout support for socket transport | src/vpp-api/python/vpp_papi/vpp_transport_socket.py | src/vpp-api/python/vpp_papi/vpp_transport_socket.py | #
# VPP Unix Domain Socket Transport.
#
import socket
import struct
import threading
import select
import multiprocessing
import logging
class VppTransport:
def __init__(self, parent, read_timeout, server_address):
self.connected = False
self.read_timeout = read_timeout if read_timeout > 0 else 1
... | Python | 0 | @@ -111,24 +111,37 @@
iprocessing%0A
+import queue%0A
import loggi
@@ -2371,19 +2371,66 @@
g.error(
-msg
+%22%7B%7D on socket %7B%7D%22.format(msg, self.server_address)
)%0A
@@ -2472,17 +2472,16 @@
= True%0A
-%0A
@@ -5467,24 +5467,41 @@
connected')%0A
+ try:%0A
retu
@@ -5514,1... |
bb357393a2d42462a5e956b5e64e1cd5d8d9cb42 | Remove redundant call to showGUI() in the navlist | src/orca/orca_gui_navlist.py | src/orca/orca_gui_navlist.py | # Orca
#
# Copyright 2012 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs@igalia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your o... | Python | 0.000001 | @@ -1630,31 +1630,8 @@
None
-%0A self.showGUI()
%0A%0A
|
77589f711605125a2faee18c3c52e5e09aa16f88 | remove shebang from dialog_add | src/pondus/gui/dialog_add.py | src/pondus/gui/dialog_add.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2007-09 Eike Nicklas <eike@ephys.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | Python | 0.000001 | @@ -1,27 +1,4 @@
-#! /usr/bin/env python%0A
# -*
|
cb94433a39be091c387bf4bc6e96a5c94e77a2c4 | Fix downloading STM32 CubeMX | tools/generator/raw-data-extractor/extract-stm32.py | tools/generator/raw-data-extractor/extract-stm32.py |
from pathlib import Path
from multiprocessing import Pool
import urllib.request
import zipfile
import shutil
import re
import io
import os
cubeurl = "https://www.st.com/content/st_com/en/products/development-tools/"\
"software-development-tools/stm32-software-development-tools/"\
"stm32-configurators-and-code... | Python | 0 | @@ -348,43 +348,490 @@
l%22%0A%0A
-with urllib.request.urlopen(cubeurl
+# Set the right headers%0Ahdr = %7B'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',%0A 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',%0A ... |
089cda617b0961b63d5eb416c50dd59e78e2ea6b | Remove fake feature added for unknown tests. | tools/python/post_generation/localads_mwm_to_csv.py | tools/python/post_generation/localads_mwm_to_csv.py | import csv
import ctypes
import logging
import os
import sys
from multiprocessing import Pool, Queue, Process
from zlib import adler32
from mwm import mwm
HEADERS = {
"mapping": "osmid fid mwm_id mwm_version source_type".split(),
"sponsored": "sid fid mwm_id mwm_version source_type".split(),
"mwm": "mwm_i... | Python | 0 | @@ -837,120 +837,8 @@
1%7D%0A%0A
-# Big enough to never intersect with a feature id (there are below 3 mln usually).%0AFAKE_FEATURE_ID = 100111000%0A%0A
%0Adef
@@ -2797,237 +2797,8 @@
eak%0A
- QUEUES%5B%22mapping%22%5D.put((ctypes.c_long(FAKE_FEATURE_ID).value,%0A FAKE_FEATURE_ID,%0A ... |
e520cbf1028309431c40dec2fc9ac83c734636e1 | remove postgres_image from CONFIG | pytest-server-fixtures/pytest_server_fixtures/__init__.py | pytest-server-fixtures/pytest_server_fixtures/__init__.py | import socket
import os
from pytest_fixture_config import Config
from .util import get_random_id
SESSION_ID_LEN = 8
class FixtureConfig(Config):
__slots__ = (
'java_executable',
'jenkins_url',
'jenkins_war',
'jenkins_image',
'minio_executable',
'minio_image',
... | Python | 0 | @@ -357,34 +357,8 @@
e',%0A
- 'postgres_image',%0A
@@ -1583,65 +1583,8 @@
.6'%0A
-DEFAULT_SERVER_FIXTURES_POSTGRES_IMAGE = 'postgres:11.1'%0A
DEFA
@@ -3392,112 +3392,8 @@
E),%0A
- postgres_image=os.getenv('SERVER_FIXTURES_POSTGRES_IMAGE', DEFAULT_SERVER_FIXTURES_POSTGRES_IMAGE),%0A
|
b8d95ff03d90a6318f8f57a44398a66601d99916 | Update Tensorflow.py | Glorot-He-Initialization/Tensorflow.py | Glorot-He-Initialization/Tensorflow.py | import tensorflow as tf
import time
batch_size = 128
epochs = 30
learning_rate = 0.05
momentum = 0.9
# input image dimensions
img_rows, img_cols = 28, 28
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = x_train.reshape([x_train.shape[0], img_rows, img_cols, 1]).a... | Python | 0.000001 | @@ -577,17 +577,16 @@
ut place
-
holders%0D
|
a2c8975751fdb67c8a6b52c60e95111649a9299d | Add rest of ECs | api/pushtx.py | api/pushtx.py | import urlparse
import os, sys,re
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_utils_parsing import *
from msc_apps import *
import tempfile
sys.path.append(os.path.abspath("../lib"))
from stats_backend import StatsBackend
error_codez= {
'-22': 'Erro... | Python | 0.000001 | @@ -307,39 +307,506 @@
%0A '-
-22': 'Error parsing transaction
+1': 'Exception thrown. Contact a developer.',%0A '-2': 'Server is in safe mode. Contact a developer.',%0A '-3': 'Unexpected type. Contact a developer.',%0A '-5': 'Invalid address or key. Contact a developer.',%0A '-7': 'Out of memory. Contact a developer.... |
2cd6a49c268e1c56f819fef5f838b2e0dfafb96b | Complete extended binary search sol | lc033_search_in_rotated_sorted_array.py | lc033_search_in_rotated_sorted_array.py | """Leetcode 33. Search in Rotated Sorted Array
Medium
URL: https://leetcode.com/problems/search-in-rotated-sorted-array/
Suppose an array sorted in ascending order is rotated at some pivot unknown
to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If fou... | Python | 0.000021 | @@ -796,35 +796,1332 @@
-pass%0A%0A%0Adef main():%0A pass
+if not nums:%0A return -1%0A%0A # Note that pivot is nums%5B0%5D.%0A pivot = nums%5B0%5D%0A%0A first, last = 0, len(nums) - 1%0A%0A while first %3C last:%0A mid = first + (last - first) // 2%0A%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.