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
eae9489f16290b70514800f757534338dae7c077
Tweak the scalar lut manager to allow changing the scalar range when the scalar bar is not visible
enthought/mayavi/core/ui/lut_manager.py
enthought/mayavi/core/ui/lut_manager.py
""" Traits View definition file. The view trait of the parent class is extracted from the model definition file. This file can either be exec()ed or imported. See core/base.py:Base.trait_view() for what is currently used. Using exec() allows view changes without needing to restart Mayavi, but is slower than imp...
Python
0
@@ -1861,220 +1861,8 @@ '),%0A - Item(name='use_default_range'),%0A Item(name='data_range',%0A enabled_when='not object.use_default_range'),%0A %0A @@ -1883,32 +1883,32 @@ HGroup(%0A + ...
ce18519c219dd5e80b277720073b99e879b8c24c
Fix for bug when splash screen text changes but control doesn't exist.
enthought/pyface/ui/wx/splash_screen.py
enthought/pyface/ui/wx/splash_screen.py
#------------------------------------------------------------------------------ # # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions...
Python
0
@@ -1,28 +1,29 @@ +%0A #--------------------------- @@ -3448,16 +3448,57 @@ round%22.%0A + if self.control is not None:%0A @@ -3525,16 +3525,20 @@ (False)%0A + @@ -4339,16 +4339,28 @@ , x, y)%0A + %0A
c4fbe5e849e29e86cfcea12b494e992a5de00474
version number?
indieweb/__init__.py
indieweb/__init__.py
__version__ = '0.0.1'
Python
0.000002
@@ -16,7 +16,7 @@ 0.0. -1 +2 '%0A
96807c87bf17406169c24d07406678fdcf5e7549
use the default visualization model
src/python/ddapp/footstepsdriverpanel.py
src/python/ddapp/footstepsdriverpanel.py
import PythonQt from PythonQt import QtCore, QtGui from ddapp import lcmUtils from ddapp import applogic as app from ddapp.utime import getUtime from ddapp import objectmodel as om from ddapp.timercallback import TimerCallback import numpy as np import math def _makeButton(text, func): b = QtGui.QPushButton(tex...
Python
0.000001
@@ -367,31 +367,31 @@ b%0A%0A%0Adef get -Visible +Default RobotModel() @@ -400,140 +400,55 @@ -for obj in om.objects.values():%0A if isinstance(obj, om.RobotModelItem) and obj.getProperty('Visible'):%0A return obj +return om.findObjectByName('robot state model') %0A%0A%0Ac @@ -1135,39 +1135,...
7cd1b03e6386c86a66f7feb24e6eb0047fb250d6
add deduplication of fare_attributes
gtfs_fare_validator.py
gtfs_fare_validator.py
#!/usr/bin/env python import argparse from base_gtfs_validator import BaseGtfsValidator class GtfsFareValidator(BaseGtfsValidator): """ removes fare_rules that have an unknown route_id overwrites given gtfs-file """ valid_fare_rows_list = None def validate(self): existing_route...
Python
0.000007
@@ -265,16 +265,53 @@ t = None +%0A valid_fare_attr_rows_list = None %0A%0A de @@ -481,16 +481,101 @@ ute_ids) +%0A self.valid_fare_attr_rows_list = self.__create_filter_fare_attributes_rows() %0A%0A de @@ -709,43 +709,905 @@ list - )%0A%0A %22%22%22%0A Private%0A %22%22%22 +)%0A ...
b0525445c0d0d125199aac32ff1b50fd2812e230
Fix issue where notes are not added to portfolio
investor/Investor.py
investor/Investor.py
#!/usr/bin/env python3 import datetime import json import requests import logging import time # investor imports from investor import LoanFilter from investor import Loan class Investor: 'A simple class to interact with your LendingClub account' def __init__(self, iid, authKey, investAmt=25, productionMode...
Python
0
@@ -5765,33 +5765,37 @@ for loan in loan -s +_dict :%0A
cdefedaf5a7f8f2affbb8e691dd3eceb93e1708c
Update organizers.py
config/organizers.py
config/organizers.py
ORGANIZERS = { ('Francis Deslauriers', 'https://twitter.com/frdeso_'), ('Myles Braithwaite', 'https://mylesb.ca/'), ('Peter McCormick', 'https://twitter.com/pdmccormick'), ('Terry Yanchynskyy', 'https://github.com/onebit0fme'), ('Ryan Wilson-Perkin', 'https://github.com/ryanwilsonperkin'), ('An...
Python
0
@@ -479,13 +479,8 @@ '),%0A - %0A
e024c2ddc8a94e6c597c9d73d91dc6d0de23c19d
Update aws_security_test.py
aws_security_test.py
aws_security_test.py
import argparse import boto3 import unittest import yaml from third_party_modules import HTMLTestRunner from tests.iam import IamAudit from tests.networking import NetworkingAudit from tests.log import LoggingAudit from tests.monitoring import MonitoringAudit suite = unittest.TestSuite() parser = argparse.ArgumentPar...
Python
0.000003
@@ -641,16 +641,42 @@ report%22 +, choices=%5B'text', 'html'%5D )%0Aargs = @@ -1510,8 +1510,9 @@ errors)) +%0A
528b6f0457388da13b0a8cd7fcf01ab906f0ef41
fix #270 and #279, refactor 'None'
backend/api/users.py
backend/api/users.py
from flask import request, jsonify, make_response, current_app, g, Blueprint from flask_security import login_required, roles_required, login_user,\ logout_user, current_user from flask_security.utils import verify_password, encrypt_password from api.helper.apiexception import ApiException users = Blueprint('api_u...
Python
0.999982
@@ -799,36 +799,32 @@ ail)%0A if +not user - is None :%0A re @@ -4034,27 +4034,28 @@ %22%22%22%0A -res +user = g.user_da @@ -4080,35 +4080,32 @@ ail)%0A if -res is None +not user :%0A re @@ -4169,24 +4169,194 @@ mail, 400)%0A%0A + roles = %5Brole for role in %5B'admin', 'user'...
701c88c0194adc6e6941ba324df614521280a545
fix error
gunicorn/httpserver.py
gunicorn/httpserver.py
# -*- coding: utf-8 -*- # # Copyright 2008,2009 Benoit Chesneau <benoitc@e-engura.org> # # 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 ...
Python
0.000002
@@ -4639,21 +4639,84 @@ ept -errno.EAGAIN, +IOError, e:%0A if e.errno == errno.EAGAIN or e.errno == err @@ -4732,16 +4732,20 @@ BORTED:%0A +
18175d41a9ea136a5c65f503367e633b0c4da6b0
print success
backup/some_tests.py
backup/some_tests.py
layer = qgis.utils.iface.activeLayer() for feature in layer.getFeatures(): numberOfLane = feature['NUMLANE'] lts = feature ['_lts12'] islLTS_1 = feature['_isl_lts1'] islLTS_2 = feature['_isl_lts2'] islLTS_3 = feature['_isl_lts3'] islLTS_4 = feature['_isl_lts4'] if lts ==1 : assert islLTS...
Python
0.000006
@@ -579,12 +579,46 @@ islLTS_4 %3E 0 +%0Aelse:%0A%09print %22Yoohoo, no errors!%22
03f77f440480b6a560327d2c11e6ea731a340bf1
add hdf5tensor
seya/data_utils.py
seya/data_utils.py
import theano import numpy as np from skimage.transform import rotate floatX = theano.config.floatX class TransformedDataset(): def __init__(self, data, transformer): self.data = data self.transformer = transformer samp_out = transformer.transform(data[:2]) self.shape = (data.shap...
Python
0.000003
@@ -26,16 +26,64 @@ y as np%0A +import h5py%0A%0Afrom collections import defaultdict %0Afrom sk @@ -1895,8 +1895,1740 @@ rn Rval%0A +%0A%0Aclass HDF5Tensor():%0A def __init__(self, datapath, dataset, start, end,%0A time_start, time_end, normalizer=None):%0A self.refs = defaultdict(int)%0A ...
e4d7d9e4039b32a5946142472f71c3e183ce604b
Tweak run dir name and reader repr.
indra/tools/reading/readers/core.py
indra/tools/reading/readers/core.py
import logging import tempfile from .util import get_dir, get_time_stamp, formats logger = logging.getLogger(__name__) # Set a character limit for reach reading CONTENT_CHARACTER_LIMIT = 5e5 CONTENT_MAX_SPACE_RATIO = 0.5 class ReadingData(object): """Object to contain the data produced by a reading. Param...
Python
0
@@ -2967,17 +2967,8 @@ ir = - 'run_' + sel @@ -2981,16 +2981,25 @@ .lower() + + '_run' %0A @@ -3594,15 +3594,35 @@ urn -'Reader +self.__class__.__name__ + ' (%5C'%25 @@ -3637,16 +3637,33 @@ roc=%25d)' + %5C%0A %25 (self
a610e4a053481afc4eb26015aefcde18e9ccb119
Add definitions and precedence for operators
components/definition.py
components/definition.py
"""These are the reserved tokens for SQLGitHub.""" EXIT_TOKENS = [u"exit", u"q"] COMMAND_TOKENS = [u"select", u"from", u"where", u"group", u"order"] ALL_TOKENS = EXIT_TOKENS + COMMAND_TOKENS
Python
0.00005
@@ -1,34 +1,25 @@ %22%22%22 -These are the reserved toke +Language definitio ns f @@ -139,47 +139,1351 @@ r%22%5D%0A -%0AALL_TOKENS = EXIT_TOKENS + COMMAND_TOKENS +OPERATOR_TOKENS = %5Bu%22interval%22,%0A u%22binary%22, u%22collate%22,%0A u%22!%22,%0A u%22-%22, u...
6e4bf8b8c200a16a5cb98c912eefa078a113c702
add join dataset method
bamboo/core/frame.py
bamboo/core/frame.py
from pandas import DataFrame, Series from bamboo.lib.jsontools import series_to_jsondict from bamboo.lib.mongo import dump_mongo_json, mongo_prefix_reserved_key,\ MONGO_RESERVED_KEYS # reserved bamboo keys BAMBOO_RESERVED_KEY_PREFIX = 'BAMBOO_RESERVED_KEY_' DATASET_ID = BAMBOO_RESERVED_KEY_PREFIX + 'dataset_id' ...
Python
0.000001
@@ -2725,8 +2725,206 @@ st())))%0A +%0A def join_dataset(self, other, on):%0A %22%22%22Left join an *other* dataset.%22%22%22%0A right_dframe = other.dframe().set_index(on)%0A return self.__class__(self.join(right_dframe, on=on))%0A
8abab0c6bede41c9e5e18641bcde802a0a012f08
Add a sensible repr
jacquard/odm/base.py
jacquard/odm/base.py
""" Base model class. Types in the ODM should derive from `Model`. """ import sys from . import inflection class ModelMeta(type): """Metaclass for models.""" # Once Python 3.5 support is dropped, we should drop `ModelMeta` and # work directly on Model using `__init_subclass__`. def __init__(self,...
Python
0.99999
@@ -2090,8 +2090,470 @@ )%0A +%0A def __repr__(self):%0A cls = type(self)%0A return %22%25s(pk=%25r, %25s)%22 %25 (%0A cls.__name__,%0A self.pk,%0A ', '.join(%0A '%25s=%25r' %25 (%0A field_name,%0A getattr(cls,...
9e09087606f6bd16939a5647a152507e74ae1a37
update numpy in utils
disaggregator/utils.py
disaggregator/utils.py
import appliance import pandas def concatenate_traces(traces, metadata=None, how="strict"): ''' Given a list of appliance traces, returns a single concatenated trace. With how="strict" option, must be sampled at the same rate and consecutive, without overlapping datapoints. ''' if not metadata:...
Python
0.000004
@@ -23,16 +23,41 @@ t pandas + as pd%0Aimport numpy as np %0A%0Adef co
24586326d01b38f0f8a045216948a2e4d93bf9cb
change password using method POST (not PUT)
shop/views/auth.py
shop/views/auth.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import logout, get_user_model from django.contrib.auth.models import AnonymousUser from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import NON_FIELD_ERRORS from django.utils.encoding impor...
Python
0
@@ -4284,17 +4284,18 @@ def p -u +os t(self,
21b4c1da359996d6e7820792e68a3304ae1490fb
Update errors.py
beanstream/errors.py
beanstream/errors.py
''' Copyright 2012 Upverter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
Python
0.000001
@@ -1479,20 +1479,24 @@ rectionE -rror +xception %0A if c
eb2d910615a674a1a61a727265aed7bcac6e17fb
Use getattr
sipa/model/user.py
sipa/model/user.py
# -*- coding: utf-8 -*- # noinspection PyMethodMayBeStatic from abc import ABCMeta, abstractmethod from collections import namedtuple from sipa.model.fancy_property import active_prop, UnsupportedProperty # noinspection PyMethodMayBeStatic class AuthenticatedUserMixin: """A mixin object defining a User class to...
Python
0.000001
@@ -3927,30 +3927,22 @@ rty= -self.__getattribute__( +getattr(self, key)
a0e133ae5d769c03b121b15de63d23ef3eae975e
Allow unicode in rewrite items
beetsplug/rewrite.py
beetsplug/rewrite.py
# This file is part of beets. # Copyright 2012, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
Python
0.000008
@@ -1249,16 +1249,24 @@ ch(value +.lower() ):%0A @@ -2198,14 +2198,16 @@ tern -, re.I +.lower() )%0A
db8f3214c4b8862d823110ba4180932962ac6347
remove set get params for now from xgboost
external/predictor/python/seldon/xgb.py
external/predictor/python/seldon/xgb.py
import sys from fileutil import * from kazoo.client import KazooClient import json from collections import OrderedDict import numpy as np import xgboost as xgb from sklearn.datasets import load_svmlight_file import scipy.sparse import math import pandas as pd from sklearn.feature_extraction import DictVectorizer import...
Python
0
@@ -1634,339 +1634,8 @@ ) %0A%0A - def get_params(self, deep=True):%0A return self.params%0A%0A def set_params(self, **params):%0A if 'num_boost_round' in params:%0A self.num_boost_round = params.pop('num_boost_round')%0A if 'objective' in params:%0A del params%5B'objec...
b6c8399d415a00aed05a4ca670756f594107a48b
Test of TruncatedGreenOperator2D.apply_all_freqs().
discretegreenoptest.py
discretegreenoptest.py
if __name__ == '__main__': import sys sys.path.append('./src/') # TODO Implement test of apply_single_freq with invalid params. import discretegreenop import greenop import itertools import numpy as np import numpy.random as rnd from numpy.testing import assert_array_max_ulp from matprop import IsotropicLine...
Python
0
@@ -2954,50 +2954,48 @@ ce%0A%0A -if __name__ == '__main__':%0A n = (8, 16) +@nottest%0Adef do_test_apply_all_freqs(n): %0A @@ -3283,30 +3283,8 @@ au)%0A - tau%5B0, 0, 0%5D = 1.%0A @@ -3327,16 +3327,76 @@ base)%0A%0A + # TODO This is not cross-platform, should be Py_ssize_t%0A b = @@ -3424,...
b4ef9fc3a148f591bdb1a1a6e1914a7901ba92f9
fix doc-string of InMemoryBackend
benchmark/httpapi.py
benchmark/httpapi.py
# Copyright ClusterHQ Inc. See LICENSE file for details. """ A HTTP REST API for storing benchmark results. """ import sys from collections import OrderedDict from json import dumps, loads from uuid import uuid4 from urlparse import urljoin from twisted.application.internet import StreamServerEndpointService from t...
Python
0.996823
@@ -1039,65 +1039,17 @@ hat -simply drops all results.%0A%0A :ivar dict results: Stored +keeps the res @@ -1057,28 +1057,21 @@ lts -by +in the -ir identifiers + memory .%0A
52ad966b25a57dba74c7a8897d2ab7109ad97966
Add new TracBatchModify page to `checkwiki` syncing script.
contrib/checkwiki.py
contrib/checkwiki.py
#!/usr/bin/python # # Check/update default wiki pages from the Trac project website. # # Note: This is a development tool used in Trac packaging/QA, not something # particularly useful for end-users. # # Author: Daniel Lundin <daniel@edgewall.com> import httplib import re import sys import getopt # Pages to inc...
Python
0.000001
@@ -505,24 +505,44 @@ racBackup%22,%0A + %22TracBatchModify%22,%0A %22TracBrowse
8bd1574f5b14499134dfd1d350709c96be58b8f1
Add unique indexes to user model
flask_security/datastore/mongoengine.py
flask_security/datastore/mongoengine.py
from flask.ext import security from flask.ext.security import UserMixin, RoleMixin from flask.ext.security.datastore import UserDatastore class MongoEngineUserDatastore(UserDatastore): """MongoEngine datastore""" def __init__(self, db): self.db = db class Role(db.Document, Rol...
Python
0.000001
@@ -370,16 +370,29 @@ ed=True, + unique=True, max_len @@ -545,32 +545,45 @@ db.StringField( +unique=True, max_length=255)%0A @@ -609,32 +609,45 @@ db.StringField( +unique=True, max_length=255)%0A @@ -676,32 +676,47 @@ db.StringField( +required=True, max_length=120)%0A
cd7ec0fce4cc73954d2c3769adff0373b9ef62b2
Update control/passivity.py
control/passivity.py
control/passivity.py
''' Author: Mark Yeatman Date: May 15, 2022 ''' import numpy as np try: import cvxopt as cvx except ImportError as e: cvx = None def is_passive(sys): ''' Indicates if a linear time invarient system is passive Constructs a linear matrix inequality and a feasibility optimization such that i...
Python
0
@@ -657,16 +657,56 @@ undError +(%22cvxopt required for passivity module%22) %0A%0A A
e13761e1bc4d225d377b357b08722eb3cfad6048
Update package info
skcode/__init__.py
skcode/__init__.py
""" SkCode (Python implementation of BBcode syntax) parser library. """ # Package information __author__ = "Fabien Batteix (@skywodd)" __copyright__ = "Copyright 2015, TamiaLab" __credits__ = ["Fabien Batteix", "TamiaLab"] __license__ = "GPLv3" __version__ = "1.0.7" __maintainer__ = "Fabien Batteix" __email__ = "fabie...
Python
0
@@ -1,16 +1,18 @@ %22%22%22%0A +Py SkCode +, -( Pyth @@ -36,11 +36,27 @@ of +a full-featured BB -c +C ode @@ -61,17 +61,16 @@ e syntax -) parser @@ -180,9 +180,9 @@ 201 -5 +6 , Ta
a9fb25b5427632460f1a36bdafabfee4ae1573e0
Allow for missing attributes in GFF for creating rnadiff info file
sequana/gff3.py
sequana/gff3.py
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016-2020 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with t...
Python
0
@@ -6999,22 +6999,32 @@ bda x: x -%5Bthis%5D +.get(this, %22NA%22) )%0A
a1d0dfdf09913b7e5fdedcc7447fb9482d365c29
remove six dependancy
slugify/slugify.py
slugify/slugify.py
import re import unicodedata import types import sys try: from htmlentitydefs import name2codepoint except ImportError: from html.entities import name2codepoint from unidecode import unidecode __all__ = ['slugify'] # character entity reference CHAR_ENTITY_REXP = re.compile('&(%s);' % '|'.join(name2codepoin...
Python
0.999799
@@ -46,16 +46,17 @@ ort sys%0A +%0A try:%0A @@ -98,16 +98,77 @@ depoint%0A + _unicode = unicode%0A _unicode_type = types.UnicodeType%0A except I @@ -228,24 +228,52 @@ int%0A -%0Afrom unidecode + _unicode = str%0A _unicode_type = str%0A%0A impo @@ -2476,24 +2476,147 @@ ):%0A %22%22%22%0A%0A + ...
16292bd16caf38f073a4a1a782798eb9f3c13c1b
fix name of test
hwtLib/mem/cam_test.py
hwtLib/mem/cam_test.py
import unittest from hdl_toolkit.bitmask import Bitmask from hdl_toolkit.hdlObjects.specialValues import Time, NOP from hdl_toolkit.simulator.agentConnector import valuesToInts from hdl_toolkit.simulator.shortcuts import simUnitVcd, simPrepare from hwtLib.mem.cam import Cam class CamTC(unittest.TestCase): def t...
Python
0.998764
@@ -329,12 +329,17 @@ eAnd -Read +MatchTest (sel
17fe9a3c4d47ba8db3b25ef55a78001d8d63775e
Handle failing operation more gracefully, closes #7
imagesort/imagesort.py
imagesort/imagesort.py
import exifread import os from datetime import datetime import shutil import filecmp import logging logger = logging.getLogger(__name__) class Operation(object): def __init__(self, func, desc): self.func = func self.desc = desc def _valid_operations(): ops = dict( copy=Operation(shu...
Python
0
@@ -1,12 +1,23 @@ +import sys%0A import exifr @@ -1224,16 +1224,37 @@ stpath)%0A + try:%0A @@ -1312,16 +1312,137 @@ stpath)%0A + except OSError:%0A logger.exception('Could not perform operation.')%0A sys.exit(1)%0A %0A%0Adef _g
97c100b2d7b8d160ceb3dce849eaaf23e929f390
Add new expect utils to bool_matrix
indico/testing/util.py
indico/testing/util.py
## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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...
Python
0.000011
@@ -1837,16 +1837,190 @@ cessary. + You can also%0A pass the strings %60any_dynamic%60 or %60all_dynamic%60 which are similar to %60any%60/%60all%60%0A but only check entries which do not have a fixed value in the template. %0A%0A In @@ -2860,16 +2860,24 @@ expect: + string, bool va @@ -4357,16 +4357,286...
6a7f2d0eed9ecb74962886e272e64702ddb79418
Set plugin attribute before getting name
indico/util/signals.py
indico/util/signals.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Python
0
@@ -3459,75 +3459,8 @@ ue)%0A - mapping = %7Bgetattr(cls, name_attr): cls for _, cls in objects%7D%0A @@ -3547,16 +3547,49 @@ ttr( +cls, plugin_attr, plugin)%0A mapping -%5B + = %7B geta @@ -3611,31 +3611,36 @@ ttr) -%5D, plugin_attr, plugin) +: cls for _, cls in objects%7D %0A
eee725353bee314a999c6c8d9d06959ac9f8b476
fix edit redirect
infotv_tracon/views.py
infotv_tracon/views.py
from django.contrib.admin.views.decorators import staff_member_required from django.core.urlresolvers import reverse from django.shortcuts import redirect @staff_member_required def infotv_edit_redirect_view(self, event): return redirect(reverse('infotv_view', args=(event,)) + '?edit=1')
Python
0.000001
@@ -110,16 +110,49 @@ reverse%0A +from django.conf import settings%0A from dja @@ -205,16 +205,46 @@ required +(login_url=settings.LOGIN_URL) %0Adef inf
2fd2ff02401339990029cc7270f912db32026230
allow msg comparison and use repr instead of str
bndl/net/messages.py
bndl/net/messages.py
_msgtypes = {} class Field(object): pass class MessageType(type): def __new__(cls, name, parents, dct): dct['__slots__'] = schema = [k for k, v in dct.items() if isinstance(v, Field)] for k in schema: dct.pop(k) _msgtypes[name] = msgtype = super().__new__(cls, name, paren...
Python
0
@@ -508,18 +508,19 @@ def __ -st +rep r__(self @@ -790,16 +790,265 @@ __, d)%0A%0A + def __eq__(self, other):%0A if not isinstance(other, type(self)):%0A return False%0A for k in self.__slots__:%0A if getattr(self, k, None) != getattr(other, k, None):%0A return...
1b12a904d24593c3010112a326d81d951651f9d0
add examples to chunked and chunked_iter
boltons/iterutils.py
boltons/iterutils.py
# -*- coding: utf-8 -*- def is_iterable(obj): return callable(getattr(obj, '__iter__', None)) def is_scalar(obj): return not is_iterable(obj) or isinstance(obj, basestring) def split(src, sep=None, maxsplit=None): """ Splits an iterable based on a separator. >>> split(['hi', 'hello', None, No...
Python
0
@@ -2766,16 +2766,252 @@ l chunk. +%0A%0A %3E%3E%3E chunked(range(10), 3)%0A %5B%5B0, 1, 2%5D, %5B3, 4, 5%5D, %5B6, 7, 8%5D, %5B9%5D%5D%0A %3E%3E%3E chunked(range(10), 3, fill=None)%0A %5B%5B0, 1, 2%5D, %5B3, 4, 5%5D, %5B6, 7, 8%5D, %5B9, None, None%5D%5D%0A %3E%3E%3E chunked(range(10), 3, count=2)%0A ...
da2b629c1a8ef1429418e2240d1f203db6d6cb65
Make default "recent" value for The Guardian as past 3 days
src/twitter_bot/service/news/guardian.py
src/twitter_bot/service/news/guardian.py
from datetime import date, timedelta import requests import urllib from twitter_bot.config.api_keys import GUARDIAN_API_KEY from twitter_bot.model.news_bite import NewsBite from twitter_bot.service.news import BaseNewsService SECTIONS = [ 'books', 'business', 'commentisfree', # Opinion Section 'cult...
Python
0.001344
@@ -2197,17 +2197,17 @@ ce_days= -1 +3 , sectio @@ -3013,17 +3013,17 @@ ce_days= -1 +3 ):%0A
26ded7af5c4d2add4a26e41d3f3525adde099f53
Stop sending email notifications to users with dummy email adress
src/utils/notify_plugins/notify_email.py
src/utils/notify_plugins/notify_email.py
from django.core.mail import EmailMultiAlternatives from django.utils.html import strip_tags from utils import setting_handler from utils import notify def send_email(subject, to, html, journal, request, bcc=None, cc=None, attachment=None, replyto=None): if journal: from_email = setting_handler.get_sett...
Python
0
@@ -1,20 +1,54 @@ +from collections import Iterable%0A%0A from django.core.mai @@ -181,16 +181,52 @@ notify%0A%0A +DUMMY_EMAIL_DOMAIN = %22@journal.com%22%0A %0Adef sen @@ -757,53 +757,221 @@ if -not type(to) in %5Blist, tuple%5D:%0A to = %5B +isinstance(to, str):%0A if DUMMY_EMAIL_DOMAIN in to:%0A ...
2f0c68f6a3fb311da9966008c0bb0e74b3e84e1b
increment patch version
instmatcher/version.py
instmatcher/version.py
# Copyright 2016 Matthias Gazzari # # 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 writ...
Python
0.000001
@@ -620,11 +620,11 @@ = '0.5. -0 +1 '%0A
69707935c5c2960f6e84d8704761d8250593c262
Remove newline.
sourcer/builder.py
sourcer/builder.py
from collections import namedtuple import contextlib import io import types def compile_rules(start, rules): out = ProgramBuilder() return out.run(start, rules) Target = namedtuple('Target', 'mode, value, pos') class ProgramBuilder: def __call__(self, text): self.buf.write(' ' * self.indent...
Python
0.000007
@@ -4321,9 +4321,8 @@ lt)%0A'''%0A -%0A
5512b88d97421646c6eaefa8486ec4d6a9d437ec
Add allowed host
invigorate/settings.py
invigorate/settings.py
""" Django settings for invigorate project. Generated by 'django-admin startproject' using Django 1.11.4. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
Python
0
@@ -831,16 +831,52 @@ OSTS = %5B +%0A 'invigorate-app.herokuapp.com'%0A %5D%0A%0A%0A# Ap
d73cc9bfe752f17ba4944cd7d1b09af941f5342a
Fix behavior of filtering by service
services/api.py
services/api.py
import json import re from django.conf import settings from django.db.models import Q from django.contrib.gis.geos import Polygon, MultiPolygon, GeometryCollection from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.gdal import CoordTransform from modeltranslation.translator import tr...
Python
0.000001
@@ -5327,16 +5327,60 @@ v_list)%0A + query %7C= Q(services=srv_id)%0A
dd161c46ce9a2c871fd16f899f0de70c109615a1
Change default archive open number to 10
core/views/public.py
core/views/public.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re from aiohttp import web from components.eternity import config from utils.abstract import AbsWebView from utils.period import todate from utils.shortcut import paginate, render from utils.response import geass, http_400_response class IndexView(AbsWebView): ...
Python
0.000008
@@ -4359,9 +4359,10 @@ x %3C -6 +10 els
8ceea345cae203705f1229650a899617e6329227
update import location of ConfigurationRequired
sparc/cache/sql.py
sparc/cache/sql.py
from zope.interface import Interface, implements from zope.component.factory import IFactory from zope.component import adapts, queryAdapter from zope.event import notify from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent from sqlalchemy.orm import Session from datetime import date import sqlalchem...
Python
0
@@ -367,20 +367,32 @@ sparc.co -mmon +nfiguration.zcml import
80b5ae550585ba82ed18e36e052e302da35a06e3
Set zip_gallery to TRUE only if archive exists
sigal/writer.py
sigal/writer.py
# -*- coding:utf-8 -*- # Copyright (c) 2009-2013 - Simon Conseil # Copyright (c) 2013 - Christophe-Marie Duquesne # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, i...
Python
0.000005
@@ -5319,24 +5319,99 @@ , relpath)%0A%0A + ctx%5B'settings'%5D%5B'zip_gallery'%5D = not not paths%5Brelpath%5D%5B'medias'%5D%0A%0A for
46f82bd2e8d85596bf57c66cf527d940f014fd03
Remove the is_active field from admin, for now
silver/admin.py
silver/admin.py
"""Admin classes for the silver app.""" from django.contrib import admin, messages from django_fsm import TransitionNotAllowed from models import (Plan, MeteredFeature, Subscription, Customer, Provider, MeteredFeatureUnitsLog, Offer) class PlanAdmin(admin.ModelAdmin): list_display = ['name', ...
Python
0
@@ -3653,36 +3653,8 @@ l'%5D%0A - exclude = %5B'is_active'%5D%0A %0A%0Acl @@ -3966,36 +3966,8 @@ lay%0A - exclude = %5B'is_active'%5D%0A %0A%0Aad
53a79a15e7de62d30beedf90bef23427d554e469
Bump to 1.1
django_nyt/__init__.py
django_nyt/__init__.py
_disable_notifications = False __version__ = "1.1b2" default_app_config = "django_nyt.apps.DjangoNytConfig" def notify(*args, **kwargs): """ DEPRECATED - please access django_nyt.utils.notify """ from django_nyt.utils import notify return notify(*args, **kwargs)
Python
0.000073
@@ -47,10 +47,8 @@ %221.1 -b2 %22%0A%0Ad
452db2d2a1bc5c5ae06a44e4fff3df6f7e5b804c
add CustomGroupAdmin, PermissionAdmin and UserPermissionListAdmin
djangotoolbox/admin.py
djangotoolbox/admin.py
from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User, Group class UserForm(forms.ModelForm): class Meta: model = User fields = ('username', 'email', 'first_name', 'last_name', 'is_active', ...
Python
0
@@ -94,24 +94,36 @@ rt UserAdmin +, GroupAdmin %0Afrom django @@ -161,16 +161,87 @@ r, Group +, Permission%0A%0Afrom djangotoolbox.auth.models import UserPermissionList%0A %0A%0Aclass @@ -502,16 +502,450 @@ erForm%0A%0A +%0Aclass GroupForm(forms.ModelForm):%0A class Meta:%0A model = Group%0A excl...
5425e10a39ce66d3c50e730d1e7b7878e8e88eb0
Allow /dev/urandom for PHP 7
dmoj/executors/PHP7.py
dmoj/executors/PHP7.py
from .php_executor import PHPExecutor from dmoj.judgeenv import env class Executor(PHPExecutor): name = 'PHP7' command = env['runtime'].get('php7') fs = ['.*\.so', '/etc/localtime$', '.*\.ini$'] initialize = Executor.initialize
Python
0.000001
@@ -200,16 +200,33 @@ *%5C.ini$' +, '/dev/urandom$' %5D%0A%0A%0Ainit
9fe7625e5d0304e2343774d28cad83e26b39adad
Change default api host
boundary/api_call.py
boundary/api_call.py
# # Copyright 2015 BMC Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.000001
@@ -734,36 +734,33 @@ i_host=%22 -premium-api.boundary +api.truesight.bmc .com%22, e
c26fd0f22a7c3de3e41f4d20379d877eaab84468
Use xyz when autodetecting bonds with Open Babel
girder/molecules/molecules/openbabel.py
girder/molecules/molecules/openbabel.py
import json import requests from girder.models.setting import Setting from molecules.avogadro import convert_str as avo_convert_str from molecules.constants import PluginSettings from molecules.utilities.has_3d_coords import cjson_has_3d_coords def openbabel_base_url(): base_url = Setting().get(PluginSettings.OP...
Python
0
@@ -1853,24 +1853,114 @@ nds(cjson):%0A + # This function drops all bonding info and autodetects bonds%0A # using Open Babel.%0A%0A # Only a @@ -2001,16 +2001,16 @@ dinates%0A - if n @@ -2096,27 +2096,27 @@ (cjson)%0A -sdf +xyz _str = avo_c @@ -2147,19 +2147,19 @@ json', ' -sdf +xyz ')%0A%0A ...
5e966cb38fd60dddf7d7abc7636e39aabfc81783
increase version to 1.6
cutadapt/__init__.py
cutadapt/__init__.py
from __future__ import print_function import sys __version__ = '1.6dev' def check_importability(): try: import cutadapt._align except ImportError as e: if 'undefined symbol' in str(e): print(""" ERROR: A required extension module could not be imported because it is incompatible with your system. A quick fix ...
Python
0.001887
@@ -65,11 +65,8 @@ '1.6 -dev '%0A%0Ad
0b3bacbb81cba8a65bea7eb3608d11865037dd46
remove system field unless there is an initial system
cyder/base/mixins.py
cyder/base/mixins.py
from string import Template from django.core.urlresolvers import NoReverseMatch, reverse from django.db.models.loading import get_model from django.forms import ModelChoiceField, HiddenInput from cyder.base.utils import filter_by_ctnr class DisplayMixin(object): # Knobs justs = { 'pk_just': 10,...
Python
0.000002
@@ -4489,49 +4489,8 @@ -if 'system' in self.initial:%0A Syst @@ -4522,16 +4522,53 @@ system') +%0A if 'system' in self.initial: %0A @@ -4890,16 +4890,93 @@ tem'%5D))) +%0A elif 'system' in self.fields:%0A del(self.fields%5B'system'%5D) %0A%0A de @@ -5001,24 +500...
a23698c3afd336995ce055327763f4b41d8f38d2
rename function
google_measurement_protocol/__init__.py
google_measurement_protocol/__init__.py
from collections import namedtuple import urllib from google.appengine.ext import ndb TRACKING_URI = 'https://ssl.google-analytics.com/collect' def _request(ctx, data, extra_headers): if extra_headers is None: extra_headers = dict() return ctx.urlfetch(TRACKING_URI, payload=urllib.urlencode(data), met...
Python
0.000011
@@ -354,28 +354,28 @@ )%0A%0A%0Adef -async_ report +_async (trackin @@ -831,20 +831,20 @@ s = -async_ report +_async (tra
87784512599c5f2334f0e93912e555d55284dada
add comment
wc_utils/util/RandomUtilities.py
wc_utils/util/RandomUtilities.py
"""Random number generator utilities. :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu> :Date: 2016-10-07 :Copyright: 2016, Karr Lab :License: MIT """ from random import Random from numpy import random as numpy_random import math import numpy as np class ReproducibleRandom(object): """A source of reproducible ...
Python
0
@@ -6458,16 +6458,90 @@ ng bias. +%0A See http://www.clivemaxfield.com/diycalculator/sp-round.shtml#A15 %0A%0A
813ee068b16bf5e4a699f1c7433cd5a0cc9046c4
add ignore_events for stupid non-km3-style tables
km3pipe/io/pandas.py
km3pipe/io/pandas.py
# coding=utf-8 # Filename: pandas.py # pylint: disable=C0103,R0903 # vim:set ts=4 sts=4 sw=4 et: """ Pandas Helpers. """ from __future__ import division, absolute_import, print_function from collections import defaultdict import os.path from six import string_types import numpy as np import pandas as pd import tables...
Python
0.000001
@@ -2025,27 +2025,48 @@ e, keys=None +, ignore_events=False ):%0A - %22%22%22%0A @@ -2780,16 +2780,95 @@ %5Bfname%5D%0A + if ignore_events:%0A max_id = n%0A else:%0A @@ -2890,16 +2890,37 @@ .unique( +%0A h5.root. @@ -2964,13 +2964,8 @@...
3a88ec452327312a1e8d799856782acaa1854fb6
Add initial code to support non-schemad files
json2parquet/client.py
json2parquet/client.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import pyarrow as pa import pyarrow.parquet as pq def ingest_data(data, schema): """ Takes an array of dictionary objects, and a pyarrow schema with column names and types. Outputs a pyarrow Batch of the data """ column_...
Python
0
@@ -143,32 +143,37 @@ ata(data, schema +=None ):%0A %22%22%22%0A T @@ -303,24 +303,432 @@ ata%0A %22%22%22%0A + if isinstance(schema, list):%0A return _convert_data_with_column_names(data, schema)%0A elif isinstance(schema, pa.Schema):%0A return _convert_data_with_schema(data, schema)%0A...
81210e645a7fbef1d8c01c2ac415154d29b8fe54
Test with Mul's instance instead of expr
sympy/parsing/tests/test_sympy_parser.py
sympy/parsing/tests/test_sympy_parser.py
from sympy.core import Symbol, Float, Rational, Integer, I, Mul, Pow from sympy.functions import exp, factorial, sin from sympy.logic import And from sympy.series import Limit from sympy.utilities.pytest import raises from sympy.parsing.sympy_parser import ( parse_expr, standard_transformations, rationalize, Token...
Python
0
@@ -2280,14 +2280,34 @@ == -2*(x + 1 +Mul(2, x + 1, evaluate=False )%0A
93575b9d35c41da77e1cc58403c0664f3a41c942
add push/pushes function
justqueue/fifoqueue.py
justqueue/fifoqueue.py
# -*- coding:utf-8 -*- # # author: yangmqglobe # file: fifoqueue.py # time: 2017/6/11 from .utils import tran_item, reduce_item from .utils import not_closed from .exceptions import EmptyQueueError import os import sqlite3 class FIFOQueue(object): _sql_create = """CREATE TABLE IF NOT EXISTS "fifoqueue" ...
Python
0.000647
@@ -405,20 +405,19 @@ _sql_ -push +add = 'INSE @@ -1334,20 +1334,19 @@ lf._sql_ -push +add , (tran_ @@ -3754,28 +3754,577 @@ xecute(self._sql_del, (1,))%0A +%0A @not_closed%0A def push(self, item):%0A %22%22%22%0A push an item into the queue%0A :param item: an item which need to push...
2c16c858f9be1f00065146b09b6cb39f3851081e
Add license
taiga/projects/userstories/validators.py
taiga/projects/userstories/validators.py
from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from . import models class UserStoryExistsValidator: def validate_us_id(self, attrs, source): value = attrs[source] if not models.UserStory.objects.filter(pk=value).exists(): msg = _("There...
Python
0
@@ -1,12 +1,832 @@ +# Copyright (C) 2015 Andrey Antukh %3Cniwi@niwi.be%3E%0A# Copyright (C) 2015 Jes%C3%BAs Espino %3Cjespinog@gmail.com%3E%0A# Copyright (C) 2015 David Barrag%C3%A1n %3Cbameda@dbarragan.com%3E%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Aff...
fa5eb900c4f166d956940c87ee3706f15934b137
Fix ordering of creating service and endpoint
kubespawner/proxy.py
kubespawner/proxy.py
import os import string import escapism import json from kubernetes import client from jupyterhub.proxy import Proxy from kubespawner.objects import make_ingress from kubespawner.reflector import NamespacedResourceReflector from concurrent.futures import ThreadPoolExecutor from traitlets import Unicode from tornado i...
Python
0.000004
@@ -2734,32 +2734,39 @@ %0A + resp = yield self.asyn @@ -2931,13 +2931,12 @@ log. -debug +info ('Cr @@ -3065,16 +3065,17 @@ tempt == + 0:%0A @@ -4240,214 +4240,159 @@ -yield create_if_required(%0A self.extension_api.create_namespaced_ingress,%0A self.extension_api...
19837171d04e7e8e125eb6699cb6313cbfaa9d9e
change link
src/apps/models.py
src/apps/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import models from markdownx.models import MarkdownxField from datetime import datetime from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from util.img_util import ...
Python
0
@@ -5804,16 +5804,19 @@ ns-apps. +ee. washingt
11761ccc8e0f5ba323b58cede3a3b8c87d162203
change https to http
src/apps/models.py
src/apps/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import models from markdownx.models import MarkdownxField from datetime import datetime from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from util.img_util import ...
Python
0.000001
@@ -5793,17 +5793,16 @@ = %22http -s ://ns-ap
c1dd8a3dea8640efe76f500efbf7e1b3071fbf04
add simple validation in set_stats_name
cassandra/metrics.py
cassandra/metrics.py
# Copyright 2013-2016 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Python
0.000002
@@ -6154,24 +6154,153 @@ %22%22%22%0A%0A + if stats_name in scales._Stats.stats:%0A raise ValueError('%22%7B0%7D%22 already exists in stats.'.format(stats_name))%0A%0A stat
aaa80bfc6199d239fc8c4d68de7a3d308afa22b8
corrects result literal
webapp/climasng/views/apiview.py
webapp/climasng/views/apiview.py
import os import json from pyramid.response import Response from pyramid.response import FileResponse from pyramid.view import view_config import pyramid.httpexceptions as httpexceptions # database stuff from sqlalchemy.exc import DBAPIError from sqlalchemy import or_ from climasng.models import * # json data stuff ...
Python
0.999802
@@ -3724,14 +3724,16 @@ +%22 mapUrl +%22 : %22h @@ -3810,16 +3810,17 @@ +%22 layerNam @@ -3820,16 +3820,17 @@ ayerName +%22 : %22walla
7213afd2c9d7ddd53c3af4a3d995a795a47019e6
Extend functional tests to check the chat window has been closed
test/functional/test_MultipleBrowsers.py
test/functional/test_MultipleBrowsers.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import mixins import unittest import time from browser_test import MultipleNodeBrowserTest from config import testConfig class MultipleBrowsersTest(mixins.WithBob, mixins.WithLarry, MultipleNodeBrowserTest): def test_audio_only_call(self)...
Python
0
@@ -3021,32 +3021,80 @@ bob.hangupCall() +%0A self.assertChatWindowClosed(self.larry) %0A%0A def test_v @@ -3404,32 +3404,80 @@ medOut(self.bob) +%0A self.assertChatWindowClosed(self.larry) %0A%0A def test_v
b5a774b9c26e114f6b682243606b052c3c57916e
Revert "GithubEventHandler: do not wait before sending a job spawn request to Jenkins"
webhooks/github_event_handler.py
webhooks/github_event_handler.py
""" Handler processing github events and triggers Jenkins jobs """ import json import logging from jenkinsapi.jenkins import Jenkins from jenkinsapi.custom_exceptions import UnknownJob, WillNotBuild from pkg_resources import resource_filename from .config import Config class GithubEventException(Exception): pas...
Python
0
@@ -3970,32 +3970,38 @@ + res = self.__jenkins%5B @@ -4003,68 +4003,29 @@ kins -%5Bjob_name%5D.invoke(%0A build_params= +.build_job(job_name, job_ @@ -4030,17 +4030,18 @@ b_params -, +)%0A %0A @@ -4061,141 +4061,147 @@ - invoke_pre_check_delay=0%0A ...
60957d5bd4753e3f7e36366d3101d69d23dfb4a0
Update MinimumJoystick.py
home/brotherbrown831/MinimumJoystick.py
home/brotherbrown831/MinimumJoystick.py
from org.myrobotlab.service import Joystick from org.myrobotlab.service import Runtime from time import sleep #---------------------------------Create Services---------------------- joystick = Runtime.createAndStart("joystick","Joystick") #----------------------Define callback function for Joystick----------- def onJ...
Python
0
@@ -103,17 +103,16 @@ t sleep%0A -%0A #------- @@ -233,16 +233,235 @@ tick%22)%0A%0A +#----------------------Connect Peripherals-----------------------------------%0Ajoystick.setController(0); #PC only - Pi needs new%0Ajoystick.addInputListener(python)%0A# Tell the joystick to turn on%0Ajoystick.startPolling()%0A%0A...
870fd0b46b23bc9aa1f23a919ef77ee944cc0343
add some soybean options to autoplot 127
htdocs/plotting/auto/scripts100/p127.py
htdocs/plotting/auto/scripts100/p127.py
"""Plot or Harvest Progress""" import calendar from collections import OrderedDict import numpy as np from pandas.io.sql import read_sql from matplotlib import cm from matplotlib import ticker from pyiem.plot.use_agg import plt from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions import NoData...
Python
0.000036
@@ -341,16 +341,21 @@ edDict(%5B +%0A ('PCT PL @@ -375,33 +375,16 @@ ting'),%0A - ('PC @@ -415,76 +415,190 @@ - ('PCT DENTED', 'Percent Dented'),%0A +('PCT DENTED', 'Percent Dented'),%0A ('PCT COLORING', 'Percent Coloring'),%0A ('PCT SETTING PODS...
fc0e6bcf641d130088f54be8d1be15b5d8d78ea7
fix matplotlib API issue with IFR autoplot
htdocs/plotting/auto/scripts100/p167.py
htdocs/plotting/auto/scripts100/p167.py
"""Flight category by hour""" import datetime import numpy as np import pytz from pandas.io.sql import read_sql from pyiem.network import Table as NetworkTable from pyiem.util import get_autoplot_context, get_dbconn def get_description(): """ Return a dict describing how to call this plotter """ desc = dict(...
Python
0.000001
@@ -4340,15 +4340,12 @@ set_ -axis_bg +face colo
602b2aaad3762f3043b26d525e3577ef8a5e9fe3
Support Django 1.2 settings.py database layout. Related to issue 47
windmill/authoring/djangotest.py
windmill/authoring/djangotest.py
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com> # # 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 req...
Python
0
@@ -2990,40 +2990,162 @@ -if settings.DATABASE_ +create_db = False%0A if settings.DATABASES:%0A # Django %3E 1.2%0A if settings.DATABASES%5B'default'%5D%5B' ENGINE +'%5D == ' +django.db.backends. sqli @@ -3153,10 +3153,16 @@ e3' -%5C%0A +or %5C%0A @@ -3169,19 +3169,234 ...
faa535921a9e0e84691c0540fb0702482ccce558
Delete redundant import
tests/db/fields/test_uniq_field_mixin.py
tests/db/fields/test_uniq_field_mixin.py
# -*- coding: utf-8 -*- import django try: from unittest import mock except ImportError: import mock import six from django.db import models from django.test import TestCase from tests.testapp.models import ( DummyRelationModel, InheritedFromPostWithUniqField, PostWithUniqField, ReverseModel, SecondDu...
Python
0.001284
@@ -21,23 +21,8 @@ -*-%0A -import django%0A%0A try:
024139cc425943c15dbc03c0a773a3eb68425a41
Add apm
labmanager/database.py
labmanager/database.py
#-*-*- encoding: utf-8 -*-*- import json import hashlib from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from config import SQLALCHEMY_ENGINE_STR try: from config import USE_PYMYSQL except ImportError: USE_PYMY...
Python
0.000214
@@ -1835,16 +1835,87 @@ assword) +%0A user3 = LabManagerUser('apm', 'Alberto Pesquera Martin', password) %0A%0A db @@ -2067,16 +2067,42 @@ d(user2) +%0A db_session.add(user3) %0A%0A we
a92eae7bb0e0d5645c86d3d045c2483635bc1215
Make the maximum number of search results configurable
lala/plugins/quotes.py
lala/plugins/quotes.py
import sqlite3 import logging import os from time import sleep from lala.util import command, initplz, msg, on_join, is_admin db_connection = None @initplz def setup(): global db_connection db_connection = sqlite3.connect( os.path.join(os.path.expanduser("~/.lala"),"quotes.sqlite3")) db_...
Python
0.000001
@@ -119,16 +119,44 @@ is_admin +%0Afrom lala.config import get %0A%0Adb_con @@ -2994,24 +2994,67 @@ s_text%5B1:%5D)%0A + max_quotes = int(get(%22max_quotes%22, 5))%0A with db_ @@ -3316,17 +3316,26 @@ otes) %3E -5 +max_quotes :%0A
bde2466a18bf32720f5b2b87263e5313c73c9594
remove unused variables
tests/integration_tests/test_kfold_cv.py
tests/integration_tests/test_kfold_cv.py
import logging import os import os.path import tempfile import yaml from ludwig.api import LudwigModel from ludwig.experiment import experiment_kfold_cross_validate from ludwig.utils.data_utils import load_json from tests.integration_tests.utils import category_feature from tests.integration_tests.utils import genera...
Python
0.000113
@@ -3139,258 +3139,8 @@ ml') -%0A results_dir = os.path.join(tmpdir, 'results')%0A statistics_fp = os.path.join(results_dir,%0A 'kfold_training_statistics.json')%0A indices_fp = os.path.join(results_dir, 'kfold_split_indices.json') %0A%0A @@ -5014,62 +5014,8 ...
27e3884cfd8f7b4b3b2af012cd90fa31ae73342d
add description for latexpages-clean command line tool
latexpages/__main__.py
latexpages/__main__.py
# __main__.py - entry points for the latexpages commands """Command-line interface.""" import os import sys import argparse from . import __version__, make, paginate, clean __all__ = ['main', 'main_paginate', 'main_clean'] INIFILE = 'latexpages.ini' def main(): """Run the command-line interface.""" parse...
Python
0
@@ -2896,16 +2896,84 @@ iption=' +Lists intermediate files to delete and deletes them on confirmation. ')%0A%0A
43f05bb600a8975c2cb406560acd1f03dc237374
Use pytest caplog
tests/pytests/unit/client/test_netapi.py
tests/pytests/unit/client/test_netapi.py
import pytest import salt.client.netapi import salt.config from tests.support.helpers import TstSuiteLoggingHandler from tests.support.mock import Mock, patch def test_run_log(): """ test salt.client.netapi logs correct message """ opts = salt.config.DEFAULT_MASTER_OPTS.copy() opts["rest_cherrypy"...
Python
0.000001
@@ -1,21 +1,23 @@ import -pytest +logging%0A %0Aimport @@ -58,65 +58,8 @@ fig%0A -from tests.support.helpers import TstSuiteLoggingHandler%0A from @@ -116,16 +116,22 @@ run_log( +caplog ):%0A %22 @@ -451,510 +451,237 @@ -exp_msg = %22INFO:Starting RunNetapi(salt.loaded.int.netapi.rest_cherrypy)%22%0A ...
0d3b265dde059e6ecc5be2f2b29f318665b94dda
Put cache clearing into except loop.
tests/test_units/test_decorator_cache.py
tests/test_units/test_decorator_cache.py
import os import shutil import time from paste.fixture import TestApp from paste.registry import RegistryManager from beaker.cache import CacheMiddleware import pylons from pylons import Response from pylons.decorators.cache import beaker_cache from pylons.controllers import Controller, WSGIController, XMLRPCContro...
Python
0
@@ -1886,16 +1886,25 @@ ache')%0A%0A +try:%0A shutil.r @@ -1918,16 +1918,33 @@ achedir) +%0Aexcept:%0A pass %0A%0Aenviro
51afb5757ae7715b28df4e8991d1d3cebe9df07c
Remove pdb
tests/testapp/tests/test_templatetags.py
tests/testapp/tests/test_templatetags.py
# coding: utf-8 from __future__ import absolute_import, unicode_literals import django from django.template.loader import render_to_string from django.test import TransactionTestCase from django.test.utils import override_settings from .factories import EntryFactory, create_entries, create_category class TemplateTag...
Python
0.000004
@@ -2012,44 +2012,8 @@ e()%0A - import pdb; pdb.set_trace()%0A
a59a06fbb1e7771a0372ba67dd9ca2af55fa5fb7
update issuer in supplier invoice
tko_coexiste_purchase/models/purchase.py
tko_coexiste_purchase/models/purchase.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
Python
0
@@ -1352,16 +1352,54 @@ tner_ref +,%0A 'issuer': '0' %7D)%0A
16d11d17c574c189fa03bed49a5851a7674d77ea
fix logging
src/LogGabor.py
src/LogGabor.py
# -*- coding: utf8 -*- from __future__ import division """ LogGabor See http://pythonhosted.org/LogGabor """ __author__ = "(c) Laurent Perrinet INT - CNRS" import numpy as np from SLIP import Image, imread class LogGabor(Image): """ Defines a LogGabor framework by defining a ``loggabor`` function which retu...
Python
0.000002
@@ -552,16 +552,59 @@ elf, pe) +%0A self.init_logging(name='LogGabor') %0A%0A ##
aa04e6313ec88fdf3d41f75a94270c96ff263a04
Revise double for loops' vars
lc0045_jump_game_ii.py
lc0045_jump_game_ii.py
"""Leetcode 45. Jump Game II Hard URL: https://leetcode.com/problems/jump-game-ii/ Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimu...
Python
0.000001
@@ -989,10 +989,13 @@ h+1%5D - ~ +,..., T%5Bi @@ -1027,33 +1027,33 @@ = 0%0A for -i +l in range(n):%0A @@ -1066,17 +1066,17 @@ for -j +r in rang @@ -1092,25 +1092,25 @@ 1, min( -i +l + nums%5B i%5D, n - @@ -1101,17 +1101,17 @@ + nums%5B -i +l %5D, n - 1 @@ -1136,17 +1136,17 @@ T%...
e0b14d9f1a89b446f78bc6af8eb47dffb3cc1e6a
Revise class name
lc0046_permutations.py
lc0046_permutations.py
"""Leetcode 46. Permutations Medium URL: https://leetcode.com/problems/permutations/ Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] """ class Solution(object): def _backtrack(self, re...
Python
0.000003
@@ -276,16 +276,25 @@ Solution +Backtrack (object) @@ -1267,16 +1267,25 @@ Solution +Backtrack ().permu
6332306d307062b082e6a0124167b85f4d44f3a5
Use EmbedlamUserAgent when talking to Vimeo
leapfrog/poll/vimeo.py
leapfrog/poll/vimeo.py
from __future__ import division from datetime import datetime import json import logging import re from urllib import urlencode from django.conf import settings import httplib2 import oauth2 as oauth from leapfrog.models import Account, Media, Person, Object, UserStream import leapfrog.poll.embedlam log = logging....
Python
0
@@ -961,21 +961,48 @@ h = -httplib2.Http +leapfrog.poll.embedlam.EmbedlamUserAgent ()%0A
ec8d7b035617f9239a0a52be346d8611cf77cb6f
Add few oc wrappers for future resiliency testing
integration-tests/features/src/utils.py
integration-tests/features/src/utils.py
"""Unsorted utility functions used in integration tests.""" import requests def download_file_from_url(url): """Download file from the given URL and do basic check of response.""" assert url response = requests.get(url) assert response.status_code == 200 assert response.text is not None return...
Python
0
@@ -69,16 +69,34 @@ equests%0A +import subprocess%0A %0A%0Adef do @@ -488,8 +488,1806 @@ t(',')%5D%0A +%0A%0Adef oc_login(url, username, password, tls_verify=True):%0A %22%22%22Wrapper around %60oc login%60.%0A%0A :param url: str, OpenShift URL%0A :param username: str, username%0A :param password: str, p...
d64a5c4027b5cdfec6078cb5da3534f4d75fc615
Return traceback, too, when handling failed forward.
inthe_am/taskmanager/signal_handlers.py
inthe_am/taskmanager/signal_handlers.py
import logging import mimetypes from django.conf import settings from django.contrib.auth.models import User from django.core.mail import EmailMultiAlternatives, mail_admins from django.db import models from django.dispatch import receiver from django_mailbox.signals import message_received from rest_framework.authtok...
Python
0
@@ -24,16 +24,33 @@ imetypes +%0Aimport traceback %0A%0Afrom d @@ -2918,23 +2918,124 @@ %25s. -%22 %25 message.pk, +%5Cn%5Cn%25s%22 %25 (%0A message.pk,%0A traceback.format_tb(),%0A ) %0A
c77518e19f061c70b9ee9b087ca8f792d3c67021
Bump the version to 0.1.2
src/__init__.py
src/__init__.py
# -*- coding: utf-8 -*- # # This module is part of the GeoTag-X project validator tool. # # Author: Jeremy Othieno (j.othieno@gmail.com) # # Copyright (c) 2016-2017 UNITAR/UNOSAT # # The MIT License (MIT) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated do...
Python
0.999999
@@ -1272,11 +1272,11 @@ = %220.1. -1 +2 %22%0A
41df08c2d29e80e1f1eadfd3d6eb6090227d3a47
remove debug and catch empty listeners.
lib/acli/output/elb.py
lib/acli/output/elb.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, print_function, unicode_literals) from acli.output import output_ascii_table, dash_if_none from colorclass import Color, Windows Windows.enable(auto_colors=True, reset_atexit=True) def get_elb_instances(instances=None): """ @type instances: list...
Python
0
@@ -2440,33 +2440,8 @@ ut:%0A - print(listeners)%0A @@ -3873,16 +3873,29 @@ +dash_if_none( get_heal @@ -3925,16 +3925,17 @@ Check')) +) %5D)%0A
096d1a64a3829607ae74d57c2acb4a5df4b65023
swap a .sort() for a sorted()
lib/calculate_terms.py
lib/calculate_terms.py
from .flattened import flatten from datetime import datetime def year_plus_term(year, term): return int(str(year) + str(term)) def find_terms_for_year(year): now = datetime.now() current_month = now.month current_year = now.year all_terms = [1, 2, 3, 4, 5] limited_terms = [1, 2, 3] # S...
Python
0.000566
@@ -1411,25 +1411,8 @@ 082) - (sorts in-place) %0A @@ -1425,14 +1425,27 @@ list -. + = sort -( +ed(term_list )%0A%0A
8844fd454428707f9b64e0941081cecbec64c43c
apply torque with left and right arrow keys
lib/cannonball/main.py
lib/cannonball/main.py
from __future__ import division import pyglet, sys, math from pyglet.gl import * from Box2D import * class CannonballWindow(pyglet.window.Window): def __init__(self): pyglet.window.Window.__init__(self, fullscreen=True, caption="Cannonball") self.set_mouse_vis...
Python
0
@@ -503,16 +503,81 @@ a = None +%0A self.left = self.right = False%0A self.fire = False %0A%0A @@ -649,24 +649,197 @@ (self, dt):%0A + torque = 0%0A if self.left:%0A torque += 1%0A if self.right:%0A torque -= 1%0A self.bodies%5B'cannonball'%5D.App...
78bce22ffb036b92daf310c37f9a1aeb62e79fe7
use bulk import to import data in elastic
src/data_import.py
src/data_import.py
import csv import os import tempfile from datetime import datetime from elasticsearch import Elasticsearch from boto.s3.connection import S3Connection host = 'http://{}:{}@localhost:9200/'.format(os.environ['ELASTIC_USER'], os.environ['ELASTIC_PASSWORD']) es_client = Elasticsearch( [host] ) ## from http://data.gd...
Python
0
@@ -14,16 +14,27 @@ port os%0A +import sys%0A import t @@ -41,16 +41,16 @@ empfile%0A - from dat @@ -110,16 +110,25 @@ icsearch +, helpers %0Afrom bo @@ -165,16 +165,50 @@ ection%0A%0A +csv.field_size_limit(sys.maxsize)%0A host = ' @@ -1874,16 +1874,102 @@ ' +_op_type': 'index',%0A '_index': 'doc...
206e5c65310751701f56c976db1cb917c3127c1d
manage jobs: allow to force fail a job
lava_server/management/commands/jobs.py
lava_server/management/commands/jobs.py
# Copyright (C) 2017 Linaro Limited # # Author: Remi Duraffort <remi.duraffort@linaro.org> # # This file is part of LAVA Dispatcher. # # LAVA Dispatcher 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 v...
Python
0.000203
@@ -1954,16 +1954,346 @@ = True%0A%0A + fail = sub.add_parser(%22fail%22, help=%22Force the job status in the database. Keep %22%0A %22in mind that any corresponding lava-run %22%0A %22process will NOT be stopped by this operati...
738c141be05bede560e46240117e598f82a052e2
version bump to 0.1.15
contact_form/__init__.py
contact_form/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 1, 14) def get_version(): """Returns the version as a human-format string.""" return '.'.join([str(i) for i in VERSION]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 2014-2015, dlancer' __license__ = 'BSD' __version__ = get_ver...
Python
0
@@ -36,17 +36,17 @@ (0, 1, 1 -4 +5 )%0A%0A%0Adef
b9996fa9f697c436ae2bf829b440340b9ddceaa7
Fix type error in `StashMixin`
core/git_mixins/stash.py
core/git_mixins/stash.py
from collections import namedtuple import re from GitSavvy.core.git_command import mixin_base Stash = namedtuple("Stash", ("id", "description")) class StashMixin(mixin_base): def get_stashes(self): """ Return a list of stashes in the repo. """ stdout = self.git("stash", "list")...
Python
0.000001
@@ -443,27 +443,13 @@ -num, _, description +match = r @@ -497,16 +497,81 @@ , entry) +%0A assert match%0A num, _, description = match .groups(
846c8de1d0ef21b9863e5121b21db9e0f5afc6a0
Revert MERGER_BASE_URL update
councilmatic/settings.py
councilmatic/settings.py
""" Django settings for councilmatic project. Generated by 'django-admin startproject' using Django 1.8.3. 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/ """ # Build...
Python
0
@@ -3160,16 +3160,8 @@ rger --upgrade .dat
5db82ed4b8830198fe8e6f7f475fff0f6a19cdf3
reorder middleware
councilmatic/settings.py
councilmatic/settings.py
""" Django settings for councilmatic project. Generated by 'django-admin startproject' using Django 1.8.3. 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/ """ # Build...
Python
0.015479
@@ -1244,43 +1244,32 @@ ngo. -contrib.sessions.middleware.Session +middleware.csrf.CsrfView Midd @@ -1305,20 +1305,33 @@ re.c -ommon.Comm +lickjacking.XFrameOpti on +s Midd @@ -1355,32 +1355,43 @@ ngo. -middleware.csrf.CsrfView +contrib.sessions.middleware.Session Midd @@ -1548,105 +1548,92 @@ ngo. -contrib.mes...
789daf0a8b0204a3a00866c0c70b44f92c531646
Add missing close paren.
countCrfResultPhrases.py
countCrfResultPhrases.py
"""Count the occurances of phrases in the CRF results, by tag.""" # TODO: Add a command line flag listing the tags to extract, # perhaps also one listing tags to exclude. import argparse import codecs import json import sys from pyspark import SparkContext def getPhrasesMaker(includeArg, excludeArg): includeTags...
Python
0.000005
@@ -1249,32 +1249,33 @@ %22 %22.join(d%5Btag%5D) +) %0A return
d0ca1fd85c2f678dcdd05c9601647e3655c0f506
Make promptable JT fields not required.
lib/tower_cli/resources/job_template.py
lib/tower_cli/resources/job_template.py
# Copyright 2015, Ansible, Inc. # Luke Sneeringer <lsneeringer@ansible.com> # # 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 requi...
Python
0
@@ -1164,16 +1164,32 @@ entory') +, required=False )%0A pr @@ -1345,32 +1345,48 @@ display=False, + required=False, %0A type=ty
df33d5064128034c57f1d9d23f275d9392c2ed76
Version 2.6.0
createsend/createsend.py
createsend/createsend.py
import urllib import urllib2 import httplib import base64 import gzip from StringIO import StringIO from urlparse import urlparse from utils import json_to_py, get_faker __version_info__ = ('2', '5', '0') __version__ = '.'.join(__version_info__) class CreateSendError(Exception): """Represents a CreateSend API error...
Python
0.000001
@@ -190,17 +190,17 @@ ('2', ' -5 +6 ', '0')%0A