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
d83ebc6834d27ca8a005db75b668d23dee2ac920
version of the consumer that should process docs from the past day
scrapi/consumers/ucescholarship/consumer.py
scrapi/consumers/ucescholarship/consumer.py
## Consumer and Normalizer for the eScholarship Repo ## at the University of California # import requests from lxml import etree, html from datetime import date, timedelta from scrapi_tools.consumer import BaseConsumer, RawFile, NormalizedFile TODAY = date.today() YESTERDAY = TODAY - timedelta(1) class EScholarshi...
Python
0
@@ -127,14 +127,42 @@ tree -, html +%0Afrom xml.etree import ElementTree %0Afro @@ -267,16 +267,31 @@ zedFile%0A +import requests %0A%0ATODAY @@ -339,16 +339,17 @@ lta(1)%0A%0A +%0A class ES @@ -617,18 +617,12 @@ -# response +data = r @@ -650,67 +650,37 @@ -# xml_text = response.content%0A%0A ...
b13ffdd2ad5ccf723a0dc0fe5f611865c0c4aa4e
Add /MTd for debug builds with MSVC
build/build-env.py
build/build-env.py
import os import inspect import platform def is_64bit(): """ is this a 64-bit system? """ return platform.machine()[-2:] == '64' #return platform.machine() == 'x86_64': #return platform.machine() == 'AMD64': def getTools(): result = [] if os.name == 'nt': result = ['default', 'msvc'] elif os.name...
Python
0
@@ -912,16 +912,24 @@ D_DEBUG' +, '/MTd' %5D, 'exce
3a411cd982b2b578a392a024ac6cc4de7e941325
Add command line args to python.
run-experiments.py
run-experiments.py
#!/usr/bin/env python import sys import os import subprocess import datetime CLIFF = 0 FIFO = 1 LRU = 2 def compute(outfile, errfile, policy=FIFO, size=None, apps=[], warmup=None, request_limit=None, infile=None): cmd = ('./compu...
Python
0.000002
@@ -70,16 +70,32 @@ datetime +%0Aimport argparse %0A%0ACLIFF @@ -832,16 +832,324 @@ main():%0A + parser = argparse.ArgumentParser(description='Process some integers.')%0A parser.add_argument('--limit', dest='request_limit',%0A default=None,%0A help='Simulate onl...
fc42655e356c5f74fbfb86b28e59f6ecb4b601fb
fix None problem different version of 3.0
run/wn-baseline.py
run/wn-baseline.py
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ """ import sys from nltk.corpus import wordnet as wn from itertools import product import task3_utils import numpy as np from wn_utils import get_synsets_for_sents_tuple from collections import defaultdict as dd import nltk test_f = sys.std...
Python
0.000111
@@ -976,16 +976,36 @@ closest + if dist is not None %5D%0A if
70a251ba27641e3c0425c659bb900e17f0f423dd
Enable initial user via service so that an event gets written
scripts/create_initial_admin_user.py
scripts/create_initial_admin_user.py
#!/usr/bin/env python """Create an initial user with admin privileges to begin BYCEPS setup. :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import click from byceps.database import db from byceps.services.user import creation_service as user_creation_service from byc...
Python
0.000001
@@ -215,26 +215,70 @@ eps. -database import db +services.user import creation_service as user_creation_service %0Afro @@ -303,33 +303,24 @@ user import -creation_ service as u @@ -319,33 +319,24 @@ ice as user_ -creation_ service%0Afrom @@ -784,16 +784,64 @@ sword)%0A%0A + user_service.enable_user(user.id, u...
e524ea3db737ee92bb3ba486240dd60928781eaf
Fix tests.
hc/front/tests/test_add_pd.py
hc/front/tests/test_add_pd.py
from hc.api.models import Channel from hc.test import BaseTestCase class AddPdTestCase(BaseTestCase): url = "/integrations/add_pd/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.assertContains(...
Python
0
@@ -773,16 +773,42 @@ %22123456 +78901234567890123456789012 %22)%0A%0A
d3f925ae635bfe593be749ca9e0c01d194cfe58d
add missing return
dvc/remote/http.py
dvc/remote/http.py
import logging import threading from funcy import cached_property, wrap_prop from dvc.config import Config from dvc.config import ConfigError from dvc.exceptions import DvcException, HTTPError from dvc.progress import Tqdm from dvc.remote.base import RemoteBASE from dvc.scheme import Schemes logger = logging.getLogg...
Python
0.999046
@@ -3602,24 +3602,48 @@ tException%0A%0A + return res%0A%0A exce
65ae8fc33a1fa7297d3e68f7c67ca5c2678e81b7
Set up Flask-User to provide user auth
app/__init__.py
app/__init__.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) from app import views, models
Python
0.000001
@@ -118,16 +118,70 @@ ort Mail +%0Afrom flask_user import UserManager, SQLAlchemyAdapter %0A%0Aapp = @@ -315,16 +315,168 @@ l(app)%0A%0A +# Configure user model for Flask-User%0Afrom app.models import User%0A%0Adb_adapter = SQLAlchemyAdapter(db, User)%0Auser_manager = UserManager(db_adapter, app)%0A %0A%0Afrom a
d0a6183b31b417b0ff11a1f74b1480b24fb558bb
Change encoding
openxc/formats/json.py
openxc/formats/json.py
"""JSON formatting utilities.""" import json from openxc.formats.base import VehicleMessageStreamer class JsonStreamer(VehicleMessageStreamer): SERIALIZED_COMMAND_TERMINATOR = b"\x00" def parse_next_message(self): parsed_message = None remainder = self.message_buffer message = "" ...
Python
0.000002
@@ -1075,23 +1075,8 @@ sage -.decode(%22utf8%22) )%0A%0A
1e8d5cd1fc76527c650d2e47794ef3af3992dea7
Fix broken test 😑
users/tests/auth_backend_authenticate_test.py
users/tests/auth_backend_authenticate_test.py
import pytest import responses from users.authBackend import NetidBackend from users.models import User pytestmark = pytest.mark.django_db @responses.activate def test_auth(): sid = "this-is-a-sid" uid = 'this-is-a-uid-and-is-longer' xml = open("users/tests/xml-fixtures/nimarcha.xml").read() respon...
Python
0.000006
@@ -1,12 +1,59 @@ +from django.test.client import RequestFactory%0A%0A import pytes @@ -256,17 +256,17 @@ uid = -' +%22 this-is- @@ -284,17 +284,17 @@ s-longer -' +%22 %0A xml @@ -401,17 +401,17 @@ f -' +%22 https:// @@ -472,17 +472,17 @@ id=%7Buid%7D -' +%22 ,%0A @@ -492,16 +492,24 @@ ody=...
32f409756af68e4500c1de310c24c2636366e133
Remove from flask_alembic
app/__init__.py
app/__init__.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_alembic import Alembic app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) alembic = Alembic() alembic.init_app(app) from app import views, models
Python
0.000001
@@ -60,42 +60,8 @@ hemy -%0Afrom flask_alembic import Alembic %0A%0Aap
b53bbce8cfffbcf926f5b9951cb89be9cdb8b276
update debugger
debug.py
debug.py
# Useful debug from time import time START = 0 FINISH = 0 def start(): global START START = time() def finish(): global FINISH FINISH = time() print FINISH - START
Python
0.000001
@@ -52,16 +52,43 @@ ISH = 0%0A +ACCUMULATOR = 0%0ADELTA = 0%0A%0A %0Adef sta @@ -109,16 +109,23 @@ al START +, DELTA %0A STA @@ -140,23 +140,152 @@ e()%0A -%0Adef finish():%0A + DELTA = START%0A%0A%0Adef finish():%0A t = time()%0A if ACCUMULATOR != 0:%0A print %22Acumulated time: %7B%7D%22.forma...
d2e82419a8f1b7ead32a43e6a03ebe8093374840
Set slug field readonly after channel create
opps/channels/forms.py
opps/channels/forms.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Channel class ChannelAdminForm(forms.ModelForm): layout = forms.ChoiceField(choices=(('default', _('Default')),)) class Meta: model = Channel
Python
0
@@ -262,16 +262,274 @@ ')),))%0A%0A + def __init__(self, *args, **kwargs):%0A super(ChannelAdminForm, self).__init__(*args, **kwargs)%0A instance = getattr(self, 'instance', None)%0A if instance and instance.pk:%0A self.fields%5B'slug'%5D.widget.attrs%5B'readonly'%5D = True%0A%0A ...
b1b960c7747afe3f95c31093efc71b5252ddf30d
Update cisco_configure_ssid_radius_5ghz.py
scripts/cisco_configure_ssid_radius_5ghz.py
scripts/cisco_configure_ssid_radius_5ghz.py
#!/usr/bin/python import paramiko from getpass import getpass import time import sys queryIP = sys.argv[1] queryUser = sys.argv[2] queryPass = sys.argv[3] querySSID = sys.argv[4] queryVlan = sys.argv[5] queryBridgeGroup = sys.argv[6] queryRadioSub = sys.argv[7] queryGigaSub = sys.argv[8] queryRadiusIP = sys.argv[9] q...
Python
0.000002
@@ -32,36 +32,8 @@ iko%0A -from getpass import getpass%0A impo
b8f6ee091a31eb86f2788468513a52c7e194647e
Improve formatting
graphdeps.py
graphdeps.py
#!/usr/bin/env python """Graph dependencies in projects""" import argparse import json from subprocess import Popen, PIPE import textwrap # Typical command line usage: # # python graphdeps.py TASKFILTER # # TASKFILTER is a taskwarrior filter, documentation can be found here: # http://taskwarrior.org/projects/taskwarr...
Python
0.647729
@@ -1319,32 +1319,33 @@ tt-ish%0AHEADER = +( %22digraph depende @@ -1394,18 +1394,18 @@ ir=LR; %22 -%5C %0A + @@ -1412,24 +1412,25 @@ %22weight=2;%22 +) %0A%0A# Spread t @@ -4778,20 +4778,37 @@ .append( -'%22%25s +%0A '%22%7B%7D %22%5Bshape= @@ -4829,10 +4829,10 @@ DTH= -%25d +%7B%7...
d71e2db04d623244df77ad2d2640ad1f42e5819d
Use new template settings.
frontend/fifoci/settings/base.py
frontend/fifoci/settings/base.py
# This file is part of the FifoCI project. # Copyright (c) 2014 Pierre Bourdon <delroth@dolphin-emu.org> # Licensing information: see $REPO_ROOT/LICENSE """ Django settings for fifoci project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings ...
Python
0
@@ -1809,32 +1809,205 @@ LATE -_CONTEXT_PROCESSORS = (%0A +S = %5B%0A %7B%0A 'BACKEND': 'django.template.backends.django.DjangoTemplates',%0A 'DIRS': %5B%5D,%0A 'APP_DIRS': True,%0A 'OPTIONS': %7B%0A 'context_processors': %5B%0A @@ -2053,16 +2053,28 @@ .auth...
2021eb01d22520d6b2b3f1d2e8ccbb30c43455fd
Handle non-existant descriptions, make logging less verbose
gsack/scrape.py
gsack/scrape.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright Aengus Walton 2013 # http://ventolin.org # ventolin@gmail.com # from datetime import datetime, timedelta import os import re import time import urlparse from BeautifulSoup import BeautifulSoup from icalendar import Calendar, Event import logbook import reque...
Python
0.001534
@@ -2084,19 +2084,21 @@ -print desc%0A +if desc:%0A @@ -2129,16 +2129,44 @@ n(desc)) +%0A else:%0A desc = '' %0A%0A ta @@ -2866,16 +2866,51 @@ er += 1%0A + if counter %25 100 == 0:%0A
c9284827eeec90a253157286214bc1d17771db24
Remove skip of service-type management API test
neutron/tests/api/test_service_type_management.py
neutron/tests/api/test_service_type_management.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.000006
@@ -570,44 +570,8 @@ e.%0A%0A -from tempest_lib import decorators%0A%0A from @@ -673,20 +673,16 @@ mentTest -JSON (base.Ba @@ -787,12 +787,8 @@ Test -JSON , cl @@ -987,52 +987,8 @@ g)%0A%0A - @decorators.skip_because(bug=%221400370%22)%0A
a7ed59af7f31a91a36c0e854f32088a3b084e7f5
add run mining on load all dashboard in scheduler
bin/scheduler.py
bin/scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from gevent import monkey monkey.patch_all() from os import sys, path import schedule from time import sleep from bottle.ext.mongo import MongoPlugin sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from bin.mining import run from utils import conf, lo...
Python
0
@@ -2053,32 +2053,58 @@ ler_interval'%5D)%0A + run(cube%5B'slug'%5D)%0A register
e0410359dbbc688f56722dc0e245c1bbd0a9bf43
Set default config file
app/__init__.py
app/__init__.py
import todoist from base import dlog import elo import argparse import sys from datetime import datetime from planner import PriorityPlanner import time import yaml def get_config(args): fs = open(args.config) cfg = yaml.load(fs) fs.close() return cfg def get_app(cfg): app = todoist.Todoist() ...
Python
0.000001
@@ -41,16 +41,26 @@ ort elo%0A +import os%0A import a @@ -3834,23 +3834,50 @@ (config= -%22config +os.path.expanduser(%22~%22) + %22/.taski .yaml%22)%0A
c75a244247988dbce68aa7985241712d8c94a24a
Fix how we set 'build_dir' and 'install_dir' options from 'install' options -- irrelevant because this file is about to go away, but oh well.
Lib/distutils/command/install_ext.py
Lib/distutils/command/install_ext.py
"""install_ext Implement the Distutils "install_ext" command to install extension modules.""" # created 1999/09/12, Greg Ward __revision__ = "$Id$" from distutils.core import Command from distutils.util import copy_tree class install_ext (Command): description = "install C/C++ extension modules" user...
Python
0.000001
@@ -759,20 +759,16 @@ ('build_ -plat lib', 'b @@ -825,20 +825,16 @@ install_ -plat lib', 'i
ace44d551fe5e11cef80c118d99d26f7327ee8fc
use a port variable
aot/__main__.py
aot/__main__.py
################################################################################ # Copyright (C) 2015-2016 by Arena of Titans Contributors. # # This file is part of Arena of Titans. # # Arena of Titans is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License ...
Python
0.000002
@@ -2896,24 +2896,60 @@ 'ws_port'%5D)%0A + port = config%5B'api'%5D%5B'ws_port'%5D%0A factory @@ -3062,32 +3062,12 @@ st, -config%5B'api'%5D%5B'ws_ port -'%5D )%0A%0A%0A
f809651c6ece66de2c6d6170f3e3dd48aa306322
Add repo data to error log files
autodeploy.py
autodeploy.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ gitdir autodeploy """ import bottle import datetime import json import os.path import subprocess import traceback try: import uwsgi CONFIG_PATH = uwsgi.opt['config_path'] except: CONFIG_PATH = '/etc/xdg/gitdir/autodeploy.json' bottle.debug() application...
Python
0.000001
@@ -1810,32 +1810,376 @@ ') as log_file:%0A + print('Error while deploying from github.com:', file=log_file)%0A print('username: ' + user, file=log_file)%0A print('repo: ' + repo, file=log_file)%0A ...
a619d5b35eb88ab71126e53f195190536d71fdb4
Throw exceptions error responses from server
orionsdk/swisclient.py
orionsdk/swisclient.py
import requests import json from datetime import datetime def _json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, datetime): serial = obj.isoformat() return serial class SwisClient: def __init__(self, hostname, username, password,...
Python
0.000001
@@ -1277,20 +1277,20 @@ re -turn +sp = request @@ -1586,8 +1586,60 @@ json'%7D)%0A + resp.raise_for_status()%0A return resp%0A
c07e87cd1641c3edc057cbba96d8ec77d4ef2f5a
Enable plotting of multiple treants
extremefill2D/fextreme/plot.py
extremefill2D/fextreme/plot.py
"""Functions to plot a vega plot from Extremefill data """ import os import numpy as np from skimage import measure import xarray # pylint: disable=redefined-builtin, no-name-in-module from toolz.curried import pipe, juxt, valmap, concat, map from scipy.interpolate import griddata import pandas import yaml import vega...
Python
0.000001
@@ -394,16 +394,23 @@ ega_plot +_treant (treant) @@ -933,32 +933,105 @@ a.Vega)%0A %22%22%22%0A + return vega_plot_treants(%5Btreant%5D)%0A%0A%0Adef vega_plot_treants(treants):%0A return pipe( @@ -1037,32 +1037,33 @@ (%0A treant +s ,%0A vega_c @@ -1056,29 +1056,78 @@ -vega_contou...
767a9d36c1283c2ab1cdf42750806a362dd7baed
Fix cuSPARSELt example not to use internal function
examples/cusparselt/matmul.py
examples/cusparselt/matmul.py
# # Example of matrix multiply using cuSPARSELt # # (*) https://docs.nvidia.com/cuda/cusparselt/getting_started.html#code-example # import cupy import numpy from cupy_backends.cuda.libs.cusparselt import Handle, MatDescriptor, MatmulDescriptor, MatmulAlgSelection, MatmulPlan # NOQA from cupy.core import _dtype from c...
Python
0.000001
@@ -151,16 +151,46 @@ numpy%0A%0A +from cupy.cuda import runtime%0A from cup @@ -312,37 +312,8 @@ OQA%0A -from cupy.core import _dtype%0A from @@ -878,198 +878,29 @@ type -_A = -_dtype.to_cuda_dtype(A.dtype, is_half_allowed=True)%0Acuda_dtype_B = _dtype.to_cuda_dtype(B.dtype, is_half_allowed=True)%0Acuda_dtype...
d1734a3ab371b79a1a89a83f926ab5aba1ab8ae6
I will not edit on github I will not edit on github
scripts/lib/readMRtrixConfSetting.py
scripts/lib/readMRtrixConfSetting.py
# TODO Add compatibility with Windows (config files are in different locations) def readMRtrixConfSetting(name): # Function definition: looking for key in whichever of the two files is open def findKey(f): for line in f: line = line.split() if len(line) != 2: continue if line[0].rstrip().repl...
Python
0.999886
@@ -372,32 +372,46 @@ turn ''%0A%0A try:%0A + import os%0A f = open (os
0d26f2e34a8a2b89d1102dfc257e01182fa3fd6b
Update nickname in sesssion when save profile
handler/user.py
handler/user.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from BaseHandler import BaseHandler from tornado.web import authenticated as Auth from model.models import User, or_, and_ class LoginHandler(BaseHandler): def get(self): if not self.session.isGuest: return self.redirect('/') # 已...
Python
0
@@ -3888,32 +3888,118 @@ elf.db.commit()%0A + self.session.set('email',email)%0A self.session.set('nickname',nickname)%0A return s
0da6b77ec037005caf5f0b06949cbf4981d82616
Fix sensitivity factories
geotrek/sensitivity/factories.py
geotrek/sensitivity/factories.py
# -*- coding: utf-8 -*- import factory from geotrek.authent.factories import StructureRelatedDefaultFactory from geotrek.common.utils.testdata import dummy_filefield_as_sequence from . import models class SportPracticeFactory(factory.DjangoModelFactory): class Meta: model = models.SportPractice na...
Python
0.000001
@@ -683,16 +683,54 @@ 7 = True +%0A category = models.Species.SPECIES %0A%0A @c @@ -1280,52 +1280,8 @@ ea%0A%0A - category = models.SensitiveArea.SPECIES%0A
d3e098e1e5b88186dcb0c848faafba4a95fee6f5
Use print wrapper to avoid IOError tracebacks
salt/cli/caller.py
salt/cli/caller.py
# -*- coding: utf-8 -*- ''' The caller module is used as a front-end to manage direct calls to the salt minion modules. ''' # Import python libs from __future__ import print_function import os import sys import logging import datetime import traceback # Import salt libs import salt.exitcodes import salt.loader import...
Python
0.000001
@@ -479,16 +479,49 @@ G_LEVELS +%0Afrom salt.utils import print_cli %0A%0A# Cust @@ -5838,16 +5838,20 @@ print +_cli ('%7B0%7D:%5Cn
53b5546d5d58f54730b6fb030304d8d9ed180d71
Add stdout to pip error output
salt/states/pip.py
salt/states/pip.py
''' Installation of Python packages using pip. ========================================== A state module to manage system installed python packages .. code-block:: yaml virtualenvwrapper: pip.installed: - version: 3.0.1 ''' # Import Salt libs from salt.exceptions import CommandExecutionError, Comm...
Python
0.000183
@@ -3195,16 +3195,17 @@ all and +( pip_inst @@ -3227,11 +3227,14 @@ de'%5D + == -0 + 0) :%0A @@ -3952,16 +3952,17 @@ ent'%5D = +( 'Failed @@ -3985,16 +3985,31 @@ ge %7B0%7D. +'%0A ' Error: %7B @@ -4010,25 +4010,30 @@ ror: %7B1%7D -' + %7B2%7D') .format( %0A @@ -4016,33 +4016,41 @@ ...
bce007eb1e89ed66d911827e764d1062dc220d4f
add another potential with steeper slope
streammorphology/potential.py
streammorphology/potential.py
# coding: utf-8 from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party import astropy.units as u import numpy as np # Project import gary.potential as gp from gary.units import galactic __all__ = ['potential_registry'] # built-in potentials potential_registry =...
Python
0.000055
@@ -625,16 +625,320 @@ %5D = p1%0A%0A +# --------------------------------------------------------------%0Ap1 = gp.LeeSutoTriaxialNFWPotential(v_c=(175*u.km/u.s).to(u.kpc/u.Myr).value,%0A r_s=20., a=1., b=0.77, c=0.55,%0A units=galactic)%0Apotential_...
336fd0a2258ae450e38dc9ddc22268b4d77f1be7
Fix broken test
studies/american_gut/tests.py
studies/american_gut/tests.py
from provider.oauth2.models import AccessToken from rest_framework import status from rest_framework.test import APITestCase class UserDataTests(APITestCase): fixtures = ['open_humans/fixtures/test-data.json'] def verify_request(self, url, status_code): response = self.client.get('/api/american-gut' ...
Python
0.000255
@@ -120,16 +120,17 @@ stCase%0A%0A +%0A class Us @@ -501,17 +501,17 @@ quest_40 -3 +1 (self, u @@ -566,19 +566,22 @@ P_40 -3_FORBIDDEN +1_UNAUTHORIZED )%0A%0A @@ -1152,33 +1152,33 @@ erify_request_40 -3 +1 ('/user-data/1/' @@ -1201,33 +1201,33 @@ erify_request_40 -3 +1 ('/user-data/2/' @@ -1262,9 +1262,9 @@ ...
4560c9fdc3ff57107f687e36a44b7038f4265463
Use -E flags in grit_info tool to modify env (previously -E was accepted but unused).
grit_info.py
grit_info.py
#!/usr/bin/env python # Copyright (c) 2012 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. '''Tool to determine inputs and outputs of a grit file. ''' import optparse import os import posixpath import sys from grit impor...
Python
0
@@ -4393,16 +4393,139 @@ = val%0A%0A + for env_pair in options.build_env:%0A (env_name, env_value) = env_pair.split('=')%0A os.environ%5Benv_name%5D = env_value%0A%0A if opt
68082ef346cbe493a9546e3f8b58547b0257866d
add better chuck norris image prediction
postcards/plugin_chuck_norris/postcards_chuck_norris.py
postcards/plugin_chuck_norris/postcards_chuck_norris.py
from postcards.postcards import Postcards from postcards.plugin_pexels.util.pexels import get_random_image_url, read_from_url import sys import json import os import random import nltk jokes_location = os.path.dirname(os.path.realpath(__file__)) + '/chuck_norris_jokes.json' nltk.download('averaged_perceptron_tagger') ...
Python
0.000391
@@ -1963,17 +1963,93 @@ -if nouns: +counter = 0%0A for n in nouns:%0A if counter %3E 2:%0A break %0A @@ -2069,18 +2069,140 @@ ord ++ = n -ouns%5B0%5D + + ' '%0A counter = counter + 1%0A self.logger.debug(n)%0A%0A keyword = keyword.strip()%0A ...
cb84cbab9dcc6acca30d65de569bc98770edef41
add .tar.gz suffix to parameter save filename
demo/word2vec/api_train_v2.py
demo/word2vec/api_train_v2.py
import gzip import math import paddle.v2 as paddle embsize = 32 hiddensize = 256 N = 5 def wordemb(inlayer): wordemb = paddle.layer.embedding( input=inlayer, size=embsize, param_attr=paddle.attr.Param( name="_proj", initial_std=0.001, learning_rate=1, ...
Python
0.000001
@@ -2502,17 +2502,60 @@ atch_id) -, + + %22.tar.gz%22,%0A 'w') as
218f9d44904305fea28ce99c3c22fd246f18b3e5
Bump 0.8.2.
yassh/__init__.py
yassh/__init__.py
import logging from .reactor import Reactor from .remote_run import RemoteRun, remote_run from .remote_copy import RemoteCopy, remote_copy from .local_run import LocalRun, local_run from .exceptions import AlreadyStartedException logging.getLogger(__name__).addHandler(logging.NullHandler()) __all__ = ['RemoteRun', '...
Python
0
@@ -486,7 +486,7 @@ 0.8. -1 +2 '%0A
a63a3592f3d1e152f0a1ad2038f4d5cdd3ecbc28
Fix plotting script
projects/sequence_prediction/discrete_sequences/plot.py
projects/sequence_prediction/discrete_sequences/plot.py
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
Python
0.00049
@@ -1058,16 +1058,19 @@ y%0A%0Afrom +exp suite im @@ -1074,16 +1074,28 @@ import +PyExperiment Suite%0A%0A%0A @@ -3462,16 +3462,28 @@ suite = +PyExperiment Suite()%0A
9b921e2006ae40f25b2ade36fba005e44cbe15c4
Add more check to node functional test
senlin/tests/functional/test_node.py
senlin/tests/functional/test_node.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 # distributed under t...
Python
0
@@ -2305,32 +2305,76 @@ %5B'cluster_id'%5D)%0A + self.assertEqual(2, node1%5B'index'%5D)%0A cluster @@ -2416,32 +2416,89 @@ cluster%5B'id'%5D)%0A + self.assertEqual(2, cluster%5B'desired_capacity'%5D)%0A self.ass @@ -4518,32 +4518,76 @@ %5B'cluster_id'%5D)%0A + self.assertEqu...
210e761f621f9c83ea4097d5f0d1af8f5a384fd9
Move assertRaises to wrap the correct call.
subvertpy/tests/test_repos.py
subvertpy/tests/test_repos.py
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. ...
Python
0
@@ -727,18 +727,18 @@ ersion r -p e +p ository @@ -3439,32 +3439,59 @@ est_read(self):%0A + s = repos.Stream()%0A if repos @@ -3566,28 +3566,22 @@ dError, -repos.Stream +s.read )%0A @@ -3592,39 +3592,8 @@ se:%0A - s = repos.Stream()%0A
809ae0b330c528af59c299b45e3494291adf2c6a
Use nvm in project file
.ycm_extra_conf.py
.ycm_extra_conf.py
import os import ycm_core from clang_helpers import PrepareClangFlags flags = [ '-Wall', '-std=c++11', '-stdlib=libc++', '-x', 'c++', '-I', 'src', '-I', 'node_modules/tree-sitter/include', '-I', '/usr/local/include/node', '-I', 'vendor/tree-sitter/include', '-isystem', '/Applicatio...
Python
0
@@ -176,65 +176,42 @@ I', -'node_modules/tree-sitter/include',%0A '-I', '/usr/local +os.path.expanduser('~/.nvm/current /inc @@ -220,16 +220,17 @@ de/node' +) ,%0A '-
dc5e0baebc6af7644340a610afe307ee2ef58cd2
Update Flask example for new APIs.
examples/flask/flask_party.py
examples/flask/flask_party.py
from flask import Flask, request from wsgi_party import WSGIParty, PartylineConnector class PartylineFlask(Flask, PartylineConnector): def __init__(self, import_name, *args, **kwargs): super(PartylineFlask, self).__init__(import_name, *args, **kwargs) self.add_url_rule(WSGIParty.invite_path, endpo...
Python
0
@@ -17,16 +17,23 @@ t Flask, + abort, request @@ -65,36 +65,16 @@ SGIParty -, PartylineConnector %0A%0A%0Aclass @@ -98,28 +98,8 @@ lask -, PartylineConnector ):%0A @@ -352,17 +352,70 @@ arty -_wrapper) +)%0A self.partyline = None%0A self.connected = False %0A%0A @@ -434,16 +434,8 @@ arty -_wr...
30f48175d9e4972599b564708fb65a6c534c9f12
fix migrations
GeoHealthCheck/migrations/versions/2638c2a40625_.py
GeoHealthCheck/migrations/versions/2638c2a40625_.py
"""empty message Revision ID: 2638c2a40625 Revises: 992013af402f Create Date: 2017-09-08 10:48:19.596099 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2638c2a40625' down_revision = '992013af402f' branch_labels = None depends_on = None alembic_helpers = imp....
Python
0.000002
@@ -151,16 +151,37 @@ y as sa%0A +import imp%0Aimport os%0A %0A%0A# revi @@ -367,16 +367,20 @@ ers', (%0A + os.getcw @@ -446,16 +446,17 @@ .py'))%0A%0A +%0A def upgr @@ -533,57 +533,8 @@ '):%0A - from sqlalchemy.sql import table, column%0A @@ -672,213 +672,83 @@ lean -, nullable=True, default=T...
6968c06464649fdfea7d3419c5f8048f60097e91
Update ipwb/__main__.py
ipwb/__main__.py
ipwb/__main__.py
import sys import os import argparse import tempfile import string # For generating a temp file for stdin import random # For generating a temp file for stdin from .__init__ import __version__ as ipwbVersion # ipwb modules from . import replay from . import indexer from . import util as ipwbUtil from .util import I...
Python
0
@@ -2139,17 +2139,16 @@ print(( -f %22%3E ipwb @@ -2250,17 +2250,16 @@ -f %22%5Cn%22))%0A%0A
ce843a7b6e941652da9fa9dd60a865e113a0c98a
Fix format
resources/lib/login.py
resources/lib/login.py
# -*- coding: utf-8 -*- # Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi. # Copyright (C) 2016 - 2017 MrKrabat # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundati...
Python
0.02182
@@ -2976,17 +2976,16 @@ kie.name - : cookie
9533235fb39155033f4b45ac5595fa00e100122c
Remove unused import
nuxeo-drive-client/nxdrive/tests/test_readonly.py
nuxeo-drive-client/nxdrive/tests/test_readonly.py
import os import time import sys from nxdrive.tests.common_unit_test import UnitTestCase from nose.plugins.skip import SkipTest from nxdrive.logging_config import get_logger log = get_logger(__name__) class TestReadOnly(UnitTestCase): def setUp(self): super(TestReadOnly, self).setUp() self.engi...
Python
0
@@ -18,19 +18,8 @@ time -%0Aimport sys %0A%0Afr
644680f1548e91c43015a0868d836b31ef584dfb
Rename 'build_bdist' to 'bdist_base', and get it by default from the "bdist" command rather than "build".
Lib/distutils/command/clean.py
Lib/distutils/command/clean.py
"""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18 __revision__ = "$Id$" import os from distutils.core import Command from distutils.util import remove_tree class clean (Command): description = "clean up output of...
Python
0
@@ -661,18 +661,17 @@ ('b -uild-bdist +dist-base =', @@ -969,26 +969,25 @@ self.b -uild_bdist +dist_base = None%0A @@ -1624,16 +1624,60 @@ d_temp') +)%0A self.set_undefined_options('bdist' ,%0A @@ -1712,33 +1712,31 @@ ('b -uild_bdist', 'build_bdist +dist_base', 'bdist_base '))%0A @@ -2504,26 ...
c90eba7dcf2759b534c79b638a933956d876f255
Add another example.
lib/ansible/modules/extras/packaging/os/pkg5.py
lib/ansible/modules/extras/packaging/os/pkg5.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Peter Oliver <ansible@mavit.org.uk> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
Python
0.000001
@@ -1617,16 +1617,122 @@ e=absent +%0A%0A# Install several packages at once:%0A- pkg5:%0A name:%0A - /file/gnu-findutils%0A - /text/gnu-grep %0A'''%0A%0A%0Ad
6fe8f0fbf33bd14fa242237bc1450eca1679ebf9
fix deprecation warning
bird_classify.py
bird_classify.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000019
@@ -4600,21 +4600,23 @@ ine. -C +c lassify -WithI +_with_i mage
0ebbd859732854e7e008a588bd78dd02efc58e4d
Make the Issue model a little saner
issues/models.py
issues/models.py
import string import datetime from django.contrib.gis.db import models from django.utils import timezone from django.utils.crypto import get_random_string ID_KEYSPACE = string.ascii_lowercase + string.digits class MultipleJurisdictionsError(ValueError): pass class Jurisdiction(models.Model): identifier = ...
Python
0.000388
@@ -1141,36 +1141,24 @@ d(blank=True -, default=%22%22 )%0A status @@ -1163,34 +1163,49 @@ us = models. -Text +Char Field( +max_length=64, blank=True, @@ -1205,32 +1205,36 @@ =True, default=%22 +open %22)%0A service_c @@ -1333,32 +1333,48 @@ True, default=%22%22 +, editable=False )%0A descriptio @@ ...
4614cd4e85159edc1f510542a766833092eff4cb
tweak directinput
osspeak/recognition/actions/library/directinput.py
osspeak/recognition/actions/library/directinput.py
# direct inputs # source to this solution and code: # http://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game # http://www.gamespp.com/directx/directInputKeyboardScanCodes.html import ctypes import time SendInput = ctypes.windll.user32.SendInput mouse_button_down_mapping = { ...
Python
0.000001
@@ -665,16 +665,61 @@ : 0x11,%0A + 'a': 0x1E,%0A 's': 0x1F,%0A 'd': 0x20,%0A 'ctr @@ -2420,9 +2420,8 @@ end( -* keys @@ -2436,16 +2436,17 @@ elay = . +0 1%0A ke @@ -2567,58 +2567,62 @@ -for code in k + ReleaseK ey +( code -s: +) %0A - ReleaseK +# for code in k ey -( code -) +s...
7d66ddf309afebadd0000074acef66d9647b52fb
Replace actions by effects in state_transition
src/yawf/state_transition.py
src/yawf/state_transition.py
# -*- coding: utf-8 -*- import logging from types import GeneratorType from django.db import transaction from yawf.signals import transition_handled from yawf.utils import select_for_update from yawf.config import REVISION_ATTR, USE_SELECT_FOR_UPDATE from yawf import get_workflow_by_instance from yawf.exceptions impo...
Python
0.000003
@@ -4293,22 +4293,22 @@ e)%0A%0A -action +effect s = work @@ -4324,22 +4324,22 @@ ary.get_ -action +effect s(%0A @@ -4445,22 +4445,22 @@ %0A if -action +effect s:%0A @@ -4470,24 +4470,24 @@ for -action in action +effect in effect s:%0A @@ -4503,22 +4503,22 @@ yield -action +effect (%0A ...
27d35f4dbf2d8a05a6abfcf73ef9ef51986d8770
add scheduled searchvector logging
jarbas/celery.py
jarbas/celery.py
import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jarbas.settings') app = Celery('jarbas') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() @app.on_after_configure.connect def setup_periodic_tasks(sen...
Python
0
@@ -439,45 +439,124 @@ -management.call_command('searchvector +print('Running searchvector...')%0A management.call_command('searchvector')%0A print('Searchvector is done ')%0A%0A
aa210a956d1014cab5a0d7bbfe3f07c6d7124ad6
Normalize the volume profile by the initial volume
profiles.py
profiles.py
# Standard libraries import sys # Related modules try: import numpy as np except ImportError: print('NumPy must be installed') sys.exit(1) class VolumeProfile(object): """ Set the velocity of the piston by using a user specified volume profile. The initialization and calling of this class are...
Python
0.000001
@@ -1200,15 +1200,13 @@ the -maximum +first vol @@ -1218,16 +1218,24 @@ # + element so that @@ -1271,24 +1271,34 @@ alculate the +%0A # velocity.%0A @@ -1403,12 +1403,8 @@ '%5D)/ -max( keyw @@ -1418,17 +1418,19 @@ proVol'%5D -) +%5B0%5D %0A%0A
85d3ed2ecb88ffc3d6cb87b4af8afcc23f369863
Add the extension .g.cs for the protoc output files (#335)
rules_csharp_gapic/csharp_gapic.bzl
rules_csharp_gapic/csharp_gapic.bzl
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0
@@ -813,24 +813,69 @@ eps = deps,%0A + opt_args = %5B%22file_extension=.g.cs%22%5D,%0A outp
2c7ccb7d801dcedf5fac62eb2123480ba0523aad
fix for session stats parsing
parse_session_stats.py
parse_session_stats.py
#! /usr/bin/env python # Copyright Arvid Norberg 2008. Use, modification and distribution is # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os, sys, time ignore = ['download rate', 'disk block buffers'] stat = ope...
Python
0.000002
@@ -1051,16 +1051,30 @@ umn = 2%0A +%09first = True%0A %09for k i @@ -1081,16 +1081,16 @@ n keys:%0A - %09%09if k n @@ -1137,16 +1137,51 @@ ontinue%0A +%09%09if not first: print %3E%3Eout, ', ',%0A %09%09print @@ -1234,17 +1234,16 @@ th steps -, ' %25 (sys @@ -1280,16 +1280,32 @@ mn-2%5D),%0A +%09%09first = F...
a614fcb0ae9170a8d0b9f50fed5ad2edb271a376
Fix name of test module.
go/apps/bulk_message/vumi_app.py
go/apps/bulk_message/vumi_app.py
# -*- test-case-name: go.apps.bulk_message.tests.test_bulk_message_vumi_app -*- # -*- coding: utf-8 -*- """Vumi application worker for the vumitools API.""" from twisted.internet.defer import inlineCallbacks from vumi.application import ApplicationWorker from vumi.persist.message_store import MessageStore from vumi....
Python
0
@@ -47,29 +47,16 @@ ts.test_ -bulk_message_ vumi_app
16070ee6d1ddc8ebbbb3cdc3992553f6e4f1daa3
Create get_company_type_selection
l10n_be_cooperator/models/subscription_request.py
l10n_be_cooperator/models/subscription_request.py
from odoo import fields, models class SubscriptionRequest(models.Model): _inherit = "subscription.request" company_type = fields.Selection( [("scrl", "SCRL"), ("asbl", "ASBL"), ("sprl", "SPRL"), ("sa", "SA")] )
Python
0
@@ -13,24 +13,16 @@ port - fields, models%0A %0A%0Acl @@ -17,16 +17,16 @@ models%0A + %0A%0Aclass @@ -103,16 +103,24 @@ t%22%0A%0A +def get_ company_ @@ -127,19 +127,10 @@ type - = fields.S +_s elec @@ -134,16 +134,22 @@ lection( +self): %0A @@ -153,9 +153,29 @@ -%5B +return %5B%0A ...
490d09a31415d3fd1b16f650188bfd8e701ae8e8
Support units in progress messages
progress.py
progress.py
# # Copyright (C) 2009 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0
@@ -754,16 +754,26 @@ total=0 +, units='' ):%0A s @@ -902,16 +902,40 @@ = False +%0A self._units = units %0A%0A def @@ -1415,19 +1415,23 @@ 3d%25%25 (%25d +%25s /%25d +%25s ) ' %25 ( @@ -1480,32 +1480,45 @@ self._done, + self._units, %0A self. @@ -1515,32 +1515,45 @@ self._total ...
f57baf219001d9f138bec5b4e793ed7f3cadffe1
Support latest-sync-revision in User API handler.
api/handlers.py
api/handlers.py
# # Copyright (c) 2009 Brad Taylor <brad@getcoded.net> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
Python
0
@@ -884,16 +884,49 @@ nsaction +%0Afrom django.db.models import Max %0A%0Afrom p @@ -2080,32 +2080,156 @@ %0A %7D,%0A + 'latest-sync-revision' : Note.objects.filter(author=user).aggregate(Max('last_sync_rev'))%5B'last_sync_rev__max'%5D%0A # TO
0ceb5c3f03d02f99ce28e9b92fa77c9384cd9470
Fix failing BigQuery tests
ibis/tests/all/test_client.py
ibis/tests/all/test_client.py
import pytest from pkg_resources import parse_version import ibis import ibis.expr.datatypes as dt @pytest.mark.xfail_unsupported def test_version(backend, con): expected_type = ( type(parse_version('1.0')), type(parse_version('1.0-legacy')), ) assert isinstance(con.version, expected_type...
Python
0.000007
@@ -93,16 +93,57 @@ s as dt%0A +from ibis.tests.backends import BigQuery%0A %0A%0A@pytes @@ -1559,16 +1559,57 @@ %5D,%0A)%0A +@pytest.mark.xfail_backends((BigQuery,))%0A @pytest.
b43a0fb6524af3dfe43aef681795bf739c394fe6
Add "IF NOT EXSISTS" option on Create table query, and add article exists check method.
blo/DBControl.py
blo/DBControl.py
# -*- coding: utf-8 -*- import sqlite3 from datetime import datetime from blo.BloArticle import BloArticle class DBControl: def __init__(self, db_name: str=":memory:"): """Initializer for blo blog engine database controller. :param db_name: database file name connect to it database file. default ...
Python
0
@@ -853,16 +853,30 @@ L TABLE +IF NOT EXISTS Articles @@ -908,16 +908,16 @@ XT );%22)%0A - @@ -1073,16 +1073,276 @@ = None%0A%0A + def is_exists(self, digest: str):%0A c = self.db_conn.cursor()%0A c.execute(%22SELECT * FROM Articles WHERE digest = ?;%22, (digest,))%0A ret = c.fet...
b4888b00d6b63361509a152a8ead444138fa2e95
include peers bw-limiter or disk-limiter state in peer up and down graphs
parse_session_stats.py
parse_session_stats.py
#! /usr/bin/env python # Copyright Arvid Norberg 2008. Use, modification and distribution is # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os, sys, time stat = open(sys.argv[1]) line = stat.readline() while not 's...
Python
0
@@ -2496,32 +2496,64 @@ ers up requests' +, 'peers disk-up', 'peers bw-up' %5D)%0Agen_report('p @@ -2639,16 +2639,52 @@ equests' +, 'peers disk-down', 'peers bw-down' %5D)%0Agen_r
94b010cff5cba4619fe8c4643669c8c5eb3dec08
Bump version to 0.3.3
sappho/__init__.py
sappho/__init__.py
if __name__ == "__main__": __version__ = "0.3.2" else: from animatedsprite import AnimatedSprite from tilemap import TileMap, Tilesheet, tmx_file_to_tilemaps from layers import SurfaceLayers
Python
0.000001
@@ -47,9 +47,9 @@ 0.3. -2 +3 %22%0Ael
c1a51f02c6c11fcec4d3f4cf64c774c8b907e8df
update to version 2.1.1
src/SSHLibrary/version.py
src/SSHLibrary/version.py
VERSION = '2.1'
Python
0
@@ -7,10 +7,12 @@ N = '2.1 +.1 '%0A
45603b9afde272cd3393ac9204e68f870c9b0f3e
Remove Python version test changes
tests/logic_adapter_tests/test_mathematical_evaluation.py
tests/logic_adapter_tests/test_mathematical_evaluation.py
from unittest import TestCase from chatterbot.logic import MathematicalEvaluation from chatterbot.conversation import Statement class MathematicalEvaluationTests(TestCase): def setUp(self): import sys self.adapter = MathematicalEvaluation() # Some tests may return decimals under python ...
Python
0.000001
@@ -194,28 +194,8 @@ f):%0A - import sys%0A%0A @@ -243,115 +243,8 @@ ()%0A%0A - # Some tests may return decimals under python 3%0A self.python_version = sys.version_info%5B0%5D%0A%0A @@ -3136,168 +3136,8 @@ t)%0A%0A - if self.python_version %3C= 2:%0A self.assertEqu...
46f2659a15a3abf1063c6fa4daad584ebc169ad9
Allow 'localhost' for production settings
discuss/discuss/production.py
discuss/discuss/production.py
from discuss.discuss.settings import * ########################################################################## # # Server settings # ########################################################################## ALLOWED_HOSTS = [] WSGI_APPLICATION = 'discuss.discuss.wsgi_production.application' ####################...
Python
0.000227
@@ -223,16 +223,27 @@ OSTS = %5B +%22localhost%22 %5D%0A%0AWSGI_
b4323061aa5559fdaa51a89b4a2768faea93b65d
Fix show_from_cache option
shinken/modules/snmp_booster/snmpbooster.py
shinken/modules/snmp_booster/snmpbooster.py
import os import glob from shinken.basemodule import BaseModule from shinken.log import logger try: import memcache from configobj import ConfigObj, Section except ImportError, e: logger.error("[SnmpBooster] Import error. Maybe one of this module is " "missing: memcache, configobj, pysnmp...
Python
0.000001
@@ -1019,16 +1019,20 @@ = bool( +int( getattr( @@ -1148,21 +1148,18 @@ -False +0) ))%0A
d96438913865bd70df75c532919018ce547e3e18
Remove incorrect docs for environment variables in attribute_modifications.py.
src/satosa/micro_services/attribute_modifications.py
src/satosa/micro_services/attribute_modifications.py
import re from .base import ResponseMicroService class AddStaticAttributes(ResponseMicroService): """ Add static attributes to the responses. The path to the file describing the mapping (as YAML) of static attributes must be specified with the environment variable 'SATOSA_STATIC_ATTRIBUTES'. """...
Python
0
@@ -149,168 +149,8 @@ ses. -%0A%0A The path to the file describing the mapping (as YAML) of static attributes must be specified%0A with the environment variable 'SATOSA_STATIC_ATTRIBUTES'. %0A @@ -540,153 +540,8 @@ gex. -%0A%0A The path to the file describing the filters (as YAML) must be specified%0A ...
844902e5b8d4810d94a2f25eb4708e7137569a03
fix static 403
blog/settings.py
blog/settings.py
""" Django settings for blog project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os im...
Python
0.000002
@@ -1932,16 +1932,84 @@ lates'), +%0A os.path.join(os.path.dirname(__file__), 'static'), %5D,%0A
79086d3de93329475dc2a67e05fccbb401f34754
Add missing VariantCycle in _hoomd.py
hoomd/_hoomd.py
hoomd/_hoomd.py
# This file exists to allow the hoomd module to import from the source checkout dir # for use when building the sphinx documentation. class Messenger(object): def openPython(self): pass def notice(self, i, v): pass class GetarCompression(object): FastCompress = 1 class GetarDumpMode(obje...
Python
0.000062
@@ -1476,28 +1476,67 @@ iantRamp(Variant):%0A pass%0A +%0Aclass VariantCycle(Variant):%0A pass%0A
2aeb7165238e848048ce3c6f9b411d55e281b419
Supprime requested_period_last_value dans les variables foncieres
openfisca_france/model/revenus/capital/foncier.py
openfisca_france/model/revenus/capital/foncier.py
# -*- coding: utf-8 -*- from openfisca_france.model.base import * # Rentes viagères class f1aw(Variable): cerfa_field = u"1AW" value_type = int unit = 'currency' entity = FoyerFiscal label = u"Rentes viagères à titre onéreux perçues par le foyer par âge d'entrée en jouissance : Moins de 50 ans" ...
Python
0.000001
@@ -2712,56 +2712,8 @@ idu%0A - base_function = requested_period_last_value%0A @@ -3821,56 +3821,8 @@ idu%0A - base_function = requested_period_last_value%0A @@ -3875,32 +3875,32 @@ s et non lou%C3%A9s%22%0A + definition_p @@ -4011,56 +4011,8 @@ idu%0A - base_function = requested_period_la...
f0911754b5c5bd40bac5c203b730339ee5379c52
Change exploitation strategy
src/tetris/tetris_agent.py
src/tetris/tetris_agent.py
from keras.models import Sequential, model_from_json from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import * from keras.optimizers import SGD from tetris_game import POSSIBLE_MOVES, TIME_PER_TICK, MOVES_POOL from collections import deque import os import glob import numpy as np import qu...
Python
0
@@ -1074,36 +1074,107 @@ -return random.random() %3C 0.8 +if n_plays %3E 250000:%0A return random.random() %3C 0.80%0A return random.random() %3C 0.4 0%0A%0A
acc468d29114f453120b4b5232c5f45f61dcf167
remove unnecessary tf import
rnndatasets/ptb/ptb.py
rnndatasets/ptb/ptb.py
"""Gets data read for penn treebank as per mikolov et al. Much of the code here is based on: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/models/rnn/ptb/reader.py """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import collect...
Python
0.000143
@@ -410,16 +410,18 @@ y as np%0A +# import t
df3d18108b8b22e23e4418ae18719d74dbc2267d
Set default watermark
app/settings.py
app/settings.py
import os from pathlib import Path ROOT = Path(__file__).parent.parent.resolve() # Server configuration PORT = int(os.environ.get("PORT", 5000)) WORKERS = int(os.environ.get("WEB_CONCURRENCY", 1)) if "DOMAIN" in os.environ: # staging / production SERVER_NAME = os.environ["DOMAIN"] RELEASE_STAGE = "staging"...
Python
0.000002
@@ -2250,16 +2250,17 @@ IONS%22, %22 +, %22%0A).spli
01925fdfffe68dbcc1ee04348c6408bf903122f9
change unknown to None in Netatmo public (#16845)
homeassistant/components/sensor/netatmo_public.py
homeassistant/components/sensor/netatmo_public.py
""" Support for Sensors using public Netatmo data. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.netatmo_public/. """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SC...
Python
0
@@ -474,23 +474,8 @@ DITY -, STATE_UNKNOWN )%0Afr @@ -4397,37 +4397,28 @@ lf._state = -STATE_UNKNOWN +None %0A @@ -5247,21 +5247,12 @@ e = -STATE_UNKNOWN +None %0A
0edc5da104fa5b2f0a0ed975973a2069a7df6674
remove D net overpowered
BGAN/bgan_train.py
BGAN/bgan_train.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data import sys import time import bgan_model as bgan sys.path.append('../') import image_utils as iu result...
Python
0.000001
@@ -1450,46 +1450,8 @@ ork%0A - if not d_overpowered:%0A @@ -1526,36 +1526,32 @@ - - feed_dict=%7B%0A @@ -1538,36 +1538,32 @@ feed_dict=%7B%0A - @@ -1624,36 +1624,32 @@ - model.z: batch_z @@ -1642,36 +1642,32 @@ del.z: b...
37605da734cff0359ed9555a810d94837f995231
fix visitor extend modifiers
district42/_schema_visitor.py
district42/_schema_visitor.py
from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, Generic, TypeVar if TYPE_CHECKING: from .types import ( AnySchema, BoolSchema, ConstSchema, DictSchema, FloatSchema, IntSchema, ListSchema, NoneSchema, StrSchema, )...
Python
0
@@ -2064,16 +2064,17 @@ swith(%22_ +_ %22):%0A
b459b34d582d8b0cdd074ee187f849c92a7f958f
Return function on wrong indent level
redditpoller/management/commands/check_watched_users.py
redditpoller/management/commands/check_watched_users.py
from django.core.management import BaseCommand from django.utils import timezone from redditpoller.models import WatchedUser, WatchedUserComment, WatchedUserThread from redditpoller.poller import get_user_threads, get_user_comments, notify_user from datetime import timedelta class Command(BaseCommand): help = "Ch...
Python
0.000003
@@ -4319,20 +4319,16 @@ - return '
a8274e8abb660b1819fa4eaaa02ee7f6baa03606
update for solar
forecast_marginal_estimator.py
forecast_marginal_estimator.py
#!/usr/bin/env python """ Loads forecast info, fits beta distributions to marginals. """ import pandas as pd import numpy as np import os from kernel_regression import KernelRegression from itertools import izip __copyright__ = "Copyright 2016, Tue Vissing Jensen" __credits__ = ["Tue Vissing Jensen"] __license__ = "M...
Python
0
@@ -612,16 +612,35 @@ 'wind'%0A +CATEGORY = 'solar'%0A FCNAME = @@ -1037,30 +1037,8 @@ ()%0A%0A -# optimal_gammas = %5B%5D%0A outm @@ -1966,183 +1966,8 @@ mas) -%0A # optimal_gammas.append(kreg.gamma)%0A # Get polynomial fit for mean production%0A # meanpolycoeff = np.polyfit(testx, kreg.pred...
720a37a7874c9ca1b963604fc2026a7e777334c1
update to handle local memcached
impactstoryanalytics/cache.py
impactstoryanalytics/cache.py
import os import pylibmc import hashlib import logging import json from cPickle import PicklingError #from totalimpact.utils import Retry # set up logging logger = logging.getLogger("ti.cache") class CacheException(Exception): pass class Cache(object): """ Maintains a cache of URL responses in memcached """...
Python
0
@@ -927,49 +927,8 @@ ry:%0A - mc = pylibmc.Client(%0A @@ -942,17 +942,19 @@ servers -= + = %5Bos.envi @@ -983,24 +983,17 @@ RVERS')%5D -,%0A +%0A @@ -996,18 +996,16 @@ - username @@ -1042,25 +1042,17 @@ ERNAME') -,%0A +%0A @@ -1055,17 +1055,1...
128d771654b99e56c0a3f399936ac2dbe046109a
create release/1.6.1 branch
dojo/__init__.py
dojo/__init__.py
# This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app # noqa __version__ = '1.6.0' __url__ = 'https://github.com/DefectDojo/django-DefectDojo' __docs__ = 'http://defectdojo.readthedocs.io/' __demo__ = 'http://defectdojo.pyt...
Python
0
@@ -174,9 +174,9 @@ 1.6. -0 +1 '%0A__
21ac6cc593abe631dfc076c5142ce12146069c8f
Enable fetching events by source ID.
been/couch.py
been/couch.py
from hashlib import sha1 import time import calendar import couchdb from core import Store def dates_to_epoch(d): for key, value in d.iteritems(): if hasattr(value, "iteritems"): d[key] = dates_to_epoch(value) elif type(value) is time.struct_time: d[key] = calendar.timegm(va...
Python
0
@@ -3374,16 +3374,29 @@ ore=None +, source=None ):%0A @@ -3455,16 +3455,171 @@ +view = 'activity/events'%0A%0A if source is not None:%0A options%5B'startkey'%5D = source%0A view = 'activity/events-by-source'%0A el if befor @@ -3674,16 +3674,17 @@ before%0A +%0A ...
4f006ccf3b53b237ada95099b44ba1d9f2f106fe
Clean up imports
python_scripts/extractor_python_readability_server.py
python_scripts/extractor_python_readability_server.py
#!/usr/bin/python import sys import os import glob #sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py")) sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/")) sys.path.append(os.path.dirname(__file__) ) from thrift.transport import TSocket from thrift.transport import TTranspor...
Python
0
@@ -49,76 +49,8 @@ lob%0A -#sys.path.append(os.path.join(os.path.dirname(__file__), %22gen-py%22))%0A sys. @@ -466,30 +466,8 @@ er%0A%0A -#import thrift_solr%0A%0A%0A impo @@ -486,17 +486,16 @@ Service%0A -%0A import s @@ -497,17 +497,16 @@ ort sys%0A -%0A import r @@ -517,35 +517,16 @@ bility%0A%0A -import re...
65105ab4b886ddc87a60cfa4e6600d8996164a81
Update __init__.py
pythonforandroid/recipes/websocket-client/__init__.py
pythonforandroid/recipes/websocket-client/__init__.py
from pythonforandroid.toolchain import Recipe # if android app crashes on start with "ImportError: No module named websocket" # # copy the 'websocket' directory into your app directory to force inclusion. # # see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe class WebSocketClient(R...
Python
0.000002
@@ -288,16 +288,337 @@ -recipe%0A +#%0A# If you see errors relating to 'SSL not available' ensure you have the package backports.ssl-match-hostname%0A# in the buildozer requirements, since Kivy targets python 2.7.x%0A#%0A# You may also need sslopt=%7B%22cert_reqs%22: ssl.CERT_NONE%7D as a parameter to ws.run_forever()...
c2e7f172153d9b1059926c9368c03bd9c33156f0
add some explaining comments
drawBot/ui/drawView.py
drawBot/ui/drawView.py
from AppKit import * from Quartz import PDFView, PDFThumbnailView, PDFDocument from vanilla import Group epsPasteBoardType = "CorePasteboardFlavorType 0x41494342" class DrawBotPDFThumbnailView(PDFThumbnailView): def draggingUpdated_(self, draggingInfo): return NSDragOperationNone class ThumbnailView(...
Python
0
@@ -915,24 +915,177 @@ lf, event):%0A + # ignore cmd + %60 as the PDFView has a bug here%0A # DrawBot%5B15705%5D: -%5B__NSCFConstantString characterAtIndex:%5D: Range or index out of bounds%0A if e
d8c9a4799d0ec23f9aa9b4419878fdba59236217
Restored a missing autocommit
openquake/engine/tests/db/upgrade_manager_test.py
openquake/engine/tests/db/upgrade_manager_test.py
import os import mock import unittest import psycopg2 import importlib from contextlib import contextmanager from openquake.engine.db.models import getcursor from openquake.engine.db.upgrade_manager import ( upgrade_db, version_db, what_if_I_upgrade, VersionTooSmall, DuplicatedVersion) conn = getcursor('admin...
Python
0.99978
@@ -5940,8 +5940,39 @@ ommit()%0A + conn.autocommit = True%0A
6d0fcb019b6d43e32ac29591220a6ce49c79e6b4
Remove extraneous broadcast_event method.
hashi/client.py
hashi/client.py
#!/usr/bin/env python import sys import json from collections import defaultdict from zmq.core import constants from txZMQ import ZmqFactory, ZmqEndpoint, ZmqConnection from twisted.words.protocols import irc from twisted.internet import protocol, reactor zf = ZmqFactory() class ZmqPushConnection(ZmqConnection): ...
Python
0.000005
@@ -2757,115 +2757,8 @@ f)%0A%0A - def broadcast_event(self, identity, event):%0A self.events.send_multipart(%5Bidentity, %22 %22, event%5D)%0A %0Aif
99a11e055f3edaf6e25e796af9cc95a8eddfacfd
remove path
calendar_manage.py
calendar_manage.py
from __future__ import print_function import httplib2 import os import sys from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import datetime try: import argparse flags = argparse.ArgumentParser(parents=[tools.argparser]).par...
Python
0.000051
@@ -995,102 +995,10 @@ dir, - '.credentials')%0A if not os.path.exists(credential_dir):%0A os.makedirs(credential_dir +'' )%0A
1241f0819fe19aa3327747a83b4c222471cd2dda
Fix suggestion `unique_id` solution key
rosie/core/__init__.py
rosie/core/__init__.py
import os.path import numpy as np from sklearn.externals import joblib class Core: """ This is Rosie's core object: it implements a generic pipeline to collect data, clean and normalize it, analyzies the data and output a dataset with suspicions. It's initialization module takes a settings module and ...
Python
0.000004
@@ -1172,17 +1172,30 @@ if -( +self.settings. UNIQUE_I @@ -1196,17 +1196,16 @@ IQUE_IDS -) :%0A
8ca2b5c366c8eb678790e4865bef0ccbf8b9ffde
remove gevent monkey_patch while we are developing
call_server/app.py
call_server/app.py
try: from gevent.monkey import patch_all patch_all() except ImportError: print "unable to apply gevent monkey.patch_all" from flask import Flask from flask.ext.assets import Bundle from .config import DefaultConfig from .admin import admin from .user import user from .call import call from .campaign impor...
Python
0
@@ -1,13 +1,86 @@ +#TODO, figure out how to load gevent monkey patch only in production%0A# try:%0A +# + from @@ -111,16 +111,18 @@ tch_all%0A +# patc @@ -129,16 +129,18 @@ h_all()%0A +# except I @@ -151,16 +151,42 @@ tError:%0A +# if not DEBUG:%0A# prin
ec0f2dca2b828748317bbddace034a0056957b16
Fix PEP8 on EMAIL_REGEXP
openstack_lease_it/openstack_lease_it/settings.py
openstack_lease_it/openstack_lease_it/settings.py
""" Django settings for openstack_lease_it project. Generated by 'django-admin startproject' using Django 1.8.7. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ #...
Python
0.000028
@@ -1043,16 +1043,17 @@ EGEXP = +r %22%5E%5BA-Za-
8e6237288dae3964cdd0a36e747f53f11b285073
Include recently added matchers in callee.__all__
callee/__init__.py
callee/__init__.py
""" callee """ __version__ = "0.0.1" __description__ = "Argument matcher for unittest.mock" __author__ = "Karol Kuczmarski" __license__ = "Simplified BSD" from callee.base import And, Or, Not from callee.general import \ Any, ArgThat, IsA, Inherits, InstanceOf, Matching, SubclassOf from callee.strings import Byte...
Python
0
@@ -187,16 +187,92 @@ Or, Not%0A +from callee.collections import Dict, List, Mapping, Iterable, Sequence, Set%0A from cal @@ -422,16 +422,41 @@ l__ = %5B%0A + 'BaseMatcher', 'Eq',%0A 'Not @@ -475,45 +475,162 @@ r',%0A +%0A ' -Any',%0A 'Matching', 'ArgThat', +Iterable', 'Sequence',%0A 'List', 'Set...
bb6c33969c7bb8359c2b0cdcfeff5aa6f9e8d3ff
Bump to v4.1.1-rc1
pebble_tool/version.py
pebble_tool/version.py
version_base = (4, 1, 0) version_suffix = None if version_suffix is None: __version_info__ = version_base else: __version_info__ = version_base + (version_suffix,) __version__ = '{}.{}'.format(*version_base) if version_base[2] != 0: __version__ += '.{}'.format(version_base[2]) if version_suffix is not No...
Python
0
@@ -15,17 +15,17 @@ (4, 1, -0 +1 )%0Aversio @@ -35,20 +35,21 @@ uffix = -None +'rc1' %0A%0Aif ver
6017c0ad6a7b6ffbf81ac81a826b65b1f995b444
fix multiple line argument reading closes #1527
framework/tests/ParseGetPot.py
framework/tests/ParseGetPot.py
#!/usr/bin/python import sys, re class GPNode: def __init__(self, name, parent): self.name = name self.parent = parent self.params = {} self.params_list = [] #This is here to capture the ordering self.param_comments = {} self.children = {} self.children_list = [] #This is here to captur...
Python
0.000326
@@ -1630,15 +1630,11 @@ *(%5B%5E -(#.* +' %5Cn -) %5D+)%22
ebfc308ea4b8851118e8194d837556bf443c329c
add coverage for non-hex value to -minimumchainwork
test/functional/feature_minchainwork.py
test/functional/feature_minchainwork.py
#!/usr/bin/env python3 # Copyright (c) 2017-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for setting nMinimumChainWork on command line. Nodes don't consider themselves out of "init...
Python
0.000002
@@ -4833,16 +4833,310 @@ True)%0A%0A + self.log.info(%22Test -minimumchainwork with a non-hex value%22)%0A self.stop_node(0)%0A self.nodes%5B0%5D.assert_start_raises_init_error(%0A %5B%22-minimumchainwork=test%22%5D,%0A expected_msg='Error: Invalid non-hex (test) minimum cha...
fcc7edd411ae4babff4ced75d3d6dbc63fe2c80a
Set random seed value for denoising tests
skimage/filter/tests/test_denoise.py
skimage/filter/tests/test_denoise.py
import numpy as np from numpy.testing import run_module_suite, assert_raises, assert_equal from skimage import filter, data, color, img_as_float lena = img_as_float(data.lena()[:256, :256]) lena_gray = color.rgb2gray(lena) def test_denoise_tv_chambolle_2d(): # lena image img = lena_gray # add noise to ...
Python
0
@@ -141,16 +141,39 @@ float%0A%0A%0A +np.random.seed(1234)%0A%0A%0A lena = i
7e358d7d32233ffce863307b745d92f017be5a69
Update an example test
examples/test_double_click.py
examples/test_double_click.py
from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_double_click_and_switch_to_frame(self): self.open("https://www.w3schools.com/jsref" "/tryit.asp?filename=tryjsref_ondblclick") self.ad_block() self.switch_to_frame("#iframeResult") self.doubl...
Python
0
@@ -39,10 +39,19 @@ ass -My +DoubleClick Test @@ -85,40 +85,40 @@ est_ -double_click_and_switch_to_frame +switch_to_frame_and_double_click (sel @@ -288,16 +288,22 @@ _frame(%22 +iframe #iframeR @@ -434,25 +434,8 @@ est_ -double_click_and_ swit @@ -456,16 +456,33 @@ _element +_and_double_click (self):%0A
54f87103b189c54ece54b5dcef1d6332ca7ea17f
change encoding from gb2312 to gb18030
best_price.py
best_price.py
# -*- coding=utf-8 -*- try: import csv import time import random import requests import warnings from bs4 import BeautifulSoup except ImportError: print 'One or more modules can not be imported! Check FAQ in README.md for solutions.' # Close all warnings warnings.filterwarnings('ignore') ...
Python
0.000036
@@ -2253,30 +2253,31 @@ t(k.encode(' -gb2312 +GB18030 '), csgo_pri @@ -2891,14 +2891,15 @@ de(' -gb2312 +GB18030 '),
2a2a1c9ad37932bf300caf02419dd55a463d46d1
Add nocov for lines that will never normally run
src/tmod_tools/__main__.py
src/tmod_tools/__main__.py
""" Entrypoint module, in case you use `python -mtmod_tools`. Why does this file exist, and why __main__? For more info, read: - https://www.python.org/dev/peps/pep-0338/ - https://docs.python.org/2/using/cmdline.html#cmdoption-m - https://docs.python.org/3/using/cmdline.html#cmdoption-m """ from tmod_tools.cli impo...
Python
0
@@ -320,16 +320,36 @@ ort main + # pragma: no cover %0A%0Aif __n @@ -368,16 +368,36 @@ main__%22: + # pragma: no cover %0A mai