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
4c547687662f7ea2a12d876291adb6e0bed85fc8
Fix database relationships
database.py
database.py
# # database.py # # set up and manage a database for storing data between sessions # from sqlalchemy import Column, ForeignKey, Integer, String, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy.orm import sessio...
Python
0.000003
@@ -634,16 +634,19 @@ owner +.id = Colum @@ -671,32 +671,97 @@ Key('users.id')) +%0A owner = relationship(User, backref('servers', uselist=True)) %0A%0Aclass Role(Bas @@ -884,32 +884,35 @@ alse)%0A server +.id = Column(Intege @@ -935,24 +935,90 @@ ervers.id')) +%0A server = relationship(Server, bac...
3b31d4538b3bd0ac3ee0708b5e67c2ecb6623c09
Allow merging when having duplicated keys
systrace/systrace/output_generator.py
systrace/systrace/output_generator.py
#!/usr/bin/env python # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import gzip import json import os import StringIO from systrace import tracing_controller from systrace import trace_re...
Python
0
@@ -5086,29 +5086,33 @@ or -str(key) in json_data +not merged_data%5Bstr(key)%5D :%0A
d017c2a2e09d043caecd555217a399453c7e60b8
fix migration imports
eventstore/migrations/0050_askfeedback.py
eventstore/migrations/0050_askfeedback.py
# Generated by Django 2.2.24 on 2021-12-07 06:26 import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.utils.timezone import uuid class Migration(migrations.Migration): dependencies = [("eventstore", "0049_auto_20211202_1220")] operations = [ migrations....
Python
0.000001
@@ -43,16 +43,29 @@ 06:26%0A%0A +import uuid%0A%0A import d @@ -100,16 +100,45 @@ s.jsonb%0A +import django.utils.timezone%0A from dja @@ -174,49 +174,8 @@ els%0A -import django.utils.timezone%0Aimport uuid%0A %0A%0Acl
daed646ff987bc86b333a995bac1283360a583ef
bump up version to 0.1.2
src/javactl/__init__.py
src/javactl/__init__.py
__version__ = '0.1.1'
Python
0.000007
@@ -12,11 +12,11 @@ = '0.1. -1 +2 '%0A
fce501b446d2a4133a244f86653bdc683f4f03de
test project manager using initial DB & validation code added
buildbuild/projects/tests/test_project_manager.py
buildbuild/projects/tests/test_project_manager.py
from django.test import TestCase from projects.models import Project from teams.models import Team from django.db import IntegrityError from django.core.exceptions import ValidationError class TestProjectName(TestCase): def setUp(self): self.name = "test_project_name" self.second_name = "test_secon...
Python
0
@@ -214,16 +214,56 @@ tCase):%0A + fixtures = %5B'properties_data.yaml'%5D%0A def @@ -477,16 +477,23 @@ elf.lang +_python = %22pyth @@ -512,16 +512,27 @@ self.ver +_python_278 = %222.7. @@ -961,26 +961,48 @@ s = -('python','2.7.8') +%7Bself.lang_python : self.ver_python_278%7D %0A @@ -1074,34 +107...
be778b351e6b6af18a786265851142a1b9dd420a
remove erroneous quotes in isinstance()
networkx/classes/labeledgraph.py
networkx/classes/labeledgraph.py
from graph import Graph from digraph import DiGraph from networkx.exception import NetworkXException, NetworkXError import networkx.convert as convert class LabeledGraph(Graph): def __init__(self, data=None, name='', weighted=True): super(LabeledGraph,self).__init__(data,name,weighted) # node label...
Python
0.000042
@@ -378,14 +378,12 @@ bel, -' dict -' ):%0A
490b888f052476ddd667e4ccd609618b4160953b
Add the vulcan-mgmt VLAN type
lib/python2.6/aquilon/aqdb/model/vlan.py
lib/python2.6/aquilon/aqdb/model/vlan.py
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2010,2011,2012,2013 Contributor # # 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 Li...
Python
0.996919
@@ -1262,16 +1262,31 @@ unknown' +, 'vulcan-mgmt' )%0A%0A_VTN
8e6f080a55e91f14122c2a0a36cb15cf566769b4
use CommunicationChannel0 in AlphaTwirl.py
AlphaTwirl/AlphaTwirl.py
AlphaTwirl/AlphaTwirl.py
# Tai Sakuma <tai.sakuma@cern.ch> import argparse import sys import os import itertools from Configure import TableConfigCompleter from Configure import EventReaderCollectorAssociatorBuilder from HeppyResult import ComponentReaderComposite from HeppyResult import ComponentLoop from HeppyResult import HeppyResult from ...
Python
0
@@ -597,16 +597,63 @@ Channel%0A +from Concurrently import CommunicationChannel0%0A from Pro @@ -680,16 +680,16 @@ ressBar%0A - from Pro @@ -1307,372 +1307,8 @@ gs%0A%0A -##__________________________________________________________________%7C%7C%0Adef buildEventLoopRunner(progressMonitor, communicationChannel, pro...
c6453752f9630a760cd2b2508d9ba39413871d86
Update SensorMotorTest.py
04Dan/SensorMotorTest.py
04Dan/SensorMotorTest.py
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) ##GPIO.setup(18, GPIO.OUT) servo ##GPIO.setup(22, GPIO.OUT) motor GPIO.setup(16, GPIO.IN) ##button try: while True: i = GPIO.input(16) print(i) delay(1000) except Keyboardinterupt: GPIO.cleanup()
Python
0
@@ -234,16 +234,17 @@ ardinter +r upt:%0A G
c3ecc4a06a212da11f52c9c0cd5c7b5c8d500516
Support -h/--help on createdb.py
createdb.py
createdb.py
#!/usr/bin/env python import sys import fedmsg.config import fmn.lib.models config = fedmsg.config.load_config() uri = config.get('fmn.sqlalchemy.uri') if not uri: raise ValueError("fmn.sqlalchemy.uri must be present") session = fmn.lib.models.init(uri, debug=True, create=True) if '--with-dev-data' in sys.argv:...
Python
0
@@ -219,16 +219,119 @@ sent%22)%0A%0A +if '-h' in sys.argv or '--help'in sys.argv:%0A print %22createdb.py %5B--with-dev-data%5D%22%0A sys.exit(0)%0A%0A session
29205582e07eaa8b28eea4b0691a9556d0999015
Remove unused LoginForm
src/keybar/web/forms.py
src/keybar/web/forms.py
from django.utils.translation import ugettext_lazy as _ from django.contrib import auth import floppyforms.__future__ as forms from keybar.models.user import User class RegisterForm(forms.ModelForm): name = forms.CharField(label=_('Your name'), widget=forms.TextInput( attrs={'placeholder': _(...
Python
0.000001
@@ -461,1013 +461,4 @@ l')%0A -%0A%0Aclass LoginForm(forms.Form):%0A email = forms.EmailField(label=_('Email'))%0A password = forms.CharField(label=_('Password'), widget=forms.PasswordInput)%0A%0A error_messages = %7B%0A 'invalid_login': _('Please enter a correct email and password. '%0A ...
e139537de43ade6549c790332f41b586aed4f63c
Put generated .c files in intermediate dir so this test can be compatible with change to detect duplicate sources.
test/actions-multiple/src/actions.gyp
test/actions-multiple/src/actions.gyp
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { # Have a long string so that actions will exceed xp 512 character # command limit on xp. 'long_string': 'abcdefghijklmnopqrs...
Python
0.000001
@@ -3025,32 +3025,52 @@ %5B%0A ' +%3C(INTERMEDIATE_DIR)/ output1.c',%0A @@ -3061,24 +3061,24 @@ output1.c',%0A - %5D, @@ -3195,32 +3195,33 @@ ar', 'foo.c', '%3C +@ (_outputs)',%0A @@ -3501,32 +3501,52 @@ %5B%0A ' +%3C(INTERMEDIATE_DIR)/ output2.c',%0A @@ -3671,32 +36...
e498d8e91cb421665ea7f28c7113a9fc33548d29
add timeout
test/functional/feature_asset_zdag.py
test/functional/feature_asset_zdag.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
Python
0.000015
@@ -3572,16 +3572,18 @@ ST_DELAY ++1 )%0A
2626b5dbfe91a6b8fee7beab370e60a5a474c699
Add my implementation of kind()
CS212/Lesson-01/poker.py
CS212/Lesson-01/poker.py
# # In the first Lesson of the class we are attempting to # build a Poker program. # def poker(hands): "Return the best hand: poker([hand,...]) => hand" return max(hands, key=hand_rank) def hand_rank(hand): ranks = card_ranks(hand) if straight(ranks) and flush(hand): # straight flush ...
Python
0
@@ -1787,16 +1787,339 @@ == 1%0A%0A%0A +def kind(n, ranks):%0A %22%22%22Return the first rank that this hand has exactly n of.%0A Return None if there is no n-of-a-kind in the hand.%22%22%22%0A%0A last = None%0A count = 0%0A%0A for rank in ranks:%0A if last != rank:%0A if count == n: return last%0A ...
8d8002062a0ecbf3720870d7561670a8c7e98da2
Fix test for auth tokens store
test/stores/test_auth_tokens_store.py
test/stores/test_auth_tokens_store.py
from test.base import ApiTestCase from zou.app.stores import auth_tokens_store class CommandsTestCase(ApiTestCase): def setUp(self): super(CommandsTestCase, self).setUp() self.store = auth_tokens_store self.store.clear() def tearDown(self): self.store.clear() def test_g...
Python
0.000002
@@ -1069,23 +1069,50 @@ f.assert -Equals( +True(%22key-1%22 in self.store.keys()) %0A @@ -1116,56 +1116,50 @@ - self. -store.keys(), %5B%22key-1%22, %22key-2%22%5D%0A +assertTrue(%22key-2%22 in self.store.keys() )%0A
7f43dfc790e9f7d18a31513ab739391b264fa12d
Fix new version check
testcases/cloud_admin/upgrade_euca.py
testcases/cloud_admin/upgrade_euca.py
#!/usr/bin/env python # # # Description: This script upgrades a Eucalyptus cloud import re from eucaops import Eucaops from eutester.euservice import Euservice from eutester.eutestcase import EutesterTestCase class Upgrade(EutesterTestCase): def __init__(self, extra_args= None): self.setuptestcase() ...
Python
0.000001
@@ -2564,21 +2564,16 @@ ersion, -self. new_vers
639a692bc06cf31b5feb1d990740976884f88a0c
Fix key format (?)
testlog_etl/transforms/jscov_to_es.py
testlog_etl/transforms/jscov_to_es.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/. # # Author: Trung Do (chin.bimbo@gmail.com) # from __future__ import division from __future__ import ...
Python
0.00006
@@ -1799,16 +1799,66 @@ etl, j)%0A + key = dest_key + %22.%22 + unicode(j)%0A @@ -2262,21 +2262,16 @@ (%7B%22id%22: -dest_ key, %22va @@ -2315,21 +2315,16 @@ .append( -dest_ key)%0A%0A
d4f2fadd94603eea2c15f5bb8a2a7d29c0d39ed0
Hello David
CreateM3Us/CreateM3Us.py
CreateM3Us/CreateM3Us.py
import os incomingDirectory = 'C:\\temp' for subdir, dirs, files in os.walk(incomingDirectory): for file in files: #print os.path.join(subdir, file) filepath = subdir + os.sep + file print (filepath) # File input/output # https://www.digitalocean.com/community/tutorials/how-t...
Python
0.999971
@@ -94,16 +94,38 @@ ectory): + #What does is.walk do %0D%0A fo
62bb2ed7c32fe7af668584ea4d5845cedb923d13
Add with-items use case to mistral integration tests
st2tests/integration/mistral/test_wiring.py
st2tests/integration/mistral/test_wiring.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
@@ -3742,24 +3742,351 @@ is cool!')%0A%0A + def test_with_items(self):%0A params = %7B'cmd': 'date', 'count': 8%7D%0A execution = self._execute_workflow('examples.mistral-repeat', params)%0A execution = self._wait_for_completion(execution)%0A self._assert_success(execution)%0A sel...
7050f13a5cda372d3fc003991981b04700114f52
Add volume cleanup to test_volume_transfer test
tempest/api/volume/test_volume_transfers.py
tempest/api/volume/test_volume_transfers.py
# Copyright 2013 OpenStack Foundation # 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 requ...
Python
0.000005
@@ -2486,16 +2486,278 @@ client%0A%0A + def _delete_volume(self, volume_id):%0A # Delete the specified volume using admin creds%0A resp, _ = self.adm_client.delete_volume(volume_id)%0A self.assertEqual(202, resp.status)%0A self.adm_client.wait_for_resource_deletion(volume_id)%0A%0A ...
4e58bcfe15144af1cd6dfde166a02291a9a3a413
add run_module
tests/chainer_tests/functions_tests/normalization_tests/test_layer_normalization.py
tests/chainer_tests/functions_tests/normalization_tests/test_layer_normalization.py
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition def _batch_normalization(expander, gamma, beta, x, mean, var): mean = mean[expa...
Python
0.000001
@@ -3481,8 +3481,49 @@ f.ggx%5D)%0A +%0A%0Atesting.run_module(__name__, __file__)%0A
0f0cfe01323e92b12a54da8aa71ca0e3951956df
version increment
SAGA/__init__.py
SAGA/__init__.py
""" This is the top directory of the SAGA package """ from .database import Database from .hosts import HostCatalog from .objects import ObjectCatalog, ObjectCuts from .targets import TargetSelection __version__ = '0.5.2'
Python
0.000002
@@ -218,7 +218,7 @@ 0.5. -2 +3 '%0A
c9e70018bda0df294c55deea2378eab07566118b
update network
SCNIC/general.py
SCNIC/general.py
from __future__ import division import re import numpy as np import networkx as nx from biom.table import Table from datetime import datetime from collections import OrderedDict from numpy.random import multivariate_normal from statsmodels.sandbox.stats.multicomp import multipletests __author__ = 'shafferm' """fu...
Python
0.000001
@@ -2920,16 +2920,17 @@ aph.node +s :%0A
0f1551db96cd27ed20e62545cac1540a405e8f1a
fix bug
FlaskWebProject/views.py
FlaskWebProject/views.py
""" Routes and views for the flask application. """ import os from datetime import datetime from flask import render_template, request from FlaskWebProject import app from generate_summary_json import generate_summary_json @app.route('/') @app.route('/home') def home(): """Renders the home page.""" return re...
Python
0.000001
@@ -513,16 +513,16 @@ v('T -REEHACKS +EST_TEAM _SLA @@ -823,36 +823,20 @@ es, -TEST_TEAM_SLACK_ACCESS_TOKEN +access_token )%0A
2dc6cfb97a579c5560c40e9311b53603da4de962
Improve variable name in ChessMatch update match embed method
Discord/modules/chess.py
Discord/modules/chess.py
import discord # import asyncio import datetime import subprocess import chess import chess.engine import chess.pgn import chess.svg from wand.image import Image class ChessMatch(chess.Board): @classmethod async def start(cls, ctx, white_player, black_player): self = cls() self.ctx = ctx self.white_player...
Python
0
@@ -2977,17 +2977,21 @@ s im -g +age :%0A%09%09%09im -g +age .for @@ -3007,17 +3007,19 @@ g%22%0A%09%09%09im -g +age .save(fi
529987bb17a05c041cdbf3bbe2a98edda72872fc
remove unneeded Todo
InvenTree/plugin/urls.py
InvenTree/plugin/urls.py
""" URL lookup for plugin app """ from django.conf.urls import url, include from plugin import plugin_reg PLUGIN_BASE = 'plugin' # Constant for links def get_plugin_urls(): """returns a urlpattern that can be integrated into the global urls""" urls = [] for plugin in plugin_reg.plugins.values(): ...
Python
0.000036
@@ -397,57 +397,8 @@ ns)%0A - # TODO wrap everything in plugin_url_wrapper%0A
6137a6f00abbeb81b080f534481bb255f950dd83
access oauth token securely through azure
FlaskWebProject/views.py
FlaskWebProject/views.py
""" Routes and views for the Flask application. """ from flask import render_template, request from FlaskWebProject import app from oauth_constants import TEST_TEAM_SLACK_ACCESS_TOKEN from generate_summary_json import generate_summary_json global TEST_TEAM_SLACK_ACCESS_TOKEN @app.route('/') @app.route('/home') de...
Python
0
@@ -44,16 +44,26 @@ ion.%0A%22%22%22 +%0Aimport os %0A%0Afrom f @@ -136,66 +136,8 @@ pp%0A%0A -from oauth_constants import TEST_TEAM_SLACK_ACCESS_TOKEN %0A from @@ -193,24 +193,44 @@ on%0A%0A -global TEST_TEAM +%0AACCESS_TOKEN = os.getenv('TREEHACKS _SLA @@ -244,16 +244,18 @@ SS_TOKEN +') %0A%0A%0A@app. @@ -499...
cd5f824a2d756c8770be6f47d946c7e39c85228e
Fix postcode importing all
molly/apps/places/providers/postcodes.py
molly/apps/places/providers/postcodes.py
import simplejson, urllib, random, csv, zipfile, tempfile, urllib2, os.path from django.contrib.gis.geos import Point from molly.apps.places.providers import BaseMapsProvider from molly.apps.places.models import Entity, EntityType, Source from molly.conf.settings import batch class PostcodesMapsProvider(BaseMapsPro...
Python
0
@@ -1218,17 +1218,16 @@ ive. +name list -names () i
e5cc051bc7be854e253853d85b1de8b3037170be
always convert to floats
nbgrader/preprocessors/overwritecells.py
nbgrader/preprocessors/overwritecells.py
from IPython.nbformat.v4.nbbase import validate from nbgrader import utils from nbgrader.api import Gradebook from nbgrader.preprocessors import NbGraderPreprocessor class OverwriteCells(NbGraderPreprocessor): """A preprocessor to overwrite information about grade and solution cells.""" def preprocess(self, ...
Python
0.999827
@@ -2648,16 +2648,22 @@ oints = +float( grade_ce @@ -2674,16 +2674,17 @@ ax_score +) %0A @@ -2701,16 +2701,22 @@ oints = +float( cell.met @@ -2743,113 +2743,8 @@ ts%22%5D -%0A%09 if type(old_points)!=type(new_points):%0A%09%09new_points=float(new_points)%0A%09%09old_points=float(old_points )%0A%0A
cecbbd6de3b2d9ac63c24cb883780fe9c56e23f5
Fix required param
openquake/hazardlib/gsim/can15/sinter.py
openquake/hazardlib/gsim/can15/sinter.py
""" :module:`openquake.hazardlib.gsim.sinter` implements :class:`SInterCan15Mid`, :class:`SInterCan15Upp`, :class:`SInterCan15Low` """ import numpy as np from openquake.hazardlib.gsim.can15.western import get_sigma from openquake.hazardlib.gsim.base import CoeffsTable from openquake.hazardlib.gsim.zhao_2006 import Zh...
Python
0.000419
@@ -633,16 +633,75 @@ %22%22%22%0A%0A + REQUIRES_SITES_PARAMETERS = set(('vs30', 'backarc',))%0A%0A def
6565e5bd88ebe5fde8d65664041a9e8f571ca7d7
switch to requests
IMGURdl/downloadIMGUR.py
IMGURdl/downloadIMGUR.py
# example from: # https://www.toptal.com/python/beginners-guide-to-concurrency-and-parallelism-in-python import json import logging import os from pathlib import Path from urllib.request import urlopen, Request # import requests logger = logging.getLogger(__name__) def get_links(client_id): headers = {'Authoriza...
Python
0.000001
@@ -205,18 +205,16 @@ Request%0A -# import r
59b3d8b5bce596583f5901f1b3b79a883b7b8e55
Fix stocktake export
InvenTree/stock/admin.py
InvenTree/stock/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from import_export.admin import ImportExportModelAdmin from import_export.resources import ModelResource from import_export.fields import Field import import_export.widgets as widgets from .models import StockLocation, S...
Python
0
@@ -479,16 +479,25 @@ s import + Company, Supplie @@ -502,16 +502,16 @@ ierPart%0A - from ord @@ -1824,16 +1824,17 @@ t__full_ +n ame', re @@ -2018,32 +2018,118 @@ readonly=True)%0A%0A + customer = Field(attribute='customer', widget=widgets.ForeignKeyWidget(Company))%0A%0A supplier_nam @@ -2592,24 +2592...
1323154dfbc453959f3d64fef439288004f6461e
add test for SyntaxError on def f(a): global a
Lib/test/test_compile.py
Lib/test/test_compile.py
from test_support import verbose, TestFailed if verbose: print 'Running test on duplicate arguments' try: exec('def f(a, a): pass') raise TestFailed, "duplicate arguments" except SyntaxError: pass try: exec('def f(a = 0, a = 1): pass') raise TestFailed, "duplicate keyword arguments" except Sy...
Python
0.000193
@@ -78,31 +78,30 @@ test +s on -duplicate arguments +argument handling '%0A%0At @@ -312,28 +312,154 @@ xcept SyntaxError:%0A pass%0A +%0Atry:%0A exec('def f(a): global a; a = 1')%0A raise TestFailed, %22variable is global and local%22%0Aexcept SyntaxError:%0A pass%0A
69a735cd134723e4d47c02d21f4ff85a65d28148
enable test_main.py
Lib/test/test_lib2to3.py
Lib/test/test_lib2to3.py
# Skipping test_parser and test_all_fixers # because of running from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor, test_parser) import unittest from test.test_support import run_unittest def suite(): tests = unittest.TestSuite() loader = unittest.TestLoade...
Python
0.000004
@@ -174,16 +174,41 @@ t_parser +, test_main as test_main_ )%0Aimport @@ -418,16 +418,42 @@ t_parser +,%0A test_main_ ):%0A
28d49f4fd9e403acf3318f1098387190581ce283
Remove extra blank line
dummyserver/testcase.py
dummyserver/testcase.py
import unittest import socket import threading from nose.plugins.skip import SkipTest from tornado import ioloop, web from dummyserver.server import ( SocketServerThread, run_tornado_app, run_loop_in_thread, DEFAULT_CERTS, ) from dummyserver.handlers import TestingApp from dummyserver.proxy import Prox...
Python
0.99854
@@ -2686,17 +2686,16 @@ .port%0A%0A%0A -%0A class HT
92c123820be466ad76078537b457bb596b86c338
Put some meaningful standard includes in the sample configuration
dwight_chroot/config.py
dwight_chroot/config.py
import copy import os from .exceptions import ( CannotLoadConfiguration, InvalidConfiguration, NotRootException, UnknownConfigurationOptions, ) from .include import Include _USER_CONFIG_FILE_PATH = os.path.expanduser("~/.dwightrc") _USER_CONFIG_FILE_TEMPLATE = """# AUTOGENERATED DEFAULT CONFIG # ...
Python
0
@@ -372,41 +372,340 @@ e(%22/ -dest/path/in/chroot%22, %22/host/path +proc%22, %22/proc/%22),%0A# Include(%22/dev%22, %22/dev/%22),%0A# Include(%22/dev/pts%22, %22/dev/pts%22),%0A# Include(%22/run%22, %22/run%22),%0A# Include(%22/sys%22, %22/sys%22),%0A# ...
3bfd3ea70980acc02bf35b1654b6c616f4af45ec
update error page
chat/views.py
chat/views.py
import random import string from django.db import transaction from django.shortcuts import render, redirect import haikunator from .models import Room def about(request): return render(request, "chat/about.html") def home(request): return render(request, "chat/about.html") # def new_room(request): # """ ...
Python
0.000001
@@ -2241,24 +2241,114 @@ n sha%0A #%0A + if request.method == 'GET':%0A return render(request, %22chat/join_room.html%22, %7B%7D)%0A label =
e5a3a49cfe6953160e6e3fbdf1ce9f55dafb2b40
Change data-checker messages to use Python logger
check_data.py
check_data.py
#!/usr/bin/env python from __future__ import print_function import argparse import os import sys from six import string_types import yaml # ABCs moved in Python 3, but six doesn't keep track of them. try: from collections.abc import Sequence except ImportError: from collections import Sequence REPO_ROOT = ...
Python
0
@@ -19,47 +19,8 @@ hon%0A -from __future__ import print_function%0A%0A impo @@ -30,16 +30,31 @@ argparse +%0Aimport logging %0Aimport @@ -630,24 +630,253 @@ rmation')%0A%0A%0A +logger = logging.getLogger(__name__)%0Alogger.setLevel(logging.DEBUG)%0Aformatter = logging.Formatter('%25(message)s')%0Astream_handler =...
a6acf8a68ee5b2ef185f279b6169a34c2b70896d
Increase feature version
acmd/__init__.py
acmd/__init__.py
# coding: utf-8 """ aem-cmd main module. """ __version__ = '0.11.1b' # Standard error codes that can be returned from any tool. OK = 0 UNCHANGED = 1 USER_ERROR = 4711 CONFIG_ERROR = 4712 SERVER_ERROR = 4713 INTERNAL_ERROR = 4714 import acmd.logger init_log = acmd.logger.init_log log = acmd.logger.log warning = acmd...
Python
0
@@ -61,11 +61,11 @@ '0.1 -1.1 +2.0 b'%0A%0A
1ac48168baf8f18870bca0be2709838120eecd93
add validation to `offline.iplot`
plotly/offline/offline.py
plotly/offline/offline.py
""" Plotly Offline A module to use Plotly's graphing library with Python without connecting to a public or private plotly enterprise server. """ from __future__ import absolute_import import json import os import uuid from pkg_resources import resource_string import warnings from plotly import session, to...
Python
0
@@ -1826,16 +1826,41 @@ plot.ly' +,%0A validate=True ):%0A %22 @@ -2676,16 +2676,388 @@ ort link +%0A validate (default=True) -- validate that all of the keys in the figure%0A are valid? omit if your version of plotly.js%0A has become outdate...
61c9d4f6798d81d6ae6d2e5641a8432121de52fa
Implement function: get_network_adapters
cloudbaseinit/osutils/freebsd.py
cloudbaseinit/osutils/freebsd.py
from cloudbaseinit.osutils import base import subprocess class FreeBSDUtils(base.BaseOSUtils): def reboot(self): if ( os.system('reboot') != 0 ): raise Exception('Reboot failed') def user_exists(self, username): try: subprocess.check_output(["id", username]) exc...
Python
0.999999
@@ -2235,36 +2235,198 @@ (self):%0A -pass +%22%22%22%0A This fucntion will return a list of interface.%0A %22%22%22%0A if_list = subprocess.check_output(%5B'ifconfig', '-l'%5D).split(' ')%0A return if_list %0A%0A def set_st
7f1af658690d284946c6b25172d215c79f61e6ea
use adapter in test
corehq/apps/userreports/tests/test_data_source_repeats.py
corehq/apps/userreports/tests/test_data_source_repeats.py
import json import os import datetime from django.test import SimpleTestCase, TestCase from corehq.apps.userreports.models import DataSourceConfiguration from corehq.apps.userreports.sql import IndicatorSqlAdapter from corehq.db import connection_manager DOC_ID = 'repeat-id' DAY_OF_WEEK = 'monday' class RepeatDataS...
Python
0
@@ -211,49 +211,8 @@ ter%0A -from corehq.db import connection_manager%0A %0A%0ADO @@ -3207,57 +3207,8 @@ ):%0A%0A - engine = connection_manager.get_engine()%0A @@ -3901,83 +3901,15 @@ -with engine.connect() as connection:%0A rows = connection.execute( +rows = adap @@ -3920,25 +3920,22...
deb96907dc9c96e0ff8772d14cad765cc5e47602
improve crawler
crawler/pagecrawler/pagecrawler/spiders/article_spider.py
crawler/pagecrawler/pagecrawler/spiders/article_spider.py
import scrapy from pagecrawler.items import ArticlecrawlerItem from pagecrawler.model_article import Articles class ArticleSpider(scrapy.Spider): name = "articlespider" filename = "delicious_article_dataset.dat" # load url in bookmarks from dataset start_urls = [] crawled_urls = {} # url_count ...
Python
0.000129
@@ -334,16 +334,40 @@ nter = 0 +%0A written_counter = 0 %0A%0A wi @@ -2263,16 +2263,59 @@ rticle%22%0A + ArticleSpider.written_counter += 1%0A @@ -2453,22 +2453,17 @@ ######## -###### + %22 + str( @@ -2531,16 +2531,76 @@ ls)) + %22 + written %22 + str(ArticleSpider.written_counter) + %22 ...
5361eec646a2ba13c56a475273a4522e60c0eac1
Optimize rotmg command
Discord/cogs/rotmg.py
Discord/cogs/rotmg.py
import discord from discord.ext import commands from utilities import checks def setup(bot): bot.add_cog(RotMG(bot)) class RotMG(commands.Cog): def __init__(self, bot): self.bot = bot async def cog_check(self, ctx): return await checks.not_forbidden().predicate(ctx) @commands.group(aliases = ["realmof...
Python
0
@@ -728,32 +728,39 @@ or%22 in data:%0A%09%09%09 +return await ctx.embed_ @@ -792,26 +792,16 @@ rror%22%5D)%0A -%09%09%09return%0A %09%09fields
39cd42fa27b87b9b1604635236f8860759a4a8db
Set Dialog's orientation to vertical
ELiDE/ELiDE/dialog.py
ELiDE/ELiDE/dialog.py
"""Generic dialog boxes and menus, for in front of a Board Mostly these will be added as children of KvLayoutFront but you could use them independently if you wanted. """ from kivy.properties import DictProperty, ListProperty, StringProperty, NumericProperty, VariableListProperty from kivy.core.text import DEFAULT_FO...
Python
0
@@ -2932,16 +2932,44 @@ ialog%3E:%0A + orientation: 'vertical'%0A Mess
69c590d7cf2d328b9e6ef63ddf49933e67df9614
fix typo
statsd/gauge.py
statsd/gauge.py
import statsd class Gauge(statsd.Client): '''Class to implement a statd gauge ''' def send(self, subname, value): '''Send the data to statsd via self.connection :keyword subname: The subname to report the data to (appended to the client name) :keyword value: The gaug...
Python
0.999991
@@ -69,16 +69,17 @@ t a stat +s d gauge%0A
b97edcc911419197099338085f0f2937286dead0
Bump version
galaxy/__init__.py
galaxy/__init__.py
# (c) 2012-2014, Ansible, Inc. <support@ansible.com> # # This file is part of Ansible Galaxy # # Ansible Galaxy 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 Foundation, either version 3 of the License, or # (at your op...
Python
0
@@ -784,17 +784,17 @@ = '2.0. -0 +1 '%0A__all_
b99de7f7d91c1be99ee7ea04da997d48126fd08b
fix model finance
finance/models.py
finance/models.py
from django.db import models from datetime import datetime class TypeLaunch(models.Model): type_name = models.CharField(max_length=100, unique=True) class Provider(models.Model): description = models.CharField(max_length=100, unique=True) type_launch = models.ForeignKey(TypeLaunch, blank=True, null=True...
Python
0.000001
@@ -343,36 +343,32 @@ se = models.Date -Time Field('date last @@ -501,36 +501,32 @@ ch = models.Date -Time Field('date laun @@ -611,12 +611,8 @@ Date -Time Fiel @@ -1020,22 +1020,19 @@ , launch -, year +='' ):%0A @@ -1038,123 +1038,170 @@ -#import pdb; pdb.set_trace()%0A if launch.strip()%5B-3...
fab74bb78de0b2f54997198ed1837cf986bbdf3b
Fix ruby gems tests, again
tests/integration/modules/test_gem.py
tests/integration/modules/test_gem.py
# -*- coding: utf-8 -*- ''' Integration tests for Ruby Gem module ''' # Import Python libs from __future__ import absolute_import, unicode_literals, print_function # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTe...
Python
0
@@ -3060,22 +3060,34 @@ p:// -gemcutter +production.cf.rubygems .org -/ '%0A%0A
747fa98c7a9ec7906dfba44e4860d300825eee39
Drop Py2 and six on tests/integration/modules/test_key.py
tests/integration/modules/test_key.py
tests/integration/modules/test_key.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import re import pytest from tests.support.case import ModuleCase from tests.support.helpers import slowTest @pytest.mark.windows_whitelisted class KeyModuleTest(ModuleCase): @slowTest def test_key_finger(self)...
Python
0
@@ -1,103 +1,4 @@ -# -*- coding: utf-8 -*-%0A%0Afrom __future__ import absolute_import, print_function, unicode_literals%0A%0A impo
be2a2ab6a67beef97e3c3cf42bd5eeea6c4e55cf
fix - use rpc_timeout as rpc timeout
test/functional/test_framework/test_node.py
test/functional/test_framework/test_node.py
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Class for bitcoind node under test""" import errno import http.client import logging import os import subpr...
Python
0
@@ -3170,16 +3170,42 @@ f.index, + timeout=self.rpc_timeout, coverag
6140507068c7a42a988bad951c1a6f120de741fb
Update cam_timeLapse_Threaded_upload.py
camera/timelapse/cam_timeLapse_Threaded_upload.py
camera/timelapse/cam_timeLapse_Threaded_upload.py
#!/usr/bin/env python2.7 import time import os from subprocess import call UPLOAD_INTERVAL = 60 def upload_file(inpath, outpath): uploadCmd = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload %s %s" % (inpath, outpath) call ([uploadCmd], shell=True) while True: # record start_time start_time = time.tim...
Python
0
@@ -69,16 +69,279 @@ t call%0A%0A +import sys%0A%0Aclass Logger(object):%0A def __init__(self):%0A self.terminal = sys.stdout%0A self.log = open(%22logfile.log%22, %22a%22)%0A%0A def write(self, message):%0A self.terminal.write(message)%0A self.log.write(message) %0A%0Asys.stdout = L...
16fca36c2032929589a718507a74c87bee52c161
move planarAxiPotential to top-level
galpy/potential.py
galpy/potential.py
from galpy.potential_src import Potential from galpy.potential_src import planarPotential from galpy.potential_src import linearPotential from galpy.potential_src import verticalPotential from galpy.potential_src import MiyamotoNagaiPotential from galpy.potential_src import LogarithmicHaloPotential from galpy.potential...
Python
0
@@ -1199,16 +1199,71 @@ tential%0A +planarAxiPotential= planarPotential.planarAxiPotential%0A planarPo
0a4265282f240dc52acac4347636417a14274ada
update dict list in mixfeatures
code/python/seizures/features/MixFeatures.py
code/python/seizures/features/MixFeatures.py
import numpy as np from seizures.features.FeatureExtractBase import FeatureExtractBase from seizures.features.ARFeatures import ARFeatures from seizures.features.FFTFeatures import FFTFeatures from seizures.features.PLVFeatures import PLVFeatures from seizures.features.RandomFeatures import RandomFeatures from seizures...
Python
0
@@ -358,16 +358,133 @@ eatures%0A +from seizures.features.SEFeatures import SEFeatures%0Afrom seizures.features.LyapunovFeatures import LyapunovFeatures%0A%0A %0Aclass M @@ -1209,16 +1209,138 @@ Features +,%0A %22SEFeatures%22:SEFeatures,%0A %22LyapunovFeatur...
198e5256063d43006b5c245866604f5bd746cfcd
Allow the plugin to be loaded from a query
plugins/Success/plugin.py
plugins/Success/plugin.py
### # Copyright (c) 2005, Daniel DiPaolo # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condition...
Python
0
@@ -2554,44 +2554,27 @@ dom( -pluginSelf.target or 'private_query' +dynamic.msg.args%5B0%5D )%0A @@ -3237,226 +3237,8 @@ ss%0A%0A - def inFilter(self, irc, msg):%0A # We need the target, but we need it before Owner.doPrivmsg is called,%0A # so this seems like the only way to do it.%0A self....
4c084313d2e27a620f194e6282a51aa1e94f7a35
Change chunk so it only takes an int
node/floor_divide.py
node/floor_divide.py
#!/usr/bin/env python from nodes import Node class FloorDiv(Node): char = "f" args = 2 results = 1 @Node.test_func([3,2], [1]) @Node.test_func([6,-3], [-2]) def func(self, a:Node.number,b:Node.number): """a/b. Rounds down, returns an int.""" return a//b @Node.test...
Python
0.000002
@@ -999,27 +999,19 @@ le, num: -Node.number +int ):%0A
002aa415c8711eb484688cd867a8a70907e5e545
Remove _py_version_switch
numba/core/typing/asnumbatype.py
numba/core/typing/asnumbatype.py
import inspect import typing as py_typing from numba.core.typing.typeof import typeof from numba.core import errors, types, utils def _py_version_switch(py_version, new_result, old_result): return new_result if utils.PYVERSION >= py_version else old_result class AsNumbaTypeRegistry: """ A registry for ...
Python
0.000549
@@ -120,148 +120,8 @@ ypes -, utils%0A%0A%0Adef _py_version_switch(py_version, new_result, old_result):%0A return new_result if utils.PYVERSION %3E= py_version else old_result %0A%0A%0Ac @@ -1092,586 +1092,79 @@ -# The type hierarchy of python typing library changes in 3.7.%0A generic_type_check = _py...
30a581f8af6efe7a6d2ff3ce803b728558bdce1e
Fix message
vmssextn.py
vmssextn.py
# Python script to do read/install/delete VM extensions on VM Scale Sets # usage: vmssextn -r rgname -v vmssname [--delete extnname] [--add extnfile] [-y][--verbose] import argparse import json import sys import time import subscription import vmss import azurerm def main(): # create parser argParser = argp...
Python
0.000002
@@ -4727,16 +4727,24 @@ odel is +applied to all V
a9482327727be721ba74c0251ec17f63f79fb1d7
fix faulty merge
galpy/potential.py
galpy/potential.py
from galpy.potential_src import Potential from galpy.potential_src import planarPotential from galpy.potential_src import linearPotential from galpy.potential_src import verticalPotential from galpy.potential_src import MiyamotoNagaiPotential from galpy.potential_src import IsochronePotential from galpy.potential_src i...
Python
0.000002
@@ -5133,16 +5133,101 @@ tential%0A +MN3ExponentialDiskPotential= MN3ExponentialDiskPotential.MN3ExponentialDiskPotential%0A KuzminKu @@ -5313,16 +5313,17 @@ tential%0A +%0A #Softeni
942e3b183859623d2f2a6bf874f8d763e960ea5b
Print AST during integration test
tests/integration/test_integration.py
tests/integration/test_integration.py
import collections import io import json import os import pytest import glob import subprocess import thinglang from thinglang import run, utils BASE_PATH = os.path.dirname(os.path.abspath(__file__)) SEARCH_PATTERN = os.path.join(BASE_PATH, '**/*.thing') TestCase = collections.namedtuple('TestCase', ['code', 'meta...
Python
0.000001
@@ -1189,43 +1189,29 @@ der( -%22Bytecode generation%22)%0A bytecode +'Parsed AST')%0A ast = t @@ -1243,16 +1243,104 @@ le.code) +%0A print(ast.tree())%0A%0A utils.print_header(%22Bytecode generation%22)%0A bytecode = ast .compile
e032136bdb5dbc8dfede3dfef8f4ede735cc5f3a
fix spacing
volatile.py
volatile.py
#!/usr/bin/python2 # # Name: volatile # Auth: Gavin Lloyd <gavinhungry@gmail.com> # Date: 21 Apr 2011 (last modified: 15 Nov 2012) # Desc: Simple ALSA status icon and volume control # import pygtk import gtk import alsaaudio import gobject import signal pygtk.require("2.0") PANEL_HEIGHT = 24 # in pixels, negati...
Python
0.000054
@@ -662,18 +662,16 @@ tivate', - show_wi @@ -2323,25 +2323,27 @@ + (SCROLL_BY -* + * 2))%0A elif e @@ -2415,17 +2415,19 @@ CROLL_BY -* + * 2))%0A%0A%0A#%0A
4fc0162c73178678281c0e09cf32ffefa4b7b923
Handle unavailable server
flasque/client.py
flasque/client.py
# -*- coding: utf8 -*- import json import Queue import requests import threading class ThreadQueue(threading.Thread): def __init__(self, api, qname, *args, **kwargs): super(ThreadQueue, self).__init__(*args, **kwargs) self.api = api self.qname = qname self.q = Queue.Queue() ...
Python
0.000001
@@ -29,16 +29,28 @@ rt json%0A +import time%0A import Q @@ -418,33 +418,276 @@ -raise NotImplementedError +while True:%0A self.loop()%0A%0A @staticmethod%0A def make_request(func, *args, **kwargs):%0A while True:%0A try:%0A return func(*args, **kwargs)%0A ...
7dd10d88b89da4a10db45d6393fd05d0d2dc718e
Change get_check_by_name optional argument
pingdombackup/PingdomBackup.py
pingdombackup/PingdomBackup.py
from calendar import timegm from datetime import datetime, timedelta from .Pingdom import Pingdom from .Database import Database from .log import log class PingdomBackup: MAX_INTERVAL = 2764800 def __init__(self, email, password, app_key, database): self.pingdom = Pingdom(email, password, app_key) ...
Python
0.000003
@@ -1237,80 +1237,10 @@ name -, from_api=True):%0A if from_api:%0A self.update_checks()%0A +): %0A @@ -2823,20 +2823,20 @@ ts), 're -cord +sult has' if @@ -2866,20 +2866,20 @@ else 're -cord +sult s have')
522dcc5f4be7271f85736160f10664a3983285b4
delete events typo
event_review/admin.py
event_review/admin.py
import re from django.contrib import admin from django import forms from django.utils.html import format_html, mark_safe from event_store.models import Event from reviewer.filters import ReviewerOrganizationFilter, review_widget from huerta.filters import CollapsedListFilter def phone_format(phone): return forma...
Python
0.000022
@@ -3897,17 +3897,16 @@ 'delete -d _selecte
0dd41b65aaa0798a7a72a0d61d746bfa29bc3aad
Allow POST of fly and worm donors
src/encoded/types/donor.py
src/encoded/types/donor.py
from ..schema_utils import ( load_schema, ) from ..contentbase import ( location, ) from .base import ( ACCESSION_KEYS, ALIAS_KEYS, Collection, paths_filtered_by_status, ) class DonorItem(Collection.Item): base_types = ['donor'] + Collection.Item.base_types embedded = set(['organism'])...
Python
0
@@ -1146,33 +1146,16 @@ .json')%0A - __acl__ = %5B%5D%0A prop @@ -1482,33 +1482,16 @@ .json')%0A - __acl__ = %5B%5D%0A prop
b9133e2fe7444b4449ab67f4d726c20ce5e21cd8
clean ups in presentation of names
gazetteer/admin.py
gazetteer/admin.py
from django.contrib import admin from django import forms from gazetteer.models import * from skosxl.models import Notation from .settings import TARGET_NAMESPACE_FT # Register your models here. # works for Dango > 1.6 class NameInline(admin.TabularInline): model = LocationName class LocationTypeInlineForm...
Python
0.000007
@@ -278,16 +278,78 @@ tionName +%0A readonly_fields = %5B'nameUsed', 'namespace'%5D%0A extra = 0 %0A%0A %0Ac
af18499e0d2c2017a01772153dbfa78c962458fa
Make sure source is a sequence of nodes before calling isfortran.
numscons/core/extension_scons.py
numscons/core/extension_scons.py
#! /usr/bin/env python # Last Change: Sun Jan 06 09:00 PM 2008 J # Module for support to build python extension. scons specific code goes here. import sys from copy import copy from distutils.unixccompiler import UnixCCompiler from numscons.numdist import msvc_runtime_library from extension import get_pythonlib_dir,...
Python
0
@@ -1814,27 +1814,316 @@ -if isfortran(source +# XXX: this is really ugly. This is all because I am too lazy to do%0A # a real python extension builder, which I should really do at some%0A # point.%0A from SCons.Node.FS import default_fs%0A snodes = %5Bdefault_fs.Entry(...
59da9b84c491fd5ca4f4c7add5891d5e9ee4b405
Make it work with astor 0.5 for now
flaws/asttools.py
flaws/asttools.py
import ast try: from ast import arg as ast_arg except ImportError: ast_arg = type('arg', (ast.AST,), {}) from funcy.py3 import lmap def is_write(node): return isinstance(node, (ast.Import, ast.ImportFrom, ast.ExceptHandler, ast.FunctionDef, ast.ClassDef, ast.arguments, ast_arg...
Python
0
@@ -2307,16 +2307,25 @@ ration%0A%0A +try:%0A from ast @@ -2359,16 +2359,82 @@ nerator%0A +except ImportError:%0A from astor.codegen import SourceGenerator%0A from ter
4ac7e5d15d3fba11ae37e5826ca6c7181539804b
Disable nested types tests affected by IMPALA-2295
tests/query_test/test_nested_types.py
tests/query_test/test_nested_types.py
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. import pytest from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestNestedTypes(ImpalaTestSuite): @classmethod def get_workload(self): return 'functional-query' @classmethod def add_test...
Python
0
@@ -1608,24 +1608,55 @@ runtime.%22%22%22%0A + pytest.skip(%22IMPALA-2295%22)%0A self.run @@ -1791,24 +1791,55 @@ dataset.%22%22%22%0A + pytest.skip(%22IMPALA-2295%22)%0A # This t
f5f0cc6998f28bee7ccdaf304d3bc5e7e45ab9a6
save memory allocation using kwarg `out`.
chainer/optimizer_hooks/gradient_hard_clipping.py
chainer/optimizer_hooks/gradient_hard_clipping.py
import chainer class GradientHardClipping(object): """Optimizer/UpdateRule hook function for gradient clipping. This hook function clips all gradient arrays to be within a lower and upper bound. Args: lower_bound (float): The lower bound of the gradient value. upper_bound (float): T...
Python
0
@@ -8,16 +8,44 @@ chainer%0A +from chainer import backend%0A %0A%0Aclass @@ -1853,69 +1853,416 @@ -param.grad = param.grad.clip(self.lower_bound, self.upper_boun +xp = param.device.xp%0A if xp == backend.chainerx %5C%0A or isinstance(param.grad, backend.intel64.mdarray):%0A ...
8c17d2076d54864094c3cd8ee51d514bc806c913
bump version
flexx/__init__.py
flexx/__init__.py
""" `Flexx <https://flexx.readthedocs.io>`_ is a pure Python toolkit for creating graphical user interfaces (GUI's), that uses web technology for its rendering. Apps are written purely in Python; The `PScript <https://pscript.readthedocs.io>`_ transpiler generates the necessary JavaScript on the fly. You can use Flexx...
Python
0
@@ -1169,11 +1169,11 @@ '0. -7.1 +8.0 '%0A%0A#
7ba77209687ae1bb1344cc09e3539f7e21bfe599
Improve test of csvstack --filenames.
tests/test_utilities/test_csvstack.py
tests/test_utilities/test_csvstack.py
#!/usr/bin/env python import sys import StringIO import unittest from csvkit import CSVKitReader from csvkit.utilities.stack import CSVStack class TestCSVStack(unittest.TestCase): def test_explicit_grouping(self): # stack two CSV files args = ["--groups", "asd,sdf", "-n", "foo", "examples/dummy.c...
Python
0
@@ -1227,35 +1227,36 @@ eader.next(), %5B%22 -foo +path %22, %22a%22, %22b%22, %22c%22 @@ -1294,35 +1294,41 @@ der.next()%5B0%5D, %22 -asd +dummy.csv %22)%0A self. @@ -1342,31 +1342,38 @@ qual(reader.next()%5B0%5D, %22 -sdf +dummy2.csv %22)%0A%0A
2f2114b47618ef6435543c05d941d3191ef44d5c
refactor Valuation functions
FinSymPy/Valuation.py
FinSymPy/Valuation.py
from sympy.matrices import Determinant, Matrix def terminal_value( cash_flows=Matrix([0.]), long_term_discount_rate=0., long_term_growth_rate=0.): m, n = cash_flows.shape if m == 1: filter_vector = Matrix((n - 1) * [0] + [1]) tv = Determinant(cash_flows * filter_vector)...
Python
0.000069
@@ -1,51 +1,4 @@ -from sympy.matrices import Determinant, Matrix%0A %0A%0Ade @@ -23,39 +23,37 @@ -cash_flows=Matrix(%5B0.%5D) +terminal_cash_flow=0. ,%0A @@ -78,18 +78,19 @@ nt_rate= -0 . +01 ,%0A @@ -126,319 +126,63 @@ -m, n = cash_flows.shape%0A if m == 1:%0A filter_vector =...
b2485d7879ea00aa745ac735beb786e3dd51cb3b
Refactor LDAPClient.bind() so it acknowledges completion of the request.
ldaptor/protocols/ldap/ldapclient.py
ldaptor/protocols/ldap/ldapclient.py
# Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the...
Python
0.000171
@@ -3351,84 +3351,8 @@ (r, -d.callback) #TODO queue needs info back from callback!!!%0A%09 d.addCallback( self @@ -3368,16 +3368,19 @@ bind_msg +, d )%0A%09retur @@ -3419,16 +3419,19 @@ lf, resp +, d ):%0A%09asse @@ -3542,23 +3542,27 @@ 0:%0A%09 -return +d.callback( (resp.ma @@ -3591,16 +3591,17 @@ sl...
241407f63bcda57499bf58e3b755df8052ecb3aa
add old nb urls and witch not found to 404
src/front/views/nb_urls.py
src/front/views/nb_urls.py
from django.core.urlresolvers import reverse, reverse_lazy from django.http import HttpResponsePermanentRedirect, HttpResponse from django.views.generic import View from events.models import Event from groups.models import SupportGroup class NBUrlsView(View): nb_paths = { '/unsubscribe': reverse_lazy('un...
Python
0.000001
@@ -2499,24 +2499,107 @@ rogramme/',%0A + '/agenda_melenchon': 'https://agir.lafranceinsoumise.fr/agenda/melenchon/'%0A %7D%0A%0A d @@ -3181,34 +3181,224 @@ -url = self.nb_paths%5Bnb_url + try:%0A url = self.nb_paths%5Bnb_url%5D%0A return HttpResponsePerman...
324bc231a65263ea1a7aaf16b027ca3f5179cd03
Fix nop filters for request documents
src/ggrc/models/request.py
src/ggrc/models/request.py
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """A module for Request object""" # pylint: disable=fixme from sqlalchemy import orm from ggrc import db from ggrc.models import audit from ggrc.models import reflection from ggrc.models import relationsh...
Python
0
@@ -4550,35 +4550,45 @@ %22filter_by%22: %22_ -nop +filter_by_url %22,%0A %22ty @@ -4743,11 +4743,26 @@ : %22_ -nop +filter_by_evidence %22,%0A @@ -5852,24 +5852,169 @@ Verifier%22)%0A%0A + @classmethod%0A def _filter_by_url(cls, predicate):%0A return None%0A%0A @classmethod%0A def _filter_by_evi...
6ff7389f85485b8aa2848aa0e7420569c0c06f37
Update pluginLoader.
src/gopher/agent/plugin.py
src/gopher/agent/plugin.py
# # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of...
Python
0
@@ -788,22 +788,16 @@ GINS = ' -gopher plugins' @@ -954,16 +954,20 @@ if +not os.path. @@ -988,23 +988,8 @@ - return%0A @@ -1018,19 +1018,18 @@ -pkg +fn = os.pa @@ -1078,11 +1078,10 @@ pen( -pkg +fn , 'w
b38497b06d52f230f9688e59a107349b4867810e
fix -- output to stdout, not to stderr as by default..
src/helpers/main_helper.py
src/helpers/main_helper.py
import logging import os from synthesis.smt_logic import Logic from synthesis.solvers import Z3_Smt_NonInteractive_ViaFiles, Z3_Smt_Interactive from third_party.ansistrm import ColorizingStreamHandler from translation2uct.ltl2automaton import Ltl2UCW def get_root_dir() -> str: #make paths independent of current ...
Python
0
@@ -18,16 +18,27 @@ port os%0A +import sys%0A from syn @@ -905,16 +905,48 @@ %25M:%25S%22)) +%0A handler.stream = sys.stdout %0A%0A ro
60f3c4e1bbd25d781cfba5993aac647d937c64c9
add BillSource to public interface
opencivicdata/models/__init__.py
opencivicdata/models/__init__.py
# flake8: NOQA from .jurisdiction import Jurisdiction, JurisdictionSession from .division import Division from .people_orgs import ( Organization, OrganizationIdentifier, OrganizationName, OrganizationContactDetail, OrganizationLink, OrganizationSource, Person, PersonIdentifier, PersonName, PersonContactDet...
Python
0
@@ -606,10 +606,22 @@ sionLink +, BillSource )%0A
479a6cfaacd34cb6cda02ebaeba057fde593341b
Set default headers value in parameters
openfisca_web_api/wsgihelpers.py
openfisca_web_api/wsgihelpers.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
Python
0.000001
@@ -2650,20 +2650,18 @@ aders = -None +%5B%5D , json_d @@ -3520,53 +3520,8 @@ one%0A - if headers is None:%0A headers = %5B%5D%0A
d52132ea28fad48b07263c8ad57a98e4690ec852
fix cranberry schema to have unsigned int for temp
Gateway_v2/decoder.py
Gateway_v2/decoder.py
from xbee import ZigBee import sys import serial import datetime import struct import collections import csv import os.path import psycopg2 class Decoder: def __init__(self): self.schemaDict = { 'ga_legacy': 'HHBI'+'B'+'H'*6+'H'*6+'IhH'+'H'*20, '0': 'HHIH', #Heartbeat schema '1': 'HHIHHIhHH', ...
Python
0.000001
@@ -345,17 +345,17 @@ 'HHIHHH -h +H HI', #Cr
5232597d574f7089f592aac0a5f25efd1ff7763a
Update test_blt.py.
openrcv/test/formats/test_blt.py
openrcv/test/formats/test_blt.py
from textwrap import dedent from openrcv.formats.blt import BLTFileWriter from openrcv.models import BallotsResource, ContestInput from openrcv.utils import StringInfo from openrcv.utiltest.helpers import UnitCase class BLTFileWriterTest(UnitCase): def test(self): contest = ContestInput() conte...
Python
0
@@ -139,20 +139,22 @@ openrcv. -util +stream s import @@ -160,20 +160,24 @@ t String -Info +Resource %0Afrom op @@ -558,27 +558,24 @@ -stream_info +resource = Strin @@ -579,12 +579,16 @@ ring -Info +Resource ()%0A @@ -617,27 +617,24 @@ eWriter( -stream_info +resource )%0A @@ -841,25 +841,25 @...
ff63f077fe68ae18b409598a3860d0abbc7442e3
fix num_topics property
orangecontrib/text/topics/hdp.py
orangecontrib/text/topics/hdp.py
from gensim import models from .topics import GensimWrapper class HdpModel(models.HdpModel): def __init__(self, corpus, id2word, **kwargs): # disable fitting during initialization _update = self.update self.update = lambda x: x super().__init__(corpus, id2word, **kwargs) s...
Python
0.000004
@@ -476,16 +476,42 @@ = kwargs +%0A self.model = None %0A%0A de @@ -751,9 +751,30 @@ shape%5B0%5D + if self.model else 0 %0A
3a247b72ba39bb2f49099905c435127aea424fe0
Remove unused variable
lib/backend_common/tests/conftest.py
lib/backend_common/tests/conftest.py
"""Configure a mock application to run queries against""" import pytest from flask_login import current_user from flask import jsonify from backend_common import create_app, auth, auth0, mocks from os.path import join, dirname FAKE_CLIENT_SECRETS = """ { "web": { "auth_uri": "https://auth.mozilla.auth0.co...
Python
0.000015
@@ -226,559 +226,8 @@ me%0A%0A -FAKE_CLIENT_SECRETS = %22%22%22%0A%7B%0A %22web%22: %7B%0A %22auth_uri%22: %22https://auth.mozilla.auth0.com/authorize%22,%0A %22issuer%22: %22https://auth.mozilla.auth0.com/%22,%0A %22client_id%22: %22some-id-string%22,%0A %22client_secret%22: %22my-super...
6cd9af9d1c2f6b7e366c4bcc0b7c7422d4f776be
Add device events hook to app engine app.
src/appengine/main.py
src/appengine/main.py
import json import logging import os import random import string import sys from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext.webapp.util import login_required from google.appengine.ext import db from google.appengine.e...
Python
0
@@ -917,16 +917,8 @@ /'%7D: - %0A @@ -1001,17 +1001,16 @@ fo(user) - %0A perso @@ -1509,17 +1509,16 @@ _app_id, - %0A key @@ -1601,24 +1601,158 @@ ', event)%0A%0A%0A +@app.route('/api/device/events', methods=%5B'POST'%5D)%0Adef DeviceEvents():%0A body = json.loads(flask.request.data)%0A loggin...
f10797b4b39c262fdb8a250386f7c61e7922005a
Check for CLI updates (from private pip by default)
src/azure/cli/main.py
src/azure/cli/main.py
import os import sys from ._argparse import ArgumentParser from ._logging import configure_logging, logger from ._session import Session from ._output import OutputProducer from azure.cli.extensions import event_dispatcher # CONFIG provides external configuration options CONFIG = Session() # SESSION provides read-w...
Python
0
@@ -14,16 +14,57 @@ port sys +%0Afrom datetime import datetime, timedelta %0A%0Afrom . @@ -260,16 +260,99 @@ atcher%0A%0A +from azure.cli.utils.update_checker import check_for_cli_update, UpdateCheckError%0A%0A # CONFIG @@ -481,16 +481,1525 @@ sion()%0A%0A +UPDATE_CHECK_DATE_FORMAT = %22%25Y-%25m-%25d %25H:%25M:%2...
f6be63484b083c07b09616c8e3dd2f916e0a4488
Change folder path of patches' tfrecords
src/btc_parameters.py
src/btc_parameters.py
# Brain Tumor Classification # Script for Hyper-Parameters # Author: Qixun Qu # Create on: 2017/10/14 # Modify on: 2017/10/28 # ,,, ,,, # ;" '; ;' ", # ; @.ss$$$$$$s.@ ; # `s$$$$$$$$$$$$$$$' # $$$$$$$$$$$$$$$$$$ # $$$$P""Y$$$Y""W$$$$$ # $$$$ p"$$$"q $$$$$ # $$$$ .$$$$$. $$$$' # $...
Python
0
@@ -2018,33 +2018,78 @@ DATA_FOLDER, - TFRECORD +%0A TFRECORDS_FOLDER, PATCHE S_FOLDER)%0A%0A# @@ -2547,16 +2547,57 @@ _FOLDER, +%0A PATCHES_FOLDER, VOLUMES
8ce52602c0804d7888bcf50ce85050e085e0797d
Raise environment.BuildNotFound if we can't patch up to the desired build
environment/__init__.py
environment/__init__.py
""" WoW-style MPQ-based environments """ import os import re import mpq class BuildNotFound(Exception): pass class Base(object): def __init__(self, rawPath, build=None): self.rawPath = rawPath if build is not None: self.setBuild(build) def __repr__(self): if hasattr(self, "_path"): return "Base(%r)" ...
Python
0
@@ -4895,16 +4895,230 @@ et = %5B%5D%0A +%0A%09%09# Raise BuildNotFound if we can't patch up to the desired build%0A%09%09# We should raise it in __init__ instead, but it would involve duplicate code%0A%09%09if self.build not in builds:%0A%09%09%09raise BuildNotFound(self.build)%0A%0A %09%09for bu
66608b724112680075d6e41edda7e631da69301e
add stop_id test
ott/otp_client/tests/tests_ti.py
ott/otp_client/tests/tests_ti.py
import os import unittest from ott.otp_client.transit_index.routes import Routes from ott.otp_client.transit_index.stops import Stops def get_db(): from gtfsdb import api, util from ott.utils import file_utils dir = file_utils.get_module_dir(Routes) gtfs_file = os.path.join(dir, '..', 'tests', 'data'...
Python
0.000001
@@ -2967,88 +2967,285 @@ est_ -bbox_stops(self):%0A # TODO !!!%0A pass%0A # stops = Stops.stop() +stop_query(self):%0A stop = Stops.stop(self.db.session, 'NEW')%0A self.assertTrue(stop)%0A self.assertTrue(stop.routes == '50')%0A%0A stop = Stops.stop(self.db.session, 'OL...
a8145f318b4659802d5f9e244354f23b5ed32fb3
fix import error
equinox/nn/attention.py
equinox/nn/attention.py
from typing import Optional import jax import jax.numpy as jnp import jax.random as jrandom from ..custom_types import Array from ..module import Module, static_field from .linear import Dropout, Linear class MultiheadAttention(Module): """Multihead Attention layer from 'Attention Is All You Need' (https://arxi...
Python
0.000001
@@ -172,14 +172,15 @@ om . -linear +dropout imp @@ -190,17 +190,36 @@ Dropout -, +%0Afrom .linear import Linear%0A
b9848aba428c1c7c99a1fef64ff56b940abb9eb9
Remove num option from fetch_recent tweets
ditto/twitter/management/commands/fetch_twitter_tweets.py
ditto/twitter/management/commands/fetch_twitter_tweets.py
# coding: utf-8 import argparse from django.core.management.base import BaseCommand, CommandError from ...fetch import FetchTweets class Command(BaseCommand): """fetches tweets from Twitter. Fetch recent tweets since the last fetch, from all accounts: ./manage.py fetch_twitter_tweets --recent Fetc...
Python
0.000025
@@ -319,11 +319,8 @@ tch -20 rece @@ -398,11 +398,8 @@ cent -=20 %0A%0A @@ -2128,21 +2128,28 @@ ites -, either with +. Favorites can have an @@ -2164,16 +2164,34 @@ number. + eg --favorites=20 %22)%0A%0A
1cf3003518ceceefcc7d518ca4afbc5571bc18e7
Use get_or_add_addon
website/addons/dataverse/views/config.py
website/addons/dataverse/views/config.py
# -*- coding: utf-8 -*- import httplib as http from flask import request from modularodm import Q from modularodm.storage.base import KeyExistsException from framework.exceptions import HTTPError from framework.auth.decorators import must_be_logged_in from website.project import decorators from website.util.sanitize...
Python
0.000017
@@ -2126,91 +2126,91 @@ -user_settings = user.get_addon('dataverse')%0A if not user_settings:%0A +# Need to ensure that the user has dataverse enabled at this point%0A - user. +get_or_ add_ @@ -2219,19 +2219,8 @@ don( -addon_name= 'dat @@ -2239,20 +2239,16 @@ h=auth)%0A - user
fda19eae8abd54dcfd5dd2d4e878a4e969528261
update FAIL
rasa/cli/utils.py
rasa/cli/utils.py
import os import sys from typing import Any, Callable, Dict, Optional, Text, List import logging from rasa.constants import DEFAULT_MODELS_PATH logger = logging.getLogger(__name__) def get_validated_path( current: Optional[Text], parameter: Text, default: Optional[Text] = None, none_is_valid: bool ...
Python
0.000362
@@ -4516,24 +4516,11 @@ 033%5B -%22 %5C%0A %22 +91m %22%0A
9cb10ef23ac0390cce9bad69532436471353181f
Fix invalid code in clean-up on error situation.
flumotion/component/encoders/h264/h264.py
flumotion/component/encoders/h264/h264.py
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
Python
0.00001
@@ -6257,12 +6257,29 @@ et_p -eer( +arent().get_pad(%22src%22 ).re
2c6a495351de52fe1de0b36d73f22e777ef3d08c
fix sqlalchemy url with sqlite prefix
wsgi/todopyramid/todopyramid/__init__.py
wsgi/todopyramid/todopyramid/__init__.py
import os from pyramid.config import Configurator from sqlalchemy import engine_from_config from .models import ( DBSession, Base, ) from .views import get_user def get_db_session(request): """return thread-local DB session""" return DBSession def main(global_config, **settings): """ This f...
Python
0.001027
@@ -511,24 +511,34 @@ my.url'%5D = ' +sqlite:/// %25(OPENSHIFT_
926df1bc4dee9fc613f0fb31bb8c579943008645
Update plot_label_propagation_digits.py (#22725)
examples/semi_supervised/plot_label_propagation_digits.py
examples/semi_supervised/plot_label_propagation_digits.py
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
Python
0
@@ -675,357 +675,504 @@ SD%0A%0A -import numpy as np%0Aimport matplotlib.pyplot as plt%0A%0Afrom scipy import stats%0A%0Afrom sklearn import datasets%0Afrom sklearn.semi_supervised import LabelSpreading%0A%0Afrom sklearn.metrics import confusion_matrix, classification_report%0A%0Adigits = datasets.load_digits()%0Arng ...
ebddb1005d3eda45f11eef08d83c271a657443b2
Add functional tests for volume set size
functional/tests/volume/v1/test_volume.py
functional/tests/volume/v1/test_volume.py
# 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 # d...
Python
0.000005
@@ -2724,28 +2724,339 @@ lf.NAME + %22%5Cn%22, raw_output)%0A +%0A def test_volume_set_size(self):%0A raw_output = self.openstack(%0A 'volume set --size 2 ' + self.NAME)%0A opts = self.get_show_opts(%5B%22display_name%22, %22size%22%5D)%0A raw_output = self.openstack('volume show ' +...
3284f18168ce274516dc51293376571f5dfada18
copy the hasher from FrozenPhoneNumber
phonenumber_field/phonenumber.py
phonenumber_field/phonenumber.py
#-*- coding: utf-8 -*- import phonenumbers from django.core import validators from phonenumbers.phonenumberutil import NumberParseException from django.conf import settings class PhoneNumber(phonenumbers.phonenumber.PhoneNumber): """ A extended version of phonenumbers.phonenumber.PhoneNumber that provides som...
Python
0
@@ -2584,33 +2584,356 @@ rn hash( +( self. -__unicode__( +country_code,%0A self.national_number,%0A self.extension,%0A self.italian_leading_zero,%0A self.number_of_leading_zeros,%0A self.raw_input,%0A ...
fe6da72e141d7cbf431f9b66f23b4b03a8d456a4
fix hanging aggregator
yandextank/aggregator/tank_aggregator.py
yandextank/aggregator/tank_aggregator.py
""" Core module to calculate aggregate data """ import json import logging import queue as q from pkg_resources import resource_string from .aggregator import Aggregator, DataPoller from .chopper import TimeChopper from yandextank.common.interfaces import AggregateResultListener, StatsReader from netort.data_process...
Python
0.000001
@@ -4326,28 +4326,28 @@ self.drain. -wait +join ()%0A @@ -4428,20 +4428,20 @@ s_drain. -wait +join ()%0A @@ -4485,16 +4485,16 @@ data')%0A + @@ -4526,98 +4526,8 @@ ue)%0A - if self.drain:%0A self.drain.join()%0A self.stats_drain.join()%0A%0A
61610e7024be54fc3ba9a67c03db7ebb0a88270b
Changing the default view graph to be 229
ScoutingWebsite2013/Scouting2011/views.py
ScoutingWebsite2013/Scouting2011/views.py
from django.shortcuts import render from django.db.models import Avg, Sum from django.http.response import HttpResponse from Scouting2011.models import Team, Match import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.font_ma...
Python
0.999998
@@ -3473,12 +3473,9 @@ = %5B -3, 4 +2 %5D%0A @@ -3490,30 +3490,47 @@ = %22 -auton_score,high_goals +HighTubesHung,ScoredUberTube,BrokeBadly %22%0A