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
9fa396ee3a13fd84cc27e692d2c5423250893d62
Set maximum select box size to 10.
src/abizeitung/views/student.py
src/abizeitung/views/student.py
# -*- coding: utf-8 -*- from abizeitung.models import Teacher, StudentSurvey, Student, TeacherSurvey,\ StudentSurveyEntry, TeacherSurveyEntry from django.contrib import messages from django.contrib.auth.decorators import login_required from django.forms import Select, ValidationError from django.forms.fields impor...
Python
0
@@ -1777,16 +1777,73 @@ : %22true%22 +,%0A %22data-size%22 : %2210%22 %7D),%0A
b83576644d5aacd4ab841a03ff228796ff1b1b67
change name
coolTestly/__openerp__.py
coolTestly/__openerp__.py
{ "name": "testly", "author": "Ju", "version": "1.0", "category": "Generic Modules/Sales & Purchases", "depends": [ "purchase", ], "demo": [], "data": [ ], "installable": True }
Python
0.000147
@@ -8,17 +8,21 @@ name%22: %22 -t +coolT estly%22,%0A @@ -222,8 +222,9 @@ : True%0A%7D +%0A
f844b95e7cb034985f1d284a41789d1e427b0f74
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
@@ -1135,8 +1135,130 @@ MASTER)%0A +i2c.send('123', 0x23) # send 3 bytes to slave with address 0x23%0Ai2c.send(b'456', addr=0x23) # keyword for address%0A
ce948b49fbd4f3e8012b6d351bbf53db32172474
fix repeated import of CascadeRPNHead (#8578)
mmdet/models/dense_heads/__init__.py
mmdet/models/dense_heads/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .anchor_free_head import AnchorFreeHead from .anchor_head import AnchorHead from .atss_head import ATSSHead from .autoassign_head import AutoAssignHead from .cascade_rpn_head import CascadeRPNHead, StageCascadeRPNHead from .centernet_head import CenterNetHead from .c...
Python
0
@@ -2324,30 +2324,8 @@ ad', - 'CascadeRPNHead',%0A 'Au @@ -2338,16 +2338,20 @@ gnHead', +%0A 'DETRHe @@ -2389,20 +2389,16 @@ TRHead', -%0A 'SOLOHe @@ -2397,24 +2397,28 @@ 'SOLOHead', +%0A 'DecoupledS
5e7e60f8afb3ddeeec2714a9d11dd30a6ea3e52f
Add new calc_total_error tests
photutils/utils/tests/test_prepare_data.py
photutils/utils/tests/test_prepare_data.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from numpy.testing import assert_allclose from astropy.tests.helper import pytest from .. import calc_total_error SHAPE = (5, 5...
Python
0.000002
@@ -267,16 +267,42 @@ pytest%0A +import astropy.units as u%0A from .. @@ -1358,28 +1358,1178 @@ t, np.sqrt(2.) * BKG_ERROR)%0A +%0A def test_units(self):%0A units = u.electron / u.s%0A error_tot1 = calc_total_error(DATA * units, BKG_ERROR * units,%0A EFFGAIN * ...
5dd6fa526eac5632f75d543342a7a5a45b866716
Update plantcv/plantcv/visualize/obj_size_ecdf.py
plantcv/plantcv/visualize/obj_size_ecdf.py
plantcv/plantcv/visualize/obj_size_ecdf.py
# Plot Empirical Cumulative Distribution Function for Object Size import os import cv2 import pandas as pd from plantcv.plantcv import params from plantcv.plantcv._debug import _debug from statsmodels.distributions.empirical_distribution import ECDF from plotnine import ggplot, aes, geom_point, labels, \ scale_col...
Python
0
@@ -301,34 +301,8 @@ els, - %5C%0A scale_color_manual, sca
77eefbefcdc5c04d194924e11fa491a0c4c91c14
convert print statement to logger call
geopy/geocoders/bing.py
geopy/geocoders/bing.py
import xml.dom.minidom from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder class Bing(Geocoder): """Geocoder using the Bing Maps API.""" def __init__(self, api_key, format_string='%s', output_format='xml'): """Initialize a customized Bing geocoder with l...
Python
0.999999
@@ -115,16 +115,46 @@ Geocoder +%0Afrom geopy.util import logger %0A%0Aclass @@ -1322,14 +1322,21 @@ -print +logger.debug( %22Fet @@ -1353,16 +1353,17 @@ .%22 %25 url +) %0A
ddf52f0a7c3ed2d276c32c9b60242449ce8bf272
convert print statement to logger call
geopy/geocoders/bing.py
geopy/geocoders/bing.py
import xml.dom.minidom from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder class Bing(Geocoder): """Geocoder using the Bing Maps API.""" def __init__(self, api_key, format_string='%s', output_format='xml'): """Initialize a customized Bing geocoder with l...
Python
0.999999
@@ -115,16 +115,46 @@ Geocoder +%0Afrom geopy.util import logger %0A%0Aclass @@ -1322,14 +1322,21 @@ -print +logger.debug( %22Fet @@ -1353,16 +1353,17 @@ .%22 %25 url +) %0A
22fdc870e6807a946f3e01b3c08b2ea5552c7555
add end point for chamber member list
congress/members.py
congress/members.py
from .client import Client from .utils import CURRENT_CONGRESS, check_chamber class MembersClient(Client): def get(self, member_id): "Takes a bioguide_id, returns a legislator" path = "members/{0}.json".format(member_id) return self.fetch(path) def filter(self, chamber, congress=CURR...
Python
0
@@ -103,16 +103,257 @@ ient):%0A%0A + def list_chamber(self, chamber,congress=CURRENT_CONGRESS):%0A %22Takes a bioguide_id, returns a legislator%22%0A path = %22%7Bcongress%7D/%7Bchamber%7D/members.json%22.format(congress=congress,chamber=chamber)%0A return self.fetch(path)%0A%0A def
6c05bf7400340d2797666e853dc813c5ff029055
Update settings for Heroku
connect/settings.py
connect/settings.py
import os from django.utils.translation import ugettext_lazy as _ """ Django settings for connect project. """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY =...
Python
0
@@ -539,17 +539,18 @@ BUG', 'o -n +ff ') == 'o @@ -683,16 +683,17 @@ t(',')%0A%0A +%0A # Honor @@ -4216,17 +4216,20 @@ '%0Aelse:%0A -%09 + EMAIL_HO @@ -4270,56 +4270,12 @@ T'%5D%0A -%09EMAIL_PORT = os.environ%5B'CONNECT_EMAIL_PORT'%5D%0A%09 + EMAI @@ -4326,17 +4326,20 @@ _USER'%5D%0A -%09 + EMAIL...
e08129c1c3f3df26a87beb04b54f388a8be1de55
Remove page outline when exporting ReST
contrib/wiki2rst.py
contrib/wiki2rst.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import os.path import re import sys from cStringIO import StringIO from pkg_resources import resource_listdir, resource_string from trac.loader import load_components from trac.test import EnvironmentStub, Mock, MockPerm from trac.util.text import printerr,...
Python
0.000002
@@ -1870,32 +1870,100 @@ %5Cn?', '', text)%0A + text = re.sub(r'%5C%5B%5C%5BPageOutline%5C(%5B%5E%5C)%5D*%5C)%5C%5D%5C%5D%5Cr?%5Cn?', '', text)%0A html = forma
21c8b67d1e8fb2f343a248d89999148ac44546c4
Remove unreachable return statement
gnocchi/storage/ceph.py
gnocchi/storage/ceph.py
# -*- encoding: utf-8 -*- # # Copyright © 2014 eNovance # # Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
Python
0.999998
@@ -4225,28 +4225,8 @@ alse -%0A return True %0A%0A
e56df10f3e40b9287735f1295a0ed72e1525896f
change json to md RasaHQ/roadmap#280
examples/restaurantbot/bot.py
examples/restaurantbot/bot.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import logging import warnings from policy import RestaurantPolicy from rasa_core import utils from rasa_core.agent import Agent from rasa_core.policies....
Python
0
@@ -1224,12 +1224,10 @@ ata. -json +md ')%0A
40316f4a2f1e973ba98a50592a54f21a2d5ac18e
Add the exceptions module to describe exceptions from external target
rapidtest/executors/exceptions.py
rapidtest/executors/exceptions.py
class ExternalExecutionTargetError(Exception): pass
Python
0
@@ -1,56 +1,920 @@ -class ExternalExecutionTargetError(Exception):%0A pass +from ..utils import Dictable%0A%0AMSG_CANNOT_GUESS_METHOD = '''cannot find the target method. You may specify operations as %5C%0Aarguments to Case if there are multiple methods to be called, or prepend all names of private %5C%0Amethods wit...
dbbdc1f262f25e7c3f27db4e2ab8076b9de2ec4d
Fix undefined variable.
vxscreenshots/watch.py
vxscreenshots/watch.py
#! /usr/bin/env python # -*- coding: UTF-8 -*- import os from os import makedirs from os.path import isdir, dirname import time import logging import boto3 import click import sqlite3 from watchdog.observers import Observer from watchdog.events import LoggingEventHandler from .config import read_config config = read_...
Python
0.000015
@@ -323,16 +323,17 @@ nfig()%0A%0A +%0A class S3 @@ -4363,36 +4363,45 @@ OError:%0A -self +event_handler .logger.info('A
8d05da2ddb115f994c652e0e9d8a75b13a6269ee
add Shallow_water to list of noteboks to use jsanimate_widget in html version
make_html_on_master.py
make_html_on_master.py
""" Convert notebooks listed in `chapters` into html files in the directory `riemann_book_files`. Run this code on the master branch with the latest set of notebooks, adjusting the specification of `chapters` below first if you want to process only a subset of the notebooks. To post on the website, check out the `gh-...
Python
0
@@ -3076,16 +3076,32 @@ ction',' +Shallow_water',' Nonconve
07aca8e96d5e93edb684d0c4684ef8f837e8fc58
Use comment builder for dirhtml too
readthedocs/doc_builder/loader.py
readthedocs/doc_builder/loader.py
from django.utils.importlib import import_module from django.conf import settings # Managers mkdocs = import_module(getattr(settings, 'MKDOCS_BACKEND', 'doc_builder.backends.mkdocs')) sphinx = import_module(getattr(settings, 'SPHINX_BACKEND', 'doc_builder.backends.sphinx')) loading = { # Possible HTML Builders ...
Python
0
@@ -392,24 +392,32 @@ mlDirBuilder +Comments ,%0A 'sphin
75c1c739547130e588f0e6d33aa3d88e364f90ee
Fix error report path
watchtower/WatchMan.py
watchtower/WatchMan.py
''' Copyright (c) 2015 Tim Savannah Under terms of the LGPLv2. See LICENSE in the root directory for full terms. WatchMan.py - Contains the main "runner" for WatchTower ''' import os import multiprocessing import signal import sys import traceback import time from .Triggers import Trigger DEFAULT_POLL_TI...
Python
0.000003
@@ -7038,16 +7038,18 @@ .__class +__ .__name_ @@ -7067,17 +7067,16 @@ tr(data) -) , traceb @@ -7106,16 +7106,17 @@ info())) +) %0A%0A
000e44df690a4a1a607224d5f53cc4feee7bcbc0
add tests for related objects.
reciprocity/chef_profile/tests.py
reciprocity/chef_profile/tests.py
"""Test ChefProfile model.""" from __future__ import unicode_literals from django.conf import settings from django.test import TestCase from django.db.models import QuerySet, Manager from .models import ChefProfile import factory USER_BATCH_SIZE = 20 class UserFactory(factory.django.DjangoModelFactory): """Facto...
Python
0
@@ -176,16 +176,74 @@ Manager%0A +from recipe.tests import RecipeFactory, IngredientFactory%0A from .mo @@ -266,16 +266,16 @@ Profile%0A - import f @@ -1580,16 +1580,169 @@ reate()%0A + self.recipe = RecipeFactory.create()%0A self.ingredient1 = IngredientFactory.create()%0A self.ingredient2 = ...
5c22153b8b43e13266ea2b68a39bcf94b75ab993
Add get_timestra and get_entry_monitor_dir
creation/lib/cgWConsts.py
creation/lib/cgWConsts.py
#################################### # # Keep all the constants used to # create glidein entries in this # module # # Author: Igor Sfiligoi # #################################### import time import string import os.path start_time_tuple=time.localtime() TIMESTR=(string.printable[start_time_tuple[0]-2000]+ #year, will...
Python
0.000001
@@ -215,16 +215,56 @@ s.path%0A%0A +%0Adef get_timestr(when=time.time()):%0A start_ti @@ -291,17 +291,25 @@ ime( -)%0ATIMESTR +when)%0A timestr =(st @@ -380,32 +380,36 @@ ~2060%0A + string.printable @@ -444,32 +444,36 @@ #month%0A + + string.printable @@ -505,16 +505,20 @@ ...
853ebd17535e97c838de18bbc093ce854a7af2b8
Version bump
biodome.py
biodome.py
""" biodome ======= Controlled environments. Copyright 2018 Caleb Hattingh 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...
Python
0.000001
@@ -1029,17 +1029,17 @@ '2018.8. -2 +3 '%0Alogger
933dacc43a4d3db0ea134d374867e80e8144a539
Fix pairing syntax bug
mycroft/managers/identity_manager.py
mycroft/managers/identity_manager.py
# Copyright (c) 2017 Mycroft AI, Inc. # # This file is part of Mycroft Light # (see https://github.com/MatthewScholefield/mycroft-light). # # 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 ...
Python
0.000001
@@ -1817,14 +1817,8 @@ rn %7B -k.get( repl @@ -1825,16 +1825,22 @@ acements +.get(k , k): v
e78d621239d6e22f7c0baf3d507eb00f733c6c11
fix file encoding issue
docs/add_image_map.py
docs/add_image_map.py
# rst doesn't support image maps, so we'll add one after the html has been built fileName = "_build/html/abmexample.html" line = 'src="_images/abmexample.jpg" />' lineWithMap = 'src="_images/abmexample.jpg" usemap="#image-map" />' imageMap = """\n <map name="image-map"> <area target="" alt="" title="" href="mod...
Python
0.000001
@@ -3239,25 +3239,8 @@ Name -, encoding=%22utf8%22 ) as
adb9b262167beecb30edc281e4ab10fc05b3e6da
optimize imports and add common exceptions
voting-server/app/errors.py
voting-server/app/errors.py
from flask import jsonify from werkzeug.exceptions import HTTPException from werkzeug.exceptions import default_exceptions from app import app def json_error(error): response = jsonify(message = str(error)) response.status_code = error.code if isinstance(error, HTTPException) else 500 return response fo...
Python
0
@@ -68,40 +68,9 @@ tion -%0Afrom werkzeug.exceptions import +, def @@ -368,8 +368,58 @@ _error)%0A +app.register_error_handler(Exception, json_error)%0A
7d650f3ee367a8eac710893c1818aa08cccf7598
Add auth
bot/dao.py
bot/dao.py
#!/usr/bin/python # -*- coding: utf-8 -*- from pymongo import MongoClient, IndexModel class DAO: def __init__(self, *args, **kwargs): #args -- tuple of anonymous arguments #kwargs -- dictionary of named arguments if kwargs.get('mongo') is None: self.default_mongo_init() ...
Python
0.000007
@@ -573,16 +573,34 @@ ngodb:// +username:password@ localhos @@ -607,16 +607,20 @@ t:27017/ +dark ')%0A
4b8339b53f1b9dcd79f2a9060933713328a13b90
Mark dask-distributed tests on Windows as xfail (#1747)
xarray/tests/test_distributed.py
xarray/tests/test_distributed.py
import pytest import xarray as xr from xarray.core.pycompat import suppress distributed = pytest.importorskip('distributed') da = pytest.importorskip('dask.array') import dask from distributed.utils_test import cluster, loop, gen_cluster from distributed.client import futures_of, wait from xarray.tests.test_backends ...
Python
0
@@ -1,12 +1,24 @@ +import sys%0A%0A import pytes @@ -633,24 +633,142 @@ 5netcdf')%0A%0A%0A +@pytest.mark.xfail(sys.platform == 'win32',%0A reason='https://github.com/pydata/xarray/issues/1738')%0A @pytest.mark
6c3ff180c3bda17f1b6fdcf4500fdefdef9d713f
Fix copy & paste errors in setting I brought over from django-skel.
vsub/settings/production.py
vsub/settings/production.py
"""Settings used in the production environment.""" from memcacheify import memcacheify from postgresify import postgresify from base import * ## Email configuration # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # See: https://...
Python
0
@@ -530,16 +530,19 @@ SWORD = +os. environ. @@ -572,16 +572,16 @@ D', '')%0A - %0A# See: @@ -666,16 +666,19 @@ _USER = +os. environ. @@ -797,16 +797,16 @@ il-port%0A - EMAIL_PO @@ -810,16 +810,19 @@ _PORT = +os. environ. @@ -1566,16 +1566,19 @@ T_KEY = +os. environ.
4fcdd2f4cea4899b3f7057f98b95fa7380682816
Add else: return to break out of loop when BACK is selected
cs251tk/webapp/web_cli.py
cs251tk/webapp/web_cli.py
import os from ..common import chdir from ..student import stash, pull, checkout_date from ..student.markdownify.process_file import process_file from PyInquirer import style_from_dict, Token, prompt def check_student(student, spec, basedir): files = [] if os.path.exists('{}/{}'.format(student, spec['assignm...
Python
0.000001
@@ -3526,16 +3526,49 @@ =False)%0A + else:%0A return%0A %0A%0Adef la
c3b0d4b05314dc9fd51c790a86d30659d09c5250
Allow negative numbers in the GEOS string
wagtailgeowidget/helpers.py
wagtailgeowidget/helpers.py
import re geos_ptrn = re.compile( "^SRID=([0-9]{1,});POINT\(([0-9\.]{1,})\s([0-9\.]{1,})\)$" ) def geosgeometry_str_to_struct(value): ''' Parses a geosgeometry string into struct. Example: SRID=5432;POINT(12.0 13.0) Returns: >> [5432, 12.0, 13.0] ''' result = geos_ptrn.m...
Python
0
@@ -59,16 +59,18 @@ POINT%5C(( +-? %5B0-9%5C.%5D%7B @@ -76,16 +76,18 @@ %7B1,%7D)%5Cs( +-? %5B0-9%5C.%5D%7B
d890d9410aa93966a7587f746378ddf13cd93395
use python tuple to push entry in queue
watchme/aosd_text_scroll.py
watchme/aosd_text_scroll.py
import sys import aosd import threading import Queue import time import thread import utils class Aosd_conf(object): line_space = 4 top_space = 0 geom_x_offset = 10 geom_y_offset = 10 shadow_color = 'black' shadow_opacity = 255 shadow_x_offset = 1 shadow_y_offset = 1 fore_opacity =...
Python
0
@@ -5611,36 +5611,9 @@ lf, -to_append%5B0%5D, to_append%5B1%5D, +* to_a @@ -5621,11 +5621,8 @@ pend -%5B2%5D )%0A @@ -5769,17 +5769,17 @@ ppend = -%5B +( text, co @@ -5790,17 +5790,17 @@ timeout -%5D +) %0A
03ea21b744a1c499348a3d1b1ad87258efee1e33
add helpful StrictJsonObject object
dimagi/ext/jsonobject.py
dimagi/ext/jsonobject.py
from __future__ import absolute_import import datetime import decimal from jsonobject.base_properties import AbstractDateProperty from jsonobject import * import re from jsonobject.api import re_date, re_time, re_decimal from dimagi.utils.dates import safe_strftime from dimagi.utils.parsing import ISO_DATETIME_FORMAT f...
Python
0.004985
@@ -3360,8 +3360,84 @@ imeMeta%0A +%0A%0Aclass StrictJsonObject(JsonObject):%0A _allow_dynamic_properties = False%0A
09e1a63ed487375b308465bfb24badffe361f182
change variable and function names
dusty/compiler/port_spec/__init__.py
dusty/compiler/port_spec/__init__.py
from dusty.constants import LOCALHOST class ReusedHostFullAddress(Exception): pass class ReusedContainerPort(Exception): pass def _docker_compose_port_spec(host_forwarding_spec, host_port): return {'in_container_port': str(host_forwarding_spec['container_port']), 'mapped_host_ip': LOCALHOST, ...
Python
0.000002
@@ -962,37 +962,37 @@ _forwarding_ -spec_document +port_mappings (host_forwar @@ -1294,36 +1294,40 @@ ile%22%22%22%0A port_ -spec +mappings = %7B'docker_comp @@ -1972,36 +1972,40 @@ port)%0A%0A port_ -spec +mappings %5B'docker_compose @@ -2075,36 +2075,40 @@ _port)%0A port_ -spec +mappings %5B'virtual...
9cb731c00bfc58c3a64b92fc3aa5140968fead43
update copyright
framework_agreement_sourcing/wizard/cost_estimate.py
framework_agreement_sourcing/wizard/cost_estimate.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
Python
0
@@ -144,16 +144,22 @@ ght 2013 +, 2014 Camptoc
9ad697081f62b63f966f998b6618bfb543717f4a
Allow to pass more attributes.
webapp/bootstrap/helpers.py
webapp/bootstrap/helpers.py
# -*- coding: utf-8 -*- from byceps.blueprints.brand.models import Brand from byceps.blueprints.orga.models import OrgaFlag, OrgaTeam, \ Membership as OrgaTeamMembership from byceps.blueprints.party.models import Party from byceps.blueprints.seating.models import Area as SeatingArea, \ Category as SeatingCateg...
Python
0
@@ -3110,24 +3110,34 @@ slug, title +, **kwargs ):%0A retur @@ -3177,32 +3177,42 @@ lug, title=title +, **kwargs )%0A%0A%0A@add_to_data
7e45a26f86095ee2f6972e08697aa132e642636e
Test for types in __mul__
csympy/tests/test_arit.py
csympy/tests/test_arit.py
from csympy import Symbol, Integer def test_arit1(): x = Symbol("x") y = Symbol("y") e = x + y e = x * y e = Integer(2)*x e = 2*x def test_arit2(): x = Symbol("x") y = Symbol("y") assert x+x == Integer(2) * x assert x+x != Integer(3) * x assert x+x == 2 * x
Python
0.000004
@@ -1,8 +1,39 @@ +from nose.tools import raises%0A%0A from csy @@ -324,12 +324,104 @@ +x == 2 * x%0A +%0A@raises(TypeError)%0Adef test_arit3():%0A x = Symbol(%22x%22)%0A y = Symbol(%22y%22)%0A e = %22x%22*x%0A
852c62eef3d9beea43927f75b1a8aaa021ce25f9
Add a docstring to test helper
test/selenium/src/lib/test_helpers.py
test/selenium/src/lib/test_helpers.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """ Utility classes for page objects used in tests. Details: Most of the te...
Python
0.000001
@@ -620,32 +620,116 @@ ser(base.Test):%0A + %22%22%22The HtmlParser class simulates what happens with (non-rich)text in HTML.%0A %22%22%22%0A @staticmethod%0A
cfca983b909c4919d8478e81fca66bf01af80c74
Fix failing tests.
test/services/updater/test_updater.py
test/services/updater/test_updater.py
import os import logging import time from threading import Semaphore, Thread, Event from unittest.mock import patch, Mock import git from weavelib.messaging import Receiver, Sender from weavelib.rpc import RPCClient from weaveserver.core.services import ServiceManager from weaveserver.services.updater.service import ...
Python
0.000003
@@ -870,15 +870,21 @@ apps - = +.update( AUTH +) %0A
9236d16b8013e3c71f57d43136be3b9640c56ee3
Fixed a Python 2.3 incompatibility.
django/test/testcases.py
django/test/testcases.py
import re, unittest from urlparse import urlparse from django.db import transaction from django.core import management, mail from django.db.models import get_apps from django.test import _doctest as doctest from django.test.client import Client normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', ...
Python
0.999738
@@ -4185,18 +4185,18 @@ elf. -assertTrue +failUnless (rea
665ece3f699d6a62be0d9c859532ae73e250d86f
Update __init__.py
wellapplication/__init__.py
wellapplication/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.2.24' __author__ = 'Paul Inkenbrandt' __name__ = 'wellapplication' from transport import * from usgs import * from chem import WQP from graphs import piper, fdc, gantt import MannKendall import avgMeths
Python
0.000072
@@ -176,16 +176,38 @@ rt WQP%0D%0A +from mesopy import *%0D%0A from gra
f5e459e369f1a00d3407f7993e427b676047da21
bump version
django_anger/__init__.py
django_anger/__init__.py
__version__ = "0.1-20130513.try3"
Python
0
@@ -15,16 +15,18 @@ %220.1 +.1 -2013051 3.tr @@ -25,12 +25,7 @@ 3051 -3.try3 +6 %22%0A
6185d7d348487a28655967f7e2c19e71bc11c67e
remove norm function references
version3/python/mpin.py
version3/python/mpin.py
# # Python 3.7 Code to implement basic MPIN protocol API # M.Scott August 2018 # import hashlib from XXX import ecp from XXX import ecp2 from XXX import curve from XXX import big from XXX.ecp import * from XXX.ecp2 import * from XXX import pair from XXX.fp12 import * # hash ID to point on curve def H(mpin_id): ...
Python
0.000001
@@ -1937,29 +1937,8 @@ * P%0A - print(%22Got here%22) %0A @@ -2113,19 +2113,16 @@ ray(0))%0A - %0A TV @@ -2208,20 +2208,16 @@ ray(0))%0A - %0A TU. @@ -3646,38 +3646,24 @@ A1.add(B1)%0A - A1.norm()%0A return A @@ -3890,22 +3890,8 @@ B1)%0A - A1.norm()%0A
34db4460aa67fc9abfaaaf2c48a6ea7c5b801ff0
Fix for libtest for cpython 2.6 / jython / pypy
examples/libtest/imports/__init__.py
examples/libtest/imports/__init__.py
exec_order = [] class Imports(object): exec_order = exec_order def __init__(self): self.v = 1 imports = Imports() overrideme = "not overridden" from . import cls as loccls from .imports import cls as upcls def conditional_func(): return "not overridden" if True: def conditional_func(): ...
Python
0.000001
@@ -190,38 +190,125 @@ cls%0A -from .imports import cls as up +%0A# This is not valid since Python 2.6!%0Atry:%0A from .imports import cls as upcls%0Aexcept ImportError:%0A upcls = loc cls%0A
e354eba380c6df2f0a14e324da9cbe6467494ddc
add - ModelIORedis & build up interface.
versus/tools/modelIO.py
versus/tools/modelIO.py
""" Class family for Model IO classes to handle read/write of learning models """ class ModelIO(object): def __init__(self): pass def write(self): raise NotImplementedError()
Python
0
@@ -76,16 +76,31 @@ ls%0A%22%22%22%0A%0A +import redis%0A%0A%0A class Mo @@ -132,24 +132,34 @@ _init__(self +, **kwargs ):%0A p @@ -181,16 +181,23 @@ ite(self +, model ):%0A @@ -226,8 +226,687 @@ dError() +%0A%0A def validate(self, model):%0A %22%22%22 Ensures that the model is valid. %22%2...
c1135762c32526b3dc70c186ab97404ac27422e6
Handle missing plugin directory
repository.py
repository.py
import re import os import ttimer import logging import subprocess import plugin import static class Repository(): def __init__(self, path): self.ttl = static.ttl self.path = path self.system = static.system.lower() self.logger = logging.getLogger('default') self.load_plugins() def pop_plugin(self, id): ...
Python
0.000001
@@ -2221,16 +2221,29 @@ s = %5B%5D%0A%0A +%09%09if files:%0A%09 %09%09for fi @@ -2258,21 +2258,23 @@ les:%0A%09%09%09 +%09 try:%0A +%09 %09%09%09%09self @@ -2331,16 +2331,17 @@ tl)%5D%0A%09%09%09 +%09 except p @@ -2364,16 +2364,17 @@ r as e:%0A +%09 %09%09%09%09self
4b9da366b4169caf8802dcbbf20168512cc4e12e
Fix typo
ostrich/stages/stage_30_clone_osa.py
ostrich/stages/stage_30_clone_osa.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
Python
0.999999
@@ -641,10 +641,10 @@ 'ans -b i +b le-d
62f137072aa26999ad30dda01fe2a736c3e00495
exclude in admin
django_typograf/admin.py
django_typograf/admin.py
from django.contrib import admin from django_typograf.utils import get_typograf_field_name, get_typograf_hash_field_name class TypografAdmin(admin.ModelAdmin): """ Admin class for hide typograf fields from admin site """ def _exclude(self, obj=None): """ Mark typograf fields as exclude """ e...
Python
0.00006
@@ -631,37 +631,32 @@ wargs):%0A -self. exclude = self.e @@ -676,21 +676,16 @@ -self. exclude @@ -706,16 +706,61 @@ de(obj)%0A + kwargs.update(dict(exclude=exclude))%0A
1ba74fc225d71bc071827291d9942738ef56dd1f
Correct login view
apps/__init__.py
apps/__init__.py
# -*- coding: utf-8 -*- from flask import Flask from flask.ext.login import LoginManager from .models import db, User from .views import module __all__ = ('create_app',) def _init_db(app): db.app = app db.init_app(app) def _init_jinja(app): pass def _init_login(app): login_manager = LoginManage...
Python
0.000001
@@ -422,19 +422,20 @@ iew = '/ -log +sign in'%0A%0A%0Ade
586418860c0441eaebadd0fe79989d6d9f90fa28
Fix for the component lookup error in vocabulary
src/bda/plone/productshop/vocabularies.py
src/bda/plone/productshop/vocabularies.py
from zope.interface import directlyProvides from zope.schema.interfaces import IVocabularyFactory from zope.schema.vocabulary import ( SimpleVocabulary, SimpleTerm, ) from zope.i18nmessageid import MessageFactory from .utils import ( dotted_name, available_variant_aspects, ) #added by espen from zope.c...
Python
0
@@ -396,56 +396,8 @@ yFTI -%0Afrom zope.component import ComponentLookupError %0A%0A_ @@ -851,20 +851,22 @@ -type +fields = getUt @@ -923,25 +923,52 @@ roduct') -%0A +.lookupSchema()%0A except:%0A + fields = @@ -972,36 +972,28 @@ s = -type.lookupSchema()%0A +%5B'Datasheet', %5D%0A ...
3cade5788e55b124ce6c55350afb1beae4d3a5c3
Update __init__.py
examples/quickhowto2/app/__init__.py
examples/quickhowto2/app/__init__.py
import logging from flask import Flask from flask.ext.appbuilder import SQLA, AppBuilder #from sqlalchemy.engine import Engine #from sqlalchemy import event logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s:%(message)s') logging.getLogger().setLevel(logging.DEBUG) app = Flask(__name__) app.config.from_ob...
Python
0.000072
@@ -382,16 +382,42 @@ .session +, menu=Menu(reverse=False) )%0A%0A%22%22%22%0AO
fb8e7ade2ca4ba01c9d6af2f169e3acc5f67613a
Enable CSRF_COOKIE_HTTPONLY = True
djangopeople/settings.py
djangopeople/settings.py
import dj_database_url import os from django.core.urlresolvers import reverse_lazy from django.utils.six.moves.urllib import parse OUR_ROOT = os.path.realpath(os.path.dirname(__file__)) DEBUG = bool(os.environ.get('DEBUG', False)) # OpenID settings OPENID_REDIRECT_NEXT = reverse_lazy('openid_whatnext') LOGIN_URL = ...
Python
0.999765
@@ -5127,24 +5127,56 @@ ONLY = True%0A + CSRF_COOKIE_HTTPONLY = True%0A CSRF_COO
aca0335593dbab772c806f8ac7ccde42cf4fd6f1
no mypy = happy mypy
paasta_tools/paasta_cluster_boost.py
paasta_tools/paasta_cluster_boost.py
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Python
0.999985
@@ -2176,16 +2176,8 @@ str) - -%3E list :%0A
33e9e7e279255c984a650e9bb2002faf4c8c66b1
fix prefix name (#3459)
PaddleSlim/classification/models/resnet.py
PaddleSlim/classification/models/resnet.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import paddle import paddle.fluid as fluid import math from paddle.fluid.param_attr import ParamAttr __all__ = ["ResNet", "ResNet34", "ResNet50", "ResNet101", "ResNet152"] train_parameters = { "input_size"...
Python
0.000002
@@ -2751,16 +2751,88 @@ * 1.0)%0A + fc_name = fc_name if fc_name is None else prefix_name + fc_name%0A
ca58c653bf56235fb66c6d25ec2dc659552ad90f
support delete another prefix cache at once
djinn/datastore/cache.py
djinn/datastore/cache.py
# -*- coding: utf-8 -*- # # Copyright(c) 2014 palmhold.com # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Python
0
@@ -817,16 +817,145 @@ flict%22)%0A +define(%22cache_key_prefix_another%22, %22%22, str,%0A %22another cache in different cache prefix, should be delete at the same time%22)%0A define(%22 @@ -1603,28 +1603,312 @@ -_key = key_gen(key)%0A +if options.cache_key_prefix:%0A key = %22%25s:%25s%22 %25 (op...
14d12b1d6bbcf5784256b82f58974f02fe8d1503
Remove unused imports. Gating tests so they do not run on Windows
tests/integration/states/test_cron.py
tests/integration/states/test_cron.py
# -*- coding: utf-8 -*- ''' Tests for the cron state ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging log = logging.getLogger(__name__) # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from test...
Python
0
@@ -308,194 +308,119 @@ pIf%0A -from tests.support.paths import FILES, TMP, TMP_STATE_TREE%0Afrom tests.support.helpers import (%0A skip_if_not_root,%0A with_system_user_and_group,%0A with_tempfile,%0A Webserver,%0A)%0A%0A +%0A# Import Salt libs%0Aimport salt.utils.platform%0A%0A%0A@skipIf(salt.utils.platf...
6493cc31acdc09df6c0ad952e95380ac31a0e504
Update __init__.py
vispy/color/__init__.py
vispy/color/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Convience interfaces to manipulate colors. This module provides support for manipulating colors. """ <<<<<<< HEAD __all__ = ['Color', 'ColorArray', 'Colormap', ...
Python
0.000072
@@ -248,21 +248,8 @@ %22%22%0A%0A -%3C%3C%3C%3C%3C%3C%3C HEAD%0A __al @@ -596,340 +596,4 @@ oqa%0A -=======%0A__all__ = %5B'Color', 'ColorArray', 'LinearGradient', 'get_color_names',%0A 'get_colormap_py'%5D%0A%0Afrom ._color_dict import get_color_names # noqa%0Afrom ._color import (Color, ColorArray, Line...
9b35aece13ee90005320996d962e1c8347a06e3b
remove debugging "print" statement
tests/twisted/jingle/payload-types.py
tests/twisted/jingle/payload-types.py
""" Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=18918 """ from gabbletest import exec_test, make_result_iq, sync_stream, \ send_error_reply from servicetest import make_channel_proxy, unwrap, tp_path_prefix, \ call_async, EventPattern from twisted.words.xish import domish import ji...
Python
0.000003
@@ -4913,28 +4913,8 @@ rs%0A%0A - print e.args%5B0%5D%0A
a364196814c3b33e7fd51a42b4c3a48a3aaeaee8
Update list of extraordinary gentlemen
volaparrot/constants.py
volaparrot/constants.py
ADMINFAG = ["RealDolos"] PARROTFAG = "Parrot" BLACKFAGS = [i.casefold() for i in ( "kalyx", "merc", "loliq", "annoying", "bot", "RootBeats", "JEW2FORU", "quag", "mire", "perici")] OBAMAS = [i.casefold() for i in ( "counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta")] BLA...
Python
0
@@ -122,15 +122,8 @@ ng%22, - %22bot%22, %22Ro @@ -168,16 +168,114 @@ %22perici%22 +, %22Voldemort%22, %22briseis%22, %22brisis%22, %22GNUsuks%22, %22rhooes%22, %22n1sm4n%22, %22honeyhole%22, %22Printer%22, %22yume1%22 )%5D%0AOBAMA @@ -397,16 +397,37 @@ %22tarta%22 +, %22counselor%22, %22myon%22 )%5D%0A%0ABLAC ...
84965de8b53dcb5b10788808a2bf135df82cd4d9
Update dev DB to sqlite3
vpr/vpr/settings/dev.py
vpr/vpr/settings/dev.py
# Django settings for vpr project. from base import * DEBUG = True DEVELOPMENT = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { #'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. #'NAME': 'vpr.sqlite3', # Or path to datab...
Python
0
@@ -144,17 +144,16 @@ -# 'ENGINE' @@ -253,17 +253,16 @@ -# 'NAME': @@ -338,32 +338,33 @@ qlite3.%0A +# 'ENGINE': 'djang
52f9d95582456754aa4e9f9cd5d59a308c9e256c
remove comments
server.py
server.py
import socket import communication import time import cv2 import numpy as np from picamera import PiCamera import sys import signal run_condition = True def signal_handler(signal, frame): print('Exiting...') global run_condition run_condition = False sys.exit(0) def generateRandomImg(...
Python
0
@@ -477,17 +477,16 @@ olution= - (500,500 @@ -487,16 +487,16 @@ 00,500)%0A + @@ -725,31 +725,8 @@ t()%0A - #send SERVER_READY%0A @@ -841,34 +841,8 @@ DY)%0A - #receive CLIENT_READY%0A @@ -1254,32 +1254,8 @@ et)%0A - #send camera id%0A @@ -1286,16 +1286,16 @@ mera_id%0A +...
95495c1b0ae1a696b95eb486c7a40d54f507dacb
Add cross origin requests.
server.py
server.py
import pymzn import os from subprocess import Popen, PIPE from flask import Flask, json, Response app = Flask(__name__) folder = 'models' #where the .mzn files are stored models = [] for file in os.listdir(folder): if file.endswith('.mzn'): models.append(file) @app.route('/') def Allmodels(): return json.jsonify(...
Python
0
@@ -490,13 +490,13 @@ n(%5B%22 -MiniZ +miniz inc%22 @@ -955,8 +955,387 @@ found%22) +%0A%0A# TODO: Unsure if this is safe security wise, have to look into it.%0A# aka. CORS request.%0A@app.after_request%0Adef after_request(response):%0A response.headers.add('Access-Control-Allow-Origin', '*')%0A response.headers....
11000be28e9c150adde2d9109bb5e078a5c553b6
Assume the dimesions are good
server.py
server.py
#!/usr/bin/env python import sys import numpy import math import logging from fuel.datasets import DogsVsCats from fuel.schemes import ShuffledScheme from fuel.server import start_server from fuel.streams import DataStream from fuel.transformers import ScaleAndShift, ForceFloatX from fuel.transformers.image import ( ...
Python
0.999997
@@ -2612,24 +2612,82 @@ =False):%0A + # Now the dataset has images with good minimum size%0A # stream = Fo @@ -2718,24 +2718,26 @@ am, 128,%0A + #
8d92fa303dc3f451ff353c9bb7b5e55a7f363c33
correct example in docs
src/compas/datastructures/mesh/duality.py
src/compas/datastructures/mesh/duality.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division from math import pi from compas.utilities import flatten __all__ = ['mesh_dual'] PI2 = 2.0 * pi def mesh_dual(mesh, cls=None, boundary=0): """Construct the dual of a mesh. Parameters ---------...
Python
0.000005
@@ -1058,24 +1058,46 @@ --------%0A + %3E%3E%3E import compas%0A %3E%3E%3E from
eb889d08c6031ba6c2b55a883d09e22f5684f0ee
Add mode (training|arena) option to the command line
server.py
server.py
#!/usr/bin/env python import os import sys import requests import re from bot import RandomBot def get_new_game_state(server_host, key, number_of_turns = '20', mode='training'): if(mode=='training'): params = { 'key': key, 'turns': number_of_turns} r = requests.post(server_host + '/api/training', ...
Python
0.000001
@@ -130,16 +130,33 @@ st, key, + mode='training', number_ @@ -170,33 +170,16 @@ s = '20' -, mode='training' ):%0A i @@ -619,16 +619,22 @@ st, key, + mode, bot, nu @@ -1348,24 +1348,30 @@ er_host, key +, mode )%0A print( @@ -1468,17 +1468,17 @@ argv) %3E -3 +4 ):%0A @@ -1511,16 +1511,29 @@ argv%...
35562f7b82a0da6625b63bf8e2aa83655f886c5f
Fix untested code.
server.py
server.py
from datetime import timedelta from flask import Flask, redirect, render_template, request, url_for import json from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.wsgi import WSGIContainer from webpixels import PixelSet, RgbPixel from webpixels.controller import ColorKinetics app ...
Python
0.000022
@@ -2984,16 +2984,25 @@ n pixels +.values() :%0A @@ -3219,16 +3219,27 @@ onds=25) +, fade_step )%0A els
03739fdd464aeb2ae3dbc0f0184c644cf02db6c4
add debug servr to CROS
server.py
server.py
#!/usr/bin/env python import http.server import socketserver import os import sys import time import json import re import argparse from cgi import parse_header, parse_multipart from urllib.parse import parse_qs # sys.path.append('./cgi-bin/wnet') sys.path.append('./cgi-bin/paint_x2_unet') import cgi_exe class ...
Python
0.000001
@@ -3269,16 +3269,129 @@ ding...%0A + self.send_header(%22Access-Control-Allow-Origin%22, %22http://paintschainer5.preferred.tech%22) # hard coding...%0A
5ca44abba27a50aaac7be91eebc46f774246117f
Check that database is empty before adding demo data
server.py
server.py
import json import logging import sys import os from datetime import datetime from flask import Flask, redirect, render_template, request, views from flask_socketio import SocketIO from flask_sqlalchemy import SQLAlchemy from redis import Redis def get_redis_connection(decode_responses = False, attach_redis_connect...
Python
0.000001
@@ -6108,64 +6108,160 @@ -consumer()%0A else:%0A prepare_demo_data() +if len(Order.query.all()) == 0:%0A print('Preparing demo data...')%0A prepare_demo_data()%0A consumer()%0A else: %0A
d34368f3c9e570d751b21499d3bd1c5faabb1dba
check more places where fxc.exe might hide
fips-generators/util/hlslcompiler.py
fips-generators/util/hlslcompiler.py
''' Python wrapper for HLSL compiler (fxc.exe) NOTE: this module contains Windows specific code and should only be imported when running on Windows. ''' import subprocess, platform, os, sys import genutil as util if sys.version_info[0] < 3: import _winreg as winreg else: import winreg #-----------------------...
Python
0
@@ -576,16 +576,70 @@ bin/x86' +, if it's not there%0A try any of the subdirectories. %0A%0A Re @@ -761,19 +761,16 @@ ath = u' -bin %5C%5Cx86%5C%5Cf @@ -1079,23 +1079,26 @@ -fxcPath +winkit_dir , _ = wi @@ -1153,18 +1153,315 @@ fxcPath -+ = + winkit_dir + u'bin' + fxcSubPath%0A ...
7542d224d2ab15adec31a2d896a22cab6a7a2b37
add log
spider.py
spider.py
# -*- coding: utf-8 -*- import http.client from ltc.models import Record import json def get_current_price(): conn = http.client.HTTPSConnection('api.huobi.com') conn.request('GET','/staticmarket/ticker_ltc_json.js') r = conn.getResponse() if r.status == 200 : data = r.read() string = ...
Python
0.000002
@@ -452,16 +452,35 @@ s=True)%0A + print(json) %0A
195e5cde1d81d7f73b77ce1b1c52f0beea8a2595
Fix tclist iterator slicing
ejdb/tc.py
ejdb/tc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numbers from . import c from .utils import CObjectWrapper class ListIterator(CObjectWrapper): """Python iterator wrapper for a `TCLIST *`. """ def __init__(self, wrapped, count=None): super(ListIterator, self).__init__( wrapped=wra...
Python
0.000009
@@ -695,16 +695,17 @@ n range( +* key.indi
1e7869a5b7c5503498634dc0161fdfb29bbb4c7b
Fix imports to restore schema import.
grano/logic/schemata.py
grano/logic/schemata.py
import os from grano.core import db, url_for from grano.model import Schema, Attribute from grano.logic.validation import validate_schema from grano.logic import projects as projects_logic from grano.logic import attributes def save(project, data): """ Create a schema. """ data = validate_schema(data) ...
Python
0
@@ -2,16 +2,54 @@ mport os +%0Aimport yaml%0Afrom pprint import pprint %0A%0Afrom g @@ -169,16 +169,25 @@ e_schema +, Invalid %0Afrom gr
1aed7a2b0213d457e1efdf5923a159fc053caae5
Check for multiple teams in migrate_tips
gratipay/models/team.py
gratipay/models/team.py
"""Teams on Gratipay are plural participants with members. """ from postgres.orm import Model class Team(Model): """Represent a Gratipay team. """ typname = 'teams' def __eq__(self, other): if not isinstance(other, Team): return False return self.id == other.id def _...
Python
0
@@ -2482,19 +2482,85 @@ -WHERE team= + JOIN participants p ON t.owner = p.username%0A WHERE p.username = %25s%0A @@ -2614,21 +2614,23 @@ , (self. -slug, +owner, ))%0A%0A
9d354ea7db8c3085660e61b743ae4733ee552784
Change envvar names (less teams in Gratipay 2.1)
gratipay/models/team.py
gratipay/models/team.py
"""Teams on Gratipay receive payments and distribute payroll. """ import requests from postgres.orm import Model status_icons = { "unreviewed": "&#9995;" , "rejected": "&#10060;" , "approved": "&#9989;" } class Team(Model): """Represent a Gratipay team. """ ...
Python
0
@@ -1915,29 +1915,24 @@ os.environ%5B' -TEAM_ REVIEW_USERN @@ -1954,13 +1954,8 @@ on%5B' -TEAM_ REVI
93ed74d3c904c743f91f0c9e81f6d36bda731a10
modify example.py
example.py
example.py
#! /usr/bin/python from FixQueue import FixQueue if __name__ == "__main__" : fq = FixQueue(2) # 2 means queue size fq.append('a') fq.append('b') print (fq) # ['a', 'b'] fq.append('c') print (fq) # ['b', 'c'] print (fq.pop()) # b print (fq) # ['b']
Python
0.000001
@@ -17,22 +17,8 @@ on%0A%0A -from FixQueue impo
80adb43a22f82a036d72bdd398d45ee4daa9a5ff
Update example.py
example.py
example.py
import pornhub search_keywords = [] #client = pornhub.PornHub("5.135.164.72", 3128, search_keywords) #With proxy, given a Proxy IP and Port. For the countries with restricted access like Turkey, etc. client = pornhub.PornHub(search_keywords) for star in client.getStars(10): print(star) print(star["name"]) ...
Python
0.000001
@@ -376,20 +376,16 @@ (video)%0A - %0Afor pho @@ -435,8 +435,96 @@ oto_url) +%0A%0Avideo = client.getVideo(%22SOME VIDEO URL%22)%0Aprint(video)%0Aprint(video%5B'accurate_views'%5D)%0A
4053baa698f1047f09540c9ff3d6e8a08d844335
Comment example
example.py
example.py
"""Example app to login to GitHub""" import argparse import mechanicalsoup parser = argparse.ArgumentParser(description='Login to GitHub.') parser.add_argument("username") parser.add_argument("password") args = parser.parse_args() browser = mechanicalsoup.Browser() # request github login page login_page = browser.ge...
Python
0
@@ -584,16 +584,26 @@ ssword%0A%0A +# submit!%0A page2 = @@ -649,16 +649,47 @@ in_form) +%0A%0A# verify we are now logged in %0Aassert @@ -717,12 +717,209 @@ ogout-form%22) +%0A%0A# verify we remain logged in (thanks to cookies) as we browse the rest of the site%0Apage3 = browser.get(%22https://github.com/matt-h...
c279eda7b56e1f793b0241a66fe155cfdbdd1d40
Remove intermediate string during gzip compression
api/tasks.py
api/tasks.py
from __future__ import absolute_import import os from celery import shared_task from celery.utils.log import get_task_logger from api.StormReplayParser import StormReplayParser import boto import StringIO import json import gzip from boto.s3.key import Key log = get_task_logger(__name__) @shared_task def Locall...
Python
0.001237
@@ -201,16 +201,33 @@ StringIO +%0Aimport cStringIO %0A%0Aimport @@ -1615,42 +1615,8 @@ ry.%0A - # also: use cStringIO instead%0A @@ -1628,16 +1628,17 @@ yFile = +c StringIO @@ -2093,16 +2093,17 @@ 'gzip')%0A +%0A out @@ -2104,16 +2104,17 @@ out = +c StringIO @@ -2213,24 +2213,25 @@ etval))%...
72b3642953d0e14d4b4c9ec03560a96d259f7d16
Remove monkey patching in favor of inheritance for SpatialReference
contones/srs.py
contones/srs.py
"""Spatial reference systems""" from osgeo import osr # Monkey patch SpatialReference since inheriting from SWIG classes is a hack def srid(self): """Returns the EPSG ID as int if it exists.""" epsg_id = (self.GetAuthorityCode('PROJCS') or self.GetAuthorityCode('GEOGCS')) try: retu...
Python
0
@@ -53,85 +53,183 @@ r%0A%0A%0A -# Monkey patch SpatialReference since inheriting from SWIG classes is a hack%0A +class BaseSpatialReference(osr.SpatialReference):%0A %22%22%22Base class for extending osr.SpatialReference.%22%22%22%0A%0A def __repr__(self):%0A return self.wkt%0A%0A @property%0A de...
aef91895b31a615bb9af4cfae96aae97d91cad91
Add Intercept transformer.
dftransformers.py
dftransformers.py
import numpy as np import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin class ColumnSelector(BaseEstimator, TransformerMixin): """Transformer that selects a column in a numpy array or DataFrame by index or name. """ def __init__(self, idxs=None, name=None): self.idxs = ...
Python
0
@@ -1228,8 +1228,363 @@ ack(Xs)%0A +%0A%0Aclass Intercept(TransformerMixin):%0A%0A def fit(self, *args, **kwargs):%0A return self%0A%0A def transform(self, X, *args, **kwargs):%0A if isinstance(X, pd.DataFrame) or isinstance(X, pd.Series):%0A return pd.Series(np.ones(X.shape%5B0%5D),%0A ...
c6268ebae09758aa2706babc254d38860db28bed
Fix permission check
api/views.py
api/views.py
#!/usr/bin/env python2 # # Copyright 2016 Red Hat, Inc. # # Authors: # Fam Zheng <famz@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. from django.shortcuts import render from django.views.generic import View from django.contrib.aut...
Python
0
@@ -1802,28 +1802,8 @@ if -grp.is_superuser or grp.
7ffae06efc649ce96807b0793c5d874ced0c64fc
Fix volume filter
src/nodeconductor_openstack/openstack/filters.py
src/nodeconductor_openstack/openstack/filters.py
import django_filters from nodeconductor.core import filters as core_filters from nodeconductor.core.filters import UUIDFilter from nodeconductor.structure import filters as structure_filters from . import models class OpenStackServiceProjectLinkFilter(structure_filters.BaseServiceProjectLinkFilter): service = ...
Python
0
@@ -5882,33 +5882,32 @@ r(name='instance -s __uuid')%0A ins @@ -5990,17 +5990,16 @@ instance -s __uuid')
4a67891a1b8a96fcc666e12b2d4c27e3598d20a2
add support email
product_price_factor_online/__openerp__.py
product_price_factor_online/__openerp__.py
# -*- coding: utf-8 -*- { 'name': "Product price factor for web shop", 'summary': """Multiplies price depending on product attributes""", 'category': 'Website', 'license': 'GPL-3', 'author': "IT-Projects LLC, Ildar Nasyrov", 'price': 20.00, 'currency': 'EUR', 'images': ['images/1.png'], ...
Python
0
@@ -309,24 +309,64 @@ es/1.png'%5D,%0A + %22support%22: %22apps@it-projects.info%22,%0A 'website
6853fd1e45370a9db650b0983e9835c14ea9209e
Add diagnostics endpoint
gutenberg_http/views.py
gutenberg_http/views.py
from sanic.exceptions import RequestTimeout from sanic.request import Request from sanic.response import json from gutenberg_http import app from gutenberg_http.errors import InvalidUsage from gutenberg_http.logic import body as _body from gutenberg_http.logic import metadata as _metadata from gutenberg_http.logic imp...
Python
0.000002
@@ -1663,8 +1663,336 @@ , 500))%0A +%0A%0A# noinspection PyUnusedLocal,PyProtectedMember%0A@app.route('/healthcheck')%0Adef healthcheck(request: Request):%0A return json(%7B%0A 'caches': %7B%0A 'metadata': _metadata.cache_info()._asdict(),%0A 'body': _body.cache_info()._asdict(),%0A ...
c33ffffb0f85e7db96f9856640ad0efdd9dc145f
Wrap all exceptions in JSON
gutenberg_http/views.py
gutenberg_http/views.py
from sanic.exceptions import RequestTimeout from sanic.request import Request from sanic.response import json from gutenberg_http import app from gutenberg_http.errors import InvalidUsage from gutenberg_http.logic import body as _body from gutenberg_http.logic import metadata as _metadata from gutenberg_http.logic imp...
Python
0.999992
@@ -1386,28 +1386,285 @@ ror, exception.status_code)%0A +%0A%0A# noinspection PyUnusedLocal%0A@app.exception(Exception)%0Adef on_exception(request: Request, exception: Exception):%0A error = %7B'error': exception.__class__.__name__, 'message': str(exception)%7D%0A return json(error, getattr(exception, 'status_co...
39f0e8ed68bea6318bcb58801b5368428582f549
remove SF checks from user api endpoint
api/views.py
api/views.py
from django.core.management import call_command from django.utils.six import StringIO from rest_framework import viewsets from salesforce.models import Adopter from salesforce.functions import check_if_faculty_pending from social.apps.django_app.default.models import \ DjangoStorage as SocialAuthStorage from wagtai...
Python
0
@@ -816,531 +816,8 @@ er%0A%0A - try:%0A social_auth = SocialAuthStorage.user.get_social_auth_for_user(user)%0A user.accounts_id = social_auth%5B0%5D.uid%0A except:%0A user.accounts_id = None%0A%0A try:%0A out = StringIO()%0A call_command('upd...
d994337007eb9cfe41edef591cbd30765660a822
Prepare for next development iteration
yarn_api_client/__init__.py
yarn_api_client/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.3.7' __all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager'] from .application_master import ApplicationMaster from .history_server import HistoryServer from .node_manager import NodeManager from .resource_manager import ResourceManager
Python
0
@@ -40,9 +40,13 @@ 0.3. -7 +8.dev '%0A__
18e3746969f9a2a4c10553cd7c59793fafd955aa
uniform multi-website public users handling
addons/website_sale/models/res_partner.py
addons/website_sale/models/res_partner.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.http import request class ResPartner(models.Model): _inherit = 'res.partner' last_website_so_id = fields.Many2one('sale.order', compute='_compute_last_website_so_...
Python
0.999999
@@ -483,16 +483,149 @@ n self:%0A + is_public = any(%5Bu._is_public()%0A for u in partner.with_context(active_test=False).user_ids%5D)%0A @@ -679,24 +679,16 @@ and not -any(%5Bu._ is_publi @@ -692,38 +692,8 @@ blic -() for u in partner.user_ids%5D) :%0A
12a287181164faf65605d1d74de5a9cdf6a2f5d4
Remove unused code
ynr/apps/people/managers.py
ynr/apps/people/managers.py
from os.path import join from django.core.files.storage import DefaultStorage from django.db import models from django.db import connection from candidates.models import PersonRedirect from ynr_refactoring.settings import PersonIdentifierFields class PersonImageManager(models.Manager): def create_from_file(self...
Python
0.000006
@@ -3731,426 +3731,8 @@ %22)%0A%0A - def joins_for_csv_output(self):%0A from popolo.models import Membership%0A%0A return self.prefetch_related(%0A models.Prefetch(%0A %22memberships%22,%0A Membership.objects.select_related(%0A %22ballot%22, ...
e3ff630917d6bb0f744330abace7c41d2b48ba8f
Add "pip_install" task
fabfile.py
fabfile.py
from fabric.api import env, task, local, cd, run, sudo, put from tempfile import NamedTemporaryFile env.use_ssh_config = True env.hosts = ['skylines@skylines'] APP_DIR = '/home/skylines' SRC_DIR = '%s/src' % APP_DIR @task def deploy(branch='master', force=False): push(branch, force) restart() @task def p...
Python
0.000011
@@ -1955,24 +1955,137 @@ APP_DIR)%0A%0A%0A +@task%0Adef pip_install():%0A with cd(SRC_DIR):%0A run('git reset --hard')%0A run('pip install -e .')%0A%0A%0A @task%0Adef cl
2d6e3beb7ea4fb5448cba6a123feb73fe25da2a1
add kobocat deployment details
fabfile.py
fabfile.py
import os import sys from fabric.api import env, run, cd DEFAULTS = { 'home': '/home/wsgi/srv/', 'repo_name': 'formhub', } DEPLOYMENTS = { 'dev': { 'home': '/home/ubuntu/src/', 'host_string': 'ubuntu@dev.ona.io', 'project': 'ona', 'key_filename': os.path.expanduser('~...
Python
0
@@ -125,22 +125,18 @@ rmhub',%0A - %7D%0A + %0ADEPLOYM @@ -371,32 +371,78 @@ virtualenvs/ona' +,%0A 'celeryd': '/etc/init.d/celeryd-ona' %0A %7D,%0A 'pro @@ -661,24 +661,418 @@ ualenvs/ona' +,%0A 'celeryd': '/etc/init.d/celeryd-ona'%0A %7D,%0A 'kobocat': %7B%0A 'home': '/home/...
6bb647771150fb006ecde0ba1d4d237ae37e0f25
fix db perms
fabfile.py
fabfile.py
"""Fabric scripts. Require mkvirtualenv to be installed on all machines and to be run in, and WORKON_HOME defined in .bash_profile. """ from __future__ import with_statement import os from fabric.api import * env.project = "h1ds" env.git_url = "git@code.h1svr.anu.edu.au:h1ds/h1ds.git" env.moin_git_url = "git@code...
Python
0.000001
@@ -3301,16 +3301,75 @@ ere....%0A + sudo('chmod -R ugo+rwX %25(venv_dir)s/%25(venv)s/db' %25env)%0A if e @@ -3704,58 +3704,8 @@ v)%0A%0A - sudo('chmod -R 666 %25(venv_dir)s/%25(venv)s/db')%0A
6fae23c1d442880256ed2d4298844a50d6a7968e
Make sure "fab publish" cleans the dist folder
fabfile.py
fabfile.py
import fabric.api as fab def generate_type_hierarchy(): """ Generate a document containing the available variable types. """ fab.local('./env/bin/python -m puresnmp.types > docs/typetree.rst') @fab.task def doc(): generate_type_hierarchy() fab.local('sphinx-apidoc ' '-o docs/de...
Python
0
@@ -510,24 +510,53 @@ publish():%0A + fab.local('rm -rf dist')%0A fab.loca
24c7c61b06ef8f1396d167bc0621d58d7a233fde
Generate local webserver using SimpleHTTPServer
fabfile.py
fabfile.py
from fabric.api import local import urllib def clean(): local('rm -rf output') def update_cv(): """Get current version of my CV.""" pdf_remote = "https://github.com/dplarson/CV/raw/master/David_Larson.pdf" pdf_local = "output/David_Larson.pdf" try: urllib.urlretrieve(pdf_remote, pdf_loca...
Python
0.999891
@@ -401,24 +401,52 @@ %0Adef gen():%0A + %22%22%22Generate website.%22%22%22%0A clean()%0A @@ -515,15 +515,161 @@ def -push(): +serve():%0A %22%22%22Server website locally.%22%22%22%0A gen()%0A local('cd output && python -m SimpleHTTPServer')%0A%0A%0Adef push():%0A %22%22%22Push website to server...
d94af25800a1e0b6d918659ef08d90f596c5a608
change uwsgi worker reload option to graceful reload
fabfile.py
fabfile.py
# -*- coding: utf-8 -*- import os from fabric.api import local, run, cd, prefix, env, sudo, settings, shell_env from deploy import server env.host_string = '{user}@{host}:{port}'.format( user=env.pycon_user, host=env.pycon_host, ...
Python
0
@@ -1463,24 +1463,28 @@ ='pyconkr')%0A + # worker @@ -1503,54 +1503,31 @@ -if target == 'dev':%0A sudo('restart +run('echo r %3E /var/run/ pyco @@ -1538,17 +1538,16 @@ 2016 -/uwsgi-%25s +-%25s.fifo ' %25 @@ -1557,69 +1557,8 @@ get) -%0A else:%0A sudo('restart pyconkr-2...
3a74328230d7e11357872cf604c9de0fa6a9553b
upgrade modules if necessary
fabfile.py
fabfile.py
import os from datetime import datetime from fabric.api import * from fabric.contrib import * from fabric.contrib.files import exists from fabric import utils _private_pypi = os.getenv('PRIVATE_PYPI') PIP_OPTIONS = '-i %s' % _private_pypi if _private_pypi else '' """ Environments """ ENVIRONMENTS = ('dev', 'stagin...
Python
0.000001
@@ -3303,16 +3303,26 @@ install +--upgrade -r %25s %25s
fcdb3de7465467e4ea4a50faec1c39ec9a26e15c
set main function
async_crawler.py
async_crawler.py
#!/usr/bin/env python # python 3.5 async web crawler. # https://github.com/mehmetkose/python3.5-async-crawler # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2016 Mehmet Kose mehmet@linux.com import aiohttp import asyncio from urllib.parse import urljoin, urldefrag...
Python
0.000019
@@ -362,14 +362,10 @@ urls +, -= %5B%5D%0A url_ @@ -375,45 +375,20 @@ = %5B -root_url, %22%25s/robots.txt%22 %25 ( +%5D, %5B root_url ), %22 @@ -383,17 +383,16 @@ root_url -) , %22%25s/si @@ -810,116 +810,25 @@ s%5D%0A%0A -if __name__ == '__main__':%0A loop = asyncio.get_event_loop()%0A client = aioht...
d9c29036de29b1563efa8ca9ce75992393b236ad
fix import error
asyncio_hn/hn.py
asyncio_hn/hn.py
#!/usr/bin/env python3.6 import asyncio import logging import aiohttp import tqdm from aiohttp import HttpProcessingError URL_GET_POST = "https://hacker-news.firebaseio.com/v0/item/{}.json" URL_GET_USER = "https://hacker-news.firebaseio.com/v0/user/{}.json" URL_MAX_ITEM = 'https://hacker-news.firebaseio.com/v0/maxite...
Python
0.000001
@@ -88,16 +88,32 @@ aiohttp +.http_exceptions import
949cf53e380a51042de1885215b94a0d32628dc6
Merge of r7486, a lxml version check, for thatch
trac/tests/functional/better_twill.py
trac/tests/functional/better_twill.py
#!/usr/bin/python """better_twill is a small wrapper around twill to set some sane defaults and monkey-patch some better versions of some of twill's methods. It also handles twill's absense. """ import os from os.path import abspath, dirname, join import sys try: from cStringIO import StringIO except ImportError: ...
Python
0
@@ -253,16 +253,62 @@ ort sys%0A +from pkg_resources import parse_version as pv%0A try:%0A @@ -1757,27 +1757,296 @@ alled)%22%0A -els + etree = None%0A%0A if etree and pv(etree.__version__) %3C pv('2.0.0'):%0A # 2.0.7 and 2.1.x are known to work.%0A print %22SKIP: validation of XHTML outpu...
5c3213ffa866ab07d597b1f4abd747228d4ea0e9
Update report.py
frappe/core/doctype/report/report.py
frappe/core/doctype/report/report.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json from frappe import _ import frappe.desk.query_report from frappe.utils import cint from frappe.model.document import Document from frappe.modules.export_...
Python
0.000001
@@ -1462,16 +1462,33 @@ (self):%0A +%09%09if self.json:%0A%09 %09%09data = @@ -1510,16 +1510,17 @@ f.json)%0A +%09 %09%09data%5B%22 @@ -1556,16 +1556,17 @@ tal_row%0A +%09 %09%09self.j
604d610d7d7e5d883c643daeba09f5b65db943ce
Make aws template use non-interactive apt-get (#1098)
parsl/providers/aws/template.py
parsl/providers/aws/template.py
template_string = """#!/bin/bash #sed -i 's/us-east-2\.ec2\.//g' /etc/apt/sources.list cd ~ apt-get update -y apt-get install -y python3 python3-pip libffi-dev g++ libssl-dev pip3 install numpy scipy parsl $worker_init $user_script # Shutdown the instance as soon as the worker scripts exits # or times out to avoid EC...
Python
0
@@ -85,16 +85,54 @@ st%0Acd ~%0A +export DEBIAN_FRONTEND=noninteractive%0A apt-get
406987b860987894e297d5172a2a3eb0f4e082f8
Fix a bug in the data resizer.
core/data/DataResizer.py
core/data/DataResizer.py
""" DataResizer :Authors: Berend Klein Haneveld """ from vtk import vtkImageResample from vtk import vtkVersion VTK_MAJOR_VERSION = vtkVersion.GetVTKMajorVersion() class DataResizer(object): """ DataResizer is a tool that will resize a given image dataset. You can specify a certain magnification factor or you c...
Python
0
@@ -1181,16 +1181,184 @@ = 1.0%0A%0A +%09%09# The factor is now only in amount of pixels. This has to be translated%0A%09%09# to each of the dimensions: factor%5E(1/3)%0A%09%09axisMagnificationFactor = pow(factor, 1.0/3.0)%0A%0A %09%09self.r @@ -1456,17 +1456,34 @@ ctor(0, -f +axisMagnificationF actor)%0A%09 @@ -...