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
7f8c2b4b9991bfa74b486bddae218124fc7c85f4
remove hack dbproxy for dev of latest script
htdocs/plotting/auto/scripts100/p103.py
htdocs/plotting/auto/scripts100/p103.py
from pandas.io.sql import read_sql import psycopg2 from pyiem import network import sys import numpy as np PDICT = {'spring': '1 January - 30 June', 'fall': '1 July - 31 December'} def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d[...
Python
0
@@ -1073,51 +1073,8 @@ ody' -,%0A port=5555 )%0A%0A
4998dc79a5dc70ee3897e9ffd5d24632e87ec8c6
set a dtype
htdocs/plotting/auto/scripts100/p194.py
htdocs/plotting/auto/scripts100/p194.py
"""USDM Heatmaps and friends""" import datetime import numpy as np import cartopy.crs as ccrs from affine import Affine import pandas as pd from geopandas import read_postgis from pyiem.plot import MapPlot from pyiem.plot.colormaps import stretch_cmap from pyiem.grid.zs import CachingZonalStats from pyiem.util import ...
Python
0.00006
@@ -5438,16 +5438,29 @@ 101, 10 +, dtype=float )%0A @@ -6289,22 +6289,32 @@ plotter( -dict() +%7B%22w%22: %22percent%22%7D )%0A fi
c729d72fc6d31af4d6a2567cc705c78d42bdb54e
Add new example for training new entity types
examples/training/train_new_entity_type.py
examples/training/train_new_entity_type.py
from __future__ import unicode_literals, print_function import json import pathlib import random import spacy from spacy.pipeline import EntityRecognizer from spacy.gold import GoldParse from spacy.tagger import Tagger try: unicode except: unicode = str def train_ner(nlp, train_data, output_dir): # Ad...
Python
0.000001
@@ -771,59 +771,48 @@ nlp. -save_to_directory(output_dir +end_training( )%0A -# nlp. -end_training +save_to_directory (out
4fb7f37e927fa90a34053ae51c1bb061b127a909
Add another uvmap generator.
a500/uvgen.py
a500/uvgen.py
#!/usr/bin/env python from math import floor, atan2, cos, sin, sqrt from array import array def frpart(x): return x - floor(x) def lerp(lo, hi, step): return lo + (hi - lo) * step def dist(x1, y1, x2, y2): dx = x2 - x1 dy = y2 - y1 return sqrt(dx * dx + dy * dy) def generate(width, height, fn): uvm...
Python
0
@@ -1156,16 +1156,186 @@ u, v)%0A%0A%0A +def Anamorphosis(x, y):%0A a = atan2(x, y)%0A r = dist(x, y, 0.0, 0.0)%0A%0A if r == 0:%0A return (0, 0)%0A%0A u = cos(a) / (3.0 * r)%0A v = sin(a) / (3.0 * r)%0A%0A return (u, v)%0A%0A if __nam
64eb2f165f5eaeca52baadc4bc9135f771c19cda
introduce moving averages
daemon19.py
daemon19.py
#!/usr/bin/env python # Based on previous work by # Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process) # and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/) # Adapted by M.Hendrix [2015] # daemon19....
Python
0
@@ -942,92 +942,114 @@ -samp +cyc les = -1 +2 %0A -datapoints = 7 +SamplesPerCycle = 1 %0A -data = %5B%5BNone%5D*datapoints for _ in range(samples) +samples = SamplesPerCycle * cycles%0A%0A datapoints = 4%0A data = %5B %5D%0A%0A @@ -1448,22 +1448,16 @@ data -%5Bsampleptr%5D = +.append( map(...
3f74de582c48f02b5b085f11fe76dbf87189db8b
add passing validation for 2012 prez general md contest
openelex/us/md/validate.py
openelex/us/md/validate.py
from openelex.models import Contest, Candidate, Result def validate_unique_contests(): """Count of contests should match unique set of election ids""" elec_ids_count = len(Contest.objects.filter(state='MD').distinct('election_id')) contest_count = Contest.objects.filter(state='MD').count() try: ...
Python
0
@@ -53,129 +53,191 @@ lt%0A%0A -def validate_unique_contests():%0A %22%22%22Count of contests should match unique set of election ids%22%22%22%0A elec_ids_ +#TODO: Genericize this to check unique contests for all elections%0Adef validate_unique_prez_2012_general():%0A %22%22%22Should only be a single contest ...
1a546e6f6ca95772f0d7dbc2792477becbb8ea63
use f-strings in feature_minchainwork.py
test/functional/feature_minchainwork.py
test/functional/feature_minchainwork.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for setting nMinimumChainWork on command line. Nodes don't consider themselves out of "init...
Python
0.000011
@@ -1911,16 +1911,17 @@ og.info( +f %22Testing @@ -1939,18 +1939,17 @@ ss node -%25d +1 (minCha @@ -1961,17 +1961,9 @@ k = -%25d)%22, 1, +%7B self @@ -1979,16 +1979,19 @@ _work%5B1%5D +%7D)%22 )%0A%0A @@ -2169,32 +2169,33 @@ self.log.info( +f %22Generating %25d b @@ -2194,29 +2194,9 @@ ing -%25d ...
df0957a71251c96d363c8457befde6b33da8a8fb
test teams view : united messages are applied
buildbuild/teams/views.py
buildbuild/teams/views.py
from django.shortcuts import render from django.http import HttpResponseRedirect,request from django.http import HttpResponse from django.views.generic.base import RedirectView from django.views.generic.edit import FormView from django.views.generic.list import ListView from django.views.generic import DetailView fro...
Python
0
@@ -824,16 +824,50 @@ berError +%0Afrom buildbuild import custom_msg %0A%0A# Warn @@ -979,204 +979,8 @@ d):%0A - already_member = %22the user is already team member%22%0A already_wait_member = %22the user already sent a request to join that team%22%0A request_join_team = %22the request to join the team send...
e0749f69d9a75ddcaa2ca927ac72ce75f0c75250
Update env_detect.py
device/src/env_detect.py
device/src/env_detect.py
#!/usr/bin/env python #Weather station. #detect environment information from several sensors: #water leverl, air humity, raining, air temperature, light sensitivity. #Air temperature&humity sensor: DHT11. #Add dht.py in micropython/stmhal/modules, refer to esp8266 #Compile the DHT in firmware, then use DHT lib in appli...
Python
0.000001
@@ -1,25 +1,260 @@ # -!/usr/bin/env python +--------------------------------------%0A# ____ ____%0A# / __/__ / __/%0A# _%5C %5C/ _ %5C_%5C %5C%0A# /___/ .__/___/%0A# /_/%0A#%0A# dev_detect.py%0A# Environment detection.%0A#%0A# Author : Arvin%0A# Date : 15/09/2017%0A#-------------------------...
f70bf550de5476d23bdd1e5fc375d9c703990bce
Drop version info from our sbt builds
builds/build_sbt_image.py
builds/build_sbt_image.py
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ Build a Docker image for one of our sbt applications. Usage: build_sbt_image.py --project=<PROJECT> [--version=<VERSION>] [--env=<BUILD_ENV>] build_sbt_image.py -h | --help Options: -h --help Show this screen. --project=<PROJECT> Nam...
Python
0
@@ -152,30 +152,8 @@ ECT%3E - %5B--version=%3CVERSION%3E%5D %5B-- @@ -169,16 +169,16 @@ D_ENV%3E%5D%0A + build_ @@ -340,70 +340,8 @@ er)%0A - --version=%3CVERSION%3E Version to use in the release ID%0A -- @@ -564,36 +564,8 @@ )%0A%0A%0A -DEFAULT_VERSION = '0.0.1'%0A%0A%0A if _ @@ -691,59 +691,8 @@ ...
a37a2818fb2d61dd4a1bba5358d6c22f166132e6
Fix a local rule reference
test/mac/archs/test-archs-multiarch.gyp
test/mac/archs/test-archs-multiarch.gyp
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'static_32_64', 'type': 'static_library', 'sources': [ 'my_file.cc' ], 'xcode_settings': { 'A...
Python
0.999981
@@ -1653,17 +1653,16 @@ ' -: static_3
fcee6aca22007c3ff64b4d87de3f1772b3c7eb99
add encoding, re: "non-ascii character" syntax error
kdtree/__init__.py
kdtree/__init__.py
"""A Python implemntation of a kd-tree This package provides a simple implementation of a kd-tree in Python. https://en.wikipedia.org/wiki/K-d_tree """ __author__ = 'Stefan Kögl <stefan@skoegl.net>' __version__ = '0.1' __website__ = 'https://github.com/stefankoegl/kdtree' __license__ = 'GNU General Public License v3 ...
Python
0.000001
@@ -1,8 +1,35 @@ +# -*- coding: latin-1 -*-%0A%0A %22%22%22A Pyt
943a312c152ec6adeeff1e7a8b5b4b46334dfc0d
Fix dims in regression tf example
examples/regression_offset_tensorflow.py
examples/regression_offset_tensorflow.py
import tensorflow as tf import numpy as np from pymanopt import Problem from pymanopt.solvers import TrustRegions from pymanopt.manifolds import Euclidean, Product if __name__ == "__main__": # Generate random data X = np.random.randn(3, 100).astype('float32') Y = (X[0:1, :] - 2*X[1:2, :] + np.random.randn...
Python
0.000006
@@ -469,16 +469,19 @@ .zeros(%5B +1, 1%5D))%0A
4e4fa994f89f70ca04fa96c23febca8c360698c2
make datepublisher save aware datetimes
feincms/module/extensions/datepublisher.py
feincms/module/extensions/datepublisher.py
""" Allows setting a date range for when the page is active. Modifies the active() manager method so that only pages inside the given range are used in the default views and the template tags. Depends on the page class having a "active_filters" list that will be used by the page's manager to determine which entries ar...
Python
0.000001
@@ -1558,16 +1558,36 @@ return +timezone.make_aware( datetime @@ -1618,16 +1618,56 @@ n.hour, +%0A (n.minu @@ -1679,16 +1679,27 @@ 5) * 5) +, n.tzinfo) %0A%0A# ---- @@ -1833,24 +1833,56 @@ ation_date', +%0A models.Date @@ -1989,16 +1989...
f4b7f90c2a7d5d575592efc21cfc83fb999fa57e
fix todo module path expansion
bumblebee/modules/todo.py
bumblebee/modules/todo.py
# pylint: disable=C0111,R0903 """Displays the number of todo items from a text file Parameters: * todo.file: File to read TODOs from (defaults to ~/Documents/todo.txt) """ import bumblebee.input import bumblebee.output import bumblebee.engine class Module(bumblebee.engine.Module): def __init__(self, engi...
Python
0
@@ -243,16 +243,31 @@ .engine%0A +import os.path%0A %0A%0Aclass @@ -463,16 +463,103 @@ )%0A + self._doc = os.path.expanduser(self.parameter(%22file%22, %22~/Documents/todo.txt%22))%0A @@ -831,16 +831,12 @@ ems( -filename +self ):%0A @@ -870,73 +870,8 @@ -1%0A - doc = self.para...
c1d18bb5f2838e9bf5c0fe59ab9978ff1fbe6b0f
Extend limit
tests/mock_vws/test_database_summary.py
tests/mock_vws/test_database_summary.py
""" Tests for the mock of the database summary endpoint. """ from time import sleep import pytest import requests import timeout_decorator from requests import codes from requests_mock import GET from common.constants import ResultCodes from tests.mock_vws.utils import assert_vws_response from tests.utils import Vuf...
Python
0.000012
@@ -947,17 +947,17 @@ seconds= -2 +3 00)%0Adef @@ -1174,17 +1174,17 @@ t up to -2 +3 00 secon @@ -2344,32 +2344,33 @@ ials%0A )%0A%0A +%0A for requ
d9a37dffd8e6c5ab44f6b355de4fc07aa64aea9f
Fix unreliability of pipeline publisher.
zeeko/telemetry/tests/test_pipeline.py
zeeko/telemetry/tests/test_pipeline.py
import pytest import h5py import time import numpy as np from ..pipeline import create_pipeline @pytest.fixture def chunksize(): """The size of chunks.""" return 10 @pytest.fixture def pipeline(address, context, chunksize, filename): """Pipeline""" ioloop = create_pipeline(address, context, chunksize,...
Python
0
@@ -822,25 +822,57 @@ -for i in range(10 +while not pipeline.record.recorder.pushed.is_set( ):%0A
52ceae8d6ca99b3521d6d5cd3e20592f00870945
Fix regression which made libsecret backend unusable in v23.8.0
keyring/backend.py
keyring/backend.py
""" Keyring implementation support """ import os import abc import logging import operator import copy from typing import Optional from .py310compat import metadata from . import credentials, errors, util from .util import properties log = logging.getLogger(__name__) by_priority = operator.attrgetter('priority') ...
Python
0.999997
@@ -7486,24 +7486,36 @@ if username + is not None %0A
5776162edb630e8de7967d6bc2319f253581b16c
Check to see whether trackInfo is null before getting track number.
PlayItem.py
PlayItem.py
# # # ### / ### # / /### / #/ ### # / / ###/ ## ## # / ## ## ## ## # ...
Python
0
@@ -3977,32 +3977,88 @@ ckNumber(self):%0A + if self.trackInfo == None:%0A return 0%0A return s
29b23bc1cc29f9d611fd06bc34d46fafab001504
add {{primary sources}} to template list
trunk/pywiki/datebot.py
trunk/pywiki/datebot.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ This script is a clone of [[en:User:SmackBot]] Syntax: python datebot.py """ # # (C) Legoktm 2008-2009, MIT License # import re, sys, time import os import wiki, pagegen, config # Define global constants readDelay = 20 # seconds writeDelay = 60 # seconds usernames = {...
Python
0.000005
@@ -3187,16 +3187,179 @@ kitext)%0A +%09%09wikitext = re.compile(r'%5C%7B%5C%7B%5Cs*primary sources%5C%7D%5C%7D', re.IGNORECASE).sub(r'%7B%7BPrimary sources%7Cdate=%7B%7Bsubst:CURRENTMONTHNAME%7D%7D %7B%7Bsubst:CURRENTYEAR%7D%7D%7D%7D', wikitext)%0A%0A %09%09EditMs @@ -4755,16 +4755,63 @@ ences%22)%0A +%09docat(%22A...
05ee29728d26cbdbab2e23bc89e0c5ffc4f9369b
Fix long message decryption error
simplecrypto/__init__.py
simplecrypto/__init__.py
import hashlib import math from os import path from base64 import b64encode, b64decode from binascii import hexlify, unhexlify from Crypto.Cipher import DES, AES, PKCS1_OAEP from Crypto.Signature import PKCS1_PSS from Crypto.PublicKey import RSA as _RSA from Crypto.Hash import SHA as RSA_SHA from Crypto import Random ...
Python
0.999994
@@ -6040,25 +6040,33 @@ urn decrypt( -m +base64(m) , symmetric_
acac9582ba7a948b1662d3e4a6a2a06db11ce59f
FIX assert_greater message
sklearn/utils/testing.py
sklearn/utils/testing.py
"""Testing utilities.""" # Copyright (c) 2011 Pietro Berkes # License: Simplified BSD from .fixes import savemat import urllib2 from StringIO import StringIO import scipy as sp try: from nose.tools import assert_in, assert_not_in except ImportError: # Nose < 1.0.0 from nose.tools import assert_true, ass...
Python
0.000001
@@ -700,16 +700,17 @@ essage%0A%0A +%0A def _ass @@ -755,35 +755,37 @@ ge = %22%25r is not -low +great er than %25r%22 %25 (a
5978ab00f200ea48216d8c67bf2f8684bdddaf00
Update dahlquist.py
pySDC/projects/Resilience/dahlquist.py
pySDC/projects/Resilience/dahlquist.py
# script to run a simple advection problem from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.problem_classes.TestEquation_0D import testequation0d from pySDC.implementations.sweeper_classes.generic_implicit import generic_implicit from pySDC.implemen...
Python
0
@@ -40,101 +40,8 @@ lem%0A -from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right%0A from @@ -1797,50 +1797,35 @@ ms%5B' -collocation_class'%5D = CollGaussRadau_Right +quad_type'%5D = 'RADAU-RIGHT' %0A
f9f01b57e6e2085786908a5ebcf0be61fefe3a51
Change version
slack_client/__init__.py
slack_client/__init__.py
from .api import SlackAPI from .channel import SlackChannel __version__ = '0.2.16'
Python
0
@@ -75,10 +75,9 @@ '0. -2.16 +3.0 '%0A
646a073aa1e2e63f06a8cfd56e467bd2f67bceff
use one timezone
SunCycle.py
SunCycle.py
import sublime from datetime import datetime from timezone import LocalTimezone from sun import Sun class Settings(): def __init__(self, onChange=None): self.loaded = False self.onChange = onChange self.load() def load(self): settings = sublime.load_settings(__name__ + '.sublim...
Python
0.977404
@@ -94,16 +94,73 @@ rt Sun%0A%0A +def logToConsole(str):%0A print(__name__ + ': ' + str)%0A%0A class Se @@ -286,24 +286,93 @@ elf.load()%0A%0A + def getTimeZone(self, lat, lon):%0A return LocalTimezone()%0A%0A def load @@ -841,23 +841,14 @@ -self.sun = Sun( +lat = sett @@ -870,17 +870,30 @@...
e710200d6b589fb149e0dcadf84513c0bfd9382c
Fix some default field values
discovery/domain/apis.py
discovery/domain/apis.py
# -*- coding: utf-8 -*- """ discovery.domain.apis.py ~~~~~~~~~~~~~~~~~~~~~~~~ 'apis' resource and schema settings. :copyright: (c) 2015 by Nicola Iarocci and CIR2000. :license: BSD, see LICENSE for more details. """ _schema = { 'name': { 'type': 'string', 'required': True, ...
Python
0.000018
@@ -1490,17 +1490,17 @@ build': -1 +0 %7D,%0A @@ -1983,39 +1983,40 @@ ' -required': True +default': 'None' ,%0A
d3847357c446c4a1ac50735b983b20cf57f9c7c6
Fix args and return of CounterController functions
malcolm/controllers/countercontroller.py
malcolm/controllers/countercontroller.py
from malcolm.core.controller import Controller from malcolm.core.attribute import Attribute from malcolm.core.numbermeta import NumberMeta from malcolm.core.method import takes import numpy as np class CounterController(Controller): def create_attributes(self): self.counter = Attribute(NumberMeta("counte...
Python
0
@@ -169,16 +169,25 @@ rt takes +, returns %0A%0Aimport @@ -479,32 +479,47 @@ r%0A%0A @takes()%0A + @returns()%0A def reset(se @@ -516,24 +516,35 @@ f reset(self +, args=None ):%0A s @@ -567,16 +567,34 @@ value(0) +%0A return %7B%7D %0A%0A @t @@ -596,24 +596,39 @@ @takes()%0A + ...
270af43ffbe8974698d17ff6d5cae20fbf410f73
Add url enter delete element on riak
admin/urls.py
admin/urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from .views import CubeHandler, ConnectionHandler from .views import ElementHandler, DashboardHandler, APIElementCubeHandler INCLUDE_URLS = [ (r"/admin/connection/?(?P<slug>[\w-]+)?", ConnectionHandler), (r"/admin/cube/?(?P<slug>[\w-]+)?", CubeHandler), (r"/ad...
Python
0
@@ -88,16 +88,31 @@ nHandler +, DeleteHandler %0Afrom .v @@ -198,16 +198,91 @@ RLS = %5B%0A + (r%22/admin/delete/(?P%3Cbucket%3E%5B%5Cw-%5D+)/(?P%3Cslug%3E%5B%5Cw-%5D+)%22, DeleteHandler),%0A (r%22/
c08222ee89916d46d23310ca28ac32f6e69fce37
Fix adding software to agent
pyfarm/master/user_interface/agents.py
pyfarm/master/user_interface/agents.py
# No shebang line, this module is meant to be imported # # Copyright 2014 Ambient Entertainment GmbH & Co. KG # # 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/lice...
Python
0.000005
@@ -4804,32 +4804,31 @@ quest.form%5B%22 -software +version %22%5D), softwar
c4fadf89161e99514037e8af7953fca0ab13b28e
Fix import.
pymatgen/symmetry/tests/test_groups.py
pymatgen/symmetry/tests/test_groups.py
#!/usr/bin/env python """ TODO: Modify unittest doc. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Virtual Lab" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "ongsp@ucsd.edu" __date__ = "4/10/14" import unittest import numpy as n...
Python
0.999591
@@ -321,16 +321,25 @@ p%0A%0Afrom +pymatgen. symmetry
48e589b200894121f32bd96b39f29ad5c0120991
add test_delete_task_id_not_integer
tests/test_agent/test_http_api_tasks.py
tests/test_agent/test_http_api_tasks.py
# No shebang line, this module is meant to be imported # # Copyright 2014 Oliver Palmer # # 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 # # Unle...
Python
0.000587
@@ -691,16 +691,29 @@ mport OK +, BAD_REQUEST %0Aexcept @@ -779,107 +779,22 @@ t OK -%0A%0Afrom json import loads%0Afrom datetime import datetime%0A%0Afrom twisted.web.server import NOT_DONE_YET +, BAD_REQUEST%0A %0A%0Afr @@ -942,11 +942,8 @@ Test -Get Task @@ -2111,12 +2111,399 @@ t_tasks)%5D)%0A%0A + def t...
222067de26b3c43e719896df27ced9dc2398655a
make sirepo default
sirepo/feature_config.py
sirepo/feature_config.py
# -*- coding: utf-8 -*- u"""List of features available :copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function # defer all imports so *_CODES is available to testing functions #: ...
Python
0.000009
@@ -2473,16 +2473,26 @@ tuple( +%5B'sirepo'%5D ),%0A
c59c91200331c8981aa8bc95eccff1e418f5b332
Fix tests
tests/test_archives/test_serializers.py
tests/test_archives/test_serializers.py
import pytest from api.archives.serializers import ( ArchivedBuildJobSerializer, ArchivedExperimentSerializer, ArchivedExperimentGroupSerializer, ArchivedJobSerializer, ArchivedProjectSerializer, ) from api.build_jobs.serializers import BookmarkedBuildJobSerializer from api.experiment_groups.serial...
Python
0.000003
@@ -1426,32 +1426,44 @@ f.factory_class( +deleted=True ) # pylint:disa @@ -1518,16 +1518,28 @@ y_class( +deleted=True ) # pyl
cb4752c102ddaa11be24b60081ce32e0c749fa73
Use actual dbus-python API to call GetHandleOwners in test-muc-ownership
tests/twisted/muc/test-muc-ownership.py
tests/twisted/muc/test-muc-ownership.py
""" Test support for the HANDLE_OWNERS_NOT_AVAILABLE group flag, and calling GetHandleOwners on MUC members. By default, MUC channels should have the flag set. The flag should be unset when presence is received that includes the MUC JID's owner JID. """ import dbus from twisted.words.xish import domish, xpath from...
Python
0.000001
@@ -4577,51 +4577,31 @@ -# FIXME: using non-API!%0A bus = conn._bus +bus = dbus.SessionBus() %0A @@ -4632,22 +4632,16 @@ onn. +bus _name -d_service , ev
7bdf0ba2ffa74d5a768274573171b11441179713
Add processLine() function
TwircBot.py
TwircBot.py
import socket import sys class TwircBot(object): """ Basic Bot class that reads in a config file, connects to chat rooms, and logs the results. """ def __init__(self, config_file_name): """Parse the configuration file to retrieve the config parameters """ self.host='irc.twitch.tv...
Python
0.000015
@@ -277,24 +277,59 @@ ameters %22%22%22%0A + self.irc = socket.socket()%0A self @@ -864,32 +864,505 @@ g_file.close()%0A%0A + def processLine(self, line):%0A words = line.split()%0A if words%5B0%5D == 'PING': %0A self.irc.send(bytes('PONG :tmi.twitch.tv%5Cr%5Cn', 'utf-8'))%...
4d04a9f96c994e4718a036f9c984231bf350918a
Optimize single term search
TxtIndex.py
TxtIndex.py
from TxtReader import TxtReader from StopWords import StopWords import re import string class TxtIndex: def __init__(self, fh): self.stop_words = StopWords() self.__fh = fh self.__reader = TxtReader(fh) self.build_index() def build_index(self): self.keyword2pointers = {...
Python
0.000653
@@ -1246,16 +1246,93 @@ it(' ')%0A +%0A if len(words) == 1:%0A return self.get_pointers(words%5B0%5D)%0A%0A
ddcd57017fa9451e85fccf92ec716ae18f91467c
Set default model argument
examples/memnn/train_memnn.py
examples/memnn/train_memnn.py
#!/usr/bin/env python import argparse import collections import chainer from chainer.training import extensions import babi import memnn def train(train_data_path, test_data_path, args): vocab = collections.defaultdict(lambda: len(vocab)) vocab['<unk>'] = 0 train_data = babi.read_data(vocab, train_dat...
Python
0.000001
@@ -2459,16 +2459,33 @@ ', '-m', + default='model', %0A @@ -2536,16 +2536,17 @@ it stor +e s traine
60504711a3685a0842d66cc5b9beac1c3f5fbf71
Fix duplicate COPY lines in Dockerfile
cage/container/handler.py
cage/container/handler.py
import os import re import urllib.request from docker import Client # TODO: Check if Docker daemon is running. Start it if it's not. class DockerNotInstalledError(Exception): pass class ContainerHandler: def __init__(self, cage_path, app_path): self.__path = cage_path self.__app_path = app_...
Python
0.000107
@@ -2759,18 +2759,16 @@ /src/app -%5Cn %22.format @@ -2775,16 +2775,16 @@ (path))%0A + %0A def @@ -3006,10 +3006,9 @@ ), %22 -a+ +r %22) a @@ -3037,40 +3037,193 @@ -if line not in dockerfile.read() +dockerfile.seek(0)%0A line_exists = line in dockerfile.read()%0A%0A if not line_exists:%...
6c3fffe4a30e4664d44418081f008c0b47537bc0
Add `noplot` option to MNIST example
examples/mnist/train_mnist.py
examples/mnist/train_mnist.py
#!/usr/bin/env python from __future__ import print_function import argparse import chainer import chainer.functions as F import chainer.links as L from chainer import training from chainer.training import extensions # Network definition class MLP(chainer.Chain): def __init__(self, n_units, n_out): sup...
Python
0.000005
@@ -1731,16 +1731,148 @@ units')%0A + parser.add_argument('--noplot', dest='plot', action='store_false',%0A help='Disable PlotReport extension')%0A args @@ -3759,16 +3759,30 @@ %0A if +args.plot and extensio
a639d3313d5a4d3134461fd51376777c4898d4cc
make the exception catching generic =(
examples/n2hp_cube_example.py
examples/n2hp_cube_example.py
import astropy import pyspeckit import os import astropy.units as u import warnings import socket from astropy import wcs if not os.path.exists('n2hp_cube.fit'): import astropy.utils.data as aud from astropy.io import fits try: f = aud.download_file('ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/472/...
Python
0.000001
@@ -81,22 +81,8 @@ ngs%0A -import socket%0A from @@ -333,16 +333,115 @@ except + Exception as ex:%0A # this might be any number of different timeout errors (urllib2.URLError, socket. @@ -447,23 +447,22 @@ .timeout - as ex: +, etc) %0A
49ac27c3863f1dc372ae0e44abaf5398205aeb91
add subhead
boxpub/__init__.py
boxpub/__init__.py
import logging import config from datetime import datetime import jinja2 import markdown import re import dropbox from dropbox import client, session # from dropbox.rest import ErrorResponse from werkzeug.routing import BaseConverter from flask import Flask, request from postutils import split_markdown, process_mar...
Python
0.00018
@@ -923,24 +923,51 @@ 'subhead': ' +Steve Ivy%5C's weblog, XI Ed. ',%0A @@ -1004,24 +1004,45 @@ 'url': ' +http://monkinetic.com ',%0A
cdc99912ef99718d587aa21dd1b55b230ff8745b
Thinking AboutWithStatements: DONE
python2/koans/about_with_statements.py
python2/koans/about_with_statements.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutSandwichCode in the Ruby Koans # from runner.koan import * import re # For regular expression string comparisons class AboutWithStatements(Koan): def count_lines(self, file_name): try: f = open(file_name) try: ...
Python
0.998796
@@ -620,34 +620,33 @@ elf.assertEqual( -__ +4 , self.count_lin @@ -1181,34 +1181,40 @@ elf.assertEqual( -__ +'test%5Cn' , self.find_line @@ -2833,34 +2833,33 @@ elf.assertEqual( -__ +4 , self.count_lin @@ -3007,67 +3007,195 @@ -# Rewrite find_line using the +with self.File Context - Manager -.%0A ...
6148e22d2056c37be300db482b37753cb94cae78
Change database#get_source() to return bytes, always.
database.py
database.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ >>> db = Database() >>> rev = '1b8f23c763d08130ec2081c35e7f9fe0d392d700' >>> repo = Repository.create('github', 'example', 'mit', rev) >>> ret = db.add_repository(repo) >>> ret == repo True >>> source_a = SourceFile.create(repo, b'void 0;', 'index.js') >>> ret = db.add...
Python
0
@@ -763,16 +763,17 @@ a.hash)%0A +b 'void 0; @@ -3124,32 +3124,128 @@ cur.fetchone()%0A + if isinstance(source, str):%0A return source.encode('utf-8')%0A else:%0A return s
4e12aea0a5479bad8289cbf6c9f460931d51f701
Add autocommit to 1 to avoid select cache ¿WTF?
database.py
database.py
import MySQLdb class database(object): def __init__(self): config = {} execfile("config.py",config) self.db = MySQLdb.connect(config["host"],config["user"],config["password"],config["database"]) def insert(self,txt): dbc = self.db.cursor() try: dbc.execute("insert into " + txt) dbc...
Python
0
@@ -202,16 +202,45 @@ abase%22%5D) +%0A self.db.autocommit(True) %0A%0A def
e5d2ed715d83be506ec452ecdd0a22748a84a007
Fix test_pull_doc (missing request id when creating messages)
bokeh/server/protocol/messages/tests/test_pull_doc.py
bokeh/server/protocol/messages/tests/test_pull_doc.py
from __future__ import absolute_import, print_function import unittest import bokeh.document as document from bokeh.plot_object import PlotObject from bokeh.properties import Int, Instance from bokeh.server.protocol import Protocol class AnotherModel(PlotObject): bar = Int(1) class SomeModel(PlotObject): fo...
Python
0
@@ -812,32 +812,45 @@ PULL-DOC-REPLY%22, + 'fakereqid', 'fakesession', @@ -988,24 +988,37 @@ -DOC-REPLY%22, + 'fakereqid', 'fakesessio
80d8f68d7eccdb114c47196d6359fe370fe922d7
Remove a couple of spurious test dependencies in production code.
ceee/ie/common/common.gyp
ceee/ie/common/common.gyp
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'includes': [ '../../../build/common.gypi', ], 'targets': [ { 'target_name': 'ie_comm...
Python
0.999991
@@ -1637,193 +1637,8 @@ n',%0A - # TODO(joi@chromium.org) Why? Can we remove?%0A '../../../ceee/testing/utils/test_utils.gyp:test_utils',%0A '../../../ceee/testing/utils/test_utils.gyp:mshtml_mocks',%0A
a74fbbd6c822b1384d9cd5f1501c8a01fb2ed9fe
Update deauthorization callback
django4facebook/views.py
django4facebook/views.py
from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseBadRequest def deauthorize_callback(request): """ When user deauthorize this application from facebook then we deactivate the user from our system """ if not request.facebook: return HttpResponseB...
Python
0
@@ -98,17 +98,127 @@ Request%0A -%0A +from django.views.decorators.csrf import csrf_exempt%0A%0Aimport facebook%0Afrom .conf import settings%0A%0A%0A@csrf_exempt %0Adef dea @@ -374,31 +374,283 @@ -if not request.facebook +signed_request = request.REQUEST.get('signed_request')%0A if not signed_request:%0A ...
19a3ead211cc4c00b219329ac63177420cdb71e6
Make all functions available from raysect.core.math.function.
raysect/core/math/function/__init__.py
raysect/core/math/function/__init__.py
# cython: language_level=3 # Copyright (c) 2014-2018, Dr Alex Meakins, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the ab...
Python
0
@@ -1655,18 +1655,9 @@ ort -Function1D +* %0Afro @@ -1681,18 +1681,9 @@ ort -Function2D +* %0Afro @@ -1707,17 +1707,8 @@ ort -Function3D +* %0A%0A%0A
f25e0fe435f334e19fc84a9c9458a1bea4a051f9
Allow to reverse the order of the CSV for a proper reading
money/parser/__init__.py
money/parser/__init__.py
import csv from money.models import Movement def parse_csv(raw_csv, parser, header_lines=0): reader = csv.reader(raw_csv, delimiter=',', quotechar='"') rows = [] for row in reader: if reader.line_num > header_lines and row: rows.append(parser.parse_row(row)) return rows def import_movements(data, bank_ac...
Python
0.000186
@@ -86,20 +86,44 @@ _lines=0 -):%0A%09 +, reverse_order=False):%0A reader = @@ -173,17 +173,20 @@ ar='%22')%0A -%09 + rows = %5B @@ -188,17 +188,20 @@ s = %5B%5D%0A%0A -%09 + for row @@ -211,18 +211,24 @@ reader:%0A -%09%09 + if reade @@ -262,19 +262,28 @@ nd row:%0A -%09%09%09 + ...
52ca7c024caa83dadbbf9b7bc74297f2d02d2fe7
Add cleanup casks step
HOME/bin/lib/homebrew.py
HOME/bin/lib/homebrew.py
"""A library for controlling Homebrew through Python.""" import getpass import logging import os import pwd import shutil import subprocess log = logging.getLogger(__name__) def workflow(settings, fix_repo=False): """Run an entire Homebrew update workflow.""" if not is_installed(): # todo: install h...
Python
0
@@ -1559,16 +1559,25 @@ cleanup +_formulas ():%0A @@ -1601,16 +1601,26 @@ cleanup +: formulas %22)%0A _ @@ -1646,24 +1646,128 @@ leanup'%5D)%0A%0A%0A +def cleanup_casks():%0A log.info(%22Running cleanup: casks%22)%0A _execute(%5B'brew', 'cask', 'cleanup'%5D)%0A%0A%0A def update() @@ -2868,16 +2868,...
fa067545657d3b1bb80a4047f175353c4856dd7c
Implement extension normalizer for NamedAccess
thinglang/parser/values/named_access.py
thinglang/parser/values/named_access.py
from thinglang.compiler.buffer import CompilationBuffer from thinglang.compiler.opcodes import OpcodePopDereferenced, OpcodeDereference from thinglang.lexer.tokens.access import LexicalAccess from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.numeric import NumericValue from thinglang....
Python
0
@@ -2172,8 +2172,240 @@ rn self%0A +%0A @classmethod%0A def extend(cls, base, extension: Identifier) -%3E 'NamedAccess':%0A if isinstance(base, NamedAccess):%0A return NamedAccess(base.target + %5Bextension%5D)%0A%0A return NamedAccess(%5Bbase, extension%5D)%0A
a259a5f2c42b58c236f3ec1fa28ea9fa5218fc29
Exclude EMC plugin since it cannot be run non-interactively
testcases/cloud_admin/run_sos_report.py
testcases/cloud_admin/run_sos_report.py
#!/usr/bin/python import os import time from eucaops import Eucaops from eutester.eutestcase import EutesterTestCase from eutester.machine import Machine class SOSreport(EutesterTestCase): def __init__(self): self.setuptestcase() self.setup_parser() self.start_time = int(time.time()) ...
Python
0.000002
@@ -1666,16 +1666,35 @@ --batch +--skip-plugins=emc --tmp-di
308c778e1846769e8bba799b6d0bca5679e1161c
move code
examples/tests/test_cp_api.py
examples/tests/test_cp_api.py
# Various calls to CP api from python to verify they work. from ortools.constraint_solver import pywrapcp from ortools.constraint_solver import model_pb2 from ortools.constraint_solver import search_limit_pb2 def test_member(): solver = pywrapcp.Solver('test member') x = solver.IntVar(1, 10, 'x') ct = x.Member(...
Python
0.000002
@@ -2342,192 +2342,8 @@ )'%0A%0A -class InitialPropagateDemon(pywrapcp.PyDemon):%0A def __init__(self, ct):%0A pywrapcp.Demon.__init__(self)%0A self._ct = ct%0A%0A def Run(self, solver):%0A self._ct.InitialPropagate()%0A%0A %0Adef @@ -2723,24 +2723,209 @@ Solve(db)%0A%0A%0A +class InitialPropagateDemon(py...
a48e50da90765b65f754a6c6eaefce7cb7e22521
Modify unicode text for Crew model
ITDB/ITDB_Main/models.py
ITDB/ITDB_Main/models.py
from django.db import models import datetime # Create your models here. class Theater(models.Model): name = models.CharField(max_length=100) street_address = models.CharField(max_length=40, blank=True) city = models.CharField(max_length=40) state_or_province = models.CharField(max_length=50, blank=True...
Python
0.000013
@@ -2583,33 +2583,38 @@ return %22 +%7B1%7D, %7B0%7D -in %7B1 +by %7B4 %7D at The %7B2%7D @@ -2615,39 +2615,24 @@ he %7B2%7D (%7B3%7D) -, played by %7B4%7D %22.format(sel @@ -2740,16 +2740,17 @@ erson)%0A%0A +%0A class Th
27fe88a325251c4b12a4b5f020c1d6c5e83b4b59
Change var to be more consistent
untz_manager/encoder.py
untz_manager/encoder.py
"""Encoding related operations""" import logging import subprocess import sys import taglib LOGGER = logging.getLogger(__name__) def _get_vorbis_comments(audio_file, pattern): macros = (('%g', 'GENRE'), ('%n', 'TRACKNUMBER'), ('%t', 'TITLE'), ('%d', 'DATE')) params...
Python
0
@@ -996,22 +996,20 @@ o_file, -output +base _dir, pa @@ -1204,22 +1204,20 @@ '-n', '%7B -output +base _dir%7D/%25a @@ -1246,33 +1246,27 @@ mat( -output_dir=output +base_dir=base _dir,%0A -
234609000de3da9449dacb363e58bf60c0e3a4d8
Change DATABASES default db to PostgreSQL
site/litlong/settings.py
site/litlong/settings.py
""" Django settings for litlong project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
Python
0
@@ -1823,90 +1823,250 @@ E': -'django.db.backends.sqlite3',%0A 'NAME': os.path.join(BASE_DIR, 'db.sqlite3') +CFG%5B'database'%5D%5B'engine'%5D,%0A 'NAME': CFG%5B'database'%5D%5B'name'%5D,%0A 'USER': CFG%5B'database'%5D%5B'username'%5D,%0A 'PASSWORD': CFG%5B'database'%5D%5B'password'%5D,%0A...
d6452848521bba37fa01fd7b82fe27d725edd2cf
The real PER_PAGE limit is 100.
uservoice/collection.py
uservoice/collection.py
PER_PAGE = 500 class Collection: def __init__(self, client, query, limit=2**60): self.client = client self.query = query self.limit = limit self.per_page = min(self.limit, PER_PAGE) self.pages = {} self.response_data = None def __len__(self): if not self....
Python
0.999177
@@ -8,9 +8,9 @@ E = -5 +1 00%0Ac
438bc2afc5802bed737fb88c38dcf1eabe4b568d
Correct test
myria/test/test_plans.py
myria/test/test_plans.py
import unittest import myria.plans from myria.schema import MyriaSchema QUALIFIED_NAME = {'userName': 'public', 'programName': 'adhoc', 'relationName': 'relation'} SCHEMA = MyriaSchema({'columnNames': ['column'], 'columnTypes': ['INT_TYPE']}) WORK = [(0, 'http:...
Python
0.001917
@@ -1368,24 +1368,39 @@ scan_type = + %7B'readerType': 'UNITTEST-S @@ -1403,16 +1403,17 @@ ST-SCAN' +%7D %0A @@ -1776,16 +1776,86 @@ pType'%5D, + 'TupleSource')%0A self.assertEquals(scan_operator%5B'reader'%5D, scan_ty
b13edc289905dd4d2c331eddffa490305f9ef827
fix a typo
bugzilla/agents.py
bugzilla/agents.py
import urllib from bugzilla.models import * from bugzilla.utils import * class InvalidAPI_ROOT(Exception): def __str__(self): return "Invalid API url specified. " + \ "Please set BZ_API_ROOT in your environment " + \ "or pass it to the agent constructor" class BugzillaAgen...
Python
1
@@ -375,16 +375,17 @@ ey=None) +: %0A%0A
c4ef7fe24477d9160214c1cd2938aa8f5135d84b
Add other needed method stubs
utils/database_setup.py
utils/database_setup.py
import pandas def load_excel(filepath): """ Returns a Pandas datafile that contains the contents of a Microsoft Excel Spreadsheet Params: filepath - A string containing the path to the file Returns: A Pandas datafile """ return pandas.read_excel(filepath) def get_column_n...
Python
0.000001
@@ -10,18 +10,33 @@ ndas +%0Aimport argparse %0A%0Adef -load +get _exc @@ -759,102 +759,1053 @@ def -set_up_mysql_schema():%0A %22%22%22%0A Sets up MySQL with a table with a set schema%0A %22%22%22%0A pass +is_table_set_up():%0A %22%22%22%0A Returns True if this project's MySQL table is set up, ...
e838370958c90ce1123aa1a5ab0823169257cfa9
Make configuration per model instead of per project.
adminfilters/admin.py
adminfilters/admin.py
from django.contrib.admin.views.main import ChangeList from django.contrib.admin.options import ModelAdmin from django.contrib.admin.filterspecs import FilterSpec from django.conf import settings GENERIC_FILTERS_ON_TOP = getattr(settings, "GENERIC_FILTERS_ON_TOP", False) class GenericFilterSpec(FilterSpec): def ...
Python
0
@@ -160,118 +160,8 @@ pec%0A -from django.conf import settings%0A%0AGENERIC_FILTERS_ON_TOP = getattr(settings, %22GENERIC_FILTERS_ON_TOP%22, False)%0A %0A%0Acl @@ -1017,24 +1017,151 @@ rs', None)%0A%0A + @property%0A def generic_filters_on_top(self):%0A return getattr(self.model_admin, 'generic_filters_...
e99d60975bca123f001fd9a536931a3c41798eb5
Fix syntax error
validatish/validator.py
validatish/validator.py
from validatish import validate from error import Invalid ##### # Validator base classes. # class Validator(object): """ Abstract Base class for all validators """ def __call__(self, value): """ A method that will raise an Invalid error """ def __repr__(self): return 'validatish.%s()'%...
Python
0.000585
@@ -2380,16 +2380,17 @@ es=None) +: %0A
81f6bbbd52acc1aa8eba6d5f14d21988f86549e2
Fix formatting of exceptions
alltheitems/obtaining.py
alltheitems/obtaining.py
import bottle import more_itertools import alltheitems.util METHODS = {} def method(name): def wrapper(f): METHODS[name] = f return f return wrapper @method('craftingShaped') def crafting_shaped(i, item_info, method, **kwargs): return bottle.template(""" <p>{{item_info['name']}}...
Python
0.000017
@@ -1986,18 +1986,17 @@ %3C -h2 +p %3ETraceba @@ -2004,10 +2004,9 @@ k:%3C/ -h2 +p %3E%0A @@ -2661,17 +2661,16 @@ aw data: -: %3C/p%3E%0A
8860810f9643b5647402ac2ff774245d18c08924
fix comment
scripts/colab_install.py
scripts/colab_install.py
""" Original code by @philopon https://gist.github.com/philopon/a75a33919d9ae41dbed5bc6a39f5ede2 """ import sys import os import requests import subprocess import shutil from logging import getLogger, StreamHandler, INFO logger = getLogger(__name__) logger.addHandler(StreamHandler()) logger.setLevel(INFO) def inst...
Python
0
@@ -746,16 +746,20 @@ ipt +will install -s the
aff03ceb63ddc37227c4302c4bd43549c71591b5
Change the name for get_final_E to read_final_E
vasp_tool/patch_vasp.py
vasp_tool/patch_vasp.py
##################################################################### # The patcher for factory ase.calculator.vasp.Vasp class # # will change the behavior of the POSCAR writer to use vasp5 format # ##################################################################### from ase.calculators.vasp.create_input ...
Python
0.999997
@@ -2710,19 +2710,20 @@ es%0AVasp. -get +read _final_E
bb12ec846e6c7f1a4ce458645595c2c30ffb46bc
Rename fixture
tests/mock_vws/test_invalid_given_id.py
tests/mock_vws/test_invalid_given_id.py
""" Tests for passing invalid endpoints which require a target ID to be given. """ import uuid from urllib.parse import urljoin import pytest import requests from _pytest.fixtures import SubRequest from requests import codes from requests_mock import GET from common.constants import ResultCodes from tests.conftest i...
Python
0.000001
@@ -1237,16 +1237,38 @@ endpoint +_which_takes_target_id (request @@ -1758,16 +1758,38 @@ endpoint +_which_takes_target_id : Endpoi @@ -1995,24 +1995,25 @@ _path = +( endpoint .path + @@ -2008,21 +2008,67 @@ oint -.path + '/' + +_which_takes_target_id.path + '/' +%0A uui @@ -2080,16 +...
cce88a16cc367ef8df9533b848e6fae29ac8a4d1
update build setup
build_win_setup.py
build_win_setup.py
""" @file @brief Builds a setup for the teachings: ensae_teaching_cs """ try: import pymyinstall except ImportError: import sys sys.path.append("../pymyinstall/src") import pymyinstall try: import pyquickhelper except ImportError: import sys sys.path.append("../pyquickhelper/src") impor...
Python
0.000001
@@ -329,16 +329,20 @@ khelper%0A + %0A%0Aif __n @@ -480,24 +480,25 @@ rom -actuariat_python +ensae_teaching_cs .aut
ed3b48c1cccc080fa209e35bf42b757b29d8693a
Remove unused includes
butter/fanotify.py
butter/fanotify.py
#!/usr/bin/env python """fanotify: wrapper aroudn the fanotify family of syscalls for watching for file modifcation""" from cffi import FFI as _FFI from os import O_RDONLY, O_WRONLY, O_RDWR from os import fdopen import errno as _errno READ_EVENTS_MAX = 10 _ffi = _FFI() _ffi.cdef(""" #define FAN_CLOEXEC ... #define F...
Python
0
@@ -1791,88 +1791,8 @@ %5B%5D)%0A -#include %3Cstdint.h%3E%0A#include %3Casm-generic/int-ll64.h%3E%0A#include %3Clinux/types.h%3E%0A%0A %0Acla
2ef5fa81d1c1edf00078c6d038e8b1ff494e9074
Set up app.py for future updates
RTDT/app.py
RTDT/app.py
from flask import Flask, render_template, jsonify, request, g from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from transit import get_bus_data_from_csv from transit import convert_df_to_list from transit import get_entities from transit import get_gtfs_data from transit import get_markers_for_...
Python
0
@@ -1525,18 +1525,16 @@ _df)%0A - # all_bus @@ -2021,18 +2021,16 @@ ist)%0A - # l3 = ge @@ -2431,17 +2431,16 @@ %0A%0A # -j all_buse
ec295698b683dd5f04df1fff49f9d1e2afdf0a86
fix bugs in writing out failures
tests/selenium/remotecontrol/test_ol.py
tests/selenium/remotecontrol/test_ol.py
from selenium import selenium import time import sys from ConfigParser import ConfigParser if len(sys.argv) > 2: filename = sys.argv[2] else: filename = "config.cfg" c = ConfigParser() c.read(filename) targets = {} sections = c.sections() for s in sections: targets[s] = dict(c.items(s)) targets[s][...
Python
0.007053
@@ -1508,18 +1508,18 @@ rHTML%22). -d e +n code(%22ut @@ -1802,23 +1802,16 @@ all_html -.encode )%0A
be92cf747a718bc004bd2024dbdcb527205d9b44
remove an extra import
scripts/lib/flattened.py
scripts/lib/flattened.py
import collections def flatten(l): # from http://stackoverflow.com/a/2158532/2347774 for el in l: if isinstance(el, list) and not isinstance(el, str): yield from flatten(el) else: yield el
Python
0.000006
@@ -1,24 +1,4 @@ -import collections%0A%0A def
56ade9d8c571c3836148ecbd1c306fa3c7796279
use parser.error() instead of raise ValueError
Lib/fontmake/__main__.py
Lib/fontmake/__main__.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Python
0.000007
@@ -2585,36 +2585,32 @@ 1:%0A -raise ValueE +parser.e rror('Exactl @@ -2655,20 +2655,16 @@ O, or '%0A - @@ -2945,20 +2945,16 @@ -raise ValueE +parser.e rror
bf163f45d1e7a28db34396b20209778668103f0a
remove password option for redis
Run/main.py
Run/main.py
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: main.py Description : 运行主函数 Author : JHao date: 2017/4/1 ------------------------------------------------- Change Activity: 2017/4/1: ----------------------------------------...
Python
0.000003
@@ -399,44 +399,8 @@ ess%0A -from Util.GetConfig import GetConfig %0A%0Asy @@ -581,16 +581,52 @@ reshRun%0A +from Util.GetConfig import GetConfig %0A%0Adef ru
a1dd1c0a8b91cb75ef773ed9566fc93b232bc2b7
Fix a broken test_dbm_gnu as introducted by r67380.
Lib/test/test_dbm_gnu.py
Lib/test/test_dbm_gnu.py
import dbm.gnu as gdbm import unittest import os from test.support import verbose, TESTFN, run_unittest, unlink filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): if self.g is not None: self.g.close() unlink(filename) ...
Python
0.000002
@@ -635,16 +635,26 @@ t(%5Bb'a', + b'bytes', b'12345
01923b0c16732277e64bcf10b101eb339bd8c0e5
Add tests for fnmatch.filter and translate.
Lib/test/test_fnmatch.py
Lib/test/test_fnmatch.py
"""Test cases for the fnmatch module.""" from test import support import unittest from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb, purge class FnmatchTestCase(unittest.TestCase): def tearDown(self): purge() def check_match(self, filename, pattern, should_match=1, fn=fnmatch): ...
Python
0
@@ -97,16 +97,17 @@ import +( fnmatch, @@ -153,16 +153,60 @@ b, purge +,%0A translate, filter) %0A%0A%0Aclass @@ -2604,57 +2604,809 @@ )%0A%0A%0A -def test_main():%0A support.run_unittest(Fnmatch +class TranslateTestCase(unittest.TestCase):%0A%0A def test_translate(self):%0A s...
a157ee8bc8c740ba7482f8e4e9116213fb18c935
fix of type in merging
src/gl_lr.py
src/gl_lr.py
from __future__ import division __author__ = 'Vladimir Iglovikov' ''' I will try to use logistic regression from Graphlab to predict ''' import graphlab as gl import os print 'reading train' train = gl.SFrame(os.path.join('..', 'data', 'trainSearch_1')) print print 'train shape' print train.shape print 'reading...
Python
0.000001
@@ -482,17 +482,17 @@ on='AdI -d +D ')%0A%0Aprin
b0614a15cedd53ba752beca9107698636ee0f8cf
replace wtf-deprecated stuff
app.py
app.py
from flask import Flask, render_template, request from flask_bootstrap import Bootstrap from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.orm.properties import ColumnProperty from flask_wtf import Form from wtforms import TextField, SubmitField, validators from wtforms.validators import ValidationError impor...
Python
0.000152
@@ -225,20 +225,22 @@ import -Text +String Field, S @@ -2620,12 +2620,14 @@ l = -Text +String Fiel @@ -2657,16 +2657,20 @@ idators. +Data Required
a9a3b1532d7835156703319491648da7c107ca58
Fix secret key to env
app.py
app.py
#!/usr/bin/env python # Setting up twitter API conection requiren oauth authentication import oauth2 as oauth import urllib2 as urllib import json from csv import DictReader import os # Personal keys apiKey = os.environ['apiKey'] apiSecret = os.environ['apiSecret'] accessTokenKey = os.environ['accessTokenKey'] accessT...
Python
0.99919
@@ -3949,24 +3949,32 @@ %5D = -myKeys.secretKey +os.environ%5B'SECRET_KEY'%5D %0Asoc
44d7f67eec87957dbb024e85713de01d778fe6e5
Add extra app routes for stability
app.py
app.py
import os import module from flask import Flask, render_template, request, session, redirect, url_for, send_from_directory from werkzeug import secure_filename app = Flask(__name__) # Configure upload locations app.config['UPLOAD_FOLDER'] = 'uploads/' app.config['ALLOWED_EXTENSIONS'] = set(['txt']) # Change this to w...
Python
0
@@ -541,16 +541,37 @@ /home%22)%0A +@app.route(%22/home/%22)%0A def home @@ -730,24 +730,70 @@ T%22,%22POST%22%5D)%0A +@app.route(%22/login/%22, methods=%5B%22GET%22,%22POST%22%5D)%0A def login(): @@ -1250,24 +1250,67 @@ s=%5B%22POST%22%5D)%0A +@app.route(%22/register/%22, methods=%5B%22POST%22%5D)%0A def registe...
b914f700687f6fbf6ccc0aac08d92ffaac76f89a
bump retry timeout, 20s is too low during meltdowns
flumine/streams/basestream.py
flumine/streams/basestream.py
import threading import queue import logging import betfairlightweight from betfairlightweight import StreamListener from tenacity import wait_exponential logger = logging.getLogger(__name__) class BaseStream(threading.Thread): LISTENER = StreamListener MAX_LATENCY = 0.5 RETRY_WAIT = wait_exponential(mu...
Python
0
@@ -336,17 +336,17 @@ =2, max= -2 +6 0)%0A%0A
c3529def6c32bdf7d9f948374ff3aba634d5b8f7
UPDATE 4th-Trial
app.py
app.py
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = request.get_json(silent=True, force=True) ...
Python
0
@@ -660,33 +660,8 @@ n %7B%0A - res = %7B%0A @@ -721,28 +721,24 @@ - - %22displayText @@ -783,28 +783,24 @@ - # %22data%22: da @@ -811,28 +811,24 @@ - - # %22contextOu @@ -831,28 +831,24 @@ xtOut%22: %5B%5D,%0A - @@ -892,...
277e3ef7544a64ddb2fa9f31b66597036a38e65b
Remove widget and test paths.
app.py
app.py
#!/usr/bin/env python import argparse from flask import Flask, render_template import app_config from render_utils import make_context, urlencode_filter import static app = Flask(app_config.PROJECT_NAME) app.jinja_env.filters['urlencode'] = urlencode_filter # Example application views @app.route('/') def index(): ...
Python
0
@@ -1242,462 +1242,8 @@ t)%0A%0A -@app.route('/widget.html')%0Adef widget():%0A %22%22%22%0A Embeddable widget example page.%0A %22%22%22%0A return render_template('widget.html', **make_context())%0A%0A@app.route('/test_widget.html')%0Adef test_widget():%0A %22%22%22%0A Example page displaying widget...
a0883d386f6c35f8cb70c6d21ad1cc37dccb90b6
Update host
app.py
app.py
from flask import Flask # from image_classification import ImageClassifier app = Flask(__name__) PORT = 33507 @app.route('/') def home(): return 'Hello classification world!' if __name__ == '__main__': app.run(port=PORT)
Python
0
@@ -105,16 +105,33 @@ = 33507%0A +HOST = '0.0.0.0'%0A %0A%0A@app.r @@ -234,16 +234,27 @@ app.run( +host=HOST, port=POR
355629e1e2e2423a4ea1ad859506e380e6ddbc89
define special route for twitter
app.py
app.py
# ingredients: tinydb joblib.Memory from flask import Flask from ml import store_feedback from ml import learn from proxy import proxy import sys import trace import logging as log # should be set at the project level log.basicConfig(filename="./log", level=log.INFO) # create a Trace object, telling it what to igno...
Python
0.000184
@@ -603,16 +603,141 @@ (url)%0A%0A%0A +@app.route('/twitter/%3Cstring:id%3E')%0Adef _twitter(id):%0A return proxy('https://twitrss.me/twitter_user_to_rss/?user=' + id)%0A%0A %0A@app.ro
07f342a2690558b8f4ce3d1bbb545c6ef3c320d1
Change the expected number of fonts for the web target.
scripts/run_web_tests.py
scripts/run_web_tests.py
#!/usr/bin/python """Test assumptions that web fonts rely on.""" import glob import json import unittest from fontTools import ttLib from nototools import coverage from nototools import font_data from nototools import render from nototools import unicode_data def load_fonts(): """Load all web fonts.""" all_...
Python
0.000278
@@ -452,17 +452,17 @@ es) == 1 -2 +8 %0A ret
b61ba8c62a9a954e1d172e0e9fca6c20fdc1c617
Update web tests
scripts/run_web_tests.py
scripts/run_web_tests.py
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
Python
0
@@ -3036,87 +3036,8 @@ S%0A%0A%0A -class TestFeatures(run_general_tests.TestFeatures):%0A loaded_fonts = FONTS%0A%0A%0A clas
3f051ae379e47c5163050a488ea9ca7e5951d4e6
test GP DB
app.py
app.py
#!/usr/bin/env python from Data import Database import urllib import json import os from flask import Flask from flask import request from flask import make_response import psycopg2 import urlparse global name global singletonObject singletonObject = None # Flask app should start in global layout app = Flask(__nam...
Python
0.000001
@@ -1678,16 +1678,20 @@ LE %22USER +NEXT %22%0A @@ -2873,24 +2873,27 @@ s(conn)%0A +### createTable(
027033d55efc1be05b6dc2ffdc422fdfe2b2db1b
Add csrf_token to cookies if there isn't one
app.py
app.py
import os import datetime from flask import (Flask, render_template, redirect, request, abort, url_for, make_response) from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt from flask_wtf.csrf import CSRFProtect, generate_csrf app = Flask(__name__) CSRFProtect().init_app(app) # C...
Python
0
@@ -880,20 +880,16 @@ en%22) is -not None:%0A
58dfa1e8df073cafc23871e76d317172758b05a6
change app.py
app.py
app.py
from bottle import route, run from bottle import static_file, request from bottle import template, get, error import os # static routes @get('/<filename:re:.*\.css>') def stylesheets(filename): return static_file(filename, root='static/css') @get('/<filename:re:.*\.js>') def javascripts(filename): return static_fil...
Python
0.000003
@@ -1271,31 +1271,8 @@ se:%0A -%09%09print('ENTROU AQUI')%0A %09%09ru
d6d67b8a831959d79a94e927bae3373bcbd4ef0a
print request args
app.py
app.py
from flask import Flask, request, jsonify app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" @app.route("/paid", methods=['POST']) def paid(): # print(request.args.get('invoice')) return jsonify(request.args) if __name__ == "__main__": app.run()
Python
0.000003
@@ -1,8 +1,20 @@ +import json%0A from fla @@ -184,17 +184,26 @@ %0A - # print( +json.dumps( requ @@ -214,22 +214,8 @@ args -.get('invoice' ))%0A
48c777958bb1a5dd6c7e975733ddca62134c2941
Fix indentation error
app.py
app.py
from flask import Flask from flask import render_template from flask import render_template_string from flask import request from networkx.readwrite import json_graph import networkx as nx import git import json app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) def form_post(): if request.method ==...
Python
0.000285
@@ -2690,20 +2690,17 @@ rint(e)%0A - +%0A def find
1599c85d2ff27ed46580679ed119cb487c230a8d
add port, host, noconfig parameters
app.py
app.py
#!/usr/bin/env python2.7 import sys from ConfigParser import SafeConfigParser from bottle import route, post, run, request, view, response, static_file from sh import cmus_remote def read_config(config_file): r = {} parser = SafeConfigParser() n = parser.read(config_file) if not len(n): raise(Exceptio...
Python
0.000011
@@ -172,16 +172,432 @@ _remote%0A +from optparse import OptionParser%0A%0Aparser = OptionParser()%0Aparser.add_option(%22-n%22, %22--noconfig%22, action=%22store_true%22, dest=%22noconfig%22,%0A help=%22do not use config file%22, default=False)%0Aparser.add_option(%22-p%22, %22--port%22, dest=%22port%...
c274325f89ef9a8fa25128b85b6d25dc634fe4a2
Fix flood control exception
bot.py
bot.py
import os import sys import logging from time import sleep from flask import request import telegram from telegram.error import NetworkError, Unauthorized from leonard import Leonard from libs import shrt WEBHOOK_HOSTNAME = os.environ.get('WEBHOOK_HOSTNAME', 'https://leonardbot.herokuapp.com') debug = False if 'BO...
Python
0.000005
@@ -149,16 +149,28 @@ thorized +, RetryAfter %0A%0Afrom l @@ -1803,24 +1803,25 @@ url)%0Aexcept +( NetworkError @@ -1816,24 +1816,37 @@ NetworkError +, RetryAfter) :%0A sleep(
1a522469da3a9ca96b43bace7fdd2d4047c52e32
Update handled exception
bot.py
bot.py
import json import requests import boto3 import validatesns from flask import Flask, request, abort from flow import Flow from raven.contrib.flask import Sentry from config import ORG_ID, CHANNEL_MAP, SENTRY_DSN, BOTNAME, BOTPW app = Flask(__name__) try: flow = Flow(BOTNAME) except flow.FlowError as e: ...
Python
0.000001
@@ -4,16 +4,49 @@ ort json +%0Afrom json import JSONDecodeError %0A%0Aimport @@ -1302,19 +1302,26 @@ except -Key +JSONDecode Error:%0A
44f33a5aacb90c66f187d88417a80320545600e8
remove the line : 'ghe' : ghe_main,
bot.py
bot.py
import boto3 import logging import urllib2 import json import re import wukong.ghe_command import wukong.config #setup simple logging for INFO log = logging.getLogger() log.setLevel(logging.DEBUG) s3 = boto3.resource('s3') # Starts a instance given an Amazon instance def start_instance(instance): try: l...
Python
0.999999
@@ -2580,35 +2580,8 @@ it,%0A - 'ghe' : ghe_main,%0A
e671dc2daa225437d6fcf9eebc839071a3a51cd8
remove password from user-agent, fix #8
bot.py
bot.py
""" @author Harrison Shoebridge <@paked/@hcwool> The r/WatchPeopleCode sidebar updater script/bot! In order to use the bot you will need a config.json file, following the format of the provided example_config.json """ from praw import * import random import os import requests import json import time from urllib.par...
Python
0.000019
@@ -725,24 +725,25 @@ , self._ -password +subreddit ))%0A%0A%09%09se
0153ff44dc484cb0d74a33e202a5decb8b714b81
Bot responds to tweets
bot.py
bot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import tweepy, time, sys from keys import * auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) infile = open('response.txt','r') f = infile.readlines() infile.close() cursor = tweepy.Cursor(a...
Python
0.999976
@@ -44,52 +44,178 @@ *-%0A%0A -import tweepy, time, sys%0Afrom keys import *%0A +from wolf import Wolf%0Aimport json%0Aimport requests%0Aimport sys%0Aimport time%0Aimport tweepy%0Aimport wolframalpha%0Afrom keys import *%0A%0A# authenticate with twitter & wolfram alpha %0Aaut @@ -346,80 +346,46 @@ h)%0A%0A -infile =...
1eb70787368fb6b1f825818b5c8d290ba9d73cd2
add error handler
bot.py
bot.py
import re import json import asyncio from urllib.parse import urljoin import telepot import telepot.async import aiohttp class ComposerBot(telepot.async.Bot): def __init__(self, *args, config=None, **kwargs): super(ComposerBot, self).__init__(*args, **kwargs) self.config = config self.mp...
Python
0.000001
@@ -1630,34 +1630,69 @@ el -se +if content.find('Composing...') != -1 :%0A @@ -1741,16 +1741,256 @@ ontent)) +%0A else:%0A print(%22error with url %7B%7D%22.format(url))%0A self.loop.create_task(self.sendMessage(chat_id, 'so...
d2179432d37a10e13d2ba03b160aed8d61d83d0c
Decrease chroma instead of hard clipping to fit colors into gamut
cam.py
cam.py
"""Converts between the sRGB and CIECAM02 JCh (lightness/chroma/hue) color spaces. See https://en.wikipedia.org/wiki/SRGB and https://en.wikipedia.org/wiki/CIECAM02. 'sRGB' here is defined as an RGB color space with the sRGB primaries and gamma 2.2 - i.e. it does not use the piecewise sRGB transfer function but goes w...
Python
0
@@ -2510,24 +2510,87 @@ S%5Bsurround%5D%0A + for _ in range(100): # limit the number of iterations%0A XYZ = co @@ -2666,23 +2666,18 @@ -return np.clip( + RGB = colo @@ -2726,11 +2726,194 @@ lse) -, 0 +%0A out_of_gamut = ((RGB %3C epsilon) + (RGB %3E 1)).any(axis=1)%0A if out_of_g...
eaf48d7d89f159d2c196985ab93d5c63eb2ae0c9
Fix typo in include file path.
cct.py
cct.py
#!/usr/bin/env python # # Distributed under GPLv2.1 or any later # # Copyright (C) 2014 Tomas Gavenciak <gavento@ucw.cz> # Copyright (C) 2014 Cyril Hrubis <metan@ucw.cz> # import re import getopt from sys import argv, exit from os import path, remove, system DEFAULT_INDENT = 4 def perror(filename, line, lineno, row,...
Python
0.000001
@@ -1663,24 +1663,20 @@ include_ -filename +path , 'r')%0A