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 |
|---|---|---|---|---|---|---|---|
4a1b670cd49f458c44bed638e2f9ecace211883a | fix and update first user as admin | websitemixer/plugins/Install/Setup.py | websitemixer/plugins/Install/Setup.py | import os
from flask import render_template, request, redirect
from websitemixer import app, db, models
@app.route('/setup/step1/')
def setup1():
return render_template("Install/step1.html")
@app.route('/setup/step2/',methods=['POST'])
def setup2():
secretkey = os.urandom(24).encode('hex')
appname = reque... | Python | 0 | @@ -1852,23 +1852,27 @@
pdate =
-Setting
+models.User
.query.f
@@ -1914,11 +1914,8 @@
ict(
-is_
admi
|
9582eefa22c5d1e5b8a71154981ca8e956bfa6f6 | throw error on missing from clause | active_data/actions/__init__.py | active_data/actions/__init__.py | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division... | Python | 0.000001 | @@ -3912,12 +3912,116 @@
-cs =
+if not frum:%0A Log.error(%22expecting json query expression with from clause%22)%0A%0A # FORCE A RELOAD%0A
nam
@@ -4057,34 +4057,16 @@
r=after)
- # FORCE A RELOAD
%0A%0A if
|
9fec79f71f6dbf80d11989fbbfc2bed43668b75d | Use skimage for circle definition | python/thunder/extraction/feature/methods/localmax.py | python/thunder/extraction/feature/methods/localmax.py | from numpy import cos, sin, pi, array, sqrt
from thunder.extraction.feature.base import FeatureMethod, FeatureAlgorithm
from thunder.extraction.feature.creators import MeanFeatureCreator
from thunder.extraction.source import SourceModel, Source
class LocalMax(FeatureMethod):
def __init__(self, **kwargs):
... | Python | 0 | @@ -1510,265 +1510,8 @@
m):%0A
- %22%22%22%0A Extract sources from an image by finding local maxima.%0A%0A Parameters%0A ----------%0A im : ndarray%0A The image or volume%0A%0A Returns%0A -------%0A A SourceModel with circular regions.%0A %22%22... |
40fe16d058d18d2384be464ecefed1028edace17 | Fix error on SASL PLAIN authentication | txircd/modules/ircv3_sasl_plain.py | txircd/modules/ircv3_sasl_plain.py | from txircd.modbase import Module
from base64 import b64decode
class SaslPlainMechanism(Module):
def authenticate(self, user, authentication):
try:
authenticationID, authorizationID, password = b64decode(authentication[0]).split("\0")
except TypeError:
user.sendMessage(irc.ERR_SASLFAILED, ":SASL authenticat... | Python | 0.000003 | @@ -451,24 +451,75 @@
False%0A%09%09if
+%22server_sasl_agent%22 not in self.ircd.servconfig or
self.ircd.se
@@ -1060,16 +1060,67 @@
):%0A%09%09if
+%22server_sasl_agent%22 not in self.ircd.servconfig or
self.irc
|
026db0e635f0c82e1b24884cb768d53b7fadfc0c | use lots of connections for the pool | feedly/storage/cassandra/connection.py | feedly/storage/cassandra/connection.py | from pycassa.pool import ConnectionPool
def get_cassandra_connection(keyspace_name, hosts):
if get_cassandra_connection._connection is None:
get_cassandra_connection._connection = ConnectionPool(
keyspace_name, hosts)
return get_cassandra_connection._connection
get_cassandra_connection._c... | Python | 0 | @@ -235,16 +235,80 @@
e, hosts
+, pool_size=len(hosts)*24,%0A prefill=False, timeout=10
)%0A re
|
4e2affde042fab083ec24ec8d6e04ba2f45d1f7d | add utcnow to if conditional evaluation | flexget/plugins/filter/if_condition.py | flexget/plugins/filter/if_condition.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves import builtins
import logging
import datetime
from copy import copy
from jinja2 import UndefinedError
from flexget import plugin
from flexget.event imp... | Python | 0.000001 | @@ -1419,16 +1419,82 @@
edelta,%0A
+ 'utcnow': datetime.datetime.utcnow(),%0A
|
fb4b9e4570c4053204304fc934d0fe816d4c056d | add new split dictionary and dependencies | tests/resources/dictionaries/transaction_dictionary.py | tests/resources/dictionaries/transaction_dictionary.py | # -*- coding: utf-8 -*-
from tests.resources.dictionaries import card_dictionary
from tests.resources.dictionaries import customer_dictionary
from tests.resources import pagarme_test
BOLETO_TRANSACTION = {'amount': '10000', 'payment_method': 'boleto'}
CALCULATE_INTALLMENTS_AMOUNT = {'amount': '10000', 'free_installm... | Python | 0 | @@ -160,27 +160,119 @@
rces
- import pagarme_tes
+.dictionaries import recipient_dictionary%0Afrom tests.resources import pagarme_test%0Afrom pagarme import recipien
t%0A%0AB
@@ -440,16 +440,48 @@
: '13',%0A
+
'max_ins
@@ -522,16 +522,17 @@
status':
+
'paid'%7D%0A
@@ -572,24 +572,... |
fa23d59a66cfc192bcfed6cdbb8426479487ccca | Add unit tests | tests/unit/synapseutils/unit_test_synapseutils_walk.py | tests/unit/synapseutils/unit_test_synapseutils_walk.py | import json
import uuid
import pytest
from unittest.mock import patch, call
import synapseclient
import synapseutils.walk_functions
def test_helpWalk_not_container(syn):
"""Test if entry entity isn't a container"""
entity = {"id": "syn123", "concreteType": "File"}
with patch.object(syn, "get", return_va... | Python | 0.000001 | @@ -962,16 +962,32 @@
=entity)
+ as mock_syn_get
,%5C%0A
@@ -1042,16 +1042,34 @@
e=child)
+ as mock_get_child
:%0A
@@ -1195,32 +1195,32 @@
ecute generator%0A
-
gen_resu
@@ -1229,32 +1229,184 @@
= list(result)%0A
+ mock_syn_get.assert_called_once_with(%22syn123%22, downloadFile=False)%0... |
ac21a23540f84e72931e2a82afc57aff420a2151 | Move speech_services_speech_tests back to qemu. | tools/android/emulated_devices/macro/emulator_info.bzl | tools/android/emulated_devices/macro/emulator_info.bzl | """Defines the emulators and their supported configs in android_test_support."""
load(
"//tools/android/emulated_devices:macro/emulator.bzl",
"new_emulator",
"emulator_type",
"emulator_files",
)
load("//tools/android/emulated_devices:macro/image.bzl", "image_files")
load("//tools/android/emulated_devic... | Python | 0 | @@ -1629,32 +1629,118 @@
subpackages__%22,%0A
+ %22//java/com/google/android/apps/gsa/binaries/speechservices:__subpackages__%22,%0A
%22//java/
@@ -2643,32 +2643,99 @@
subpackages__%22,%0A
+ %22//javatests/com/google/android/apps/gsa:__subpackages__%22,%0A
%22//javat
|
d2fe267359feec48888469909bec3b432d1f4a93 | Fix `BundleIntegrationTest`. (#4953) | tests/python/pants_test/engine/legacy/test_bundle_integration.py | tests/python/pants_test/engine/legacy/test_bundle_integration.py | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | Python | 0 | @@ -3105,16 +3105,24 @@
out_data
+.strip()
, 'Hello
@@ -3140,11 +3140,7 @@
Foo
-%5Cn%5Cn
')%0A
|
f48432a61ab6d3d97c4a93dc9c2178a9b01695a9 | Add now-needed response_type param to login urls | linode/login_client.py | linode/login_client.py | import requests
from enum import Enum
from linode.errors import ApiError
try:
from urllib.parse import urlparse
from urllib.parse import urlencode
from urllib.parse import urlunparse
except ImportError:
from urlparse import urlparse
from urllib import urlencode
from urlparse import urlunparse
... | Python | 0 | @@ -5372,32 +5372,93 @@
self.client_id,%0A
+ %22response_type%22: %22code%22, # needed for all logins%0A
%7D%0A
|
1bccf48e6e142e6c62374dd9d7dc94330f15c650 | Update ipc_lista1.3.py | lista1/ipc_lista1.3.py | lista1/ipc_lista1.3.py | #ipc_lista1.3
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça dois números e imprima a soma.
number1 = input("Digite o primeiro: ")
number2 = input("Digite o segundo número: ")
print(number1+number2)
| Python | 0 | @@ -66,17 +66,16 @@
61531004
-4
%0A#%0A#%0A#%0A#
|
4e6fc94fde8eace1b461eba59dc4a56611664877 | Update ipc_lista1.7.py | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: "
| Python | 0 | @@ -229,9 +229,10 @@
etros: %22
+)
%0A
|
950e9f82be8b3a02ce96db47061cf828da231be9 | Update ipc_lista1.8.py | lista1/ipc_lista1.8.py | lista1/ipc_lista1.8.py | #ipc_lista1.8
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
#Calcule e mostre o total do seu salário no referido mês.
QntHora = input("Entre com o valor de seu rendimento por hora: ")
hT = input
| Python | 0 | @@ -310,9 +310,16 @@
= input
+(%22Entre
%0A
|
26c781807937038ec2c4fbfd4413ae2c60decd1b | add stdint.h for c++ default header include. | src/py/cpp_fragment_tmpl.py | src/py/cpp_fragment_tmpl.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
hpp_tmpl="""#ifndef __FRAGMENT_HPP__
#define __FRAGMENT_HPP__
#include <string>
#include <vector>
#include <map>
#include <list>
{includes}
void fragment_container();
#endif
"""
cpp_tmpl="""#include "{head_file}"
#include <iostream>
#include <stdio.h>
void fragment_co... | Python | 0 | @@ -170,16 +170,129 @@
%3Clist%3E%0A%0A
+// linux int type define; should be remore/add by system dependent in the future version.%0A#include %3Cstdint.h%3E %0A%0A
%7Binclude
|
5e21c7d0fa46e2b290368533cc6dc741b1d366e2 | correct src path in settings | functional-tests/clickerft/settings.py | functional-tests/clickerft/settings.py | import os
BASEDIR = os.path.dirname(os.getcwd())
HOME = "file://" + BASEDIR + "/src/"
| Python | 0.000001 | @@ -1,51 +1,96 @@
-import os%0A%0ABASEDIR = os.path.dirname(os.getcwd(
+from os.path import dirname, realpath%0A%0ABASEDIR = dirname(dirname(dirname(realpath(__file__))
))%0AH
|
b251092c7f752df365392efba805f2c04d4617a0 | add pragmas | galpy/potential_src/linearPotential.py | galpy/potential_src/linearPotential.py | import os, os.path
import pickle
import numpy as nu
import galpy.util.bovy_plot as plot
from Potential import PotentialError, Potential
class linearPotential:
"""Class representing 1D potentials"""
def __init__(self,amp=1.):
self._amp= amp
self.dim= 1
self.isRZ= False
self.hasC= ... | Python | 0.999885 | @@ -742,32 +742,50 @@
AttributeError:
+ #pragma: no cover
%0A rai
@@ -1259,16 +1259,34 @@
teError:
+ #pragma: no cover
%0A
|
623a4d54d2bd15ada9efd82437ba6387dd1ba7b7 | use shorter backoff function | gcloud_requests/requests_connection.py | gcloud_requests/requests_connection.py | import logging
import requests
import time
from gcloud.datastore.connection import Connection as GCloudDatastoreConnection
from gcloud.connection import Connection as GCloudConnection
from gcloud.storage.connection import Connection as GCloudStorageConnection
from threading import local
logger = logging.getLogger(__f... | Python | 0.000109 | @@ -4801,16 +4801,25 @@
f = min(
+0.0625 *
2 ** ret
@@ -4824,17 +4824,19 @@
etries,
-5
+1.0
)%0A
|
54563933a265a7c70adce3996d0a31eb9c915203 | Use kwarg normally in piratepad.controllers.Form | addons/piratepad/controllers.py | addons/piratepad/controllers.py | from openobject.tools import expose
from openerp.controllers import form
from openerp.utils import rpc, common, TinyDict
import cherrypy
class Form(form.Form):
_cp_path = "/piratepad/form"
@expose('json', methods=('POST',))
def save(self, **kwargs):
params, data = TinyDict.split(cherrypy.session['... | Python | 0 | @@ -100,16 +100,8 @@
rpc,
- common,
Tin
@@ -242,16 +242,16 @@
lf,
-**kwargs
+pad_name
):%0A
@@ -319,48 +319,8 @@
'%5D)%0A
- pad_name=kwargs.get('pad_name')%0A
|
8dfed1bb3070d5dde5a727c9d5739c6dc419069b | fix squeeze bug and some other refinement (#1874) | python/dllib/src/bigdl/dllib/utils/tf_utils.py | python/dllib/src/bigdl/dllib/utils/tf_utils.py | #
# Copyright 2016 The BigDL 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 applicable law or agreed to in ... | Python | 0 | @@ -3627,24 +3627,47 @@
ing%0A %22%22%22%0A
+ import numpy as np%0A
jtensors
@@ -3702,16 +3702,156 @@
keys():%0A
+ if not isinstance(tensors%5Btn%5D, np.ndarray):%0A value = np.array(tensors%5Btn%5D)%0A else:%0A value = tensors%5Btn%5D%0A
@@ -3882,35 +3882,29 @... |
31aa44ef336c497be9f545c9bd4af64aac250748 | Fix remote coverage execution | python/helpers/coverage_runner/run_coverage.py | python/helpers/coverage_runner/run_coverage.py | """Coverage.py's main entrypoint."""
import os
import sys
bundled_coverage_path = os.getenv('BUNDLED_COVERAGE_PATH')
if bundled_coverage_path:
sys_path_backup = sys.path
sys.path = [p for p in sys.path if p != bundled_coverage_path]
from coverage.cmdline import main
sys.path = sys_path_backup
else:
... | Python | 0.000001 | @@ -932,17 +932,8 @@
file
- + %22.cov%22
%0A%0Aif
|
1f6a154967ecd74c538f9ddda3f4a83018a6eef7 | Attempt to fix iris_val_based_early_stopping test. Change: 127441610 | tensorflow/examples/skflow/iris_val_based_early_stopping.py | tensorflow/examples/skflow/iris_val_based_early_stopping.py | # Copyright 2016 The TensorFlow Authors. 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 required by appl... | Python | 0.999225 | @@ -796,16 +796,31 @@
nction%0A%0A
+import shutil%0A%0A
from skl
@@ -986,16 +986,150 @@
learn%0A%0A%0A
+def clean_folder(folder):%0A %22%22%22Cleans the given folder if it exists.%22%22%22%0A try:%0A shutil.rmtree(folder)%0A except OSError:%0A pass%0A%0A%0A
def main
@@ -1498,16 +1498,75 @@
s=200)%0A%0A
+ ... |
0f1a046b2c9de38fb73dbdef9b9c64845fd28147 | Allow to filter marketplace offering by billable flag. | src/waldur_mastermind/marketplace/filters.py | src/waldur_mastermind/marketplace/filters.py | import json
from django.db.models import Q
import django_filters
from django.utils.translation import ugettext_lazy as _
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import exceptions as rf_exceptions
from waldur_core.core import filters as core_filters
from . import models
cla... | Python | 0 | @@ -177,16 +177,65 @@
Backend%0A
+from django_filters.widgets import BooleanWidget%0A
from res
@@ -1483,24 +1483,90 @@
ory__uuid')%0A
+ billable = django_filters.BooleanFilter(widget=BooleanWidget)%0A
o = djan
|
150d3b5a8eebf69e22432406fe4a8217997995dc | Fix a typo | libdiscid/compat/discid.py | libdiscid/compat/discid.py | # -*- coding: utf-8 -*-
# Copyright 2013 Sebastian Ramacher <sebastian+dev@ramacher.at>
#
# 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 th... | Python | 0.999999 | @@ -1942,16 +1942,17 @@
n super(
+_
NoneHelp
|
c109728986a3a583fe037780c88bdaa458e663c4 | Bump 2.1.1 | appium/version.py | appium/version.py | version = '2.1.0'
| Python | 0.000011 | @@ -12,7 +12,7 @@
2.1.
-0
+1
'%0A
|
28f3564470ec4f8df0bf4d2a90102489bef76bfe | Add a notification for raids, so we can do stuff. | apps/api/views.py | apps/api/views.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.shortcuts import get_object_or_404
from rest_framework import views, viewsets
from rest_framework.response import Response
from socketIO_client import SocketIO
from apps.broadcasts.models import Broadcast, Host, Raid, Series
from apps.games.models i... | Python | 0 | @@ -2038,24 +2038,192 @@
Serializer%0A%0A
+ def create(self, request, *args, **kwargs):%0A notify('raid', %7B'username': request.data%5B'username'%5D%7D)%0A return super().create(request, *args, **kwargs)%0A%0A
%0Aclass Ticke
|
05140304c1ef08e7e291eec92de4091320bdfc0e | Add acceleration to example | encoder/examples/encoder_lcd.py | encoder/examples/encoder_lcd.py | # -*- coding: utf-8 -*-
"""Read encoder and print position value to LCD."""
from machine import sleep_ms
from pyb_encoder import Encoder
from hd44780 import HD44780
class STM_LCDShield(HD44780):
_default_pins = ('PD2','PD1','PD6','PD5','PD4','PD3')
def main():
lcd.set_string("Value: ")
lastval = 0
... | Python | 0 | @@ -504,16 +504,74 @@
yte(c)%0A%0A
+ enc.cur_accel = max(0, enc.cur_accel - enc.accel)%0A
@@ -681,16 +681,25 @@
alue=999
+, accel=5
)%0A ma
|
2268ebdc47b1d9221c06622a7b1992cae14013c2 | Test endpoint for the web server | web/server.py | web/server.py | import http.client
import os
from flask import Flask
from pymongo import MongoClient
MONGO_URL = os.environ.get('MONGO_URL', 'mongodb://mongo:27017/')
MONGO_DATABASE = os.environ.get('MONGO_DATABASE', 'whistleblower')
DATABASE = MongoClient(MONGO_URL)[MONGO_DATABASE]
app = Flask(__name__)
@app.route('/facebook_webh... | Python | 0 | @@ -287,16 +287,80 @@
me__)%0A%0A%0A
+@app.route('/')%0Adef hello_world():%0A return 'Hello, World!'%0A%0A%0A
@app.rou
|
db40a42c2825b157017e6730a2b5c95371bbe598 | Allow user to adjust nyquist freq and freq spacing in cp_utils.py | arfit/cp_utils.py | arfit/cp_utils.py | import carmcmc as cm
from gatspy.periodic import LombScargleFast
import matplotlib.pyplot as plt
import numpy as np
def csample_from_files(datafile, chainfile, p, q):
data = np.loadtxt(datafile)
times, tind = np.unique(data[:,0], return_index=True)
data = data[tind, :]
chain = np.loadtxt(chainfil... | Python | 0 | @@ -549,16 +549,50 @@
ys, dys
+, oversampling=5, nyquist_factor=3
):%0A m
@@ -642,211 +642,151 @@
-T = np.max(ts)-np.min(ts)%0A dts = np.diff(np.sort(ts))%0A%0A fny = 1.0/(2.0*np.min(dts)
+pers, pows = model.periodogram_auto(oversampling=oversampling, nyquist_factor=nyquist_factor
)%0A
-d
f
+s
... |
762397854e90d0288081f0741fb742024217be8f | fix for a bug reported by Kirill (unknown charset '8859-1') | lib/request/basic.py | lib/request/basic.py | #!/usr/bin/env python
"""
$Id$
Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
See the file 'doc/COPYING' for copying permission
"""
import codecs
import gzip
import os
import re
import StringIO
import zlib
from lib.core.common import extractErrorMessage
from lib.core.common import extrac... | Python | 0 | @@ -3196,24 +3196,206 @@
er)%5D%0A%0A #
+popular typos/errors%0A if '8858' in encoding:%0A encoding = encoding.replace('8858', '8859')%0A if encoding.startswith('8859'):%0A encoding = 'iso-%25s' %25 encoding%0A%0A #
http://phili
@@ -3499,121 +3499,8 @@
ing%5D
-%0A elif encoding.startsw... |
5169175c8e6d88e67849006d976e4d3967e113c5 | fix pep8 error | rasa_nlu/extractors/duckling_http_extractor.py | rasa_nlu/extractors/duckling_http_extractor.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import time
import requests
import simplejson
from typing import Any
from typing import List
from typing import Optional
from typing import Text... | Python | 0.000001 | @@ -4357,17 +4357,19 @@
ge.time)
-*
+ *
1000%0A
@@ -4773,17 +4773,19 @@
.time())
-*
+ *
1000%0A%0A
|
e76c6be06e0bfcb0f2e0ac2876dee46c6236ea6c | mark developer help function | ports/pyqt-webengine/next-pyqt.py | ports/pyqt-webengine/next-pyqt.py | import logging
import utility
import buffers
import window
# from dbus.mainloop.glib import DBusGMainLoop
import dbus
import dbus.service
from dbus.mainloop.pyqt5 import DBusQtMainLoop
from PyQt5.QtWidgets import QApplication
logging.basicConfig(level=logging.INFO)
"""
This is a Next port with Qt's Web Engine, thro... | Python | 0.000001 | @@ -1602,32 +1602,63 @@
ete(window_id)%0A%0A
+ # DEVELOPER HELP FUNCTION%0A
@dbus.servic
@@ -1731,22 +1731,23 @@
return
-window
+utility
.killall
|
4fd80a9a593a4f9100899e96a383782c68a41af1 | Fix to subtract USDT withdrawals from balance | poloniex_apis/api_models/deposit_withdrawal_history.py | poloniex_apis/api_models/deposit_withdrawal_history.py | from collections import defaultdict
from poloniex_apis.api_models.ticker_price import TickerData
class DWHistory:
def __init__(self, history):
self.withdrawals = defaultdict(float)
self.deposits = defaultdict(float)
self.history = history
def get_dw_history(self):
for deposit... | Python | 0.000007 | @@ -1452,33 +1452,33 @@
balance
-+
+-
= amount * ticke
|
1e16048c7ceb50377fdfdda3a39ef9910d2021bb | Bump version to 0.2 | wagtail_simple_gallery/__init__.py | wagtail_simple_gallery/__init__.py | __version__ = '0.1' | Python | 0.000001 | @@ -14,6 +14,6 @@
'0.
-1
+2
'
|
f5f33b7d7ae8a6eefe60d826c06fbbf67de95861 | Make html protected | lightning/visualization.py | lightning/visualization.py | import requests
import json
import webbrowser
class Visualization(object):
def __init__(self, session=None, json=None, auth=None):
self.session = session
self.id = json.get('id')
self.auth = auth
if self.session.lgn.ipython_enabled:
from IPython.kernel.comm import Co... | Python | 0.000013 | @@ -4643,24 +4643,25 @@
self.
+_
html = html%0A
@@ -5512,12 +5512,13 @@
rn self.
+_
html
|
7e9d3b3d2c4e46c2b16595b7acc6aa670ece9e6e | use correct API to save to bucket. | astrobin/tasks.py | astrobin/tasks.py | from django.conf import settings
from celery.decorators import task
from celery.task.sets import subtask
from PIL import Image as PILImage
from subprocess import call
import StringIO
import os
import os.path
from image_utils import *
from s3 import *
from notifications import *
@task()
def solve_image(image, callba... | Python | 0 | @@ -1257,16 +1257,37 @@
_bucket(
+uid + '_solved.png',
solved_r
@@ -1311,153 +1311,8 @@
ue()
-,%0A 'image/png',%0A settings.S3_SOLVED_BUCKET,%0A uid,%0A '.png'
)%0A
|
4b1f8fb2077055bc97e8a69ff8e36ef53567ccb4 | Remove extraneous debug stuff. | audio_matching.py | audio_matching.py | import os, sys
import pyaudio
import wave
import numpy
import scikits.audiolab as audiolab
import matplotlib.pyplot as pyplot
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import generate_binary_structure, iterate_structure, binary_erosion
from time import sleep # DEBUG
# Audio stream... | Python | 0 | @@ -271,40 +271,8 @@
on%0A%0A
-from time import sleep # DEBUG%0A%0A
# Au
|
555b48cf41cea940a3a13c9570d03876db3b62cd | add comment explaining purpose of clearing sys.modules in DataSetRepo | src/main/python/smv/datasetrepo.py | src/main/python/smv/datasetrepo.py | #
# This file is 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 writing, software
# distr... | Python | 0 | @@ -1217,24 +1217,141 @@
pp = smvApp%0A
+ # Remove client modules from sys.modules to force reload of all client%0A # code in the new transaction%0A
self
@@ -1877,28 +1877,16 @@
smvApp)%0A
-
%0A
|
70f137998b2cc3b9c873a57e17a435c6ca181192 | improve code for getting the pricelist | product_supplier_intercompany/models/purchase_order.py | product_supplier_intercompany/models/purchase_order.py | # Copyright 2021 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, models
from odoo.exceptions import UserError
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
def _p... | Python | 0 | @@ -187,16 +187,24 @@
mport _,
+ fields,
models%0A
@@ -324,154 +324,136 @@
ef _
-prepare_sale_order_data(%0A self, name, partner, dest_company, direct_delivery_address%0A ):%0A res = super()._prepare_sale_order_data(
+get_intercompany_pricelist(self, partner, dest_company):%0A if partner.pro... |
590ba3c9d645f6eac41687bee9f12f7c914858d6 | revert to http for loading clusters | progressivis/datasets/__init__.py | progressivis/datasets/__init__.py | import os
from progressivis import ProgressiveError
from .random import generate_random_csv
from .wget import wget_file
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../data'))
def get_dataset(name, **kwds):
if not os.path.isdir(DATA_DIR):
os.mkdir(DATA_DIR)
if name == 'bigfi... | Python | 0 | @@ -896,17 +896,16 @@
rl='http
-s
://cs.jo
|
0658934a7a7a1581c6f1d871c192f49b42144b09 | fix issue with ControlPlayer on mac | pyforms/gui/Controls/ControlPlayer/VideoQt5GLWidget.py | pyforms/gui/Controls/ControlPlayer/VideoQt5GLWidget.py | from pyforms.gui.Controls.ControlPlayer.AbstractGLWidget import AbstractGLWidget
from PyQt5 import QtGui
from PyQt5.QtWidgets import QOpenGLWidget
from PyQt5 import QtCore
class VideoQt5GLWidget(AbstractGLWidget, QOpenGLWidget):
def initializeGL(self):
self.gl = self.context().versionFunctions()
self.gl.initi... | Python | 0 | @@ -583,18 +583,23 @@
lEnable(
-GL
+self.gl
.GL_DEPT
|
055fb6e4a3cec3d9ed8406c2d2795d6089e6241d | fix optimMethod (#1806) | python/orca/src/bigdl/orca/tfpark/gan/gan_estimator.py | python/orca/src/bigdl/orca/tfpark/gan/gan_estimator.py | #
# Copyright 2018 Analytics Zoo 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 applicable law or agreed to... | Python | 0 | @@ -2276,23 +2276,18 @@
set.
-feature_
tensors
+%5B0%5D
%0A
@@ -2319,21 +2319,18 @@
set.
-label_
tensors
+%5B1%5D
%0A%0A
@@ -5681,18 +5681,230 @@
ze.value
-)
,
+%0A self._discriminator_steps,%0A ... |
d0ed8aeb2126a4b14b8413bd8c6d54952451e890 | Update version number. | libcloud/__init__.py | libcloud/__init__.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.000021 | @@ -967,11 +967,11 @@
%220.
-4.3
+5.0
-dev
|
4aacd356fe7354b044d7c5787fb2366219294658 | Add 'auto_correlation' to _allowed_symbols. | tensorflow/contrib/distributions/__init__.py | tensorflow/contrib/distributions/__init__.py | # Copyright 2016 The TensorFlow Authors. 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 required by applica... | Python | 0.000854 | @@ -5290,16 +5290,40 @@
ols = %5B%0A
+ 'auto_correlation',%0A
'bij
|
b999240903bb71e14818fb3f2d8eb12bda75ada2 | Bump tensorflow to 2.1.0 (#721) | tensorflow_io/core/python/ops/version_ops.py | tensorflow_io/core/python/ops/version_ops.py | # Copyright 2019 The TensorFlow Authors. 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 required by applica... | Python | 0 | @@ -726,18 +726,15 @@
flow
-%3E
+=
=2.1.0
-rc2
'%0Ave
|
ce0a3a4b13b8257fa95c95376a043b02958e73f2 | Fix exception parameters | src/sentry_gitlab/plugin.py | src/sentry_gitlab/plugin.py | """
sentry_gitlab.plugin
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django import forms
from sentry.plugins.bases.issue import IssuePlugin
from django.utils.translation import ugettext_lazy as _
from gitlab import *... | Python | 0.000011 | @@ -2346,16 +2346,21 @@
ionError
+ as e
:%0A
@@ -2470,16 +2470,21 @@
xception
+ as e
:%0A
|
0260b5d1d222fe9c8fa629ea8063c7a6e4964603 | Remove unused import | overlay/composite-frame.py | overlay/composite-frame.py | #!/usr/bin/env python3
import os
import time
import io
import re
import argparse
import sys
from PIL import Image
import cairosvg
from SVGGenerator import SVGGenerator
from DataManager import DataManager
from Data import Data
from Chart import Chart
# create regex for extracting time data from file names
TIME_AND_F... | Python | 0.000001 | @@ -31,20 +31,8 @@
os%0A
-import time%0A
impo
|
f45cd2ff52cb672068e4bcf31b9c260cd43032ee | Use timeout decorator with use_signals=False | paasta_tools/remote_git.py | paasta_tools/remote_git.py | # Copyright 2015-2016 Yelp Inc.
#
# 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 writin... | Python | 0.023608 | @@ -655,21 +655,8 @@
ls%0A%0A
-import time%0A%0A
impo
@@ -3088,16 +3088,122 @@
timeout(
+error_message=%22Timed out connecting to git server, is it reachable from where you are?%22, use_signals=False
)%0Adef li
@@ -3308,27 +3308,8 @@
%22%22%22%0A
- time.sleep(15)%0A
|
a9cd7d6eaa7ea70e962cf4d1c9e4aa53a2845968 | Bump version number | lillebror/version.py | lillebror/version.py | # Copyright 2012 Loop Lab
#
# 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 writing, sof... | Python | 0.000002 | @@ -612,11 +612,11 @@
'0.
-1.1
+2.0
'%0A__
|
d9f445796599bf1ecb48e21a53f3188925012053 | Correct order of synced/desynced subtitles in calc_correction | linear-correction.py | linear-correction.py | #!/usr/bin/env python
import srt
import datetime
import utils
def timedelta_to_milliseconds(delta):
return delta.days * 86400000 + \
delta.seconds * 1000 + \
delta.microseconds / 1000
def parse_args():
def srt_timestamp_to_milliseconds(parser, arg):
try:
delta = srt... | Python | 0.000001 | @@ -1461,18 +1461,16 @@
ular = (
-de
synced_e
@@ -1474,18 +1474,16 @@
d_end -
-de
synced_s
@@ -1491,16 +1491,18 @@
art) / (
+de
synced_e
@@ -1498,32 +1498,34 @@
(desynced_end -
+de
synced_start)%0A
@@ -1535,18 +1535,16 @@
inear =
-de
synced_e
@@ -1558,16 +1558,18 @@
gular *
+de
synced_e
|
3fea814461d2a51e0cc13c4981fa6f4cdfca75e9 | Correct broken import, this could never have worked. | providers/moviedata/filmtipset.py | providers/moviedata/filmtipset.py | from providers.moviedata.provider import MoviedataProvider
from urllib import urlencode
from settings import ACCESS_KEYS
from application import APPLICATION as APP
IDENTIFIER = "Filmtipset"
class Provider(MoviedataProvider):
def get_url(self, movie):
options = {
"action": "search",
... | Python | 0 | @@ -90,15 +90,18 @@
rom
-setting
+access_key
s im
|
1ee492838c3289629a9213309c05761ac290d081 | correct filetype arg | web/documentserver-example/python/src/utils/trackManager.py | web/documentserver-example/python/src/utils/trackManager.py | """
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)
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, copy... | Python | 0.01345 | @@ -2480,32 +2480,38 @@
downloadExt =
+ %22.%22 +
body.get('filet
@@ -5163,16 +5163,22 @@
oadExt =
+ %22.%22 +
body.ge
|
00d9ee19790e0cd1bfdab0765e4c0e858d5f22bd | fix bug in use of 'media' | localcrawler/core.py | localcrawler/core.py | from urlparse import urlparse
from BeautifulSoup import BeautifulSoup
from django.conf import settings
from django.test.client import Client
import sys
__all__ = ['Crawler']
class Crawler(object):
def __init__(self, entry_point='/',
img=True, media=True, # Media is deprecated: Use img
... | Python | 0 | @@ -680,19 +680,21 @@
media =
-img
+media
# Depr
@@ -2646,32 +2646,155 @@
return%0A
+ # media is deprecated but currently setting either media or%0A # img to False will disable checking of images%0A
if self.
|
b8241c2ff0cff4a0bc96e6d229c80029cdbcb71c | Change contact email. | luminoth/__init__.py | luminoth/__init__.py | from .cli import cli # noqa
__version__ = '0.0.1.dev0'
__title__ = 'Luminoth'
__description__ = 'Computer vision toolkit based on TensorFlow'
__uri__ = 'http://luminoth.ai'
__doc__ = __description__ + ' <' + __uri__ + '>'
__author__ = 'Tryolabs'
__email__ = 'hello@tryolabs.com'
__license__ = 'BSD 3-Clause License'... | Python | 0 | @@ -260,13 +260,16 @@
= '
-hello
+luminoth
@try
|
df3441a2c98fffbb18c11d3660acb86d2e31e5fa | Fix main run | src/ultros/core/__main__.py | src/ultros/core/__main__.py | # coding=utf-8
import argparse
import asyncio
from ultros.core.ultros import Ultros
"""
Ultros - Module runnable
"""
__author__ = "Gareth Coles"
__version__ = "0.0.1"
def start(args):
u = Ultros(args.config, args.data)
# Gonna have to be a coroutine if we're AIO-based. Probably.
asyncio.get_event_loop(... | Python | 0.000733 | @@ -174,24 +174,29 @@
ef start(arg
+ument
s):%0A u =
@@ -205,16 +205,21 @@
tros(arg
+ument
s.config
@@ -223,16 +223,21 @@
fig, arg
+ument
s.data)%0A
@@ -244,124 +244,16 @@
-# Gonna have to be a coroutine if we're AIO-based. Probably.%0A asyncio.get_event_loop().run_until_complete(
u.start
+(
)%0A%0... |
4300cf8c6e98081c429fcbed44ed387af7735aa4 | Add a link to python-markdown-math extension | markups/mdx_mathjax.py | markups/mdx_mathjax.py | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2015
'''
Math extension for Python-Markdown
==================================
Adds support for displaying math formulas using [MathJax](http://www.mathjax.org/).
Author: 2015, Dmitry Shachnev <mitya57@gmail.com>.
'''
from... | Python | 0 | @@ -93,16 +93,81 @@
, 2015%0A%0A
+# Maintained in https://github.com/mitya57/python-markdown-math%0A%0A
'''%0AMath
|
5229bf4a16d468a3a337db65c478671409d6d898 | Update summery.py | metric-consumer/summary.py | metric-consumer/summary.py | #!/usr/bin/python
import os
import argparse
import re
def cumulative_moving_average(new_value, old_mean, total_items):
return old_mean + (new_value - old_mean) / total_items
def print_file_summary(path):
cma = 0
n = 0
with open(path, 'r') as csv_file:
all_lines = csv_file.readlines()
for line in all_line... | Python | 0.000001 | @@ -452,18 +452,20 @@
_time =
-in
+floa
t(values
@@ -489,12 +489,8 @@
e =
-int(
floa
@@ -501,17 +501,16 @@
lues%5B7%5D)
-)
%0A%09%09%09%09rec
|
4395fb9d6c1f7c4c48618a13681eae16e5e41ae6 | Fix docs | xpathwebdriver/default_settings.py | xpathwebdriver/default_settings.py | # -*- coding: utf-8 -*-
'''
Smoothtest
Copyright (c) 2014 Juju. Inc
Code Licensed under MIT License. See LICENSE file.
'''
import logging
import json
class Settings(object):
def __init__(self):
if self.webdriver_remote_credentials_path:
with open(self.webdriver_remote_credentials_path, 'r') a... | Python | 0.000003 | @@ -1225,170 +1225,92 @@
lse
- # Keep the virtual display after a smoothtest %0A # process finished (useful when we also keep the browser open for debugging)
+# If we want to check results (useful whe combined with webdriver_browser_keep_open)
%0A%0A
@@ -1386,16 +1386,16 @@
br... |
9f899f439dbe9c80e77eee08fb674917c74f0b2a | Remove unused import | mechanize/_testcase.py | mechanize/_testcase.py | import os
import shutil
import subprocess
import sys
import tempfile
import unittest
class SetupStack(object):
def __init__(self):
self._on_teardown = []
def add_teardown(self, teardown):
self._on_teardown.append(teardown)
def tear_down(self):
for func in reversed(self._on_teard... | Python | 0.000001 | @@ -39,19 +39,8 @@
ess%0A
-import sys%0A
impo
|
4eb71abf71823a5a065d1b593ca8b624d17a35c9 | prepare for 1.6 | src/pyckson/__init__.py | src/pyckson/__init__.py | from pyckson.decorators import *
from pyckson.json import *
from pyckson.parser import parse
from pyckson.parsers.base import Parser
from pyckson.serializer import serialize
from pyckson.serializers.base import Serializer
from pyckson.dates.helpers import configure_date_formatter
__version__ = '1.5'
| Python | 0.000001 | @@ -296,7 +296,7 @@
'1.
-5
+6
'%0A
|
00812b21b2a86f0b17888c32de0fc8d65b44510f | Use multiple info | manager/operation.py | manager/operation.py | from manager.models import Package, Build
import lib.aur as aur
import lib.pacman.sync as sync
import lib.pacman.upgrade as upgrade
import itertools
import shutil
import os.path
from packager.settings import BUILD_ROOT_DIR
from packager.manager import BuilderManager
import packager.path
class OperationError(Exception... | Python | 0 | @@ -2611,32 +2611,56 @@
ystem_upgrade()%0A
+ need_check = list()%0A
for package
@@ -3010,32 +3010,85 @@
UCCESS:%0A
+ need_check.append(latest)%0A if need_check:%0A
info = a
@@ -3087,61 +3087,202 @@
info
+s
= aur.
-info(package.name)%0A if not info
+multiple_info(m... |
63ae7b4caf877cb043b2c2d4861e6ab5bb5f5390 | fix flake8 | memote/suite/runner.py | memote/suite/runner.py | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | Python | 0 | @@ -2767,10 +2767,18 @@
ngs=
-%7B%22
+dict(%0A
defa
@@ -2788,11 +2788,9 @@
_map
-%22:
+=
Conf
@@ -2822,9 +2822,10 @@
ig()
-%7D
+%0A)
)%0A@c
|
3fc6a711146afa79794ec884f560f1ea43e4565a | Update the latest version | src/site/sphinx/conf.py | src/site/sphinx/conf.py | # -*- coding: utf-8 -*-
import sys, os, re
import xml.etree.ElementTree as etree
from datetime import date
from collections import defaultdict
def etree_to_dict(t):
t.tag = re.sub(r'\{[^\}]*\}', '', t.tag)
d = {t.tag: {} if t.attrib else None}
children = list(t)
if children:
dd = defaultdict(li... | Python | 0 | @@ -1246,17 +1246,17 @@
e = '0.1
-8
+9
.0.Final
@@ -1275,17 +1275,17 @@
n = '0.1
-8
+9
'%0Aelse:%0A
|
521c71c38d4e6edc242afb76daf330d9aec8e9ff | remove ipdb | scripts/dataverse/connect_external_accounts.py | scripts/dataverse/connect_external_accounts.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
from website.addons.dataverse.model import AddonDataverseNodeSettings
logger = logging... | Python | 0.000016 | @@ -509,48 +509,8 @@
ngs%0A
- # import ipdb; ipdb.set_trace()%0A
|
9cdd86499013c1deac7caeb8320c34294789f716 | Add _kill_and_join to async actor stub | py/garage/garage/asyncs/actors.py | py/garage/garage/asyncs/actors.py | """Asynchronous support for garage.threads.actors."""
__all__ = [
'StubAdapter',
]
from garage.asyncs import futures
class StubAdapter:
"""Wrap all method calls, adding FutureAdapter on their result.
While this simple adapter does not work for all corner cases, for
common cases, it should work fine... | Python | 0.000001 | @@ -1124,8 +1124,140 @@
future)%0A
+%0A async def _kill_and_join(self, graceful=True):%0A self._kill(graceful=graceful)%0A await self._get_future().result()%0A
|
16381d4fafe743c3feb1de7ec27b6cbf95f617f1 | Add state and conf to interactive namespace by default | pyexperiment/utils/interactive.py | pyexperiment/utils/interactive.py | """Provides helper functions for interactive prompts
Written by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
def embed_interactive(**kwargs):
"""Embed an interactive terminal into a running py... | Python | 0 | @@ -225,16 +225,77 @@
import%0A%0A
+from pyexperiment import state%0Afrom pyexperiment import conf%0A
%0Adef emb
@@ -395,16 +395,138 @@
%22%22%22%0A
+ if not 'state' in kwargs:%0A kwargs%5B'state'%5D = state%0A if not 'conf' in kwargs:%0A kwargs%5B'conf'%5D = conf%0A%0A
try:
|
6cd34697334ddd8ada1daeee9a2c8b9522257487 | Remove unused function | pyramda/iterable/for_each_test.py | pyramda/iterable/for_each_test.py |
try:
# Python 3
from unittest import mock
except ImportError:
# Python 2
import mock
from .for_each import for_each
def print_x_plus_5(x):
print(x + 5)
def test_for_each_nocurry_returns_the_original_iterable():
assert for_each(mock.MagicMock(), [1, 2, 3]) == [1, 2, 3]
def test_for_each_c... | Python | 0.000004 | @@ -1,9 +1,8 @@
-%0A
try:%0A
@@ -132,50 +132,8 @@
h%0A%0A%0A
-def print_x_plus_5(x):%0A print(x + 5)%0A%0A%0A
def
|
d46eb3b0103a41568284fffeb2acadedd95561bb | Update Monitor.py to allow for custom "Unknown command." message | mk2/plugins/monitor.py | mk2/plugins/monitor.py | from mk2.plugins import Plugin
from mk2.events import ServerOutput, StatPlayerCount, ServerStop, ServerEvent, Event
class Check(object):
alive = True
timeout = 0
time = 0
warn = 0
def __init__(self, parent, **kw):
self.dispatch = parent.dispatch
self.console = parent.console
... | Python | 0 | @@ -2080,24 +2080,161 @@
y(default=0)
+%0A crash_unknown_cmd_message = Plugin.Property(default=%22Unknown command.*%22)%0A crash_check_command = Plugin.Property(default=%22%22)
%0A%0A oom_en
@@ -5197,27 +5197,38 @@
ern=
-'Unknown command.*'
+self.crash_unknown_cmd_message
,%0A
@@ -5290,10 +5290,32 ... |
4f2b7e5601e9f241868f86743eacb0e432be7495 | fix settings of cache in UT | source/jormungandr/tests/integration_tests_settings.py | source/jormungandr/tests/integration_tests_settings.py | # encoding: utf-8
START_MONITORING_THREAD = False
SAVE_STAT = True
# désactivation de l'authentification
PUBLIC = True
LOGGER = {
'version': 1,
'disable_existing_loggers': False,
'formatters':{
'default': {
'format': '[%(asctime)s] [%(levelname)5s] [%(process)5s] [%(name)10s] %(messag... | Python | 0 | @@ -652,9 +652,62 @@
%7D%0A%7D%0A%0A
+CACHE_CONFIGURATION = %7B%0A 'CACHE_TYPE': 'null'%0A%7D%0A%0A%0A
%0A
|
488c363227434b44efe58d13e38020b9c76c600f | Fix CPT test for tag branch (#333) | cpt/test/test_client/upload_checks_test.py | cpt/test/test_client/upload_checks_test.py | import unittest
import os
import zipfile
from conans.client.tools import environment_append
from conans.test.utils.tools import TestClient, TestServer
from cpt.test.test_client.tools import get_patched_multipackager
class UploadTest(unittest.TestCase):
conanfile = """from conans import ConanFile
class Pkg(Cona... | Python | 0.000013 | @@ -3217,24 +3217,72 @@
Y_WHEN_TAG%22:
+ %221%22,%0A %22TRAVIS%22:
%221%22%7D):%0A%0A
|
4697a7677aecaab4135e483c30e9fc6cc780fcca | test skipped as experimental without street network. | source/jormungandr/tests/routing_tests_experimental.py | source/jormungandr/tests/routing_tests_experimental.py | # Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | Python | 0 | @@ -3917,534 +3917,117 @@
-def test_sp_to_sp(self):%0A %22%22%22%0A Test journeys from stop point to stop point without street network%0A %22%22%22%0A query = %22journeys?from=stop_point:uselessA&to=stop_point:B&datetime=20120615T080000%22%0A%0A # with street network desactivate... |
8552bccb91755c3a69d1435976cfeffef1e1137e | handle exceptions, fix #169 | src/you_get/downloader/coursera.py | src/you_get/downloader/coursera.py | #!/usr/bin/env python
__all__ = ['coursera_download']
from ..common import *
def coursera_login(user, password, csrf_token):
url = 'https://www.coursera.org/maestro/api/user/login'
my_headers = {
'Cookie': ('csrftoken=%s' % csrf_token),
'Referer': 'https://www.coursera.org',
'X-CSRFTo... | Python | 0.000002 | @@ -3087,24 +3087,41 @@
l)%0A %0A
+ try:%0A
if e
@@ -3137,32 +3137,36 @@
4':%0A
+
+
download_urls(%5Br
@@ -3228,24 +3228,28 @@
ge)%0A
+
else:%0A
@@ -3246,32 +3246,36 @@
se:%0A
+
+
download_url_chu
@@ -3334,24 +3334,139 @@
ge = merge)%0... |
6683afcbe771f6dd72faaf4070a4e7c8e19d2919 | Handle incorrect data with sismos API | modules/info/sismos.py | modules/info/sismos.py | from datetime import datetime
from discord import Embed
from bot import Command, categories
from bot.utils import pat_channel, format_date
from bot.libs.configuration import ServerConfig
class Sismos(Command):
__version__ = '1.0.1'
__author__ = 'makzk'
cfg_channel_name = 'sismos_channel'
api_url = 'h... | Python | 0.000003 | @@ -2396,24 +2396,161 @@
t r.json()%0A%0A
+ if not isinstance(data, list) or len(data) == 0:%0A self.log.debug('No data retrieved')%0A return%0A%0A
@@ -2780,17 +2780,16 @@
%5B'id'%5D:%0A
-%0A
|
26c4effd8741d2511bb0b3bd46cca12d37b0e01b | Add file magic | examples/python/scheme_timer.py | examples/python/scheme_timer.py | """
Checks the execution time of repeated calls to the Scheme API from Python
Runs an empty Scheme command NUMBER_OF_ITERATIONS times and displays the
total execution time
"""
__author__ = 'Cosmo Harrigan'
NUMBER_OF_ITERATIONS = 100
from opencog.atomspace import AtomSpace, TruthValue, types, get_type_name
from open... | Python | 0.000001 | @@ -1,12 +1,36 @@
+#! /usr/bin/env python%0A%0A
%22%22%22%0AChecks t
|
075e7ea4e6be57cb618fcc26484456bf24db99c9 | add button for pyjd to load slides | examples/slideshow/Slideshow.py | examples/slideshow/Slideshow.py | from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Hyperlink import Hyperlink
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.ScrollPanel import... | Python | 0 | @@ -1,24 +1,37 @@
+import pyjd%0A%0A
from pyjamas.ui.Button i
@@ -520,16 +520,85 @@
stLoader
+%0Afrom pyjamas.Timer import Timer%0Afrom pyjamas.ui.Button import Button
%0A%0Aclass
@@ -972,33 +972,44 @@
-%0A self.loadSinks()
+self.b=Button(%22load%22, self)%0A
%0A
@@ -1864,16 +1864,417 @@
f... |
9f1a4977e34dc01a0489655df826b63b84f7d3be | Use SunPy sample data for Solar Cycle example. | examples/solar_cycle_example.py | examples/solar_cycle_example.py | """
===============
The Solar Cycle
===============
This example shows the current and possible next solar cycle.
"""
import datetime
import matplotlib.pyplot as plt
import sunpy.lightcurve as lc
###############################################################################
# Let's download the latest data from NOA... | Python | 0 | @@ -190,16 +190,93 @@
ve as lc
+%0Afrom sunpy.data.sample import NOAAINDICES_LIGHTCURVE, NOAAPREDICT_LIGHTCURVE
%0A%0A######
@@ -355,49 +355,191 @@
#%0A#
-Let's download the latest data from NOAA.
+For this example we will use the SunPy sample data, if you want the current%0A# data, delete the argument to the %60%6... |
0ac3750c2b8d0fc978c076604db3bfee1a47708f | allow name param to name tab widgets | examples/tabpanelwidget/Tabs.py | examples/tabpanelwidget/Tabs.py | import pyjd # dummy in pyjs
from pyjamas.ui.TabBar import TabBar
from pyjamas.ui.TabPanel import TabPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Image import Image
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HorizontalPanel import Horizonta... | Python | 0 | @@ -1584,18 +1584,59 @@
g%22),
- red, True
+%0A red, True, name=%22johannes%22
)%0A
@@ -1711,20 +1711,57 @@
g%22),
- green, True
+%0A green, True, name=%22self%22
)%0A
@@ -1836,14 +1836,55 @@
g%22),
- %221642
+%0A %221642%22, name=%22lamarche... |
858e9f91e042a0fc1143e300e4e883b43d17a346 | FIX : get_config raises redirect after try-except block | bidder_gateway.py | bidder_gateway.py | import sys
import shutil
import os
import logging
import pickle
import subprocess
from bottle import Bottle, run, urljoin, HTTPResponse, request
AGENT_CONFIG_SERVER = 'http://127.0.0.1:9985'
# agent pickle file path
pickle_path = '.bidders'
# agent base path
exec_base_path = '/home/nemi/workspace/test/daemon'
# se... | Python | 0 | @@ -1137,70 +1137,8 @@
'%5D)%0A
- raise HTTPResponse(%22%22, status=302, Location=location)%0A
@@ -1296,20 +1296,70 @@
%7D%0A
-
+raise HTTPResponse(%22%22, status=302, Location=location)%0A
%0A@app.po
|
78ef7be3f97a8189a845ace2380ce8dfc8a4c531 | improve TypeError messages with invalid slices | bidict/_common.py | bidict/_common.py | from .compat import PY2, iteritems, viewitems
from .util import pairs
from collections import Mapping
class BidirectionalMapping(Mapping):
"""
Mutable and immutable bidict types extend this class,
which implements all the shared logic.
Users typically won't need to touch this.
"""
def __init__... | Python | 0 | @@ -1618,31 +1618,18 @@
-start_missing =
+if
slice.s
@@ -1633,28 +1633,33 @@
e.st
-art
+ep
is
+not
None
-%0A
+:%0A
star
@@ -1658,60 +1658,75 @@
-start_found = not start_missing%0A stop_missing
+ raise TypeError('Slice may not specify step')%0A none_start
= s
@@ -173... |
ac477a9d73a60551678f31e34b4f4527fc330a04 | Update affected tests (sensor_wrapper already registers the options). | st2tests/st2tests/config.py | st2tests/st2tests/config.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | Python | 0 | @@ -1043,16 +1043,30 @@
reset()%0A
+%0A try:%0A
_reg
@@ -1081,24 +1081,194 @@
nfig_opts()%0A
+ except Exception:%0A # Some scripts register the options themselves which means registering them again will%0A # cause a non-fatal exception%0A return%0A
_overrid
|
23cc84147f52cd4036398200916e68bd0f078050 | Fix print statemenet | stationspinner/evecentral/tasks.py | stationspinner/evecentral/tasks.py | from stationspinner.celery import app
from celery import chord
from stationspinner.evecentral.models import Market, MarketItem
from stationspinner.libs.pragma import get_location_name
from stationspinner.sde.models import InvType
from stationspinner.settings import STATIC_ROOT
from evelink.thirdparty.eve_central import... | Python | 0.99991 | @@ -1892,18 +1892,93 @@
-print item
+log.debug('Failed to render csv row for %7B0%7D at %7B1%7D.'.format(item, market.locationID))
%0A%0A%0A%0A
|
df69d04b468bfa74419fc6715bdef30e38374b1b | Reword message when trying to stage on an unnamed buffer | core/commands/inline_stage_hunk.py | core/commands/inline_stage_hunk.py | from collections import namedtuple
from itertools import chain
import re
import sublime
from sublime_plugin import TextCommand
from ..fns import accumulate, filter_, unique
from ..git_command import GitCommand
from ..parse_diff import SplittedDiff
__all__ = (
"gs_inline_stage_hunk",
)
MYPY = False
if MYPY:
... | Python | 0 | @@ -1089,16 +1089,19 @@
t stage
+on
unnnamed
@@ -1101,20 +1101,22 @@
nnnamed
-file
+buffer
s.%22)%0A
|
ca57e29c15ad02dee3cdad0d2159cbe33c15d6e0 | fix expire cache | corehq/apps/app_manager/signals.py | corehq/apps/app_manager/signals.py | from __future__ import absolute_import
from __future__ import unicode_literals
from django.dispatch.dispatcher import Signal
from corehq.apps.callcenter.app_parser import get_call_center_config_from_app
from corehq.apps.domain.models import Domain
from dimagi.utils.logging import notify_exception
def create_app_stru... | Python | 0.000001 | @@ -1702,16 +1702,22 @@
_version
+.clear
(applica
|
55c0d8912750ad8ddc702213c340c02d10638640 | Test function | corehq/apps/sms/tests/test_util.py | corehq/apps/sms/tests/test_util.py | #!/usr/bin/env python
from django.test import TestCase
from corehq.apps.hqcase.utils import update_case
from corehq.apps.sms.mixin import apply_leniency
from corehq.apps.sms.util import (
ContactNotFoundException,
clean_phone_number,
get_contact,
is_contact_active,
)
from corehq.apps.users.models impor... | Python | 0.000006 | @@ -49,16 +49,66 @@
stCase%0A%0A
+from nose.tools import assert_false, assert_true%0A%0A
from cor
@@ -326,16 +326,48 @@
active,%0A
+ is_superuser_or_contractor,%0A
)%0Afrom c
@@ -409,16 +409,27 @@
CareUser
+, CouchUser
%0Afrom co
@@ -596,16 +596,30 @@
est_case
+, flag_enabled
%0A%0A%0Aclass
@@ -3059,16 +3059... |
4f0d43f3c451a4059a2931ec771a8d796396250e | fasta2imgt converts to upper | bin/fasta2imgt.py | bin/fasta2imgt.py | #! /usr/bin/env python
import sys
import optparse
from Bio import SeqIO
from Bio.Alphabet import generic_dna
import vdj
parser = optparse.OptionParser()
(options, args) = parser.parse_args()
if len(args) == 2:
inhandle = open(args[0],'r')
outhandle = open(args[1],'w')
elif len(args) == 1:
inhandle = op... | Python | 0.999999 | @@ -577,16 +577,24 @@
n(record
+.upper()
)%0A pr
|
9ebf03ddcba26054824547f6d1094ba9fb37a030 | Restructure the create_permission signal handler to perform fewer SQL queries, this speeds up the test suite dramatically. | django/contrib/auth/management/__init__.py | django/contrib/auth/management/__init__.py | """
Creates permissions for all installed apps that need permissions.
"""
from django.db.models import get_models, signals
from django.contrib.auth import models as auth_app
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retur... | Python | 0.000002 | @@ -84,25 +84,28 @@
ngo.
-db.models
+contrib.auth
import
get_
@@ -104,27 +104,26 @@
ort
-get_
models
-, signals
+ as auth_app
%0Afro
@@ -131,36 +131,33 @@
django.
-contrib.auth
+db.models
import
models a
@@ -148,34 +148,36 @@
import
+get_
models
- as auth_app
+, signals%0A
%0A%0Adef _g
@@ -752,16 +7... |
8431458f7f18ec0dde86d46ec18dbdb61412f8ef | bump version | blaze/__init__.py | blaze/__init__.py | from __future__ import absolute_import, division, print_function
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
inf = float('inf')
nan = float('nan')
__version__ = '0.4.2-dev'
# If IPython is already loaded, register the Blaze catalog magic
# from . impo... | Python | 0 | @@ -229,11 +229,11 @@
'0.
-4.2
+6.0
-dev
|
dc9071a9574d435cead5b54355d237c7cfe679d1 | handle datetime in encoder | bokeh/protocol.py | bokeh/protocol.py | import uuid
import json
import logging
import time
from six.moves import cPickle as pickle
import numpy as np
import pandas as pd
log = logging.getLogger(__name__)
"""
serialization functions for rpc server, we serialize json messages,
as well as python data, which are lists of numpy arrays.
msg serialization one obj... | Python | 0.000002 | @@ -1443,16 +1443,126 @@
ifactor%0A
+ elif isinstance(obj, (dt.datetime, dt.date)):%0A return time.mktime(obj.timetuple()) * 1000.%0A
|
f794817bf62c8f92a6d7d9e55e13866dc63df7ba | Fix issue #7 | botbot/checker.py | botbot/checker.py | import stat, os
from . import problems
class Checker:
"""
Holds a set of checks that can be run on a file to make sure that
it's suitable for the shared directory. Runs checks recursively on a
given path.
"""
# checks is a set of all the checking functions this checker knows of. All
# che... | Python | 0 | @@ -2963,16 +2963,57 @@
fastq%22:%0A
+ if not os.path.islink(path):%0A
@@ -3047,30 +3047,17 @@
S_FASTQ%0A
- else:%0A
+%0A
retu
|
a7b9c9a120aebe270ea200f3be0b2d3468f911cf | Bump version | modelqueryform/__init__.py | modelqueryform/__init__.py | __version__ = "2.1"
| Python | 0 | @@ -14,7 +14,7 @@
%222.
-1
+2
%22%0A
|
ed360f5d896593f2646037c1b2028d8a5552a2d2 | fix test import data | tests/case_manager/test_case_data_manager.py | tests/case_manager/test_case_data_manager.py | # @Time : 2016/9/1 21:04
# @Author : lixintong
import datetime
import os
import unittest
from uitester.case_manager.case_data_manager import CaseDataManager
class TestCaseDataManager(unittest.TestCase):
def setUp(self):
self.case_data_manager = CaseDataManager()
self.package_name = ''
de... | Python | 0 | @@ -1936,24 +1936,28 @@
%5D)%0A%0A
+
self.assertT
|
4d40e9db4bd6b58787557e8d5547f69eb67c9b96 | Add additional coverage to author build list | tests/changes/api/test_author_build_index.py | tests/changes/api/test_author_build_index.py | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | Python | 0 | @@ -518,25 +518,31 @@
ail=
-'foo@example.com'
+self.default_user.email
, na
@@ -650,16 +650,16 @@
uthor)%0A%0A
-
@@ -906,8 +906,281 @@
.id.hex%0A
+%0A self.login(self.default_user)%0A%0A path = '/api/0/authors/me/builds/'%0A%0A resp = self.client.get(path)%0A assert resp.status... |
03aebd7eff51be1847866d9920b8520cee72348f | fix failure in test_global_pinger_memo | tests/python/pants_test/cache/test_pinger.py | tests/python/pants_test/cache/test_pinger.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import threading
imp... | Python | 0.000017 | @@ -2253,32 +2253,38 @@
elf.slow_seconds
+ - .01
, tries=2)%0A s
|
932fccc77fb10ece61c3feeb47a28225216c7c0d | add two more authors for gemeinfrei_2021.py | service/ws_re/scanner/tasks/gemeinfrei_2021.py | service/ws_re/scanner/tasks/gemeinfrei_2021.py | import pywikibot
from service.ws_re.register.authors import Authors
from service.ws_re.scanner.tasks.base_task import ReScannerTask
from service.ws_re.template.article import Article
from tools.bots.pi import WikiLogger
class GF21Task(ReScannerTask):
def __init__(self, wiki: pywikibot.Site, logger: WikiLogger, d... | Python | 0 | @@ -1014,16 +1014,51 @@
Bannert%22
+, %22Adolf Wilhelm%22, %22Wilhelm Schmid%22
):%0A
|
6a7d7393d90c1a10071b392d24431af1111a0824 | clean up | streamteam/dynamics/plot.py | streamteam/dynamics/plot.py | # coding: utf-8
""" ...explain... """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import matplotlib.pyplot as plt
import numpy as np
__all__ = ['plot_orbits']
def plot_orbits(w, ix=None, axes=None, triangle=False, *... | Python | 0.000001 | @@ -273,17 +273,17 @@
_orbits(
-w
+x
, ix=Non
@@ -339,13 +339,1022 @@
-TODO:
+Given time series of positions, %60x%60, make nice plots of the orbit in%0A cartesian projections.%0A%0A Parameters%0A ----------%0A x : array_like%0A Array of positions. The last axis (%60axis=-1%60) is assumed%0A ... |
d56382a87068e7d43b3333b6ea3dc2fd0a80d929 | Use dict instead of list | 10-disambiguate.py | 10-disambiguate.py | #!/usr/bin/env python
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
import csv
import gc
import sys
from collections import defaultdict
from sklearn.feature_extraction import DictVectorizer
from sklearn.metrics.pairwise import cosine_similarity as sim
from operator import itemgetter
from multip... | Python | 0.000001 | @@ -1131,16 +1131,17 @@
atures)%0A
+%0A
@@ -1236,18 +1236,16 @@
ghbours
-
= wsi%5Bne
@@ -1280,19 +1280,16 @@
tes
- = %5B(
+= %7B
nsid
-,
+:
sim
@@ -1335,17 +1335,16 @@
.item(0)
-)
for nsi
@@ -1358,17 +1358,17 @@
ighbours
-%5D
+%7D
%0A
@@ -1372,20 +1372,17 @@
-nsid
+_
, cosin... |
c7af9fc8a512e9dfffb456fbb7af7d099b36436d | add logging conf | memopol2/settings.py | memopol2/settings.py | # Django settings for memopol2 project.
import os
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# those emails are used as the contact form recipient
ADMINS = (
('memopol', 'contact@lqdn.fr'),
)
MANAGERS = ADMINS
DEFAULT_FROM_EMAIL='memopol@lqdn.fr'
DATABASES =... | Python | 0 | @@ -4220,16 +4220,626 @@
n.org%22%0A%0A
+# See http://docs.djangoproject.com/en/dev/topics/logging for%0A# more details on how to customize your logging configuration.%0ALOGGING = %7B%0A 'version': 1,%0A 'disable_existing_loggers': True,%0A 'handlers': %7B%0A 'console': %7B%0A 'level': 'WARN... |
f129d3ae3b81a59ea04103cc214a6f1893d4420a | Return also _id | app/mapproxy_webconf/storage.py | app/mapproxy_webconf/storage.py | import errno
import inspect
import os
import sqlite3
import yaml
import json
from bottle import PluginError
from mapproxy_webconf import utils
class YAMLStorePlugin(object):
name = 'yamlstore'
def __init__(self, storage_dir, keyword='storage'):
self.storage = YAMLStore(storage_dir)
self.key... | Python | 0.001708 | @@ -4767,16 +4767,52 @@
data'%5D)%0A
+ data%5B'_id'%5D = row%5B'id'%5D%0A
|
70197850e6ab2df07ccb2c3463b1912c087255eb | Update forward compatibility horizon to 2020-11-13 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. 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 required by applica... | Python | 0 | @@ -1446,17 +1446,17 @@
0, 11, 1
-2
+3
)%0A_FORWA
|
82dd23f64b9617db7b333c51f20a314777c6e22c | Update forward compatibility horizon to 2022-08-05 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. 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 required by applica... | Python | 0 | @@ -1338,9 +1338,9 @@
8,
-4
+5
)%0A_F
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.