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
262efddb6c2ac0bf2a60a1d02705fa9ff66c96bf
Fix init scale in transformer example, avoid an extra sqrt.
examples/transformer/model.py
examples/transformer/model.py
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Python
0.000091
@@ -4731,24 +4731,16 @@ = 2. / -np.sqrt( self._nu @@ -4747,17 +4747,16 @@ m_layers -) %0A dro
006ef89dfcd3761ebe363b0ca0680d63fbe018a4
Load Freesound credentials from env variables in prod env
freesound_datasets/settings.py
freesound_datasets/settings.py
""" Django settings for freesound_datasets project. Generated by 'django-admin startproject' using Django 1.10.6. 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/ """...
Python
0
@@ -556,13 +556,418 @@ ipt%0A +if os.getenv('DEPLOY_ENV', 'dev') == 'prod':%0A # If in production environment, load them from environment variables%0A FS_CLIENT_ID = os.getenv('FS_CLIENT_ID', None)%0A FS_CLIENT_SECRET = os.getenv('FS_CLIENT_SECRET', None)%0A if FS_CLIENT_ID is None or FS_CLIENT_SECRET is N...
8b8c698f1a02789e54d6f765872facf099ab851c
Add more interpreter versions to multipython example
doc/en/example/multipython.py
doc/en/example/multipython.py
""" module containing a parametrized tests testing cross-python serialization via the pickle module. """ import py import pytest import _pytest._code pythonlist = ['python2.6', 'python2.7', 'python3.3'] @pytest.fixture(params=pythonlist) def python1(request, tmpdir): picklefile = tmpdir.join("data.pickle") ret...
Python
0
@@ -193,17 +193,30 @@ python3. -3 +4', 'python3.5 '%5D%0A@pyte
11faafcbf7d3dad761d43ef67f9733ecb45423a1
Fix error when there are no docker volumes present yet (#28145)
lib/ansible/modules/cloud/docker/docker_volume.py
lib/ansible/modules/cloud/docker/docker_volume.py
#!/usr/bin/python # coding: utf-8 # # Copyright 2017 Red Hat | Ansible, Alex Grönholm <alex.gronholm@nextday.fi> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'meta...
Python
0
@@ -3785,32 +3785,97 @@ (text_type(e))%0A%0A + if volumes%5Bu'Volumes'%5D is None:%0A return None%0A%0A for volu
28d7e7915db0529a04ee7ad70f041bee95b35a5b
Fix imports in backoff.py to prevent warnings
scraper/backoff.py
scraper/backoff.py
import requests from requests.packages.urllib3.util.retry import Retry TIMEOUT = 5 # Time before a request times out BACKOFF = 0.25 # Try 0.0s, 0.25s, 0.5s, 1s, 2s between requests AMOUNT = 13 # Amount of request to make before giving up class TimeoutHTTPAdapter(requests.adapters.HTTPAdapter): def __init__(se...
Python
0.000001
@@ -12,50 +12,30 @@ ests -%0Afrom requests.packages.urllib3.util.retry +.adapters%0Afrom urllib3 imp
50e8f6e540bb8e94b61a0ee10b966b5b5c00f930
test objectsio
sktracker/io/tests/test_objectsio.py
sktracker/io/tests/test_objectsio.py
import os from nose import with_setup from sktracker import data from sktracker.io import objectsio def test_from_store(): store_path = data.sample_h5()
Python
0.000001
@@ -97,16 +97,35 @@ bjectsio +, validate_metadata %0A%0Adef te @@ -176,13 +176,102 @@ le_h5()%0A -%0A +oio = objectsio.ObjectsIO.from_h5(store_path)%0A assert validate_metadata(oio.metadata)%0A%0A
e7b16b7f2f80f8f224fc443b580a847cc9c3e263
fix spelling
scraper/votings.py
scraper/votings.py
import logging import requests import lxml.html import dateparser logger = logging.getLogger(__name__) TWEEDEKAMER_URL = 'https://www.tweedekamer.nl' SEARCH_URL = 'https://www.tweedekamer.nl/zoeken' class Vote(object): def __init__(self, vote_table_row): self.vote_table_row = vote_table_row sel...
Python
0.999999
@@ -1788,10 +1788,10 @@ 'AG -I A +I NST'
2eae9322c837e5e2c6b733f13a1428ff62c83279
Allow Print to output to a stream.
penchy/jobs/filters.py
penchy/jobs/filters.py
""" This module provides filters. Inputs are fed to filters via keywords in the ``run`` method. Outputs are available via the ``out`` attribute. """ import logging import re from pprint import pprint from penchy.jobs.elements import Filter, SystemFilter log = logging.getLogger(__name__) class WrongInputError(Exc...
Python
0
@@ -3246,48 +3246,266 @@ def -run(self, **kwargs +__init__(self, stream=None ): +%0A -# pragma: no cover + %22%22%22%0A :param stream: stream to print to, defaults to sys.stdout%0A :type stream: open :class:%60file%60%0A %22%22%22%0A super(Print, self).__init__()%0A%0A sel...
0a45f998fe76243f397ee982a3660fe7d62911d5
Fix misspellings
salt/modules/gnomedesktop.py
salt/modules/gnomedesktop.py
# -*- coding: utf-8 -*- ''' GNOME implementations ''' # Import Python libs from __future__ import absolute_import import re import logging try: import pwd HAS_PWD = True except ImportError: HAS_PWD = False # Import 3rd-party libs try: from gi.repository import Gio, GLib # pylint: disable=W0611 HA...
Python
0.000008
@@ -1056,18 +1056,18 @@ def g -e s +e tting_co @@ -1130,18 +1130,18 @@ un the g -e s +e ttings b @@ -1653,34 +1653,34 @@ cmd = self.g -e s +e tting_command + @@ -2557,18 +2557,18 @@ = self.g -e s +e tting_co
6819bfde8df253a94fd63d80c655cfe59789ee1b
Update messenger.py
bot/messenger.py
bot/messenger.py
# -*- coding: utf-8 -*- import logging import random logger = logging.getLogger(__name__) class Messenger(object): def __init__(self, slack_clients): self.clients = slack_clients def send_message(self, channel_id, msg): # in the case of Group and Private channels, RTM channel payload is a c...
Python
0.000001
@@ -1831,21 +1831,12 @@ nly -@ juan -twothree %22,%22T @@ -2576,10 +2576,9 @@ rry, -@s +S harp
33aa75b99dab3810e44da6e69ebe5bec3b1ab20b
Update src/nanoemoji/disjoint_set.py
src/nanoemoji/disjoint_set.py
src/nanoemoji/disjoint_set.py
# https://en.wikipedia.org/wiki/Disjoint-set_data_structure import collections from typing import FrozenSet, Generic, Generator, Tuple, TypeVar T = TypeVar("T") class DisjointSet(Generic[T]): def __init__(self): self.parent = {} self.rank = {} def make_set(self, e: T): if e in self....
Python
0
@@ -1062,29 +1062,10 @@ ot%5D -= self.rank%5Bx_root%5D + += 1%0A%0A
8831db8606c89ab6832e9b07abad06f09e6a96a6
fix json aspath
lib/exabgp/bgp/message/update/attribute/aspath.py
lib/exabgp/bgp/message/update/attribute/aspath.py
# encoding: utf-8 """ aspath.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ from exabgp.bgp.message.update.attribute.id import AttributeID from exabgp.bgp.message.update.attribute import Flag,Attribute # ======================================================...
Python
0.000055
@@ -2140,14 +2140,23 @@ '%5B -%25s, %25s +%5B %25s %5D, %5B %25s %5D %5D' %25 @@ -2201,29 +2201,16 @@ seq%5D)),' -( %25s ) ' %25 (' , '.join @@ -2233,33 +2233,32 @@ n self.as_set%5D)) -) %0A%09%09%09%09else:%0A%09%09%09%09%09
f5685f5da99ccfd0b4bc0a018dfd474e9edca810
Rename dag BaseModel to be in line with config
code/marv-api/marv_api/dag.py
code/marv-api/marv_api/dag.py
# Copyright 2020 Ternaris. # SPDX-License-Identifier: AGPL-3.0-only # pylint: disable=too-few-public-methods,invalid-name,no-self-argument,no-self-use from typing import Optional, Union from pydantic import BaseModel as _BaseModel from pydantic import Extra, create_model, validator class BaseModel(_BaseModel): ...
Python
0
@@ -217,43 +217,9 @@ odel - as _BaseModel%0Afrom pydantic import +, Ext @@ -258,19 +258,14 @@ ass -Base Model( -_ Base @@ -562,20 +562,16 @@ Inputs( -Base Model):%0A @@ -1114,20 +1114,16 @@ ss Node( -Base Model): @@ -1983,20 +1983,16 @@ Stream( -Base Model):%0A
aeca7082cf506d6bcbcf203f8b485796bc5a6eee
Add a link on how to properly do eject on windows
plugins/LocalFileStorage/WindowsRemovableDrives.py
plugins/LocalFileStorage/WindowsRemovableDrives.py
import threading import string from ctypes import windll import ctypes import time import os import subprocess ## Removable drive support for windows class WindowsRemoveableDrive(threading.Thread): def __init__(self, drives): super(WindowsRemoveableDrive, self).__init__() self.daemon = True ...
Python
0
@@ -2722,16 +2722,139 @@ ecting.%0A + #%0A #See http://support2.microsoft.com/?scid=kb%253Ben-us%253B165721&x=18&y=13 for how to do it with just WinAPI%0A
30fca51cbd74b0dba46462d6383dc9055d67eed1
Fix for #11, how could I miss this one?
captcha/helpers.py
captcha/helpers.py
# -*- coding: utf-8 -*- import random from captcha.conf import settings def math_challenge(): operators = ('+','*','-',) operands = (random.randint(1,10),random.randint(1,10)) operator = operators[random.randint(0,len(operators)-1)] if operands[0] < operands[1] and '-' == operator: operands = (...
Python
0
@@ -197,38 +197,21 @@ r = -operators%5Brandom.randint(0,len +random.choice (ope @@ -217,20 +217,16 @@ erators) --1)%5D %0A if @@ -584,45 +584,28 @@ += -chars%5B random. -randint(0,len +choice (chars) --1)%5D %0A @@ -758,45 +758,28 @@ += -chars%5B random. -randint(0,len +choice (chars) --1)%5D %0...
a741bbf53ea62a264bb7c8e7f66ac299026d0b8a
Update OpenStack release name for integration tests
fuelweb_test/nailgun_client.py
fuelweb_test/nailgun_client.py
# Copyright 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0
@@ -3086,15 +3086,39 @@ == %22 -Grizzly +OpenStack Grizzly on CentOS 6.4 %22:%0A
84fcfd46b4282c0cf7ea6f1fb68370ba90d7c796
fix typo in render_template
hflossk/site.py
hflossk/site.py
""" Author: Remy D <remyd@civx.us> Ralph Bean <rbean@redhat.com> Sam Lucidi <mansam@csh.rit.edu> License: Apache 2.0 """ from __future__ import division import os import yaml import hashlib from datetime import datetime # flask dependencies from flask import Flask from flask import jsonify from flas...
Python
0.001021
@@ -3888,17 +3888,23 @@ %0A%0A re -s +turn re nder_tem
2796d19412b29ec1c392dff01fac88757f7928e6
Add watch support to the cms state
salt/states/cmd.py
salt/states/cmd.py
''' Command Executions ================== The cmd state module manages the enforcement of executed commands, this state can tell a command to run under certian circumstances. Available Functions ------------------- The cmd state only has a single function, the ``run`` function run ~~~ Execute a command given certi...
Python
0
@@ -2847,12 +2847,26 @@ return ret%0A%0A +watcher = run%0A
26d8188024845055b96597833f1e8b077aaa84a9
Make advisor.py capable of running a proper Advisor analysis
scripts/advisor.py
scripts/advisor.py
import os import sys from pathlib import Path from subprocess import check_call import click @click.command() # Required arguments @click.option('--path', '-p', help='Absolute path to the Devito executable.', required=True) @click.option('--output', '-o', help='A directory for storing profiling reports...
Python
0
@@ -72,16 +72,48 @@ eck_call +%0Afrom tempfile import gettempdir %0A%0Aimport @@ -1116,16 +1116,91 @@ =True)%0A%0A + # Devito must be told where to find Advisor, because it uses its C API%0A if a @@ -1339,131 +1339,1572 @@ -os.environ%5B'DEVITO_PROFILING'%5D = 'advisor'%0A%0A command = %5B'python', ...
8afb6763e69e6e4435ff951c64e849f3118fd232
Order adduct columns by charge (ascending)
mcf_standard_browser/standards_review/tables.py
mcf_standard_browser/standards_review/tables.py
import logging import numpy as np from django.core.urlresolvers import reverse_lazy from django.db.utils import OperationalError from django.utils import safestring from table import Table from table.columns import Column, LinkColumn, Link from table.utils import Accessor from models import Standard, Adduct, Molecule...
Python
0
@@ -3861,16 +3861,35 @@ ts.all() +.order_by(%22charge%22) :%0A
e95a3fd3b190baacda0a646ca0cab1d20d9ef5a0
Downgrade log.error in process_email(): it's mostly spam at this point (#19707)
src/olympia/activity/tasks.py
src/olympia/activity/tasks.py
import olympia.core.logger from olympia.activity.models import ActivityLogEmails from olympia.activity.utils import add_email_to_activity_log_wrapper from olympia.amo.celery import task from olympia.amo.decorators import use_primary_db log = olympia.core.logger.getLogger('z.amo.activity') @task @use_primary_db def...
Python
0.000049
@@ -1257,13 +1257,15 @@ log. -error +warning (%0A
f809506eaa20af8441217d9901b65834e11b1104
Use relative paths for VPI source files
fusesoc/simulator/simulator.py
fusesoc/simulator/simulator.py
import argparse import os import logging from fusesoc.edatool import EdaTool from fusesoc.utils import run_scripts logger = logging.getLogger(__name__) class FileAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, [os.path.abspath(valu...
Python
0
@@ -1374,27 +1374,27 @@ = %5Bos.path. -abs +rel path(os.path @@ -1417,16 +1417,32 @@ f.name) +, self.work_root ) for f
c13e0d94c5490ac0220dc741cbcf01e8a84115c7
Fix typo
app/__init__.py
app/__init__.py
from __future__ import print_function from inspect import isclass, getmembers from importlib import import_module from itertools import imap, repeat from sqlalchemy.exc import IntegrityError, OperationalError from savalidation import ValidationError from flask import Flask, render_template, g from flask.ext.sqlalchemy...
Python
0.999999
@@ -1613,17 +1613,16 @@ ailable! -. %22%0A%09%09kwar
87b7967fca02be19b03beaacabcbbaf522a45348
Fix prospector
polyaxon/dockerizer/dockerizer/initializer/init.py
polyaxon/dockerizer/dockerizer/initializer/init.py
import traceback from typing import Tuple from . import settings from .extract import extract_code, extract_dockerfile from .download import download from .generate import generate def init(job: 'Job', build_context: str, from_image: str, commit: str, context_path: str, d...
Python
0.000001
@@ -189,32 +189,68 @@ init(job: 'Job', + # pylint:disable=too-many-branches %0A build_ @@ -2116,21 +2116,16 @@ xception - as e :%0A
d2950f4360cecbd3a71cc4eb7a857316a173acf4
fix typo in comment
sasmodels/models/spherepy.py
sasmodels/models/spherepy.py
r""" For information about polarised and magnetic scattering, click here_. .. _here: polar_mag_help.html Definition ---------- The 1D scattering intensity is calculated in the following way (Guinier, 1955) .. math:: I(q) = \frac{\text{scale}}{V} \cdot \left[ 3V(\Delta\rho) \cdot \frac{\sin(qr) - qr\cos...
Python
0.001377
@@ -4172,17 +4172,16 @@ cepts an -d array o
54010535f402d4e9bcbd58524bf431cfc476d6c8
remove unreachable code
cartodb/cartodb.py
cartodb/cartodb.py
# -*- encoding: utf-8 -*- """ ** CartoDBClient ** A simple CartoDB client to perform requests against the CartoDB API. Internally it uses OAuth * Requirements: python 2.5 pip install oauth2 pip install simplejson # if you're running python < 2.6 * Example use: user = 'your@mai...
Python
0.998361
@@ -2746,30 +2746,8 @@ )%0A%0A%0A - return None%0A%0A%0A clas
f1372842fa1c3eef11f4e9dbe2b35af02c1c5bf5
Fix the migration so it takes care of bad default for resource links.
mdot_rest/migrations/0003_auto_20150723_1759.py
mdot_rest/migrations/0003_auto_20150723_1759.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mdot_rest', '0002_auto_20150722_2054'), ] operations = [ migrations.RemoveField( model_name='resourcelink', ...
Python
0
@@ -494,10 +494,9 @@ ult= -'' +1 , to
58ae1b483801a53c0119e2d7c9e1d2c27652c2c5
Fix typo in django admin (#16604)
src/olympia/shelves/models.py
src/olympia/shelves/models.py
from django.db import models from olympia.amo.models import ModelBase ENDPOINTS = ('collections', 'search', 'search-themes') ENDPOINT_CHOICES = tuple((ty, ty) for ty in ENDPOINTS) class Shelf(ModelBase): title = models.CharField(max_length=200) endpoint = models.CharField( max_length=200, choices=E...
Python
0.000035
@@ -987,16 +987,19 @@ 'will +be included @@ -999,19 +999,16 @@ ncluded -be in shelf
c415a1c30ad51ef4bdf005b4b5c39301a2837efc
Bump to version 0.6.0
app/__init__.py
app/__init__.py
# -*- coding: utf-8 -*- """ app ~~~ Provides the flask application """ ########################################################################### # WARNING: if running on a a staging server, you MUST set the 'STAGE' env # heroku config:set STAGE=true --remote staging ######################################...
Python
0
@@ -1292,11 +1292,11 @@ '0. -5.2 +6.0 '%0A__
ab73d6ccf86e929b8b4cba6c934ba592cd8f1589
Make eq role work in sphinx
rst2pdf/sphinxnodes.py
rst2pdf/sphinxnodes.py
# -*- coding: utf-8 -*- #$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ # See LICENSE.txt for licensing terms ''' This module contains sphinx-specific node handlers. An import of this module will apparently fail if sphinx.roles hasn't been imported. This module creates a sphinx-specific dispatch dictionary, w...
Python
0.002271
@@ -5632,16 +5632,39 @@ tex','') +,node.get('label',None) )%5D%0A%0A @@ -5988,16 +5988,248 @@ scent)%0A%0A +class HandleSphinxEq(SphinxHandler, mathbase.eqref):%0A%0A def get_text(self, client, node, replaceEnt):%0A return '%3Ca href=%22equation-%25s%22 color=%22%25s%22%3E%25s%3C/a%3E'%25(node%5B'targe...
d0b288a5f6aaf00683d6b0d8b981301c8030b509
add self to pop
scripts/populate_popular_history.py
scripts/populate_popular_history.py
import setup_django from django.utils import timezone from api.models import EyeHistory,PopularHistory, PopularHistoryInfo import datetime from urllib2 import urlopen from lxml import etree import urllib2 from accounts.models import UserProfile from api.utils import humanize_time def reset_values(): p = PopularH...
Python
0.000001
@@ -2854,16 +2854,21 @@ users = +list( UserProf @@ -2932,16 +2932,17 @@ elated() +) %0A @@ -2943,32 +2943,74 @@ %0A +follow_users.append(eyehist.user.profile)%0A %0A for use @@ -3904,32 +3904,246 @@ p.delete()%0A %0A + p = PopularHistory.objects.filter(user__isnull=False)%0A ...
1128aac773e6a8cf271db36c2d9530cee3ef31ca
Rearrange imports
app/__init__.py
app/__init__.py
# -*- coding: utf-8 -*- """ app ~~~~~~~~~~~~~~ Provides the flask application """ from __future__ import print_function import re import config from inspect import isclass, getmembers from functools import partial, update_wrapper from importlib import import_module from itertools import imap, repeat from os impo...
Python
0.00005
@@ -339,68 +339,8 @@ dir%0A -from sqlalchemy.exc import IntegrityError, OperationalError%0A from @@ -419,16 +419,77 @@ plate, g +%0A%0Afrom sqlalchemy.exc import IntegrityError, OperationalError %0Afrom fl
b5957756cf3680faca627ef0a492c90f6594ee90
Add assert_racefree support to regression2sv-benchmarks.py
scripts/regression2sv-benchmarks.py
scripts/regression2sv-benchmarks.py
#!/usr/bin/python3 import sys from pathlib import Path import re import subprocess goblint_root = Path(".") goblint_regression = goblint_root / "tests" / "regression" EXCLUDE_TASKS = [ "04-mutex_13-failed_locking", "04-mutex_31-uninitialized", "04-mutex_49-type-invariants", "04-mutex_29-funstruct_rc...
Python
0.000001
@@ -2301,16 +2301,314 @@ = True%0A +%0A if re.search(r%22assert_racefree%5B%5E%5Cn%5D*//%5Cs*UNKNOWN%22, content):%0A properties%5B%22../properties/unreach-call.prp%22%5D = False%0A elif %22assert_racefree%22 in content:%0A # if didn't contain UNKNOWN assert_racefree, must be race-free%0A p...
fbf13169173025451d3a6c13e37d8fb8a167284f
Unify silent
expyfun/_sound_controllers.py
expyfun/_sound_controllers.py
"""Hardware interfaces for sound output""" # Authors: Dan McCloy <drmccloy@uw.edu> # Eric Larson <larsoner@uw.edu> # # License: BSD (3-clause) import numpy as np from scipy import fftpack import sys import os _use_silent = (os.getenv('_EXPYFUN_SILENT', '') == 'true') _linux = ('silent',) if _use_silent else ...
Python
0.012338
@@ -276,118 +276,8 @@ e')%0A -_linux = ('silent',) if _use_silent else ('pulse',)%0A_win32 = ('silent',) if _use_silent else ('directsound',)%0A _opt @@ -301,14 +301,18 @@ ux2= -_linux +('pulse',) ,%0A @@ -452,16 +452,87 @@ on Py3k%0A +_driver = _opts_dict%5Bsys.platform%5D if not _use_silent else ('silent',)%0A...
c4a40a5a17ae7a5a1758bc7d3adb7beb11567684
format code
rqalpha/mod/rqalpha_mod_sys_simulation/signal_broker.py
rqalpha/mod/rqalpha_mod_sys_simulation/signal_broker.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
Python
0.000061
@@ -800,94 +800,8 @@ ent%0A -from rqalpha.model.order import LimitOrder%0Afrom rqalpha.model.order import ORDER_TYPE%0A from @@ -876,16 +876,28 @@ US, SIDE +, ORDER_TYPE %0A%0Afrom .
f16febdfc17ea7fcb9f4f8a960b3fb6b5c4ce26d
append `GermanNationalDay` to `regular_holidays`
pandas_market_calendars/exchange_calendar_eurex.py
pandas_market_calendars/exchange_calendar_eurex.py
# # kewlfft # from datetime import time from pandas.tseries.holiday import ( Holiday, previous_friday, GoodFriday, EasterMonday, ) from pytz import timezone from pandas.tseries.holiday import AbstractHolidayCalendar from .market_calendar import ( MarketCalendar, MONDAY, TUESDAY, WEDNESDAY, THUR...
Python
0.999999
@@ -2426,16 +2426,47 @@ ayBank,%0A + GermanNationalDay,%0A
bacd05f50574a3149d5e765be8821f66bd14191b
Update for rpm based systems
ceph_deploy/lsb.py
ceph_deploy/lsb.py
def lsb_release(): import subprocess args = [ 'lsb_release', '-s', '-i', '-r', '-c', ] p = subprocess.Popen( args=args, stdout=subprocess.PIPE, ) out = p.stdout.read() ret = p.wait() if ret != 0: raise subprocess.C...
Python
0
@@ -1,13 +1,12 @@ -%0A def lsb_rele @@ -51,95 +51,1001 @@ = %5B -%0A 'lsb_release',%0A '-s',%0A '-i',%0A '-r',%0A '-c',%0A + 'which', 'lsb_release', %5D%0A p = subprocess.Popen(%0A args=args,%0A stdout=subprocess.PIPE,%0A )%0A distro = p.stdout.rea...
8ee1d65a474096ae4682ed0820304b436b079737
use bzrlib.merge3 correctly in merge_3way
docweb/utils.py
docweb/utils.py
import time import difflib import cgi import tempfile import subprocess import cPickle as pickle from django.shortcuts import render_to_response, get_object_or_404 from django.http import (HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponse, Http404) from django.core.urlresolvers...
Python
0.000001
@@ -2710,17 +2710,16 @@ %22%22%22%0A -%0A # 1. @@ -2836,20 +2836,21 @@ ines(), -mine +other .splitli @@ -2848,37 +2848,36 @@ r.splitlines(), -other +mine .splitlines())%0A @@ -2911,17 +2911,17 @@ es(name_ -a +b =%22web ve @@ -2964,17 +2964,17 @@ name_ -b +a =%22new sv
3e0b4f393b2bd395a26591f1a138dffb3fc934e1
document usage of s3_connection sub-object in JSON config
hatrac/model/storage/amazons3.py
hatrac/model/storage/amazons3.py
# # Copyright 2015 University of Southern California # Distributed under the Apache License, Version 2.0. See LICENSE for more info. # """Filesystem-backed object bulk storage for Hatrac. This module handles only low-level byte storage. Object and object-version lifecycle and authorization is handled by the caller. ...
Python
0.000001
@@ -769,19 +769,16 @@ - boto.S3C @@ -809,16 +809,215 @@ ection)) +, e.g.:%0A%0A aws_access_key_id,%0A aws_secret_access_key,%0A provider,%0A security_token,%0A anon,%0A validate_certs %0A%0A
c622a3d59d21abab5410c7449020d0bf7694d9a6
Change the callbacks from the channel (in Protocol.py) to call the implementations (in swi.py) using set_timeout. This ensures the call is on the main thread, not the websocket thread. Can now remove most of the set_timeouts in swi.py.
protocol.py
protocol.py
import os import sys import json swi_folder = os.path.dirname(os.path.realpath(__file__)) if not swi_folder in sys.path: sys.path.append(swi_folder) import threading import websocket import swi class Protocol(object): """ Encapsulate websocket connection """ def __init__(self): self.next_id = 0 ...
Python
0
@@ -1,12 +1,13 @@ +%EF%BB%BF import os%0Aim @@ -26,16 +26,31 @@ ort json +%0Aimport sublime %0A%0Aswi_fo @@ -2759,32 +2759,33 @@ data = None%0A +%0A @@ -2776,32 +2776,52 @@ +self.to_main_thread( notification.cal @@ -2825,16 +2825,18 @@ callback +, (data, n @@ -2847,16 +28...
f86578c88e61b81cd5bdbf5e1cd6841aeabaf0e6
Use module locator
wutu/tests/modules/test_module/test_module.py
wutu/tests/modules/test_module/test_module.py
from wutu.module import Module from wutu.util import load_js from test_util import test_locator class TestModule(Module): def __init__(self): super(TestModule, self).__init__() def ping(self): return "pong" def get(self, id): return {"result": id} def get_identifier(self): ...
Python
0.000001
@@ -23,16 +23,32 @@ t Module +, module_locator %0Afrom wu @@ -74,43 +74,8 @@ _js%0A -from test_util import test_locator%0A %0A%0Acl @@ -374,20 +374,8 @@ js(%22 -test_module/ cont @@ -390,12 +390,14 @@ s%22, -test +module _loc
d4a8720d9f8ce9e7b73dfd804e45f3cdb9bd6ca1
Update database.py
app/database.py
app/database.py
from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base engine0 = create_engine('postgresql://gui:AniTa08@128.175.112.125/anita_0116d', convert_unicode=True) Base = declarative_base() # engine0 seems can be any database, does n...
Python
0.000001
@@ -196,31 +196,29 @@ a08@ -128.175.112.125 +67.239.76.218 /anita_0 116d @@ -217,12 +217,12 @@ ta_0 -116d +710a ', c
a4dd311658e555403b0587983be6f0e9765e46e6
Update pullover.py
pullover.py
pullover.py
#!/usr/bin/env python import sys, getopt from flask import Flask from flask import request import subprocess from config import repos def main(argv): try: opts, args = getopt.getopt(argv,"hr") except getopt.GetoptError: print_help() sys.exit(2) for opt, arg in opts: if opt == '-...
Python
0
@@ -565,16 +565,24 @@ s=%5B'GET' +, 'POST' %5D)%0A d
097aaaf639f0fa5f2e9eae26ca5b7eb0c610faba
Add script to check SNIC user status on ngi-internal:Improvements 1
statusdb_snicuser_checker.py
statusdb_snicuser_checker.py
#!/usr/bin/env python """ Get open projects from statusdb, checks if the users have a SNIC account and writes the result back into statusdb. """ import argparse import yaml from couchdb import Server import requests from requests.auth import HTTPBasicAuth import json def update_statusdb(config, dryrun=True): url_s...
Python
0
@@ -846,20 +846,26 @@ -flag +update_doc = False @@ -1332,36 +1332,42 @@ -flag +update_doc = True%0A%0A @@ -1381,56 +1381,8 @@ se:%0A - snic_checked = %7B'status': True%7D%0A @@ -1665,22 +1665,44 @@ -if not + snic_checked%5B'status'%5D = snic_ch...
e3464414886ec28fe8c989ea0af0b310ef176a0a
Remove commented code.
app/database.py
app/database.py
"""This module initialises database transactions.""" from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from config.config import Config engine = create_engine(Config.DATABASE_URI, convert_unicode=True) db_session = scope...
Python
0
@@ -558,27 +558,26 @@ %0A %22%22%22 -i +I nitiali -ses +ze databas
b78d5bc7a592350ac4995b20ba7343aa2409efc1
bump version to 3.13.0 in setup.py
py/setup.py
py/setup.py
#!/usr/bin/env python # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # ...
Python
0
@@ -1155,17 +1155,17 @@ n': %223.1 -2 +3 .0%22,%0A
869597b8f874f8a6bea0a47115e839e8681532f1
Use pillow, not PIL
storagemgr/storage/smhash.py
storagemgr/storage/smhash.py
import hashlib import Image from logger import init_logging logger = init_logging(__name__) def smhash(fn): """Try and return the hash of just the image data. If not, the entire file.""" try: img = Image.open(fn) img_data = img.tostring() hasher = hashlib.sha256() hasher.u...
Python
0.002122
@@ -8,16 +8,25 @@ hashlib%0A +from PIL import I
42626626d393208e533eacc4dfd91d5680723ee8
Update menu to be compatible with pygame-menu v2
pibooth/config/menu.py
pibooth/config/menu.py
# -*- coding: utf-8 -*- """Pibooth config menu. """ import pygame import pygameMenu as pgm from pygameMenu import config_controls from pygameMenu import events as pgmevt from pygameMenu import fonts as pgmfonts from pibooth.config.parser import DEFAULT config_controls.MENU_CTRL_BACK = pygame.K_ESCAPE def _find(ch...
Python
0
@@ -112,28 +112,32 @@ port con -fig_controls +trols as pmgctrl %0Afrom py @@ -258,33 +258,19 @@ T%0A%0A%0A -config_controls.MENU_CTRL +pmgctrl.KEY _BAC @@ -1376,18 +1376,16 @@ elf. -config.sav +_on_clos e,%0A @@ -1776,20 +1776,8 @@ evt. -PYGAME_MENU_ EXIT @@ -1885,12 +1885,8 @@ pgm. -Text Menu @@ -1927,39 +1...
9c69e19225d98afaca6ca129ac1c9a4013e39e35
fix collide.hit file location.
assets/files.py
assets/files.py
from pathlib import Path, PureWindowsPath from pygame.mixer import Sound from resources.cmp import CmpFile from resources.font import FontFile from resources.piv import PivFile from settings import MOONSTONE_DIR from resources.terrain import TerrainFile from .collide import parse_collision_file def load_file(file_...
Python
0
@@ -1740,16 +1740,22 @@ n_file(%22 +DISKB%5C COLLIDE.
2cfa2ef22dae4d0dc434bd79aa849033b8ed53d3
update version
pillowtalk/__init__.py
pillowtalk/__init__.py
__version__ = "1.0.6dev" from .base import * from .schemas import * from .relationship import * from .session import SessionManager from .exceptions import * from marshmallow import pprint
Python
0
@@ -16,9 +16,9 @@ 1.0. -6 +7 dev%22
94d57446c7e74881816115954a1b8528421df2f1
Add libjpeg-turbo 2.0.3 (#13152)
var/spack/repos/builtin/packages/libjpeg-turbo/package.py
var/spack/repos/builtin/packages/libjpeg-turbo/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class LibjpegTurbo(Package): """libjpeg-turbo is a fork of the original IJG libjpeg which uses S...
Python
0
@@ -680,17 +680,17 @@ ive/2.0. -2 +3 .tar.gz%22 @@ -691,16 +691,112 @@ ar.gz%22%0A%0A + version('2.0.3', sha256='a69598bf079463b34d45ca7268462a18b6507fdaa62bb1dfd212f02041499b5d')%0A vers @@ -1551,14 +1551,14 @@ _on( -%22 +' yasm -%22 +' , ty @@ -1588,14 +1588,14 @@ _on( -%22 +' nasm -%22 +' , ty @@ -1...
cacfd08c63bbcc29686b4279593901b5edb4ddd7
fix assignment to request arguments
pyvk/api.py
pyvk/api.py
# ----------------------------------------------------------------------------- # pyvk: vk.py # # Defines classes for VK API public interface, requests, and authorisation. # # Copyright (c) 2013-2016, Max Kuznetsov # Licence: MIT # ----------------------------------------------------------------------------- from __fu...
Python
0.000001
@@ -2650,37 +2650,32 @@ -self. args%5B'captcha_si @@ -3044,21 +3044,16 @@ -self. args%5B'ca
b0e7168ce5182272691e22122acb7be3800cfa13
remove unused code
planetstack/observer/steps/sync_site_privileges.py
planetstack/observer/steps/sync_site_privileges.py
import os import base64 from django.db.models import F, Q from planetstack.config import Config from observer.openstacksyncstep import OpenStackSyncStep from core.models import User, UserDeployments, SitePrivilege, SiteDeployments class SyncSitePrivileges(OpenStackSyncStep): requested_interval=0 provides=[S...
Python
0.000017
@@ -491,261 +491,8 @@ v):%0A - if site_priv.user.kuser_id and site_priv.site.tenant_id:%0A self.driver.add_user_role(site_priv.user.kuser_id,%0A site_priv.site.tenant_id,%0A site_priv.role.role) %0A%0A
6185c39d45ced57cfa1ce1df069b13d1a9a326da
replace continue with return
pyytcast.py
pyytcast.py
import configparser import feedparser import os import youtube_dl from feedgen.feed import FeedGenerator config = configparser.ConfigParser() config.read('config.conf') MP3_FOLDER = config.get('paths', 'mp3_folder') URL = config.get('paths', 'url') DEPLOY_PATH = config.get('paths', 'deploy_path') def get_channel_i...
Python
0.001443
@@ -989,17 +989,14 @@ -continue; +return %0A%0A
4355006067f781d502486210655428d665287c3a
change base_profile test from none to empty string
accelerator/tests/test_base_profile.py
accelerator/tests/test_base_profile.py
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals from django.test import TestCase from accelerator.tests.factories import MemberFactory class TestBaseProfile(TestCase): def test_str_is_first_and_last_name(self): member = MemberFactory() display = mem...
Python
0.000002
@@ -520,16 +520,13 @@ _to_ -username +email _if_ @@ -642,12 +642,10 @@ e = -None +'' %0A
6af644a5b7814e3222b2adff24712390df6b56f9
Fix a bug in py-test - expecting wrong type.
py/testdir_single_jvm/test_rf_float_bigexp_fvec.py
py/testdir_single_jvm/test_rf_float_bigexp_fvec.py
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_rf # fyi max FP single precision (hex rep. 7f7f ffff) approx. 3.4028234 * 10**38" print "https://0xdata.atlassian.net/browse/HEX-1315" print "datasets with reals outside the range of singl...
Python
0
@@ -4283,21 +4283,20 @@ lType, ' -float +Real ', msg=%22
742295dcdb08825d0c59f5167fbd46f72d63013e
Fix id and method validation
acquisition/tomviz/jsonrpc/__init__.py
acquisition/tomviz/jsonrpc/__init__.py
import json import traceback import bottle from bottle import post endpoint_map = {} # Invalid JSON was received by the server. An error occurred on the server # while parsing the JSON text. PARSE_ERROR = -32700 # The JSON sent is not a valid Request object. INVALID_REQUEST = -32600 # The method does not exist / is n...
Python
0.000001
@@ -2398,28 +2398,36 @@ or -not id or not method +id is None or method is None :%0A
19e5b75ea80e2623d96ab5620224f9cd17a066ea
Order testimonials by date
aclarknet/aclarknet/aclarknet/views.py
aclarknet/aclarknet/aclarknet/views.py
from django.shortcuts import render from aclarknet.aclarknet.models import Client from aclarknet.aclarknet.models import Service from aclarknet.aclarknet.models import TeamMember from aclarknet.aclarknet.models import Testimonial def clients(request): clients = Client.objects.all() context = {'clients': clien...
Python
0
@@ -1051,36 +1051,47 @@ imonial.objects. -all( +order_by('date' )%0A context =
5918751e53ae66a1b27822d9918808852b0329fb
enable grcov
activedata_etl/transforms/cov_to_es.py
activedata_etl/transforms/cov_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.000001
@@ -3235,26 +3235,24 @@ - # if not task @@ -3294,34 +3294,32 @@ - # Log.warning @@ -3413,26 +3413,24 @@ - # continu @@ -3431,37 +3431,16 @@ ontinue%0A - # %0A @@ -3451,18 +3451,16 @@ - # coverag @@ -3503,18 +3503,16 @@ ...
3898ce548aff92ac23617d39b928448f6a6ef9b6
fix heading
acoustics/standards/iso_1996_1_2003.py
acoustics/standards/iso_1996_1_2003.py
""" ISO 1996-1-2003 =============== ISO 1996-1:2003 defines the basic quantities to be used for the description of noise in community environments and describes basic assessment procedures. It also specifies methods to assess environmental noise and gives guidance on predicting the potential annoyance response of a...
Python
0.000007
@@ -7,17 +7,17 @@ O 1996-1 -- +: 2003%0A===
675c763a763673279596faf7c960ac87440f4b61
Fix get host ips for MPIRunner (#3728)
python/orca/src/bigdl/orca/learn/mpi/mpi_runner.py
python/orca/src/bigdl/orca/learn/mpi/mpi_runner.py
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
0
@@ -1260,24 +1260,91 @@ _node_ip()%0A%0A + from bigdl.util.common import get_node_and_core_number%0A @@ -1441,48 +1441,54 @@ -master = sc.getConf().get(%22spark.master%22 +node_num, core_num = get_node_and_core_number( )%0A @@ -1501,194 +1501,41 @@ -if master == %22local%22 or m...
07a70b3a047c16c8c54c374b898a990fe4df1eb8
Fix linked URL.
irrigator_pro/notifications/notification_email.py
irrigator_pro/notifications/notification_email.py
# Class to handle the notification email. from irrigator_pro.settings import NOTIFICATION_SMTP, NOTIFICATION_HOST, NOTIFICATION_PORT import smtplib from tabulate import tabulate # Still needed? from datetime import date from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart class EmailL...
Python
0
@@ -846,37 +846,13 @@ =%22%25( -host)s/report/summary_report/ +URL)s %22%3EDa @@ -3218,12 +3218,11 @@ ' -host +URL ' :
462c384b3dc56865a145d2fb922b86975299edbc
Bump version to 0.0.0
iga/__init__.py
iga/__init__.py
__version__ = '0.0.0-dev' __author__ = 'Che-Liang Chiou' __author_email__ = 'clchiou@gmail.com' __copyright__ = 'Copyright 2015, Che-Liang Chiou' __license__ = 'MIT' __all__ = [ 'workspace', ] def workspace(**kwargs): import iga.context iga.context.set_global_context(**kwargs)
Python
0.000001
@@ -17,12 +17,8 @@ .0.0 --dev '%0A%0A_
cda357307674ddc19770439b062cee33a029b17f
set command
scan_client/scan/commands.py
scan_client/scan/commands.py
import xml.etree.ElementTree as ET class Comment(object): """Command to add comment""" def __init__(self, text): self.text = text def genXML(self): xml = ET.Element("comment") ET.SubElement(xml, "text").text = self.text return ET.tostring(xml) def __repr__(sel...
Python
0.000056
@@ -1561,50 +1561,8 @@ ue%22%0A - if self.readback == True:%0A @@ -1622,80 +1622,38 @@ vice -%0A else:%0A ET.SubElement(xml, %22readback%22).text = + if self.readback == True else sel
000f367e69181c5e484cd89bdf7badc59c31438d
Refactor to reduce complexity
pipe2py/lib/dotdict.py
pipe2py/lib/dotdict.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ pipe2py.dotdict ~~~~~~~~~~~~~~ Provides methods for creating dicts using dot notation """ from pipe2py import util from feedparser import FeedParserDict class DotDict(FeedParserDict): """A dictionary whose keys can be accessed using dot notation...
Python
0.000085
@@ -1206,16 +1206,291 @@ n keys%0A%0A + def _parse_value(self, value, key):%0A try:%0A value = value%5Bkey%5D%0A except (KeyError, TypeError):%0A if key in %5B'value', 'content', 'utime'%5D:%0A value = value%0A else:%0A value = None%0A%0A ...
e08c012c6d3c6d7c434b7bc50e6d5b7dbe83df1f
Output length of the string
Coursera_HSE_Py_Ass-3.9-Strings-Slices.py
Coursera_HSE_Py_Ass-3.9-Strings-Slices.py
s = input() print(s[2]) print(s[-2]) print(s[:5]) print(s[:-2]) print(s[::2]) print(s[1::2]) print(s[::-1]) print(s[::-2])
Python
1
@@ -112,12 +112,26 @@ nt(s%5B::-2%5D)%0A +print(len(s))%0A
c6338c72869a73b9baa0f74d16206e64437eef41
Update reverse_with_singledispatch.py
job_interview_algs/reverse_with_singledispatch.py
job_interview_algs/reverse_with_singledispatch.py
import functools def swap_it(arr): i = 0 j = -1 for _ in range(len(arr)//2): arr[i], arr[j] = arr[j], arr[i] i += 1 j -= 1 return arr @functools.singledispatch def reverse_it(seq): return swap_it(seq) @reverse_it.register(list) def _(arr): return swap_it(arr) @rev...
Python
0.000002
@@ -344,33 +344,35 @@ ef _(text):%0A -s +arr = list(text)%0A @@ -392,25 +392,27 @@ oin(swap_it( -s +arr ))%0A%0A%0A@revers @@ -446,17 +446,19 @@ t):%0A -s +arr = list( @@ -485,17 +485,19 @@ swap_it( -s +arr ))%0A%0A%0Aif
3fd2d1cade716f264b2febc3627b1443a1d3e604
Fix a problem with a migration between master and stable branch
taiga/projects/migrations/0043_auto_20160530_1004.py
taiga/projects/migrations/0043_auto_20160530_1004.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-05-30 10:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('projects', '0042_auto_20160...
Python
0.000254
@@ -305,28 +305,55 @@ '004 -2_auto_20160525_0911 +0_remove_memberships_of_cancelled_users_acounts '),%0A
6916a3fb24a12ce3c0261034c1dcaae57a8cd0ee
Add stdout flushing statements to example.
docs/examples/kernel/task2.py
docs/examples/kernel/task2.py
#!/usr/bin/env python # encoding: utf-8 from IPython.kernel import client import time tc = client.TaskClient() mec = client.MultiEngineClient() mec.execute('import time') for i in range(24): tc.run(client.StringTask('time.sleep(1)')) for i in range(6): time.sleep(1.0) print "Queue status (vebose=False)...
Python
0
@@ -79,16 +79,52 @@ ort time +%0Aimport sys%0Aflush = sys.stdout.flush %0A%0Atc = c @@ -379,16 +379,28 @@ tatus()%0A + flush()%0A %0Afor @@ -573,16 +573,28 @@ us(True) +%0A flush() %0A%0Afor i @@ -717,16 +717,24 @@ us(True) +%0Aflush() %0A%0Aqs = t @@ -891,32 +891,32 @@ (vebose=True)%22%0A - p...
ddc0cea514705d88aecae4e4852fa1abf1ff4ca3
Add command line arguments to dp_provisioner.py
himlar_dp_prep/dp_provisioner.py
himlar_dp_prep/dp_provisioner.py
import logging import argparse from keystoneclient.auth.identity import v3 from keystoneclient import session from keystoneclient.v3 import client ADMIN_NAME = 'admin' PROJECT_NAME = 'openstack' DEFAULT_DOMAIN_NAME = 'default' DP_DOMAIN_NAME = 'dataporten' MEMBER_ROLE_NAME = 'user' log = logging.getLogger(__name__) ...
Python
0
@@ -3861,16 +3861,214 @@ e url%22)%0A + parser.add_argument('--project-name', default=PROJECT_NAME, help=%22Admin project name%22)%0A parser.add_argument('--dp-domain-name', default=DP_DOMAIN_NAME, help=%22Dataporten domain name%22)%0A @@ -4516,28 +4516,33 @@ ct_name= -PROJECT_NAME +args.proje...
397bba809cb35048d7b1243039fe7c2dc2ca0e58
modify moving.py, set new post updated time to correct time
schoolcms/moving/__main__.py
schoolcms/moving/__main__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """SchoolCMS util. Move old_ann_system to SchoolCMS. Terminal Tool. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from .movinglog import MovingLog from ..db import SessionGen, Announce, Record, ...
Python
0
@@ -3569,32 +3569,50 @@ created=ann_time +, updated=ann_time )%0A sql_se
491c51005ca42dcdb4410b5e7b3afe0822bd509a
Use integer cast instead of case expression
scripts/search.py
scripts/search.py
#!/usr/bin/python import sys from sqlalchemy import case, desc, literal_column from skylines.config import environment from skylines import model NULL = literal_column(str(0)) def ilike_as_int(column, value, relevance): # Make sure relevance is numeric and we can safely # pass it to the literal_column() ...
Python
0.000075
@@ -50,14 +50,8 @@ port - case, des @@ -67,16 +67,31 @@ l_column +, cast, Integer %0A%0Afrom s @@ -477,19 +477,20 @@ Return -cas +ilik e expres @@ -512,11 +512,9 @@ cas -e(%5B +t (col @@ -535,32 +535,28 @@ e), -relevance)%5D, else_=NULL) +Integer) * relevance %0A%0A%0Ad
b6db94b4c557a5bed9192fffdfabf2d5bd9835ae
include all tenants in search
sensu/plugins/check-glance-store.py
sensu/plugins/check-glance-store.py
#!/usr/bin/env python2.7 import argparse import logging import os import pytz import re import sys import time from datetime import datetime, timedelta from dateutil import parser from glanceclient import client from iso8601 import iso8601 from keystoneclient.v2_0 import client as ksclient glance_auth = { 'use...
Python
0
@@ -699,16 +699,100 @@ mages')%0A +argparser.add_argument('--debug', help='Enable API debugging', action='store_true')%0A options @@ -1159,17 +1159,37 @@ cURL')%0A%0A -# +if options.debug:%0A logging @@ -1222,16 +1222,17 @@ .DEBUG)%0A +%0A glance = @@ -1792,16 +1792,112 @@ es = %5B%5D%0A +kwargs = %7B'sort_...
a96f02ac57de414d94b73378bc40348616f1926d
Update B_ETA.py
Cas_4/ETA/B_ETA.py
Cas_4/ETA/B_ETA.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER plt.ion() dir0 = '/homedata/bderembl/runmit/test_southatlgyre3' ds0 = open_mdsdataset(dir0...
Python
0.000001
@@ -342,14 +342,8 @@ = 0%0A -nz = 0 %0Awhi @@ -480,11 +480,8 @@ %5Bnt, -nz, :,:%5D
e2cb957b298c5d1ec652e560076d053d0ceb8137
add condition
account_invoice_sale_data/models/account_invoice.py
account_invoice_sale_data/models/account_invoice.py
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models, _ from openerp.addons import decimal_precision as dp class AccountInvoice(models.Model): _inherit = 'account.invoice' total_net_sale = fields.Float(...
Python
0.000001
@@ -2537,16 +2537,61 @@ ic_id()%0A + if self.type in ('out_invoice'):%0A
523defbe78a6b11e4603bf176c7ecdeb9b146c7c
Fix test for remote python module
Wrapping/Generators/Python/Tests/findEmptyClasses.py
Wrapping/Generators/Python/Tests/findEmptyClasses.py
# ========================================================================== # # Copyright NumFOCUS # # 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/...
Python
0
@@ -851,120 +851,8 @@ ()%0A%0A -%0Adef isEmpty(o):%0A for i in dir(o):%0A if i%5B0%5D.isupper():%0A return False%0A return True%0A%0A%0A excl @@ -1862,102 +1862,683 @@ n%22,%0A -%5D%0A%0Atotal = 0%0Aempty = 0%0A%0Afor t in dir(itk):%0A if t not in exclude:%0A T = itk.__dict__%5B...
a0978d09c5460657fef187ac90ad0eb01b3754bc
update useragent
marionette/tor_browser_tests/test_fp_useragent.py
marionette/tor_browser_tests/test_fp_useragent.py
from marionette_driver import By from marionette_driver.errors import MarionetteException from marionette import MarionetteTestCase class Test(MarionetteTestCase): def test_useragent(self): with self.marionette.using_context('content'): self.marionette.navigate('about:robots') js =...
Python
0.000088
@@ -523,18 +523,18 @@ 6.1; rv: -38 +45 .0) Geck @@ -556,10 +556,10 @@ fox/ -38 +45 .0%22,
2293669674ee7881ff3cfc84cfcbcf2e34de2144
Add error output for missing deps
pkgs/servers/home-assistant/parse-requirements.py
pkgs/servers/home-assistant/parse-requirements.py
#! /usr/bin/env nix-shell #! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ attrs ]) # # This script downloads Home Assistant's source tarball. # Inside the homeassistant/components directory, each integration has an associated manifest.json, # specifying required packages and other integrations it depen...
Python
0
@@ -4283,18 +4283,36 @@ -for +missing_reqs = %5B%5D%0A req - in +s = sor @@ -4347,16 +4347,36 @@ ponent)) +%0A for req in reqs :%0A @@ -4828,58 +4828,329 @@ -else:%0A build_inputs%5Bcomponent%5D = attr_paths + else:%0A missing_reqs.append(name)%0A else:%0A bu...
afdf5d3ccd3556a0f1204ad9a4b92632ed836898
fix for querying api
bingsearch.py
bingsearch.py
import requests URL = 'https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=%(query)s&$top=50&$format=json' API_KEY = 'SECRET_API_KEY' def request(query, **params): r = requests.get(URL % {'query': query}, auth=('', API_KEY)) return r.json['d']['results']
Python
0
@@ -1,8 +1,23 @@ +import urllib2%0A import r @@ -69,18 +69,8 @@ com/ -Data.ashx/ Bing @@ -80,16 +80,54 @@ arch -Web/Web? +/v1/Composite' %5C%0A + '?Sources=%25(source)s& Quer @@ -226,47 +226,135 @@ -r = requests.get(URL %25 %7B'query': query%7D +url = URL %25 %7B'source': urllib2.quote(%22'web'%22),%0A ...
b123c407332b758b583e7b6131cd3cf23aca37ec
update test
_unittests/ut_module/test_compare_module_versions.py
_unittests/ut_module/test_compare_module_versions.py
""" @brief test log(time=5s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if path not in sys.path: ...
Python
0.000001
@@ -1789,16 +1789,23 @@ indings%22 +, %22ad3%22 %5D:%0A
8eaf66d329cc9c8c5411a25cc198152099e3aa21
Use files existing in community and corporate site for tests
readthedocs/rtd_tests/tests/test_config_wrapper.py
readthedocs/rtd_tests/tests/test_config_wrapper.py
from __future__ import absolute_import import mock from django.test import TestCase from django_dynamic_fixture import get from readthedocs.config import BuildConfig, ProjectConfig, InvalidConfig from readthedocs.builds.models import Version from readthedocs.projects.models import Project from readthedocs.doc_builder....
Python
0
@@ -6388,20 +6388,24 @@ find = ' -urls +__init__ .py'%0A @@ -6978,12 +6978,16 @@ = ' -wsgi +__init__ .py'
95f7e96d23fd43b9ffda2a6f45c81665f30a7674
optimize efashion_task.py
efashion_task.py
efashion_task.py
#!/usr/bin/env python #coding: utf-8 # by yanchao email:yanchao727@gmail.com # import random import psycopg2 from datetime import datetime import sys import os sys.path.append('/home/zhangxue/aphrodite') sys.path.append('/home/zhangxue') os.environ['DJANGO_SETTINGS_MODULE'] = 'aphrodite.settings' from django.conf impo...
Python
0.99949
@@ -177,23 +177,24 @@ ('/home/ -zhangxu +aphrodit e/aphrod @@ -226,15 +226,16 @@ ome/ -zhangxu +aphrodit e')%0A @@ -638,14 +638,12 @@ er=' -wgwang +chao ', h @@ -652,19 +652,16 @@ t='1 -92.168.1.55 +27.0.0.1 ', p @@ -669,12 +669,13 @@ rt=' -6403 +18068 ')%0A%0A @@ -1870,16 +1870,251 @@ ll()%5B0%5D%0A + ...
b06952bd9ed1fa298c06bcb3199bac648752b73a
Update ECP example
examples/gto/05-input_ecp.py
examples/gto/05-input_ecp.py
#!/usr/bin/env python from pyscf import gto, scf ''' Use gto.basis.parse_ecp and gto.basis.load_ecp functions to input user-specified ecp functions. ''' mol = gto.M(atom=''' Na 0. 0. 0. H 0. 0. 1.''', basis={'Na':'lanl2dz', 'H':'sto3g'}, ecp = {'Na':'lanl2dz'}) mol = gto.M(atom=''' Na...
Python
0
@@ -1051,8 +1051,241 @@ %0A''')%7D)%0A +%0A%0A#%0A# Burkatzki-Filippi-Dolg pseudo potential and basis are prefixed with %22bfd%22%0A#%0Amol = gto.M(atom='Na 0. 0. 0.; H 0 0 2.',%0A basis=%7B'Na':'bfd-vtz', 'H':'ccpvdz'%7D,%0A ecp = %7B'Na':'bfd-pp'%7D,%0A verbose=0)%0A%0A
3fabae09c849b6fecf1b1d63eb177cea5c0ca7b3
clean does it already but refresh still need to
gitcd/interface/cli/refresh.py
gitcd/interface/cli/refresh.py
from gitcd.interface.cli.abstract import BaseCommand from gitcd.git.branch import Branch class Refresh(BaseCommand): def run(self, branch: Branch): remote = self.getRemote() master = Branch(self.config.getMaster()) if branch.getName() == master.getName(): # maybe i should us...
Python
0
@@ -114,16 +114,41 @@ mand):%0A%0A + updateRemote = True%0A%0A def
490872b8296ec8c93b9631fd61bef7070b732db8
Fix some bugs in the Celery code
eforge/queue/celery.py
eforge/queue/celery.py
# -*- coding: utf-8 -*- # EForge project management system, Copyright © 2010, Element43 # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWA...
Python
0.000083
@@ -1506,17 +1506,16 @@ nc(args= -* args, kw @@ -1523,27 +1523,25 @@ rgs= -** kwargs, -%0A +%0A @@ -1540,55 +1540,17 @@ - +%09%09%09%09%09%09%09%09%09 publ @@ -1778,17 +1778,16 @@ *kwargs) -) %0A%0A de @@ -1800,32 +1800,33 @@ (self, **kw...
5e0016f4a3a54eab6cd71f6e121b9e21d448f923
Bump patch
egta/__init__.py
egta/__init__.py
__version__ = '0.0.21'
Python
0.000001
@@ -17,7 +17,7 @@ .0.2 -1 +2 '%0A
deb5d2fd6aabb21da98afec145b1bcf5e5a332be
Print output in an optional timezone
SLA_bot/schedule.py
SLA_bot/schedule.py
import asyncio import datetime as dt import math import os import sys import aiohttp from discord.ext import commands import icalendar as ical import pytz import SLA_bot.config as cf class Schedule: def __init__(self, bot): self._events = [] self.bot = bot async def dow...
Python
0.00002
@@ -3618,26 +3618,176 @@ q_print(self +, u_tz=None):%0A if u_tz == None:%0A u_tz = pytz.timezone(cf.config.get('Bot', 'default_timezone'))%0A timezone = pytz.timezone(u_tz ) -: %0A awa @@ -3847,16 +3847,29 @@ one.utc) +, tz=timezone )%0A%0A
4141041dad14f060270f8b46588cbb0e5b45bb3b
Add form_class processing to update API view
fancypages/api/serialisers.py
fancypages/api/serialisers.py
from django.db.models import get_model from django.utils.translation import ugettext as _ from django.forms.models import modelform_factory from django.template import loader, RequestContext from rest_framework import serializers from fancypages.dashboard import forms Page = get_model('fancypages', 'Page') Widget = ...
Python
0
@@ -1193,32 +1193,210 @@ ass(self, obj):%0A + # check if the widget has a class-level attribute that%0A # defines a specific form class to be used%0A form_class = getattr(obj.__class__, 'form_class', None)%0A return m @@ -1425,16 +1425,33 @@ _class__ +, form=form_class )%0A%0A%0Aclas @@...
c0f6668d64b0d8f098b0962b23ab86e80e01f1d9
Remove options from command line
junction/tickets/management/commands/fill_data.py
junction/tickets/management/commands/fill_data.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import os import optparse # Third Party Stuff from django.core.management.base import BaseCommand, CommandError from django.db import transaction # Junction Stuff from junction.tickets.models import Ticket class Comman...
Python
0.000005
@@ -95,35 +95,8 @@ ls%0A%0A -import os%0Aimport optparse%0A%0A # Th @@ -405,478 +405,8 @@ %22%22%22%0A - option_list = BaseCommand.option_list + (%0A optparse.make_option(%0A %22-i%22,%0A %22--infile%22,%0A dest = %22filename%22,%0A help = %22specify import file%...
8177766cb9c27baa69a00c8a8a0a5308b0853dd7
update timestamps on reactions add
seen/shop.py
seen/shop.py
from discord.ext import commands from cogs.utils.dataIO import dataIO import discord import os import asyncio from datetime import datetime DB_VERSION = 2 class Seen: '''Check when someone was last seen.''' def __init__(self, bot): self.bot = bot self.seen = dataIO.load_json('data/seen/seen....
Python
0
@@ -133,16 +133,27 @@ atetime%0A +import time %0A%0ADB_VER @@ -2882,215 +2882,576 @@ -if not any(message.content.startswith(n) for n in self.bot.settings.prefixes):%0A server = message.server%0A author = message.author%0A ts = message.timestamp.timestamp +server = me...
acc692a6f05e327bb9502ad73189f727075b6cd7
remove an unused logger instance
ryu/app/rest_conf_switch.py
ryu/app/rest_conf_switch.py
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
Python
0.000001
@@ -901,44 +901,8 @@ b%0A%0A%0A -LOG = logging.getLogger(__name__)%0A%0A%0A # RE
73b6db43b80b2c86e9bd7b342c8dcd24aee122fa
update yaml_mako to use standard template renderer
salt/renderers/yaml_mako.py
salt/renderers/yaml_mako.py
''' Process yaml with the Mako templating engine This renderer will take a yaml file within a mako template and render it to a high data format for salt states. ''' # Import Python Modules import os # Import Third Party libs from mako.template import Template from salt.utils.yaml import CustomLoader, load def ren...
Python
0
@@ -498,93 +498,141 @@ %7B%7D%0A -%0A -passthrough = %7B%7D%0A passthrough%5B'salt'%5D = __salt__%0A passthrough%5B' +tmp_data = salt.utils.templates.mako(%0A template_file,%0A True,%0A salt=__salt__,%0A grains -'%5D = += __gr @@ -641,37 +641,56 @@ ns__ -%0...
a97996f44dbbb13bfd3135d83b02b4cc7a1723f0
Fix invalid import
src/adhocracy_core/adhocracy_core/__init__.py
src/adhocracy_core/adhocracy_core/__init__.py
"""Configure, add dependency packages/modules, start application.""" from pyramid.config import Configurator from pyramid_zodbconn import get_connection from substanced.db import RootAdded from logging import getLogger import transaction from adhocracy_core.authentication import TokenHeaderAuthenticationPolicy from a...
Python
0.000039
@@ -2944,24 +2944,34 @@ mport audit_ +resources_ changes_call @@ -3155,16 +3155,26 @@ k(audit_ +resources_ changes_
136eb26a62235908d4af935630ac8ceb801320b2
Add 'type' and 'fields' to AbstractField.common_fields
bungiesearch/fields.py
bungiesearch/fields.py
from six import iteritems from django.template import Context, loader from django.template.defaultfilters import striptags from elasticsearch_dsl.analysis import Analyzer class AbstractField(object): ''' Represents an elasticsearch index field and values from given objects. Currently does not support bin...
Python
0.999983
@@ -552,16 +552,34 @@ copy_to' +, 'type', 'fields' %5D%0A @p
1067e8fbcda84d6c656ccee8e996dc32450c4123
Fix as_seconds on Windows where tz is present
touchdown/core/datetime.py
touchdown/core/datetime.py
# Copyright 2011-2015 Isotoma Limited # # 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 wr...
Python
0
@@ -2322,16 +2322,17 @@ urn int( +( value - @@ -2354,9 +2354,10 @@ econds() +) %0A
0ebc33aa8858eda11170fe69983ded65f59563d1
Correct an unsplit `rng` in convolution layer.
trax/layers/convolution.py
trax/layers/convolution.py
# coding=utf-8 # Copyright 2019 The Trax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Python
0.999996
@@ -3269,16 +3269,62 @@ shape))%0A + rng1, rng2 = backend.random.split(rng, 2)%0A w = @@ -3361,24 +3361,25 @@ l_shape, rng +1 )%0A b = se @@ -3414,16 +3414,17 @@ ape, rng +2 )%0A re
36913eca4ce476238a68ef0c38083193cf351517
test commit
New_studies-microbes.py
New_studies-microbes.py
""" these are the studies that may go into the next round of synthesis """ studytreelist=[ "2862_6766", # Scuticociliatia (Ciliates). Gao et al. 2014. MPE ## unrooted. ### FIXED! HDL "2863_6767", # Oligohymenophorea (Ciliates). Gao et al. 2013. MPE ## unrooted; no ingroup defined ### FIXED! HDL "2739_6601", ...
Python
0.000001
@@ -87,16 +87,28 @@ ist=%5B%0A%0A%0A +# Hi Dail!%0A%0A %222862_67
d552f87a874eda6f0638e508655e99fe586bb35b
Improve error message when you pass wrong type to ScriptTarget.addTarget().
src/cake/script.py
src/cake/script.py
"""Base script class and utilities. @see: Cake Build System (http://sourceforge.net/projects/cake-build) @copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon. @license: Licensed under the MIT license. """ import threading import cake.path from cake.target import Target from cake.async import AsyncResult, waitF...
Python
0
@@ -2275,17 +2275,42 @@ ddTarget -%22 + not %22 + str(type(target)) )%0A%0A s
72c96b3ac30ad17fad3dda69836478fd1e54492d
Fix encoding issue in shippable downloader.
test/utils/shippable/download.py
test/utils/shippable/download.py
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible 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 yo...
Python
0
@@ -4635,16 +4635,32 @@ ntents'%5D +.encode('utf-8') %0A
32d4339cf27306792fc5776193f82ac9bd6ef39d
Add output result box for remove_padding script
remove_padding.py
remove_padding.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import click from PIL import Image from utils import get_file_list def box_union(a, b): left = min(a[0], b[0]) top = min(a[1], b[1]) right = max(a[2], b[2]) bottom = max(a[3], b[3]) return left, top, right, bottom @click.command() @click.argument('p...
Python
0.000001
@@ -590,24 +590,38 @@ ion, boxes)%0A + print box%0A for f in