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
6e87102251f6448ffa7b9c662ace3b50b00b69b2
Test for git config.
apgl/data/ExamplesGenerator.py
apgl/data/ExamplesGenerator.py
''' A simple class which can be used to generate test sets of examples. ''' #import numpy import numpy.random class ExamplesGenerator(): def __init__(self): pass def generateBinaryExamples(self, numExamples=100, numFeatures=10, noise=0.4): """ Generate a certain nu...
Python
0
@@ -402,32 +402,77 @@ ary -/+ 1 labels +. Must have more than 1 example and feature. %0D%0A %22%22%22%0D%0A
25870e710ca51a6fe373677f2d2889a0df3641ca
Revert "test commit heroku"
farmsList/public/api.py
farmsList/public/api.py
import jsonpickle from flask import Blueprint from farmsList.public.models import Parcel blueprint = Blueprint('api', __name__, url_prefix='/api', static_folder="../static") @blueprint.route("/parcel/", methods=["GET", "POST"]) def api_parcel(): print "HELLO" parcelData = Parcel.query.filter(Parcel.listedToP...
Python
0
@@ -252,23 +252,8 @@ ():%0A -%09print %22HELLO%22%0A %09par @@ -323,25 +323,8 @@ l()%0A -%09print %22HELLO 2%22%0A %09ret
0163d94f2ad28d8457b99f05c427b88bc97881f1
fix links
examples/ensemble/plot_partial_dependence.py
examples/ensemble/plot_partial_dependence.py
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
Python
0
@@ -459,14 +459,23 @@ ee : -meth:%60 +attr:%60~sklearn. ense @@ -603,16 +603,25 @@ :class:%60 +~sklearn. ensemble
cebc863ebd4942bf7393d04bdf1066c57652fe75
add --no-pager for git call in log_since.py
appengine/components/tools/log_since.py
appengine/components/tools/log_since.py
#!/usr/bin/env python # Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Prints a short log from HEAD (or [end]) to a pseudo revision number.""" from __future__ import print_function __version...
Python
0
@@ -3941,16 +3941,30 @@ %5B'git', + '--no-pager', 'diff',
e265fd0ab0845ab20751ce0291436922e00ef1cc
version 0.1.17 release
fastprogress/version.py
fastprogress/version.py
__all__ = ['__version__'] __version__ = '0.1.16'
Python
0
@@ -43,7 +43,7 @@ .1.1 -6 +7 '%0A
e6c8706a87cf83e5e5ffbadad4b8b96effd14e04
Fix tests
features/files/tests.py
features/files/tests.py
import os import shutil import django import django_mailbox import core from features.associations import models as associations from features.images import tests as images from features.memberships import test_mixins as memberships class GroupMessageMixin(memberships.MemberMixin): def setUp(self): mail...
Python
0.000003
@@ -552,19 +552,28 @@ -to_header=' +body='Delivered-To: %7B%7D@l @@ -580,16 +580,26 @@ ocalhost +%5Cn%5CnText A '.format @@ -619,39 +619,8 @@ lug) -,%0A body='Text A' )%0A%0A%0A
145b25626dd018c4dd8b86e17361b9e4eeb935ea
Add some more comments to filter file.
filter_nsized_groups.py
filter_nsized_groups.py
#!/usr/bin/python import struct import sys def parse_arguments(): options = {} for arg in sys.argv[1:]: if arg == "--help": print "usage: ./filter_nsized_causes.py --outfile=OUTPUT [--n=N] [--infile=INPUT]" print "" print "n: threshold of group size to include in output file. (default = 1)" ...
Python
0
@@ -37,16 +37,469 @@ rt sys%0A%0A +# filter_nsized_groups: Given a CSV file of (user, group) pairs, each indicating%0A# that user USER belongs to group GROUP, do two things:%0A#%0A# 1. Remove all groups with a size that fall under a threshold, specified in %0A# arguments passed to the file (defaults to 1).%0A#%0A# ...
119b154f0cad59b11306995b774e225f6061dc6f
Clarify Task.tick design choice
py/g1/asyncs/kernels/g1/asyncs/kernels/tasks.py
py/g1/asyncs/kernels/g1/asyncs/kernels/tasks.py
__all__ = [ 'Task', ] import inspect import logging import weakref from g1.bases.assertions import ASSERT from . import contexts from . import errors from . import traps LOG = logging.getLogger(__name__) class Task: """Task object. A ``Task`` object wraps an coroutine object, and is the basic unit ...
Python
0.000053
@@ -3036,16 +3036,574 @@ p point. +%0A%0A NOTE: %60%60tick%60%60 catches %60%60BaseException%60%60 raised from the%0A coroutine. As a result, %60%60SystemExit%60%60 does not bubble up to%0A the kernel event loop. I believe this behavior is similar to%0A Python threading library and thus m...
10bddfe09f5026f32951e9d3608166515a755613
Document the NFKC-normalized ligature in the Arabic test.
tests/test.py
tests/test.py
from wordfreq import ( word_frequency, available_languages, cB_to_freq, top_n_list, random_words, random_ascii_words, tokenize ) from nose.tools import ( eq_, assert_almost_equal, assert_greater, raises ) def test_freq_examples(): # Stopwords are most common in the correct language assert_greater(...
Python
0.001611
@@ -4282,33 +4282,103 @@ r'), -%0A %5B'%5Cu0644%5Cu0627'%5D + # An Arabic ligature...%0A %5B'%5Cu0644%5Cu0627'%5D # ...that is affected by NFKC normalization %0A
57c0668b9dd11845fb2d845ecbcb0a8aae19eb9c
Add default params to template
exercises/scale-generator/scale_generator.py
exercises/scale-generator/scale_generator.py
class Scale(object): def __init__(self): pass
Python
0
@@ -35,16 +35,49 @@ t__(self +, tonic, scale_name, pattern=None ):%0A
321e285f853280204371a882808c116e59892e27
Make wording of message describing not passing filter more clear
extraction/runnables.py
extraction/runnables.py
import collections import sys import traceback class Runnable(object): # runnable properties result_file_name = None dependencies = frozenset() def __init__(self): pass def check_dep_errors(self, dep_results): deps = self.__class__.dependencies filter_deps = [e for e in deps if issu...
Python
0.000671
@@ -732,14 +732,22 @@ %25s -failed +returned false ' %25
2b3431f302cf08d3892eb613079df905ba1f68cb
Add tests to check content page rendering
src/core/tests.py
src/core/tests.py
import pytest from django.test import override_settings from core.utils import collect_language_codes def test_locale_fallback_middleware(client, settings): response = client.get('/en/', follow=True) assert response.redirect_chain == [('/en-us/', 302)] @override_settings(USE_I18N=False) def test_locale_fa...
Python
0
@@ -1,12 +1,23 @@ +import os%0A%0A import pytes @@ -18,16 +18,16 @@ pytest%0A - %0Afrom dj @@ -60,16 +60,62 @@ settings +%0Afrom django.utils.translation import activate %0A%0Afrom c @@ -1217,16 +1217,16 @@ ected):%0A - asse @@ -1269,8 +1269,1454 @@ xpected%0A +%0A%0Adef content_page_path_gen():%0A from...
2b403cb00f3dd7e676a40fffcbd14a22c8e54635
work in progress...
metadata_export_batch/metadata_batch_operations.py
metadata_export_batch/metadata_batch_operations.py
import arcpy import os.path, os,fnmatch import time import pdb #Get the record and path to XMLs record = raw_input("Enter record number: ") record_path = raw_input("Enter path to shapefiles: ") blankMXD = r'D:\drive\Map Library Projects\MGS\Metadata Templates\blank.mxd' #Static vars TRANSLATOR = "C:\\Program Files\\A...
Python
0
@@ -55,16 +55,28 @@ port pdb +%0Aimport glob %0A%0A#Get t @@ -1006,150 +1006,8 @@ %0A - #importXMLext = importXMLfile+'.xml'%0A #importXMLpath = os.path.join(base_path,record,'converted',importXMLext)%0A print importXMLpath%0A @@ -1439,32 +1439,59 @@ s = -arcpy.ListFiles( +glob.glob(os.path.join(...
ee98b5a5c6b82671738bc60e68ea87d838c5400f
Improve the migration for unique data source name
migrations/0020_change_ds_name_to_non_uniqe.py
migrations/0020_change_ds_name_to_non_uniqe.py
from redash.models import db import peewee from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): success = False ...
Python
0.000017
@@ -300,288 +300,139 @@ -success = False%0A for index_name in %5B'unique_name', 'data_sources_name'%5D:%0A try:%0A print %22Trying to remove data source name uniqueness index with the name: %7B%7D%22.format(index_name)%0A migrate(migrator.drop_index(%22data_sources%...
791546d9fa1fc0317dc613e0ba7e74ca1cbf8210
Update __init__.py
flask_admin/__init__.py
flask_admin/__init__.py
__version__ = '1.4.1' __author__ = 'Flask-Admin team' __email__ = 'serge.koval+github@gmail.com' from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView
Python
0.000072
@@ -12,17 +12,17 @@ = '1.4. -1 +2 '%0A__auth
558085de2a32ef14d7b9ef2884f34699b7f7c39b
Update test.py
tests/test.py
tests/test.py
from nose.tools import with_setup from ..MyModule import MyModule count = 0 def setup_module(): print('<<<Setup Module>>>') def teardown_module(): print('<<<Teardown Module>>>') def setup_function(): print('<<<Setup Function>>>') global count count = 1 def teardown_function(): print('<<<Te...
Python
0.000001
@@ -1,12 +1,46 @@ +import sys%0Asys.path.append('..')%0A%0A from nose.to @@ -67,18 +67,16 @@ p%0A%0Afrom -.. MyModule
53d75c14d79b92ad1fdf9c99b0773db6427d4294
update to reveal.js 3.2.0
flask_reveal/tools/commands/installreveal.py
flask_reveal/tools/commands/installreveal.py
# -*- coding: utf-8 -*- import argparse import os from urllib import request import flask_reveal from flask_reveal.tools.helpers import extract_file, move_and_replace class InstallReveal(argparse.ArgumentParser): info = ({ 'prog': 'installreveal', 'description': 'installs Reveal.js', }) ...
Python
0
@@ -817,9 +817,9 @@ e/3. -1 +2 .0.t
b663fd1a42506eeddc6c86a72f6833d737c7e135
fix logger
keystone_spassword/contrib/spassword/mailer.py
keystone_spassword/contrib/spassword/mailer.py
# # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you unde...
Python
0.000005
@@ -2656,14 +2656,11 @@ -logger +LOG .inf
623d49f79dcc1986c224f2fdfdfdd825e923c53f
Add treeview
python/regvar/webapps/alignments/application.py
python/regvar/webapps/alignments/application.py
import bx.align.maf import cStringIO import os from flask import Flask, request ENVSETTINGSVAR = 'ALIGNMENTS_SETTINGS' app = Flask(__name__) # # Change this to ProductionConfig when finished app.config.from_object('regvar.webapps.alignments.DevelopmentConfig') if ENVSETTINGSVAR in os.environ: app.config.from_envva...
Python
0
@@ -39,16 +39,38 @@ mport os +%0Aimport io%0Aimport ete2 %0A%0Afrom f @@ -95,16 +95,27 @@ request +, send_file %0AENVSETT @@ -370,27 +370,37 @@ )%0A%0A%0Adef get_ -maf +alignment_dir (genome, ali @@ -405,23 +405,16 @@ lignment -, chrom ):%0A r @@ -490,62 +490,1046 @@ ome, -%0A alignment, 'maf', '%7B...
d060a9ad8483b86c1417ac4e439b90d2a35c6f2f
Fix management command for Django 1.11.
kitsune/sumo/management/commands/extract_db.py
kitsune/sumo/management/commands/extract_db.py
import os from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db.models.loading import get_model HEADER = """\ ####################################################################### # # Note: This file is a generated file--do not edit it directly! # Instead...
Python
0
@@ -119,42 +119,24 @@ ngo. -db.models.loading import get_model +apps import apps %0A%0A%0AH @@ -1876,16 +1876,23 @@ +django_ apps = s @@ -2061,16 +2061,23 @@ dels in +django_ apps.ite @@ -2161,16 +2161,21 @@ class = +apps. get_mode @@ -2970,17 +2970,17 @@ print - +( 'Outputt @@ -3034,16 +3034,1...
4d5b82a33473475adc3042f7fb6a2718cb17e9fe
handle resource leak
python/selenium_load_page/selenium_load_page.py
python/selenium_load_page/selenium_load_page.py
#!/usr/bin/python ##------------------------------------------------------------------- ## ## File : selenium_load_page.py ## Author : ## Description : ## Test page loading with selenium: slow load, severe ## errors when launching network requests, and save screenshots as images. ## ## More reading: h...
Python
0.000001
@@ -1543,24 +1543,26 @@ okies()%0A%0A + # driver.set_ @@ -2865,16 +2865,34 @@ close()%0A + driver.quit()%0A retu
a7db7bdb277eed65c93fbc9f5e9e923487711071
Update file_system_storage.py
image_diet/file_system_storage.py
image_diet/file_system_storage.py
import os from image_diet import settings from django.conf import settings as main_settings from django.contrib.staticfiles.storage import StaticFilesStorage class ImageDietFileSystemStorage(StaticFilesStorage): def post_process(self, files, *args, **kwargs): results = [] print settings d...
Python
0.000002
@@ -281,16 +281,37 @@ ts = %5B%5D%0A + print 'test'%0A
9c3b3cb541e8d42d1206fabae83fbef4a249f3ec
bump version
backslash/__version__.py
backslash/__version__.py
__version__ = "2.3.1"
Python
0
@@ -14,9 +14,9 @@ %222. -3.1 +4.0 %22%0A
2f76784cc016f9ed5afef704cbcf8a445af9fc45
Fix the test by sorting the results before comparing
flocker/cli/functional/test_deploy_script.py
flocker/cli/functional/test_deploy_script.py
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Functional tests for the ``flocker-deploy`` command line tool. """ from subprocess import check_output, CalledProcessError import time from unittest import skipUnless from twisted.python.procutils import which from twisted.python.filepath import FilePat...
Python
0.001031
@@ -6676,32 +6676,39 @@ +sorted( expected_errors, @@ -6706,16 +6706,17 @@ d_errors +) ,%0A @@ -6725,17 +6725,23 @@ -%5B +sorted( f.value @@ -6757,17 +6757,17 @@ failures -%5D +) %0A
9834fab5a7e061f0eb1cb7b737cec8d2b23b4c7c
Declare numpydoc template in setup_package.py
astropy_helpers/extern/setup_package.py
astropy_helpers/extern/setup_package.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst def get_package_data(): return {'astropy_helpers.extern': ['automodapi/templates/*/*.rst']}
Python
0.000001
@@ -151,11 +151,39 @@ */*.rst' +, 'numpydoc/templates/*.rst' %5D%7D%0A
65636f9545018b887f7a8aa6c063de63570119c9
Load DOS briefs_search_filters separately
app/__init__.py
app/__init__.py
from flask import Flask, request, redirect, session, abort from flask_login import LoginManager from flask_wtf.csrf import CsrfProtect import dmapiclient from dmutils import init_app, flask_featureflags from dmcontent.content_loader import ContentLoader from dmutils.user import User from config import configs login...
Python
0
@@ -2000,24 +2000,26 @@ rs',%0A )%0A%0A +%0A%0A from .ma
8bc306d466034d0d44fc41e935a5499631011149
Add missing module
factory/glideFactory.py
factory/glideFactory.py
# # Description: # This is the main of the glideinFactory # # Arguments: # $1 = poll period (in seconds) # $2 = advertize rate (every $2 loops) # $3 = glidein submit_dir # # Author: # Igor Sfiligoi (Apr 9th 2007 - moved old glideFactory to glideFactoryEntry) # import os import os.path import sys import fcntl...
Python
0.000016
@@ -314,16 +314,30 @@ t fcntl%0A +import popen2%0A import t
a37d8a9874898b072b72c85a8b611e46a459a19e
Move order of installed apps
imagersite/imagersite/settings.py
imagersite/imagersite/settings.py
""" Django settings for imagersite 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 p...
Python
0.000001
@@ -1111,81 +1111,81 @@ ' -imager_profile',%0A 'imager_images',%0A 'bootstrap3',%0A 'registration +bootstrap3',%0A 'registration',%0A 'imager_profile',%0A 'imager_images ',%0A)
220708945a18b5d876cdff32dcfb9b8b8971d85b
Add time/space complexity
lc017_letter_combinations_of_a_phone_number.py
lc017_letter_combinations_of_a_phone_number.py
"""Leetcode 17. Letter Combinations of a Phone Number Medium URL: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho...
Python
0.002369
@@ -711,16 +711,193 @@ st%5Bstr%5D%0A + %0A Time complexity: O(n * m%5E2)%0A - n is the length of digits,%0A - m is the mean length of digit's letters, basically 3.%0A Space complexity: O(m%5En).%0A
8161561499e813c8821d6f810e6e28d4e3984922
Update __init__.py
app/__init__.py
app/__init__.py
from flask import Flask, render_template from flask_assets import Bundle, Environment from flask_socketio import SocketIO, emit from flask.ext.mail import Mail from flask.ext.login import LoginManager from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.pagedown import PageDown...
Python
0.000072
@@ -83,50 +83,8 @@ ent%0A -from flask_socketio import SocketIO, emit%0A from @@ -568,30 +568,8 @@ p()%0A -socketio = SocketIO()%0A logi @@ -1152,35 +1152,8 @@ pp)%0A - socketio.init_app(app)%0A
2b482f638a2ff51eeed595b15f338333b5dd8856
Fix --no-progress-bar option in generate.py (#115)
fairseq/progress_bar.py
fairseq/progress_bar.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # """ Progress bar wrapper around ...
Python
0.000003
@@ -891,16 +891,21 @@ le, desc +=None , *_args @@ -1346,16 +1346,94 @@ +desc = '' if self.desc is None else '%7B%7D: '.format(self.desc)%0A msg = '%7B @@ -1433,19 +1433,16 @@ sg = '%7B%7D -: %7B:5d%7D / @@ -1455,29 +1455,24 @@ %7D%5Cn'.format( -self. desc, i, siz
007c8bd8bba14b2c16ba9a79d47f7c0630d20f85
Add __del__
aioinflux/client.py
aioinflux/client.py
import asyncio import logging from typing import Union, AnyStr, Mapping, Iterable from urllib.parse import urlencode import aiohttp from .line_protocol import parse_data PointType = Union[AnyStr, Mapping] class AsyncInfluxDBClient: def __init__(self, host='localhost', port=8086, database='testdb', ...
Python
0.0006
@@ -862,16 +862,69 @@ lose()%0A%0A + def __del__(self):%0A self.session.close()%0A%0A asyn
cc734b39fe18ae66fee0f5b35deaf4f864fa9a4f
remove old imports
game.py
game.py
# from cardsource import * # import cardsource as cs from collections import deque class SheddingGame(object): """ Represents a Shedding-type game https://en.wikipedia.org/wiki/Shedding-type_game """ def __init__(self, deck): super(SheddingGame, self).__init__() self.players = deque() s...
Python
0.998694
@@ -1,57 +1,4 @@ -# from cardsource import *%0A# import cardsource as cs%0A from
65f8dc529a78593621f4f2b2477707b8e877f0d3
Add Mooseman to privileged users. --autopull
globalvars.py
globalvars.py
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:%M:%S") ...
Python
0
@@ -1416,16 +1416,26 @@ %22203389%22 +, %22202832%22 %5D %7D%0A
b518de210dc3ae075beea60a06e981844ecff3d8
fix lint errors
app/__init__.py
app/__init__.py
import os from flask import Flask, render_template from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.openid import OpenID from flask.ext.mail import Mail from config import config, basedir db = SQLAlchemy() mail = Mail() login_manager = LoginManager() login_manager.ses...
Python
0.000037
@@ -30,25 +30,8 @@ lask -, render_template %0Afro @@ -421,16 +421,17 @@ tmp'))%0A%0A +%0A def crea
f775efb26a274f6a77c30ac70a17eeee8c215011
Update fields.py
graphene_django_extras/paginations/fields.py
graphene_django_extras/paginations/fields.py
# -*- coding: utf-8 -*- from functools import partial from math import fabs from graphene import Field, Int, List, NonNull, String from .utils import _nonzero_int, _get_count from ..settings import graphql_api_settings __all__ = ('LimitOffsetPaginationField', 'PagePaginationField', 'CursorPaginationField') class A...
Python
0.000001
@@ -1265,16 +1265,17 @@ ery_para +m %0A
10bbd489e4123363ee4ecafe0ca43151f52a9813
Create compatibility settings/functions for pluggable auth user functionality. See #24
allaccess/compat.py
allaccess/compat.py
"Python and Django compatibility functions." from __future__ import unicode_literals from django.conf import settings try: from django.utils.crypto import get_random_string except ImportError: # pragma: no cover # Backport implementation from Django 1.4 import hashlib import random import string ...
Python
0
@@ -114,16 +114,86 @@ tings%0A%0A%0A +AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')%0A%0A%0A try:%0A @@ -1156,8 +1156,206 @@ ngth)%5D)%0A +%0A%0Atry:%0A from django.contrib.auth import get_user_model%0Aexcept ImportError: # pragma: no cover%0A # Django %3C 1.5%0A from django.contrib...
15f00997113ecb87de9daf636738bc0b51686918
Fix assertion in AutocompleteList.choices_for_request for empty lists
autocomplete_light/autocomplete/list.py
autocomplete_light/autocomplete/list.py
from __future__ import unicode_literals from django.utils.encoding import force_text __all__ = ('AutocompleteList',) class AutocompleteList(object): """ Simple Autocomplete implementation which expects :py:attr:`choices` to be a list of string choices. .. py:attribute:: choices List of str...
Python
0
@@ -1408,16 +1408,28 @@ .choices + is not None , 'autoc
d92cfdf6644663a6e615e032c6bc6ca52bed3edb
Add DragonLord to privileged users
globalvars.py
globalvars.py
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:%M:%S") ...
Python
0
@@ -1414,16 +1414,26 @@ %22202832%22 +, %22160017%22 %5D%7D%0A s
cc1000824237cd74dec3e0ff210ee08020c2cd92
add config ini to ament_mypy site package (#182)
ament_mypy/setup.py
ament_mypy/setup.py
from setuptools import find_packages from setuptools import setup setup( name='ament_mypy', version='0.7.3', packages=find_packages(exclude=['test']), install_requires=['setuptools'], zip_safe=False, author='Ted Kern', author_email='ted.kern@canonical.com', maintainer='Ted Kern', ma...
Python
0
@@ -190,24 +190,96 @@ tuptools'%5D,%0A + package_data=%7B'': %5B%0A 'configuration/ament_mypy.ini',%0A %5D%7D,%0A zip_safe
d2eb8bd9588bdda2e05967d10ffc6da786f0e82b
fix LinearFA_Agent batch mode learn method. self.laststate is not defined, use self.lastobs instead
pybrain/rl/agents/linearfa.py
pybrain/rl/agents/linearfa.py
from __future__ import print_function __author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.rl.agents.logging import LoggingAgent from pybrain.utilities import drawIndex from scipy import array class LinearFA_Agent(LoggingAgent): """ Agent class for using linear-FA RL algorithms. """ init_explor...
Python
0
@@ -3077,21 +3077,19 @@ elf.last -state +obs is not
3b8385e75f9d6259f085746fe90e6ab3d9dbdc90
Update perms.py
discord/perms.py
discord/perms.py
# -*- coding: utf-8 -*- """Ces fonctions sont utilisรฉes afin de permettre de rรฉcupรฉrer la totalitรฉ des donnรฉes de permissions des utilisateurs. Crรฉรฉ par @Sakiut25#7390 (c)""" ######################################################################################################################################...
Python
0
@@ -8704,28 +8704,295 @@ ############################ +%0D%0A%0D%0Adef getToken():%0D%0A%09%0D%0A%09fileName = './token.txt'%0D%0A%09with open(fileName) as f: token = f.read()%0D%0A%09%0D%0A%09return token%0D%0A%0D%0A######################################################################################################...
1ec0b7bf12b8d0ea452caa9aad17535a2fd745d8
Optimise for readability
scell/core.py
scell/core.py
""" scell.core ~~~~~~~~~~ Provides abstractions over lower level APIs and file objects and their interests. """ from select import select as _select from collections import namedtuple def select(rl, wl, timeout=None): """ Returns the file objects ready for reading/writing from the read-...
Python
0.672366
@@ -709,22 +709,17 @@ iters%0A%0A%0A -class +_ Monitore @@ -719,17 +719,19 @@ onitored -( + = namedtup @@ -734,17 +734,16 @@ dtuple(' -_ Monitore @@ -783,16 +783,127 @@ llback') +%0A_Event = namedtuple('Event', 'monitored,readable,writable,fp,callback,ready')%0A%0A%0Aclass Monitored(_Monitored ):%0A %2...
9f0837d387c7303d5c8c925a9989ca77a1a96e3e
Bump version after keras model fix
fancyimpute/__init__.py
fancyimpute/__init__.py
from __future__ import absolute_import, print_function, division from .solver import Solver from .nuclear_norm_minimization import NuclearNormMinimization from .iterative_imputer import IterativeImputer from .matrix_factorization import MatrixFactorization from .iterative_svd import IterativeSVD from .simple_fill impo...
Python
0
@@ -508,9 +508,9 @@ 0.4. -2 +3 %22%0A%0A_
63fd814c8989881f5e805eff89e568bd35ac0006
move the combine_page_rank param to the analyze methode.
analyzer/cosinus.py
analyzer/cosinus.py
import math import os from analyzer.hit import Hit from analyzer.hit import Hits from model.index import Index from model.page import Page from model.page import Pages from indexer.lexer import TokenLexer from utils.string import StringUtil class CosinusAnalyzer: def __init__(self, index, pages, combine_with_pag...
Python
0
@@ -299,38 +299,8 @@ ages -, combine_with_page_rank=False ):%0A%0A @@ -681,97 +681,66 @@ s()%0A +%0A - self.combine_with_page_rank = combine_with_page_rank%0A%0A def analyze(self, query +def analyze(self, query, combine_with_page_rank=False ):%0A @@ -1695,21 +1695,16 @@ if ( -self. combine_
5b7abc62a541622b007da367e52488eab72f2b5a
Fix font usage.
graph-deps.py
graph-deps.py
#!/usr/bin/env python3 # file: graph-deps.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Author: R.F. Smith <rsmith@xs4all.nl> # Created: 2017-04-27 13:50:28 +0200 # Last modified: 2017-06-04 13:38:06 +0200 # # To the extent possible under law, R.F. Smith has waived all copyright and # related or neighboring righ...
Python
0.000002
@@ -187,28 +187,28 @@ 201 -7-06-04 13:38:06 +02 +8-03-10 22:50:33 +01 00%0A# @@ -932,23 +932,99 @@ ', ' -node %5Bshape=box +fontname=%22Alegreya%22;', 'concentratr=true;',%0A 'node %5Bshape=box, fontname=%22Alegreya%22 %5D;'%5D
8408f5431e56309d95076db16c86b0aa2ef044ba
Decrease number of messages from MoveToFort worker
pokemongo_bot/event_manager.py
pokemongo_bot/event_manager.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals class EventNotRegisteredException(Exception): pass class EventMalformedException(Exception): pass class EventHandler(object): def __init__(self): pass def handle_event(self, event, kwargs): raise NotImplementedError(...
Python
0.000001
@@ -57,16 +57,39 @@ iterals%0A +from sys import stdout%0A %0A%0Aclass @@ -508,16 +508,48 @@ s) or %5B%5D +%0A self._last_event = None %0A%0A de @@ -1533,16 +1533,254 @@ event)%0A%0A + if (event == self._last_event) and (event in %5B%22moving_to_fort%22, %22moving_to_lured_fort%22%5D):%0A ...
05835304797c9486d0c715d5a07d02fffd676b67
Fix test to account for new composition
karld/tests/test_run_together.py
karld/tests/test_run_together.py
from itertools import islice import string import unittest from mock import patch, Mock from ..run_together import csv_file_to_file class TestCSVFileToFile(unittest.TestCase): def setUp(self): self.csv_contents = iter([ ['a', 'b'], ['c', 'd'], ['e', 'f'], ]) ...
Python
0
@@ -244,14 +244,110 @@ -%5B +'a,b',%0A 'c,d',%0A 'e,f',%0A %5D)%0A self.csv_list = (%0A %5Bu 'a', +u 'b'%5D @@ -365,13 +365,15 @@ %5B +u 'c', +u 'd'%5D @@ -391,13 +391,15 @@ %5B +u 'e', +u 'f'%5D @@ -408,17 +408,16 @@ -%5D )%0A%0A @ @@ ...
034c361f4bf455ef468c1e500ce717d21aad7bc7
Bump version
form_error_reporting.py
form_error_reporting.py
from collections import OrderedDict import logging from math import ceil import re import uuid import warnings from django.conf import settings import requests from six.moves.urllib.parse import quote, urljoin VERSION = (0, 4) __version__ = '.'.join(map(str, VERSION)) __all__ = ('GAErrorReportingMixin', 'GARequestErr...
Python
0
@@ -219,17 +219,17 @@ N = (0, -4 +5 )%0A__vers
25e7574b6d58444ba81b3ad9321662e3a1a6b7e8
Apply some PEP8 cleanup
product_variant_sale_price/models/product_product.py
product_variant_sale_price/models/product_product.py
# -*- coding: utf-8 -*- # ยฉ 2016 Sergio Teruel <sergio.teruel@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api class ProductTemplate(models.Model): _inherit = "product.template" @api.multi def write(self, vals): res = super(P...
Python
0.000001
@@ -384,45 +384,8 @@ ls:%0A - for product in self:%0A @@ -407,23 +407,20 @@ iant in -product +self .mapped( @@ -443,20 +443,16 @@ _ids'):%0A - @@ -1101,17 +1101,19 @@ vals -= + = %7B%7D%0A @@ -1259,16 +1259,37 @@ e_price( +%0A product.
93181a9a8df89c9ed1ff1e06672cc592a2b689dc
Fix deadcode
polyphony/compiler/deadcode.py
polyphony/compiler/deadcode.py
from .env import env from .ir import * from logging import getLogger logger = getLogger(__name__) class DeadCodeEliminator(object): def process(self, scope): if scope.is_namespace() or scope.is_class() or scope.is_method(): return usedef = scope.usedef for blk in scope.traverse...
Python
0.999094
@@ -212,29 +212,8 @@ ss() - or scope.is_method() :%0A
e1e4d36096fe2c8cea92b77feabc60d94ac4310a
Break class now inherits behaviour from KitchenTimer.
pomodoro_evolved/rest_break.py
pomodoro_evolved/rest_break.py
from kitchen_timer import KitchenTimer, AlreadyRunningError, TimeAlreadyUp, NotRunningError from math import ceil class BreakAlreadySkipped(Exception): pass class BreakCannotBeSkippedOnceStarted(Exception): pass class BreakAlreadyStarted(Exception): pass class BreakNotStarted(Exception): pass class BreakAlreadyTermina...
Python
0
@@ -351,14 +351,20 @@ eak( -object +KitchenTimer ):%0A @@ -838,35 +838,36 @@ + super(Break, self +) ._ -timer = KitchenTimer +_init__ (whe @@ -891,28 +891,16 @@ InMins)%0A - %0A def @@ -1307,23 +1307,16 @@ if self. -_timer. isStoppe @@ -1360,16 +1360,18 @@ rminated +() %0A @@ -1...
ca15e6523bd34e551528dce6c6ee3dcb70cf7806
Use sed inline (unsure why mv was used originally).
pyinfra/modules/util/files.py
pyinfra/modules/util/files.py
# pyinfra # File: pyinfra/modules/util/files.py # Desc: common functions for handling the filesystem from types import NoneType def ensure_mode_int(mode): # Already an int (/None)? if isinstance(mode, (int, NoneType)): return mode try: # Try making an int ('700' -> 700) return in...
Python
0
@@ -657,55 +657,8 @@ ')%0A%0A - temp_filename = state.get_temp_filename()%0A%0A @@ -669,16 +669,19 @@ rn 'sed +-i %22s/%7B0%7D/%7B @@ -691,28 +691,8 @@ %7B2%7D%22 - %7B3%7D %3E %7B4%7D && mv %7B4%7D %7B3%7D @@ -743,23 +743,8 @@ name -, temp_filename %0A
f015c3e5973c9424734ff6181563ee7905c73428
fix version pattern
sdcm/utils.py
sdcm/utils.py
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
Python
0.000003
@@ -2121,16 +2121,19 @@ ll(%22 -%5E%5Cw+.%5Cw+ +-(%5Cd+%5C.%5Cd+) %22, f
1e7ee86b888a7e8ebb4026f13855ed4ca241af44
change a few iterations over keys() in dict to over list; fixing query filters test
portality/lib/query_filters.py
portality/lib/query_filters.py
from flask_login import current_user from portality.core import app from portality import models # query sanitisers ################## def public_query_validator(q): # no deep paging if q.from_result() > 10000: return False if q.size() > 200: return False # if the query has facets, t...
Python
0
@@ -1840,32 +1840,37 @@ for k in +list( results%5B%22admin%22%5D @@ -1861,38 +1861,32 @@ results%5B%22admin%22%5D -.keys( ):%0A @@ -2271,32 +2271,37 @@ for k in +list( hit%5B%22_source%22%5D%5B%22 @@ -2299,38 +2299,32 @@ ource%22%5D%5B%22admin%22%5D -.keys( ):%0A @@ -34...
c1a263107cac6f55ce01ea5f260c005d307398e7
add env vars to ping.json
laalaa/apps/healthcheck/views.py
laalaa/apps/healthcheck/views.py
import requests from django.http import JsonResponse from django.conf import settings def ping(request): res = { "version_number": None, "build_date": None, "commit_id": None, "build_tag": None } # Get version details try: res['version_number'] = str(open("{0}...
Python
0.000001
@@ -1,12 +1,22 @@ +import os%0A import reque @@ -19,16 +19,16 @@ equests%0A - from dja @@ -153,241 +153,93 @@ r%22: -None,%0A %22build_date%22: None,%0A %22commit_id%22: None,%0A %22build_tag%22: None%0A %7D%0A%0A # Get version details%0A try:%0A res%5B'version_number'%5D = str...
5a4d9255c59be0d5dda8272e0e7ced71822f4d40
Fix memory issues by just trying every number
prime-factors/prime_factors.py
prime-factors/prime_factors.py
import sieve def prime_factors(n): primes = sieve.sieve(n) factors = [] for p in primes: while n % p == 0: factors += [p] n //= p return factors
Python
0.000002
@@ -1,19 +1,4 @@ -import sieve%0A%0A%0A def @@ -23,31 +23,20 @@ -primes = sieve.sieve(n) +factors = %5B%5D %0A @@ -46,34 +46,29 @@ ctor -s = -%5B%5D +2 %0A -for p in primes +while n != 1 :%0A @@ -83,17 +83,22 @@ ile n %25 -p +factor == 0:%0A @@ -120,17 +120,22 @@ ors += %5B -p +factor %5D...
f0e68095cd0afc0b1d960d726e0e64de9dec14f1
remove unused variable
hack.py
hack.py
import time import json import smbus import logging BUS = None address = 0x42 gpsReadInterval = 0.1 LOG = logging.getLogger() # GUIDE # http://ava.upuaut.net/?p=768 GPSDAT = { 'strType': None, 'fixTime': None, 'lat': None, 'latDir': None, 'lon': None, 'lonDir': None, 'fixQual': None, ...
Python
0.00003
@@ -564,32 +564,8 @@ e):%0A - global lastLocation%0A
8ea3350c6944946b60732308c912dc240952237c
Revert "Set the right recalbox.log path"
project/settings_production.py
project/settings_production.py
from .settings import * # Update SITE infos to use the common port 80 to publish the webapp SITE_FIXED = { 'name': "Recalbox Manager", 'ip': None, # If 'None' find the ip automatically. Use a string to define another ip/hostname 'port': None, # If 'None' no port is added to hostname, so the server have to ...
Python
0
@@ -416,16 +416,21 @@ = %22/ +root/ recalbox /sha @@ -429,26 +429,12 @@ lbox -/share/system/ +. log -s %22%0A%0A#
812efd4b5addeee879e91c6c660ac2a1a2adfe5d
mueve logica de avance de un paso a una funcion
heat.py
heat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Este script resuelve un problema simple de diffusion en 1D. La ecuaciรณn a resover es: dT/dt = d2T/dx2; T(0,x) = sin(pi * x); T(t, 0) = T(t, 1) = 0 ''' from __future__ import division import numpy as np def inicializa_T(T, N_steps, h): ''' Rellena T con ...
Python
0.000001
@@ -1009,16 +1009,273 @@ Acero)%0A%0A +def avanza_paso_temporal(T, T_next, alpha, beta, N_steps):%0A T_next%5B0%5D = 0%0A T_next%5B-1%5D = 0%0A for i in range(N_steps - 2, 0, -1):%0A T_next%5Bi%5D = alpha%5Bi%5D * T%5Bi+1%5D + beta%5Bi%5D%0A # T = T_next.copy() # Esto no funciona, hacerlo fuera de l...
6c2da0407bbaf0fb2e77d0847cce9fb9aeab2b02
remove useless ()
python/integer_programming.py
python/integer_programming.py
# Copyright 2010-2011 Google # 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, so...
Python
0.000003
@@ -2844,17 +2844,16 @@ print -( '---- In @@ -2910,17 +2910,16 @@ ) -----' -) %0A Run
c9b7be796ee886a8407d7d9cf43dbf19aa811a00
Revert "more fixe"
shorten_url.py
shorten_url.py
import json import logging import random import sys import tornado import urllib from tornado.options import define, options from tornado.web import RequestHandler, Application define('debug', default=1, help='hot deployment. use in dev only', type=int) define('port', default=8000, help='run on the given port', type=i...
Python
0
@@ -1993,16 +1993,20 @@ nd.redis +Labs Conn%0A%0A
a5ae77ab93811948c95e579667719971ec47ad3b
Add extra check for ESSID field in case there's a wired connection (#13459)
homeassistant/components/device_tracker/unifi.py
homeassistant/components/device_tracker/unifi.py
""" Support for Unifi WAP controllers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.unifi/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistan...
Python
0
@@ -3571,16 +3571,61 @@ if +'essid' in client and%0A client%5B'
6102e0aae8ead38351368a1402657447ca8d3ef7
Use new SensorDeviceClass in mitemp-bt (#61925)
homeassistant/components/mitemp_bt/sensor.py
homeassistant/components/mitemp_bt/sensor.py
"""Support for Xiaomi Mi Temp BLE environmental sensor.""" from __future__ import annotations import logging from typing import Any import btlewrap from btlewrap.base import BluetoothBackendException from mitemp_bt import mitemp_bt_poller import voluptuous as vol from homeassistant.components.sensor import ( PLA...
Python
0
@@ -327,16 +327,39 @@ SCHEMA,%0A + SensorDeviceClass,%0A Sens @@ -538,91 +538,8 @@ UT,%0A - DEVICE_CLASS_BATTERY,%0A DEVICE_CLASS_HUMIDITY,%0A DEVICE_CLASS_TEMPERATURE,%0A @@ -1266,29 +1266,34 @@ e_class= -DEVICE_CLASS_ +SensorDeviceClass. TEMPERAT @@ -1452,29 +1452,34 @@ e_class= -DEVICE_CL...
eb66cae55dee3b401cd84a71f9906cdb42a217bc
Update __init__.py
pytorch_lightning/__init__.py
pytorch_lightning/__init__.py
"""Root package info.""" __version__ = '0.9.0rc3' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' __copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning' # this has to be simple string, ...
Python
0.000072
@@ -41,17 +41,17 @@ '0.9.0rc -3 +4 '%0A__auth
a5f274b5a3dbb72e109184b7a3c56b2a1dac13b4
Enable WebForm page
frappe/website/serve.py
frappe/website/serve.py
import frappe from frappe import _ from frappe.utils import cstr from frappe.website.page_controllers.document_page import DocumentPage from frappe.website.page_controllers.list_page import ListPage from frappe.website.page_controllers.not_permitted_page import NotPermittedPage from frappe.website.page_controllers.pri...
Python
0.000008
@@ -475,16 +475,81 @@ aticPage +%0Afrom frappe.website.page_controllers.web_form import WebFormPage %0A%0Afrom f @@ -958,22 +958,8 @@ ath) -%0A%09%09data = None %0A%0A%09%09 @@ -1217,32 +1217,32 @@ f not response:%0A - %09%09%09response = Li @@ -1289,32 +1289,107 @@ f not response:%0A +%09%09%09response = WebFor...
19eb327f180bdd9990ea013f2c3b74f46b85545c
Fancier output
ibm1.py
ibm1.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys ###################################################### #### EM-IBM1 : Expectation-Maximization Algorithm #### ###################################################### # Alexandre Pais Gomes # Master ISI ######################### #### Initializations #### ###########...
Python
0.999981
@@ -3103,28 +3103,138 @@ w%22)%0A -output.write(repr(p) +s = ''%0Afor (a,b),y in p.items():%0A%09s += repr(a) + %22 %22 + repr(b) + %22 %22 + repr(y) + '%5Cn'%0A#output.write(repr(p) + '%5Cn')%0Aoutput.write(s + '
fccc9c14a46e529bd8af0da83f5efc2d4e675769
Add a device to back the non-existant floppy drive controller.
src/dev/x86/Pc.py
src/dev/x86/Pc.py
# Copyright (c) 2008 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
Python
0
@@ -2805,24 +2805,165 @@ io_size=8)%0A%0A + # A device to catch accesses to the non-existant floppy controller.%0A fake_floppy = IsaFake(pio_addr=x86IOAddress(0x3f2), pio_size=4)%0A%0A def atta @@ -3242,32 +3242,72 @@ .pio = bus.port%0A + self.fake_floppy.pio = bus.port%0A self.pci
fd4688cc899b08253cc50b345bb7e836081783d8
Add Beta and Binomial to automatically imported nodes
bayespy/inference/vmp/nodes/__init__.py
bayespy/inference/vmp/nodes/__init__.py
###################################################################### # Copyright (C) 2011,2012 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ###############...
Python
0
@@ -1097,24 +1097,24 @@ om . -gaussian +binomial import Gaus @@ -1113,69 +1113,64 @@ ort -Gaussian, GaussianARD%0Afrom .wishart import Wishart +Binomial%0Afrom .categorical import Categorical%0A %0Afrom . -gamm +bet a im @@ -1178,12 +1178,11 @@ ort -Gamm +Bet a%0Afr @@ -1216,53 +1216,65 @@ let%0A +%0A fro...
6523991e9d3ea7e7a01e5e36c6fb310ca00ea84c
Update simplefetch.py
simplefetch.py
simplefetch.py
import paramiko, logging, socket, time, re, datetime import sys python3_usage=True if sys.version_info[0] < 3: python3_usage=False """ #v2.0 2020.01.20 #Written by Ercin TORUN #automates ssh login using paramiko library """ #==================some variables line_break = "\r" ios_any_cli_length = "...
Python
0
@@ -3988,17 +3988,16 @@ awei-vrp -6 %22:%0D%0A%09%09%09%09 @@ -5707,28 +5707,30 @@ ose%22 %25 self.host)%0D%0A%09%09%09return +%0D%0A
769a334675cc451c6de07ed21e23ffd4480088df
Add time/space complexity
lc0041_first_missing_positive.py
lc0041_first_missing_positive.py
"""Leetcode 41. First Missing Positive Hard URL: https://leetcode.com/problems/first-missing-positive/ Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 Note: Your algori...
Python
0.002369
@@ -504,16 +504,80 @@ ype: int +%0A%0A Time complexity: O(n).%0A Space complexity: O(1). %0A @@ -676,16 +676,18 @@ nums%5Bi%5D +'s to thei @@ -849,14 +849,11 @@ - 1%5D -, with + at cor
f33b294d60ffbfb5351d4579e38ea197e2c3787a
Complete reverse iter sol
lc0482_license_key_formatting.py
lc0482_license_key_formatting.py
"""Leecode 482. License Key Formatting Easy URL: https://leetcode.com/problems/license-key-formatting/ You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes. Given a number K, we would want to reformat the stri...
Python
0.999999
@@ -1351,16 +1351,27 @@ Solution +ReverseIter (object) @@ -1512,35 +1512,944 @@ -pass%0A%0A%0Adef main():%0A pass +# Upper case and drop dash.%0A S_nodashes = S.upper().replace('-','')%0A size_nodashes = len(S_nodashes)%0A%0A # Reversely iterate through no-dashed list, concat to string u...
9a1aec04549ed03cb8e0d8e4e59f29c08bce7716
set absolute uri script path
middleware.py
middleware.py
__license__ = "Apache 2.0" __copyright__ = "Copyright 2008 nb.io" __author__ = "Randy Reddig - ydnar@nb.io" import sys import logging import re from time import sleep from random import randint from django.conf import settings from django.http import HttpResponsePermanentRedirect, Http404 from django.core.urlresolver...
Python
0
@@ -329,16 +329,35 @@ resolve +, set_script_prefix %0Afrom dj @@ -1063,32 +1063,128 @@ ment()%0A %0A + # set script prefix%0A set_script_prefix(request.build_absolute_uri('/'))%0A %0A # test s
dc95d6766d305f2126c158f50417e29d0c47ce3f
Change doc route
backoffice_operateurs/__init__.py
backoffice_operateurs/__init__.py
# -*- coding: utf8 -*- VERSION = (0, 1, 0) __author__ = 'Vincent Lara' __contact__ = "vincent.lara@data.gouv.fr" __homepage__ = "https://github.com/" __version__ = ".".join(map(str, VERSION)) from flask import Flask, make_response from flask.ext.security import Security, SQLAlchemyUserDatastore from flask.ext.script ...
Python
0
@@ -642,17 +642,25 @@ port Api +, apidoc %0A - %0Aapp = F @@ -1009,16 +1009,26 @@ Api(app +, ui=False )%0Aapi.mo @@ -1140,16 +1140,102 @@ ADS%22)%0A%0A +%0A@app.route('/doc/', endpoint='doc')%0Adef swagger_ui():%0A return apidoc.ui_for(api)%0A%0A from vie @@ -1460,16 +1460,54 @@ ome.mod) +%0Aapp.register_b...
aa4061887fc750dd63cd226e3fa45f0b56ec2462
Update server.py
site/server.py
site/server.py
#Import flask libraries import json, re, os, datetime, logging;#Import general libraries from flask import Flask, jsonify, request, render_template, send_from_directory; from flask_socketio import SocketIO, send, emit, join_room, leave_room, close_room; from flask_mail import Mail, Message; from flask_socketio imp...
Python
0.000001
@@ -447,24 +447,25 @@ ort Image;%0D%0A +# from logging @@ -503,16 +503,17 @@ ndler;%0D%0A +# from log @@ -536,16 +536,17 @@ atter;%0D%0A +# import e
184ac486740cfca13b3fdb42d3965017c93c6fb5
remove streamcloud filter
flashget/pages/ddlme.py
flashget/pages/ddlme.py
# -*- coding: utf-8 -*- from flashget.page import Page, log from flashget.url import UrlMgr from flashget.helper import textextract import json class DdlMe(Page): eregex = r'.*ddl.me.*' ename = 'ddl.me' name = 'ddl me' url = 'http://de.ddl.me' def get(self): link = self.link # th...
Python
0.000001
@@ -1164,158 +1164,8 @@ '%5D:%0A - if streamName != %22Streamcloud%22:%0A log.info(%22at ddl.me only download from streamcloud%22)%0A continue%0A
d6949099bb718a218d4cce778969ec484e8f4e29
use different position identifier
scripts/ingestors/dotcams/ingest_dot_webcams.py
scripts/ingestors/dotcams/ingest_dot_webcams.py
"""Ingest DOT RWIS Webcams. RUN from RUN_10MIN.sh """ # stdlib from datetime import datetime, timedelta, timezone import os import json import tempfile import subprocess # third party import requests from pyiem import util LOG = util.logger() URI = ( "https://services.arcgis.com/8lRhdTsQyJpO52F1/ArcGIS/rest/serv...
Python
0.000461
@@ -696,24 +696,84 @@ s%5B%22RPUID%22%5D)%0A + # Changed from SCANWEB_ as that appears to be wrong now%0A scene = @@ -783,23 +783,22 @@ (props%5B%22 -S CA -NWEB +MERA _POSITIO @@ -798,18 +798,16 @@ POSITION -ID %22%5D)%0A @@ -908,16 +908,51 @@ 02.0f%7D%22%0A + LOG.info(%22Processing %25s%22, cam)...
ec149e2e6b56f201ed154eaeecab2f651fe70351
Update docstrings.
dyfunconn/graphs/laplacian_energy.py
dyfunconn/graphs/laplacian_energy.py
# -*- coding: utf-8 -*- """ Laplcian Energy The Laplcian energy (LE) for a graph :math:`G` is computed as .. math:: LE(G) = \sum_{i=1}^n | {\mu_i - \frac{2m}{n}} | ฮพ(A_1, A_2 ; t) = โ€–expโก(-tL_1 ) - expโก(-tL_2 )โ€–_F^2 Where :math:``\mu_i` denote the eigenvalue associated with the node of the Laplcian matrix of...
Python
0
@@ -123,16 +123,17 @@ LE(G) = +%5C %5Csum_%7Bi= @@ -144,16 +144,21 @@ %7C %7B + %5C %5Cmu_ -i +%7Bi%7D - +%5C %5Cfra @@ -165,16 +165,17 @@ c%7B2m%7D%7Bn%7D + %7D %7C%0A @@ -240,17 +240,16 @@ :math:%60 -%60 %5Cmu_i%60 d @@ -362,16 +362,17 @@ :math:%60%5C +%5C frac%7B2m%7D
cd3e129c1951dbb1d2d99d454b1e07d96d1d5497
Support multi or non-multi mappers for bowtie alignments
bcbio/ngsalign/bowtie.py
bcbio/ngsalign/bowtie.py
"""Next gen sequence alignments with Bowtie (http://bowtie-bio.sourceforge.net). """ import os import subprocess from bcbio.utils import file_transaction galaxy_location_file = "bowtie_indices.loc" def align(fastq_file, pair_file, ref_file, out_base, align_dir, config): """Before a standard or paired end alignme...
Python
0
@@ -543,16 +543,146 @@ gs = %5B%5D%0A + multi_mappers = config%5B%22algorithm%22%5D.get(%22multiple_mappers%22, True)%0A multi_flags = %5B%22-M%22, 1%5D if multi_mappers else %5B%22-m%22, 1%5D%0A out_ @@ -733,16 +733,16 @@ t_base)%0A - if n @@ -838,16 +838,42 @@ l_flags%0A + cl += multi_flags%...
18febd5525a745b9f8cf6acacbe22e7823d80ac2
Update references to coala-analyzer
bears/python/MypyBear.py
bears/python/MypyBear.py
from collections import namedtuple import textwrap import sys from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.PipRequirement import PipRequirement class FlagInfo(namedtuple('FlagInfo', 'arg doc inverse')): """ Information about a command-line flag. :param ar...
Python
0.000001
@@ -4593,17 +4593,8 @@ oala --analyzer /coa
49e86f8f0f16ac5fe20cb9f91893f5aa5eee2237
Remove tests for old api
games/tests/test_api.py
games/tests/test_api.py
from django.test import TestCase from django.core.urlresolvers import reverse from . import factories import json class TestOldApi(TestCase): def setUp(self): game = factories.GameFactory games = [game() for i in range(5)] self.library = factories.GameLibraryFactory(games=games) ot...
Python
0
@@ -113,1039 +113,8 @@ n%0A%0A%0A -class TestOldApi(TestCase):%0A def setUp(self):%0A game = factories.GameFactory%0A games = %5Bgame() for i in range(5)%5D%0A self.library = factories.GameLibraryFactory(games=games)%0A other_games = %5Bgame(name=%22Metroid%22), game(name=%22Mario%22)%5D...
a6283772b07a29faa54a8c141947e19005bef61e
append max and min to entire dataset
minMaxCalc.py
minMaxCalc.py
import pandas as pd # read in dataset xl = pd.ExcelFile("data/130N_Cycles_1-47.xlsx") df = xl.parse("Specimen_RawData_1") df """ This is what the dataset currently looks like - it has 170,101 rows and two columns. The dataset contains data from 47 cycles following an experiment. The output of these experiments form...
Python
0.000294
@@ -2216,16 +2216,17 @@ ls%5B:47%5D%0A +# print(ou @@ -2319,16 +2319,202 @@ = j%5B1%5D:%0A + combine_data.append(i + (%22min%22,))%0A if i%5B1%5D == j%5B2%5D:%0A combine_data.append(i + (%22max%22,))%0A else:%0A combine_data.append(i)%0Aprint(combine_data)%0A
fff56b52afb40ee0a69c9a84b847f7ccc0836bd6
Update some admin list parameters.
greenmine/scrum/admin.py
greenmine/scrum/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from guardian.admin import GuardedModelAdmin from greenmine.scrum import models import reversion class MilestoneInline(admin.TabularInline): model = models.Milestone fields = ('name', 'owner', 'estimated_start', 'estimated_finish', 'closed', 'disponibi...
Python
0
@@ -1217,32 +1217,55 @@ roject%22, %22owner%22 +, 'status', 'is_closed' %5D%0A%0Aadmin.site.re
c36a884b4b3089d507390452d3e6d09654c8a92d
Update API tests
games/tests/test_api.py
games/tests/test_api.py
from django.test import TestCase from django.core.urlresolvers import reverse from . import factories import json class TestOldApi(TestCase): def setUp(self): game = factories.GameFactory games = [game() for i in range(5)] self.library = factories.GameLibraryFactory(games=games) ot...
Python
0.000001
@@ -1670,16 +1670,27 @@ en(games +%5B'results'%5D ), self. @@ -1692,32 +1692,32 @@ self.num_games)%0A - %0A def test_ca @@ -2126,32 +2126,43 @@ tEqual(len(games +%5B'results'%5D ), len(game_slug @@ -2580,32 +2580,32 @@ sponse.content)%0A - self.ass @@ -2622,16 +2622,27 @@ en(games +%5B'results'%5D ...
2b00e1de2448b9a80545935354d06950be1ff65f
Add missing path kwarg to update_after_write_time()
beetsplug/importadded.py
beetsplug/importadded.py
# -*- coding: utf-8 -*- """Populate an item's `added` and `mtime` fields by using the file modification time (mtime) of the item's source file before import. Reimported albums and items are skipped. """ from __future__ import division, absolute_import, print_function import os from beets import util from beets impo...
Python
0
@@ -5247,32 +5247,38 @@ _time(self, item +, path ):%0A %22%22%22Up
f66a679a1ca8f78a12567a1d8acfe04ca2778ce3
allow removal of genomes and fragments in admin
src/edge/admin.py
src/edge/admin.py
from django.contrib import admin from edge.models import Genome, Fragment class Genome_Admin(admin.ModelAdmin): list_display = ('id', 'name', 'notes', 'parent', 'created_on') search_fields = ('name',) fields = ('name', 'notes', 'active') actions = None def has_add_permission(self, request): ...
Python
0
@@ -334,168 +334,8 @@ se%0A%0A - def has_delete_permission(self, request, obj=None):%0A return False%0A%0A def delete_model(self, request, obj):%0A raise Exception(%22Not allowed%22)%0A%0A admi @@ -647,168 +647,8 @@ se%0A%0A - def has_delete_permission(self, request, obj=None):%0A retur...
ed21e865f346b700c48458f22e3d3f1841f63451
Fix JSON encoder to work with Decimal fields
api/swd6/api/app.py
api/swd6/api/app.py
import flask import flask_cors from sqlalchemy_jsonapi import flaskext as flask_jsonapi import logging from swd6.config import CONF from swd6.db.models import db logging.basicConfig(level=logging.DEBUG) app = flask.Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.con...
Python
0
@@ -561,16 +561,745 @@ p(app)%0A%0A +import json%0Aimport uuid%0Aimport datetime%0Aimport decimal%0A%0Aclass JSONAPIEncoder(json.JSONEncoder):%0A %22%22%22 JSONEncoder Implementation that allows for UUID and datetime %22%22%22%0A%0A def default(self, value):%0A %22%22%22%0A Handle UUID, datetime, d...
1437018c16c4b2f7197722a65b2bdab0ce59b03b
Use DJANGO_SETTINGS_MODULE from env variable instead of defaulting
appconf/base.py
appconf/base.py
import sys import six from django.core.exceptions import ImproperlyConfigured from .utils import import_attribute class AppConfOptions(object): def __init__(self, meta, prefix=None): self.prefix = prefix self.holder_path = getattr(meta, 'holder', 'django.conf.settings') self.holder = i...
Python
0
@@ -17,16 +17,27 @@ rt six%0A%0A +import os%0A%0A from dja @@ -281,30 +281,44 @@ r', -'django.conf.settings' +os.environ%5B'DJANGO_SETTINGS_MODULE'%5D )%0A
efe79ebfa2b023e6971244b7f3c803a09dd6d2c7
change check to skipp
tools/pcdo.py
tools/pcdo.py
import glob from joblib import Parallel, delayed import os import click def cdo_comand(ifile, opath, command, ext, checko): if opath != 'no': ofile = os.path.join(opath, '{}_tm.nc'.format(os.path.basename(ifile)[:-3])) else: ofile = ' ' if checko: if os.path.isfile(ofile): ...
Python
0
@@ -78,16 +78,17 @@ cdo_com +m and(ifil @@ -107,30 +107,28 @@ mmand, ext, -checko +skip ):%0A if op @@ -180,18 +180,18 @@ th, '%7B%7D_ -tm +%7B%7D .nc'.for @@ -222,16 +222,21 @@ le)%5B:-3%5D +, ext ))%0A e @@ -268,22 +268,20 @@ %0A if -checko +skip :%0A @@ -821,16 +821,21 @@ '--cdo', +'-c',...
ad1d33f1a4051a3440c60e4a8a655f167fcee1b6
Rewrite result handling
src/result.py
src/result.py
""" The MIT License (MIT) Copyright (c) 2017 Stefan Graupner 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, modify, mer...
Python
0.000009
@@ -2051,16 +2051,17 @@ , text, +* context) @@ -2074,228 +2074,116 @@ -%0A%0A def process_message(self, type, message, *args):%0A if self.silent:%0A return%0A%0A if type == Result.Verbosity.Default:%0A type = Result.Verbosity.Error%0A%0A message = message +if self....
c89ce3e5d9f5745262f547bf53772d55fcf1db4b
Clean up the code path for Just Visiting clients
init.py
init.py
import os import os.path import sys import cgi import cStringIO import hashlib import base64 # Observed that we don't seem to have a sane umask, URL files are # coming out with mode 666, kinda unexpected. os.umask(022) # Get config from the environment URL_STEM = os.environ.get('URL_STEM') URL_STORE = os.environ.get...
Python
0
@@ -5719,16 +5719,69 @@ %3C/p%3E%22%0A%0A%0A + # Should never get here? Probably proveable.%0A @@ -6385,16 +6385,116 @@ /p%3E%22%22%22%0A%0A + # Dead code, we don't want to enumerate all the short URLs%0A return output.finalise()%0A
f77276f74b2a34aa9b1579940ad3d44dc0b60613
Fix hardcoded maxixum values for layer dimensions
gerberlicious/render.py
gerberlicious/render.py
from .drawable import PointList, ApertureFlash from .aperture import CircleAperture class SVGRenderer: """ SVG Renderer for Layer objects """ def __init__(self, layer): self.layer = layer self.setup_canvas() def setup_canvas(self): self.min_x = 10000 # FIXME sel...
Python
0.000001
@@ -1,12 +1,24 @@ +%0Aimport math %0Afrom .drawa @@ -298,31 +298,24 @@ min_x = -10000 # FIXME +math.inf %0A @@ -332,23 +332,16 @@ y = -10000 # FIXME +math.inf %0A
eb368c11b7d0e481c6539130c34cb0b04c8f57a6
add prompt number
tpl/prompt.py
tpl/prompt.py
# -*- coding:utf-8 -*- import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import prompt_toolkit from prompt_toolkit.history import FileHistory from prompt_toolkit.completion import Completion, Completer from tpl import path class WordMatchType(object): CONTAINS = 'CONTAINES' ...
Python
0.000007
@@ -1689,16 +1689,159 @@ (res)%0A%0A%0A +def prompt_number(message, default=None):%0A res = prompt_toolkit.prompt(message, default=default or '', history=history)%0A return int(res)%0A %0A%0A%0A%0A%0Adef
fc301544022c00403cc9ba86c8be7dbe3eee3e47
Fix formatting
benchbuild/source/git.py
benchbuild/source/git.py
""" Declare a git source. """ import typing as tp import attr import plumbum as pb from plumbum import local from benchbuild.utils.cmd import git, mkdir from benchbuild.utils.path import flocked from . import base Command = pb.commands.base.BaseCommand VarRemotes = tp.Union[str, tp.Dict[str, str]] Remotes = tp.Dict...
Python
0
@@ -635,16 +635,48 @@ e%5B%5Bstr%5D, +%0A bool%5D =
ee2a385d407ae9f3b5f24897319431c3f0091f78
fix categorize
benchmarks/aggregates.py
benchmarks/aggregates.py
import vaex from benchmarks.fixtures import generate_numerical class Aggregates: pretty_name = "Performance of aggregates: stats, binby etc" version = "1" params = ([10**7, 5*10**7, 10**8],) param_names = ['N'] def setup_cache(self): # ensure the dataframe is generated generate_...
Python
0.998737
@@ -463,32 +463,46 @@ =5, max_value=15 +, inplace=True )%0A self.d @@ -546,32 +546,46 @@ =5, max_value=15 +, inplace=True )%0A self.d @@ -637,16 +637,30 @@ value=15 +, inplace=True )%0A @@ -720,16 +720,30 @@ value=15 +, inplace=True )%0A%0A @@ -801,32 +801,46 @@ ax_value=1_000+5 +, inp...
7652ab7388d181f09087bbc69a23fc00452d5309
update params
app/engine/vgg16.py
app/engine/vgg16.py
# -*- coding: utf-8 -*- import operator import functools import numpy as np import tensorflow as tf from app.main import EVAL from app.models.cnn import ConvolutionalNeuralNet from app.settings import IMAGE_PATH, IMAGE_SHAPE, MODEL_PATH, MAX_STEPS, ALPHA from app.pipeline import data_pipe, generate_data_skeleton from...
Python
0.000001
@@ -3355,17 +3355,17 @@ d_size=. -2 +1 )%0Atrain_
63fddd07e3b110c06c7369fa9d815e79384ef27e
update try_pandas.py
try_pandas.py
try_pandas.py
# I'm using Spark Cloud Community Edition, sicne my own machine cannot have the right numpy for pandas... # So, in this code, so features could only be used in Spark Cloud Python Notebook # Try pandas :) # cell 1 - load the data (I upload the .csv into Spark Cloud first) import pandas as pd import numpy as np ## The ...
Python
0.000002
@@ -1342,12 +1342,375 @@ , axis=0)%0A%0A%0A +# cell 5 - create Excel style pivot table, I really like this%0A# check data type first%0Apdata.dtypes%0A%0A# convert Monthly_Income into numerical data%0Apdata%5B'Monthly_Income'%5D = pdata%5B'Monthly_Income'%5D.astype(float)%0Apdata.dtypes%0A%0Apivot_t = pdata.pivot_table...
45d9697bf7758aaf41e2946017e98323ed0845dc
Maybe.is_empty
tryp/maybe.py
tryp/maybe.py
from typing import TypeVar, Generic, Callable, Union, Any from typing import Tuple # NOQA from functools import wraps, partial # type: ignore from operator import eq, is_not # type: ignore import inspect import traceback from fn import _ # type: ignore from fn.op import identity # type: ignore from tryp.logging ...
Python
0.999887
@@ -3419,24 +3419,95 @@ lf, Just))%0A%0A + @property%0A def is_empty(self):%0A return not self.is_just%0A%0A def __no
5d43a326d5c18f5493f97ed0420187ec7656ca4e
Fix releases path.
twisted_trac_plugins/release_macro.py
twisted_trac_plugins/release_macro.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Trac macros for the Twisted website. """ from StringIO import StringIO from urlparse import urlparse from trac.core import TracError from trac.util.html import Markup from trac.wiki.formatter import OneLinerFormatter from trac.wiki.macros im...
Python
0
@@ -3514,26 +3514,20 @@ srv/ -www-data/twisted/R +t-web/data/r elea
348711795607844bb9c0f84154849f7f25235268
Add missing shop ID on article creation
byceps/services/shop/article/service.py
byceps/services/shop/article/service.py
""" byceps.services.shop.article.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import datetime from decimal import Decimal from typing import Dict, Optional, Sequence, Set from flask_sqlalchemy import Paginat...
Python
0.000001
@@ -904,16 +904,25 @@ Article( +shop_id, item_num @@ -955,16 +955,38 @@ ax_rate, +%0A quantit