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
b628eb4f737b7cb3c3becb17a6545ad400aab1a0
Simplify the NOPASS test for PUBDEV-2981
h2o-py/dynamic_tests/testdir_algos/kmeans/pyunit_NOPASS_PUBDEV_2981_kmeans_hanging.py
h2o-py/dynamic_tests/testdir_algos/kmeans/pyunit_NOPASS_PUBDEV_2981_kmeans_hanging.py
from __future__ import print_function import sys from builtins import range sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.kmeans import H2OKMeansEstimator class Test_PUBDEV_2981_kmeans: """ PUBDEV-2981: Sometimes algos just hangs and seem to be doing nothing....
Python
0.000095
@@ -1755,24 +1755,9 @@ 0.00 -5857068399999999 +1 %7D%0A @@ -1927,692 +1927,23 @@ -bad_params_list = %7B'seed': 1464837574, 'max_iterations': 10, 'k': 10, 'init': 'Furthest'%7D%0A bad_model_params= %7B'max_runtime_secs': 0.00519726792%7D%0A bad_model = H2OKMeansEstimator(**bad_params_list)%0A ...
b4fdb95ef8a88cfd2d283698ac005ce8d9ec3468
Create fetch-wms-urls.py
scripts/fetch-wms-urls.py
scripts/fetch-wms-urls.py
Python
0.000002
@@ -0,0 +1,335 @@ +#!/usr/bin/python%0A%0A%0Aimport requests%0Aimport json%0A%0Aurl = %22http://129.24.196.43/apps/my_app/search/datasets.json?version=3&model_run_uuid=20f303cd-624d-413d-b485-6113319003d4&model_set=outputs&model_set_type=vis%22%0A%0Ar = requests.get(url)%0Adata = json.loads(r.text)%0Afor i in data%5B%2...
6d4efa0bd1199bbe900a8913b829ca7201dde6ab
Add migration to add new Juniper SASS vars to sites
openedx/core/djangoapps/appsembler/sites/migrations/0003_add_juniper_new_sass_vars.py
openedx/core/djangoapps/appsembler/sites/migrations/0003_add_juniper_new_sass_vars.py
Python
0
@@ -0,0 +1,1843 @@ +# -*- coding: utf-8 -*-%0A%0A%0Aimport json%0Afrom django.db import migrations, models%0A%0A%0Adef add_juniper_new_sass_vars(apps, schema_editor):%0A %22%22%22%0A This migration adds all the new SASS variabled added during the initial%0A pass of the Tahoe Juniper release upgrade.%0A %22%...
46351669c279764e1b070943366d7c0ea84a243a
Build pipeline directly in build/action_maketokenizer.py. Review URL: http://codereview.chromium.org/67086
webkit/build/action_maketokenizer.py
webkit/build/action_maketokenizer.py
#!/usr/bin/python # Copyright (c) 2009 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. # usage: action_maketokenizer.py OUTPUTS -- INPUTS # # Multiple INPUTS may be listed. The sections are separated by -- arguments. # #...
Python
0.000001
@@ -1503,271 +1503,204 @@ # -Build up the command.%0A command = 'flex -t %25s %7C perl %25s %3E %25s' %25 (flex_input, maketokenizer, output)%0A%0A # Do it. check_call is new in 2.5, so simulate its behavior with call and%0A # assert.%0A # TODO(mark): Don't use shell=True, build up the pipeline directly. +Do i...
163c214f8d714e3f1dc08324f9d48a34f813d9fe
Add agency creation script.
regscrape/regscrape_lib/commands/create_agencies.py
regscrape/regscrape_lib/commands/create_agencies.py
Python
0
@@ -0,0 +1,1165 @@ +def run():%0A from regscrape_lib.util import get_db%0A from regscrape_lib.search import get_agencies%0A from pymongo.errors import DuplicateKeyError%0A %0A db = get_db()%0A new = 0%0A %0A print 'Fetching agencies...'%0A agencies = get_agencies()%0A%0A print 'Saving agen...
392125f2b3fae38b4f4d32877ad2abaa60ea6ffd
Add pony/orm/examples/demo.py
pony/orm/examples/demo.py
pony/orm/examples/demo.py
Python
0
@@ -0,0 +1,2358 @@ +from decimal import Decimal%0Afrom pony.orm import *%0A%0Adb = Database(%22sqlite%22, %22demo.sqlite%22, create_db=True)%0A%0Aclass Customer(db.Entity):%0A id = PrimaryKey(int, auto=True)%0A name = Required(unicode)%0A email = Required(unicode, unique=True)%0A orders = Set(%22Order%22)%0...
d5ed0cf979fa393d45e2f719d3096618e0f723aa
Add utils.py file for util functions
utils.py
utils.py
Python
0.000001
@@ -0,0 +1,621 @@ +%22%22%22Utilities.%22%22%22%0A%0Aimport logging%0A%0Adef configure_logging(to_stderr=True, to_file=True, file_name='main.log'):%0A %22%22%22Configure logging destinations.%22%22%22%0A root_logger = logging.getLogger()%0A root_logger.setLevel(logging.INFO)%0A%0A format_str = '%25(asctime)s - %25(...
f2b97f029e61bd70b9f4ef5d79c875132907e45e
add missing file.
gunicorn/monkey.py
gunicorn/monkey.py
Python
0.000001
@@ -0,0 +1,1937 @@ +# -*- coding: utf-8 -%0A#%0A# This file is part of gunicorn released under the MIT license.%0A# See the NOTICE for more information.%0A%0Adef patch_django():%0A %22%22%22 monkey patch django.%0A%0A This patch make sure that we use real threads to get the ident which%0A is going to happen if...
b0f8c27325c9b4cbc5cd5bc83ece6f3d7569f7da
Add gzip stream
gzipinputstream.py
gzipinputstream.py
Python
0
@@ -0,0 +1,2836 @@ +import zlib%0Aimport string%0A%0ABLOCK_SIZE = 16384%0A%22%22%22Read block size%22%22%22%0A%0AWINDOW_BUFFER_SIZE = 16 + zlib.MAX_WBITS%0A%22%22%22zlib window buffer size, set to gzip's format%22%22%22%0A%0A%0Aclass GzipInputStream(object):%0A %22%22%22%0A Simple class that allow streaming reads...
95e5b80117b090ae0458df18e062bad50b0c0b5a
add module init file
io_exporter_zombye/__init__.py
io_exporter_zombye/__init__.py
Python
0.000001
@@ -0,0 +1,1432 @@ +# The MIT License (MIT)%0A#%0A# Copyright (c) 2015 Georg Sch%C3%A4fer%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without restriction, including without ...
19df1ece66f815d0aaaae5e7273117b2da9541ac
Create mpu9250_i2c_modi.py
mpu9250_i2c_modi.py
mpu9250_i2c_modi.py
Python
0
@@ -0,0 +1,1378 @@ +import smbus%0Aimport time,timeit%0A#import RPi.GPIO as GPIO%0A%0A# Global varible%0Ai2c = smbus.SMBus(1)%0Aaddr = 0x68%0A%0Ac_t0 = time.clock()%0At_t0 = time.time()%0A%0Atry:%0A%09device_id = i2c.read_byte_data(addr,0x75)%0A%09print %22Device ID:%22 + str(hex(device_id))%0A%09print %22MPU9250 I2C C...
7acd91331d97a9a4c2190c7d6c8844bd4b7ccfe3
add cache to diagnostics/__init__.py
dask/diagnostics/__init__.py
dask/diagnostics/__init__.py
from .profile import Profiler from .progress import ProgressBar
Python
0.000013
@@ -57,8 +57,33 @@ ressBar%0A +from .cache import Cache%0A
63318185d5477fbf99e570e5ccaba303ebe26493
add testcases
jsmapper/tests/test_mapping.py
jsmapper/tests/test_mapping.py
Python
0.000013
@@ -0,0 +1,890 @@ +# -*- coding: utf-8 -*-%0A%0Afrom nose.tools import (%0A eq_,%0A ok_,%0A)%0A%0Afrom ..mapping import (%0A Mapping,%0A MappingProperty,%0A object_property,%0A)%0Afrom ..schema import JSONSchema%0Afrom ..types import (%0A Integer,%0A String,%0A)%0A%0A%0Adef test_object_property():%...
dab55518bacc70c2f44ca11787c346b821343316
Update cifar10 example
examples/cifar10_cnn.py
examples/cifar10_cnn.py
from __future__ import absolute_import from __future__ import print_function from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolutio...
Python
0
@@ -2587,18 +2587,24 @@ b_epoch= -10 +nb_epoch )%0A sc @@ -4066,16 +4066,25 @@ el.train +_on_batch (X_batch @@ -4366,16 +4366,25 @@ del.test +_on_batch (X_batch
190df1378844c6294c6f48ad6cb0272f2146fc48
Add example of force https
examples/force_https.py
examples/force_https.py
Python
0.000357
@@ -0,0 +1,355 @@ +%22%22%22An example of using a middleware to require HTTPS connections.%0A requires https://github.com/falconry/falcon-require-https to be installed via%0A pip install falcon-require-https%0A%22%22%22%0Aimport hug%0Afrom falcon_require_https import RequireHTTPS%0A%0Ahug.API(__name__).http.add_m...
c7e8f255d5ad85dc03f5f302f49295d491ac11a1
Create app.py
app.py
app.py
Python
0.000003
@@ -0,0 +1,2639 @@ +#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0Afrom future.standard_library import install_aliases%0Ainstall_aliases()%0A%0Afrom urllib.parse import urlparse, urlencode%0Afrom urllib.request import urlopen, Request%0Afrom urllib.error import HTTPError%0A%0Aimport json%0Aimport os...
2b74fccbed0a63a503d59ac46fe90d0916abe39c
Add sublime script
bdo.py
bdo.py
Python
0.000008
@@ -0,0 +1,613 @@ +import sublime, sublime_plugin, subprocess, threading, time%0A%0Aclass Bdo(sublime_plugin.TextCommand):%0A def run(self, cmd):%0A sublime.active_window().show_input_panel(%22bdo %22, %22update%22, self.execute, None, None)%0A def execute(self, cmd):%0A output = subprocess.Popen(%0...
876365a7f19a3786db15dc7debbd2686fa5d02ef
Add WmataError class and start of Wmata class.
wmata.py
wmata.py
Python
0
@@ -0,0 +1,376 @@ +import datetime%0Aimport urllib%0Aimport json%0A%0Aclass WmataError(Exception):%0A pass%0A%0Aclass Wmata(object):%0A%0A base_url = 'http://api.wmata.com/%25(svc)s.svc/json/%25(endpoint)s'%0A # By default, we'll use the WMATA demonstration key%0A api_key = 'kfgpmgvfgacx98de9q3xazww' %0A%0A...
473516ce881711ee515606a02d3199e195d0c167
allow reports that extend basictabular to specify whether to run couchdb queries with stale='update_after'
corehq/apps/reports/basic.py
corehq/apps/reports/basic.py
from corehq.apps.reports.datatables import (DataTablesHeader, DataTablesColumn, DTSortType) from corehq.apps.reports.generic import GenericTabularReport from couchdbkit_aggregate import KeyView, AggregateView from dimagi.utils.couch.database import get_db __all__ = ['Column', 'BasicTabularReport'] class Column(ob...
Python
0
@@ -2839,16 +2839,41 @@ ollector +%0A update_after = False %0A%0A @p @@ -3206,32 +3206,104 @@ def rows(self):%0A + kwargs = %7B'stale': 'update_after'%7D if self.update_after else %7B%7D%0A startkey @@ -3351,19 +3351,24 @@ kwargs - = +.update( %7B%0A @@ -3522,16 +3522,17 @@ %...
2a3f45c9a3b3b4f513b113e68b160e0780b78cb8
Revert "build: get rid of the sparse expand stuff"
tools/releasetools/build_image.py
tools/releasetools/build_image.py
#!/usr/bin/env python # # Copyright (C) 2011 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
Python
0
@@ -1648,17 +1648,16 @@ )%0A -# run_fsck
6cf1dbcdf1ffa57136d9476eb43d2b858c4ad6ea
use 'settings' for system libpng.
third_party/libpng/libpng.gyp
third_party/libpng/libpng.gyp
# Copyright (c) 2009 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. { 'includes': [ '../../build/common.gypi', ], 'variables': { 'use_system_libpng%': 0, }, 'conditions': [ ['use_system_libpng==0', {...
Python
0.000029
@@ -1711,34 +1711,32 @@ 'type': ' -%3C(library) +settings ',%0A
43a59b0d883e84005f9b8687ac3aa4ed449f9b78
Fix Padatious to load intents and entities Doesn't make sense to add intents since no sample lines are provided
mycroft/skills/padatious_service.py
mycroft/skills/padatious_service.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
Python
0
@@ -3326,18 +3326,19 @@ ntainer. +lo a -d d_intent @@ -3444,18 +3444,19 @@ ntainer. +lo a -d d_entity
6f3847fb1408064250c6e3ce128bc85868c15467
Update Windows Clang version to r201604
tools/clang/scripts/update.py
tools/clang/scripts/update.py
#!/usr/bin/env python # Copyright (c) 2012 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. """Windows can't run .sh files, so this is a Python implementation of update.sh. This script should replace update.sh on all platfo...
Python
0
@@ -667,11 +667,11 @@ '201 -116 +604 '%0A%0A#
e7180497f2cb59414d06b944ccea5ceffd3c8e51
fix build on windows
tools/grit/grit/tool/build.py
tools/grit/grit/tool/build.py
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''The 'grit build' tool along with integration for this tool with the SCons build system. ''' import os import getopt import ...
Python
0.000001
@@ -5770,16 +5770,33 @@ .close() +%0A continue %0A%0A
a4ab01d64c505b786e6fef217829fb56c3d6b6ce
Add management script to generate hansard appearance scores.
mzalendo/scorecards/management/commands/scorecard_update_person_hansard_appearances.py
mzalendo/scorecards/management/commands/scorecard_update_person_hansard_appearances.py
Python
0
@@ -0,0 +1,1819 @@ +import datetime%0A%0Afrom django.core.management.base import NoArgsCommand%0Afrom django.core.exceptions import ImproperlyConfigured%0A%0Aclass Command(NoArgsCommand):%0A help = 'Create/update hansard scorecard entry for all mps'%0A args = ''%0A%0A def handle_noargs(self, **options):%0A ...
4a404709081515fa0cc91683b5a9ad8f6a68eae6
Add a migration to drop mandatory assessment methods from brief data
migrations/versions/630_remove_mandatory_assessment_methods_.py
migrations/versions/630_remove_mandatory_assessment_methods_.py
Python
0
@@ -0,0 +1,1777 @@ +%22%22%22Remove mandatory assessment methods from briefs%0A%0ARevision ID: 630%0ARevises: 620%0ACreate Date: 2016-06-03 15:26:53.890401%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '630'%0Adown_revision = '620'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom...
def036cfb47f1ae9e0efaa5ff238a3b159ab9405
Create Quotation from Service Order Template
netforce_service/netforce_service/models/service_create_quot.py
netforce_service/netforce_service/models/service_create_quot.py
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
Python
0
@@ -1784,24 +1784,50 @@ template_id%0A + line_sequence = 1%0A for @@ -1899,32 +1899,75 @@ line_vals = %7B%0A + %22sequence%22: line_sequence,%0A @@ -2225,16 +2225,55 @@ e None,%0A + %22amount%22: line.amount,%0A @@ -2334,16 +2334,47 @@ _va...
d44fc89f27be0e618d02202b5d067466079be16d
add tool to download and extract latest firmware
download-mcuimg.py
download-mcuimg.py
Python
0
@@ -0,0 +1,876 @@ +#! /usr/bin/env python3%0A%0Aimport urllib.request%0Afrom pprint import pprint%0Aimport zipfile%0Aimport json%0A%0Aprint('Downloading release info..')%0Arelease_info = json.loads(urllib.request.urlopen('https://api.github.com/repos/wipy/wipy/releases/latest').read().decode('utf-8'))%0Awith open('mcui...
d430411fae7c20ff72e60fd63e7854de64da7e71
Update ceph_help.py
tendrl/node_agent/flows/import_cluster/ceph_help.py
tendrl/node_agent/flows/import_cluster/ceph_help.py
import subprocess from tendrl.commons.event import Event from tendrl.commons.message import Message from tendrl.commons.utils import ansible_module_runner import yaml def import_ceph(integration_id, request_id, flow_id): attributes = {} if tendrl_ns.config.data['package_source_type'] == 'pip': name =...
Python
0.000001
@@ -370,16 +370,18 @@ git@v1.2 +.1 %22%0A
50845b24028f4aef96370abae41c7833fda8846c
modify report name to identify execution context
tensorflow/python/data/benchmarks/benchmark_base.py
tensorflow/python/data/benchmarks/benchmark_base.py
# Copyright 2019 The TensorFlow Authors. 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 applica...
Python
0.000001
@@ -4435,24 +4435,143 @@ imizations)%0A + if context.executing_eagerly():%0A name = %22%7B%7D_eager%22.format(name)%0A else:%0A name = %22%7B%7D_graph%22.format(name) %0A if extr
373bdc41b35f75a15430eb2f9a03a8ab38d401e8
Test for upcast with parent unbound method.
tests/basics/subclass_native6.py
tests/basics/subclass_native6.py
Python
0
@@ -0,0 +1,183 @@ +# Calling native base class unbound method with subclass instance.%0A%0Aclass mylist(list):%0A pass%0A%0A%0Al = mylist((1, 2, 3))%0Aassert type(l) is mylist%0Aprint(l)%0A%0Alist.append(l, 4)%0Aprint(l)%0A
9d3dd8f1921165bc0c28b94257a2266202b326bb
Return alliance info from key_info and characters
evelink/account.py
evelink/account.py
from evelink import api from evelink import constants class Account(object): """Wrapper around /account/ of the EVE API. Note that a valid API key is required. """ def __init__(self, api): self.api = api @api.auto_call('account/AccountStatus') def status(self, api_result=None): ...
Python
0
@@ -1591,32 +1591,246 @@ ,%0A %7D%0A + if row.attrib%5B'allianceID'%5D:%0A character%5B'alliance'%5D = %7B%0A 'id': int(row.attrib%5B'allianceID'%5D),%0A 'name': row.attrib%5B'allianceName'%5D,%0A %7D%0A resu @@ -250...
9ffa7abeccbce24b037a644612681fd397e9d13a
add dict example
trypython/basic/dict_preserved_insert_order_py37.py
trypython/basic/dict_preserved_insert_order_py37.py
Python
0
@@ -0,0 +1,995 @@ +%22%22%22%0APython 3.7 %E3%81%A7 %E8%BE%9E%E6%9B%B8%E3%81%AE%E6%8C%BF%E5%85%A5%E9%A0%86%E5%BA%8F%E3%81%8C%E4%BF%9D%E6%8C%81%E3%81%95%E3%82%8C%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB%E3%81%A7%E3%81%99%E3%80%82%0A%0AREFERENCES:: http:/...
f1b91a52b52dfab3b350191ede23731f0a30f4c4
Add pythonrc
python/pythonrc.py
python/pythonrc.py
Python
0.000004
@@ -0,0 +1,601 @@ +#!/usr/bin/env python%0A%0A# Inspired by https://github.com/dag/dotfiles/blob/master/python/.pythonrc%0A%0Aimport os%0Aimport readline%0A%0Areadline.parse_and_bind('tab: complete')%0Ahistory = os.path.expanduser(%22~/.pythonhist%22)%0A%0Aif os.path.exists(history):%0A try:%0A readline.read_...
12ad56d1360d6140093f2871c32593751b8ae052
Add modeset_event.py
py/tests/modeset_event.py
py/tests/modeset_event.py
Python
0
@@ -0,0 +1,1839 @@ +#!/usr/bin/python3%0A%0Aimport pykms%0Aimport selectors%0Aimport sys%0A%0Adef readdrm(fileobj, mask):%0A for ev in card.read_events():%0A ev.data(ev)%0A%0Adef waitevent(sel):%0A events = sel.select(1)%0A if not events:%0A print(%22Error: timeout receiving event%22)%0A else:...
2ab8680c1a5e420de3f6b82db9a994eaeace164f
Add a snippet.
python/unicode/unicode.py
python/unicode/unicode.py
Python
0.000002
@@ -0,0 +1,1034 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2013 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A# DEFINE%0Astr1 = %22Hello!%22%0Aunicode_obj1 = u%22%C2%A1Buenos d%C3%ADas!%22%0Aunicode_obj2 = u%22%E4%BD%A0%E5%A5%BD%EF%BC%81%22%0A%0A# PRINT%0A%0Aprint%0Aprint str1%0Aprin...
f6acf955904765f57ba15837fd6440a524590268
add migrations
ureport/polls/migrations/0024_auto_20160118_0934.py
ureport/polls/migrations/0024_auto_20160118_0934.py
Python
0.000001
@@ -0,0 +1,392 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('polls', '0023_populate_flow_date'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFiel...
5390abc3f53f18515cd9a658d6286ac8a9b09d81
Create parrot_trouble.py
Python/CodingBat/parrot_trouble.py
Python/CodingBat/parrot_trouble.py
Python
0.005895
@@ -0,0 +1,155 @@ +# http://codingbat.com/prob/p166884%0A%0Adef parrot_trouble(talking, hour):%0A if talking and (hour %3C 7 or hour %3E 20):%0A return True%0A else:%0A return False%0A
7c4df6bfa4d8d2370c96ffd9efe0017447629a5d
add dep-free baseclass for typing
graphistry/Plottable.py
graphistry/Plottable.py
Python
0
@@ -0,0 +1,757 @@ +from typing import Iterable, List, Optional, Union%0Afrom typing_extensions import Protocol%0Aimport pandas as pd%0A%0Aclass Plottable(Protocol):%0A @property%0A def _point_title(self) -%3E Optional%5Bstr%5D:%0A return None%0A%0A @property%0A def _point_label(self) -%3E Optional%5B...
14a9296056c4dede324465791052119890f40725
add a TransactionTestCase to cover the flush command
tests/functionals/test_transactiontestcase.py
tests/functionals/test_transactiontestcase.py
Python
0
@@ -0,0 +1,657 @@ +from django.test import TransactionTestCase%0A%0Afrom tests.north_app.models import Author%0Afrom tests.north_app.models import Book%0A%0A%0Aclass BookTestCase(TransactionTestCase):%0A def setUp(self):%0A self.author = Author.objects.create(name=%22George R. R. Martin%22)%0A self.boo...
9b345bba13b572ebdd52c6dca534a7cf95e11335
Add examples
examples/colors.py
examples/colors.py
Python
0
@@ -0,0 +1,1239 @@ +from PIL import Image, ImageDraw%0Afrom time import sleep%0A%0AOFF_TARGET = True%0A%0Aif OFF_TARGET:%0A from matrixtoolkit import Adafruit_RGBmatrix%0Aelse:%0A from rgbmatrix import Adafruit_RGBmatrix%0A%0A%0Aclass drawer():%0A %22%22%22%0A handles controls what is being drawn%0A %22%...
6fdf7cc68e05ce6e8e18306eca7d8e36d1a166ea
Add Client class to abstract from different datbase clients
hotline/db/db_client.py
hotline/db/db_client.py
Python
0
@@ -0,0 +1,697 @@ +import importlib%0Aimport os%0A%0Aclass DBClient:%0A%0A db_defaults = %7B'mongo': 'mongodb://localhost:27017/',%0A 'redis': 'redis://localhost:6379',%0A 'postgresql': 'postgresql://localhost:5432'%0A %7D%0A%0A def __init__(self, url=None, db_...
aac6b16b3c532d74d788cbad942af6a147a06f4b
add broadcast org
migrations/versions/0331_add_broadcast_org.py
migrations/versions/0331_add_broadcast_org.py
Python
0
@@ -0,0 +1,2204 @@ +%22%22%22%0A%0ARevision ID: 0331_add_broadcast_org%0ARevises: 0330_broadcast_invite_email%0ACreate Date: 2020-09-23 10:11:01.094412%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Aimport os%0A%0Arevision = '0331_add_broadcast_org'%0Adown_revision = '0330_broadcast_invite_email'%0...
353edcdcfae15f06b998a4ad1481b3ad99e514bd
Remove easeventuid migration.
migrations/versions/127_remove_easeventuid.py
migrations/versions/127_remove_easeventuid.py
Python
0
@@ -0,0 +1,716 @@ +%22%22%22remove easeventuid%0A%0ARevision ID: 581e91bd7141%0ARevises: 262436681c4%0ACreate Date: 2015-01-10 00:57:50.944460%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '581e91bd7141'%0Adown_revision = '262436681c4'%0A%0Afrom alembic import op%0A%0A%0Adef upgrade():%0A ...
5f7344b8a99880bec7195b951b495970116f0b0d
Initialize P2_blankRowInserter
books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P2_blankRowInserter.py
books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P2_blankRowInserter.py
Python
0.000064
@@ -0,0 +1,255 @@ +# Create a program blankRowInserter.py that takes two integers and a filename%0A# string as command line arguments. Let%E2%80%99s call the first integer N and the second%0A# integer M. Starting at row N, the program should insert M blank rows into the%0A# spreadsheet.%0A
37f5ddd7e8802b5d5213b5cadb905c39abe92dfc
Add test..
tests/adapter/mongo/test_case_group_handling.py
tests/adapter/mongo/test_case_group_handling.py
Python
0
@@ -0,0 +1,724 @@ +import pytest%0Aimport copy%0Aimport pymongo%0Aimport logging%0A%0Alogger = logging.getLogger(__name__)%0A%0A%0Adef test_init_case_group(adapter, institute_obj):%0A # given a database and an institute%0A owner = institute_obj%5B%22_id%22%5D%0A%0A # when attempting to create a case group%0A ...
28ad4d2770921c7d148b00ed0533b9051fb08122
enable utils.get to get any url with or without selector/username/password
utils.py
utils.py
#! /usr/bin/env python import httplib, mimetypes, base64 def encode_multipart_formdata(fields, files): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready ...
Python
0
@@ -1898,16 +1898,19 @@ selector +=%22%22 , userna @@ -1903,32 +1903,37 @@ tor=%22%22, username +=None , password):%0A @@ -1922,27 +1922,53 @@ ne, password -):%0A +=None):%0A if username:%0A base64st @@ -2060,32 +2060,53 @@ onnection(host)%0A + if username:%0A headers = %7B @@ -2150,16...
ecbc691307c43ad06d7f539f008fccbff690d538
Add unit tests for the precomputed_io module
unit_tests/test_precomputed_io.py
unit_tests/test_precomputed_io.py
Python
0
@@ -0,0 +1,2013 @@ +# Copyright (c) 2018 CEA%0A# Author: Yann Leprince %3Cyann.leprince@cea.fr%3E%0A#%0A# This software is made available under the MIT licence, see LICENCE.txt.%0A%0Aimport numpy as np%0Aimport pytest%0A%0Afrom neuroglancer_scripts.accessor import get_accessor_for_url%0Afrom neuroglancer_scripts.chunk_...
2224963d6dc413b2bf18fe585c98f85e41686175
Use the new mailset propper for the python fake service
py-fake-service/app/pixelated_user_agent.py
py-fake-service/app/pixelated_user_agent.py
from flask import Flask, request, Response, redirect import json import datetime import requests from adapter import MailService from search import SearchQuery app = Flask(__name__, static_url_path='', static_folder='../../web-ui/app') client = None converter = None account = None loaded = False mail_service = MailSe...
Python
0
@@ -3055,16 +3055,19 @@ /static/ +py- mediumta
de4f3d3b31b5336cb541c0e6d17f198799c4dc53
Remove unnecessary argument
graphitepager/config.py
graphitepager/config.py
import os import yaml from alerts import Alert def contents_of_file(filename): open_file = open(filename) contents = open_file.read() open_file.close() return contents def get_config(path): return Config(path) class Config(object): def __init__(self, path): alert_yml = contents_o...
Python
0.043649
@@ -834,16 +834,8 @@ self -, config ):%0A
3ce64bd781b59fffe42a59155a6f81f641647653
add package information
source/src/info.py
source/src/info.py
Python
0
@@ -0,0 +1,263 @@ +# -*- coding: utf-8 -*-%0A%0A%22%22%22%0ABase module variables%0A%22%22%22%0A%0A__version__ = '0.2.00'%0A__author__ = 'Joke Durnez'%0A__license__ = 'MIT'%0A__email__ = 'joke.durnez@gmail.com'%0A__status__ = 'Prototype'%0A__url__ = 'https://www.neuropowertools.org'%0A__packagename__ = 'neurodesign'%0A...
117ddac033b0b337ced9589851e74056740cdb3e
patch to create workflow for existing leave applications
erpnext/patches/v10_0/workflow_leave_application.py
erpnext/patches/v10_0/workflow_leave_application.py
Python
0
@@ -0,0 +1,1315 @@ +# Copyright (c) 2017, Frappe and Contributors%0A# License: GNU General Public License v3. See license.txt%0A%0Afrom __future__ import unicode_literals%0Aimport frappe%0A%0Adef execute():%0A%09frappe.reload_doc(%22hr%22, %22doctype%22, %22leave_application%22)%0A%09frappe.reload_doc(%22workflow%22, %...
3aaa64c7ca9721e74fd52d3274a91fdd4c4cb678
add initial test cron
cron.py
cron.py
Python
0
@@ -0,0 +1,1513 @@ +import boto3%0Aimport credstash%0Aimport gspread%0Aimport json%0Afrom oauth2client.service_account import ServiceAccountCredentials%0Afrom oauth2client import file, client, tools%0Afrom models.v1.assets.asset import Asset%0Afrom models.v1.asset_groups.asset_group import AssetGroup%0Afrom models.v1.s...
49b3c91ffdbd04fbce523599320820278bb5d8aa
Add data file.
data.py
data.py
Python
0.000001
@@ -0,0 +1,293 @@ +# Ignore this file%0A%0A%7B'paper_abstract': 'An abstract',%0A 'authors': %5B%7B'first_names': 'XX',%0A 'surname': 'XXX',%0A 'address': 'XXX',%0A 'country': 'XXX',%0A 'email_address': 'xxx@XXX',%0A 'institution': 'XXX'%7D%5D,%0A ...
885ed1e8e3256352d2fde771bef57997809c3c1e
Remove monthly_billing table from the database
migrations/versions/0209_remove_monthly_billing_.py
migrations/versions/0209_remove_monthly_billing_.py
Python
0.000002
@@ -0,0 +1,1728 @@ +%22%22%22%0A%0ARevision ID: 0209_remove_monthly_billing%0ARevises: 84c3b6eb16b3%0ACreate Date: 2018-07-27 14:46:30.109811%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.dialects import postgresql%0A%0Arevision = '0209_remove_monthly_billing'%0Adown_revision = '84...
324f670e747af0b949bc2c9fb503c875b7f20a7b
Initialize 06.sameName3
books/AutomateTheBoringStuffWithPython/Chapter03/06.sameName3.py
books/AutomateTheBoringStuffWithPython/Chapter03/06.sameName3.py
Python
0.999999
@@ -0,0 +1,357 @@ +# This program demonstrates global and local variable rules%0Adef spam():%0A global eggs%0A eggs = 'spam' # this is the global (global statement)%0A%0A%0Adef bacon():%0A eggs = 'bacon' # this is a local (assignment)%0A%0A%0Adef ham():%0A print(eggs) # this is the global (no assignment)...
6987558cefb1179c4501ee5f43e39618f67c49c7
Initialize P02_writeCSV
books/AutomateTheBoringStuffWithPython/Chapter14/P02_writeCSV.py
books/AutomateTheBoringStuffWithPython/Chapter14/P02_writeCSV.py
Python
0.000004
@@ -0,0 +1,381 @@ +# This program uses the csv module to manipulate .csv files%0A%0Aimport csv%0A%0A# Writer Objects%0AoutputFile = open(%22output.csv%22, %22w%22, newline='')%0AoutputWriter = csv.writer(outputFile)%0Aprint(outputWriter.writerow(%5B'spam', 'eggs', 'bacon', 'ham'%5D))%0Aprint(outputWriter.writerow(%5B'H...
b6aacfff8a400f4cc671790a827a778bbbc74635
Update customer alerts to avoid is_available_to_buy
oscar/apps/customer/alerts/utils.py
oscar/apps/customer/alerts/utils.py
import logging from django.core import mail from django.conf import settings from django.template import loader, Context from django.contrib.sites.models import Site from django.db.models import get_model, Max from oscar.apps.customer.notifications import services ProductAlert = get_model('customer', 'ProductAlert')...
Python
0.000004
@@ -259,16 +259,57 @@ services +%0Afrom oscar.core.loading import get_class %0A%0AProduc @@ -398,16 +398,69 @@ roduct') +%0ASelector = get_class('partner.strategy', 'Selector') %0A%0Alogger @@ -767,52 +767,8 @@ ts:%0A - if product.is_available_to_buy:%0A @@ -2514,28 +2514,283 @@ -for alert i...
b8ddb1b64ef2216add5b0b136b09b72d91506767
Add initial msgpack renderer
salt/renderers/msgpack.py
salt/renderers/msgpack.py
Python
0
@@ -0,0 +1,596 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import%0A%0A# Import third party libs%0Aimport msgpack%0A%0A%0Adef render(msgpack_data, saltenv='base', sls='', **kws):%0A '''%0A Accepts JSON as a string or as a file object and runs it through the JSON%0A parser.%0A%0A :rtype: A ...
e665e9cb374fd67baec7ec598bfd352e04192210
add gripper class to pick up pieces with electromagnet
raspberryturk/embedded/motion/gripper.py
raspberryturk/embedded/motion/gripper.py
Python
0
@@ -0,0 +1,1146 @@ +import RPi.GPIO as GPIO%0Afrom time import sleep%0A%0Aelectromagnet_pin = 40%0Aservo_pin = 38%0A%0Aclass Gripper(object):%0A def __init__(self):%0A self.previous_z = None%0A GPIO.setmode(GPIO.BOARD)%0A GPIO.setup(servo_pin, GPIO.OUT)%0A GPIO.setup(electromagnet_pin, GP...
009bf3d7ffc6545cb2d37a36bc327de2bebd283d
Comment admin ought to have a better preview; #444
judge/admin/comments.py
judge/admin/comments.py
from django.forms import ModelForm from django.utils.html import format_html from django.utils.translation import ungettext, ugettext_lazy as _ from reversion.admin import VersionAdmin from judge.models import Comment from judge.widgets import MathJaxAdminPagedownWidget, HeavySelect2Widget class CommentForm(ModelFor...
Python
0
@@ -28,16 +28,53 @@ delForm%0A +from django.urls import reverse_lazy%0A from dja @@ -107,16 +107,16 @@ at_html%0A - from dja @@ -275,23 +275,28 @@ import -MathJax +HeavyPreview AdminPag @@ -288,33 +288,33 @@ PreviewAdminPage -d +D ownWidget, Heavy @@ -558,23 +558,28 @@ if -MathJax +HeavyPreview AdminP...
a65d9a9ba0ab594903c7e811ff5bd7400c7cbedd
add support for cdn region.
dj/scripts/rax_uploader.py
dj/scripts/rax_uploader.py
# rax_uploader.py # rackspace cdn (openhatch) specific code # caled from post_rak.py # that is a lie. it is currently called from post_yt.py. import argparse import os import pyrax pyrax.set_setting("identity_type", "rackspace") from pyrax.exceptions import PyraxException import urllib # The following 2 impo...
Python
0
@@ -1412,16 +1412,36 @@ n pw.py%0A + region = %22DFW%22%0A%0A buck @@ -1698,24 +1698,74 @@ oad(self):%0A%0A + pyrax.set_setting(%22region%22, self.region)%0A%0A cf = @@ -4648,95 +4648,54 @@ e', -default=%0A '/home/carl/Videos/veyepar/test_client/test_show/webm/Lets_make_a_Test.webm' +%0A ...
59837bda53b958c7fdb50a3b2808a42fd667cd96
Create z07-dnn_autoencoder_iris.py
skflow-examples/z07-dnn_autoencoder_iris.py
skflow-examples/z07-dnn_autoencoder_iris.py
Python
0.000016
@@ -0,0 +1,1216 @@ +# Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/lice...
96eba676abeb8c70dcaddb692133a9314e2255c3
Add harvester for pcom
scrapi/harvesters/pcom.py
scrapi/harvesters/pcom.py
Python
0
@@ -0,0 +1,715 @@ +'''%0AHarvester for the DigitalCommons@PCOM for the SHARE project%0A%0AExample API call: http://digitalcommons.pcom.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc%0A'''%0Afrom __future__ import unicode_literals%0A%0Afrom scrapi.base import OAIHarvester%0A%0A%0Aclass PcomHarvester(OAIHarvester):%0...
aefd4009393e5ebf05ea9e485a1723776689ed70
add node and node to container link
tests/acceptance/mapping/node_at.py
tests/acceptance/mapping/node_at.py
Python
0
@@ -0,0 +1,2858 @@ +# Ariane CLI Python 3%0A# Node acceptance tests%0A#%0A# Copyright (C) 2015 echinopsii%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as%0A# published by the Free Software Foundation, either version 3 of the...
84ae279c0044e63e00c7d21823c3159e34c73d03
Add a memory test script
scripts/uvfits_memtest.py
scripts/uvfits_memtest.py
Python
0.000003
@@ -0,0 +1,1586 @@ +#!/usr/bin/env python2.7%0A# -*- mode: python; coding: utf-8 -*-%0A%0Afrom __future__ import print_function, division, absolute_import%0A%0Afrom memory_profiler import profile%0Aimport numpy as np%0Afrom astropy import constants as const%0Afrom astropy.io import fits%0Afrom pyuvdata import UVData%0A...
6bb1d3939a076d7b7fe799cdac8885a5f67219e3
add ex32
ex32.py
ex32.py
Python
0.000637
@@ -0,0 +1,827 @@ +the_count = %5B1, 2, 3, 4, 5%5D%0Afruits = %5B'apples', 'oranges', 'pears', 'apricots'%5D%0Achange = %5B1, 'pennies', 2, 'dimes', 3, 'quarters'%5D%0A%0A# this first kind of for-loop goes through a list for number in the_count%0Afor number in the_count:%0A print %22This is count %25d%22 %25 number%...
46a71071ed4982b02d0e49818a678dc2744c1b23
Bump version number to 1.0
flask/__init__.py
flask/__init__.py
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ __version__ = '1.0-dev' # utilities we import from Werkzeug an...
Python
0.000074
@@ -272,12 +272,8 @@ '1.0 --dev '%0A%0A#
3d2ad56b5d24405eb6f261b32b0347a7e7d8785a
use make_muc_presence
tests/twisted/muc/test-muc-alias.py
tests/twisted/muc/test-muc-alias.py
""" Test that our alias is used to create MUC JIDs. Mash-up of vcard/test-set-alias.py and muc/test-muc.py. """ import dbus from twisted.words.xish import domish from gabbletest import go, make_result_iq, acknowledge_iq, exec_test from servicetest import call_async, lazy, match, EventPattern def test(q, bus, conn, ...
Python
0.000008
@@ -226,16 +226,35 @@ xec_test +, make_muc_presence %0Afrom se @@ -1938,298 +1938,89 @@ -presence = domish.Element((None, 'presence'))%0A presence%5B'from'%5D = 'chat@conf.localhost/bob'%0A x = presence.addElement(('http://jabber.org/protocol/muc#user', 'x'))%0A item = x.addElement('item')%0A item%5...
4c9af992891ac5d39be50f9876a807f131a922e4
prepare the organism annotation details
gfftools/gff_db.py
gfftools/gff_db.py
Python
0.000001
@@ -0,0 +1,2215 @@ +#!/usr/bin/env python%0A%22%22%22%0AFetch the details about the features explained in a GFF type file.%0A%0AUsage: python feature_info.py in.gff%0A%0ARequirements:%0A gfftools : https://github.com/vipints/genomeutils/blob/master/gfftools%0A%22%22%22%0A%0Aimport re%0Aimport sys%0Aimport GFFParser%...
a7787c60af7059f3b1a4dc3773da04dfc72631e2
Add tools.ping
grab/tools/ping.py
grab/tools/ping.py
Python
0.000001
@@ -0,0 +1,1876 @@ +from grab import Grab%0Aimport logging%0Aimport os%0Afrom grab.tools import html%0Afrom grab.tools.pwork import make_work%0Afrom grab.tools.encoding import smart_str%0A%0APING_XML = %22%22%22%3C?xml version=%221.0%22?%3E%0A%3CmethodCall%3E%0A %09%3CmethodName%3EweblogUpdates.ping%3C/methodName%3E%0A...
f31a735ce54f74e7a38edaeb7c404a2dec8e5584
add script
MeowRTC/cloud/stack/python/scripts/sample-p2p.py
MeowRTC/cloud/stack/python/scripts/sample-p2p.py
Python
0.000001
@@ -0,0 +1,1814 @@ +import logging%0Aimport jinja2%0Aimport webapp2%0Aimport os%0Aimport random%0Aimport json%0Afrom google.appengine.api import channel%0A%0Ajinja_environment = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))%0A%0Alogging.getLogger().setLevel(logging.DEBUG)%0A%0Ausers = se...
4c60f8f643fe05b69ca475242d8c46b02697d5d4
Add example for type-checking chain
examples/howto/type_chain.py
examples/howto/type_chain.py
Python
0.000001
@@ -0,0 +1,757 @@ +from thinc.api import chain, ReLu, MaxPool, Softmax, chain%0A%0A# This example should be run with mypy. This is an example of type-level checking %0A# for network validity.%0A#%0A# We first define an invalid network.%0A# It's invalid because MaxPool expects Floats3d as input, while ReLu produces%0A# ...
f6bdab51054b08d203251b0e7e73ed7818613c8d
add models.py file so test runner will recognize the app
eca_catalogue/text/models.py
eca_catalogue/text/models.py
Python
0
@@ -0,0 +1,20 @@ +# Hello test runner%0A
c38a801cdf42788ba6d3ce9d009593ee68c4225f
version bump for 0.25.19.6.
oneflow/__init__.py
oneflow/__init__.py
VERSION = '0.25.19.5'
Python
0
@@ -13,12 +13,12 @@ 0.25.19. -5 +6 '%0A%0A
8851a11d7881dc16cf132e0bf88c94f82b7e5eaa
version bump for 0.25.19.8.
oneflow/__init__.py
oneflow/__init__.py
VERSION = '0.25.19.7'
Python
0
@@ -17,8 +17,8 @@ .19. -7 +8 '%0A%0A
52f5946e7feccd90e0aa2e1f4674a7b51837e69d
version bump for 0.21.7.1.
oneflow/__init__.py
oneflow/__init__.py
VERSION = '0.21.7'
Python
0
@@ -11,11 +11,13 @@ '0.21.7 +.1 '%0A%0A
4ebe44abb3ae91b3b93154d3f82635dd09cbce93
version bump for 0.25.14.8.
oneflow/__init__.py
oneflow/__init__.py
VERSION = '0.25.14.7'
Python
0
@@ -17,8 +17,8 @@ .14. -7 +8 '%0A%0A
ce792a1b167b268ba1f798b3b08e08679d962d02
Create distributeOnSurface.py
af_scripts/tmp/distributeOnSurface.py
af_scripts/tmp/distributeOnSurface.py
Python
0
@@ -0,0 +1,2132 @@ +import random%0Aimport maya.mel%0A%0A%0Aclass distributeOnSurface(object):%0A %0A def __init__(self):%0A pass%0A %0A def _UI(self):%0A if cmds.window('dosWin',exists=True):%0A cmds.deleteUI('dosWin',window=True)%0A w=300%0A w2=180%0A cmds.win...
e484b67372be22dae78a526c21e62661e4602913
Add todo files with incomplete fixes
test/todo.py
test/todo.py
Python
0
@@ -0,0 +1,54 @@ +raise KeyError, key%0A%0Adef foo(a%0A , b):%0A pass%0A
c669d498fa81ffb399d7d7c42654f5ac69428a28
Update templates.py
infra/templates.py
infra/templates.py
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000001
@@ -3213,13 +3213,18 @@ ake -clean +-j$(nproc) all
47f7fa72ab3ba75ad4182592f6413702fd509ba7
Create middleware to redirect users when accessing certain paths
iogt/middleware.py
iogt/middleware.py
Python
0
@@ -0,0 +1,1030 @@ +from django.conf import settings%0Afrom django.http import HttpResponsePermanentRedirect%0A%0A%0Aclass SSLRedirectMiddleware(object):%0A def process_request(self, request):%0A HTTPS_PATHS = getattr(settings, 'HTTPS_PATHS', %5B%5D)%0A response_should_be_secure = self.response_should_...
eeab27ecc6843136938e7607a619baef8626118a
Make contest_ranking visible
judge/views/contests.py
judge/views/contests.py
from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestContext from judge.comments import comment_form, contest_comments from judge.models import Contest __all__ = ['contest_list', 'c...
Python
0.000073
@@ -320,16 +320,35 @@ contest' +, 'contest_ranking' %5D%0A%0A%0Adef
65e4659ccd3f22f817403dc39869626873f9fb34
Add test_runner.py
test/test_runner.py
test/test_runner.py
Python
0.000014
@@ -0,0 +1,404 @@ +from microscopes.lda.definition import model_definition%0Afrom microscopes.lda import model, runner%0Afrom microscopes.common.rng import rng%0A%0A%0Adef test_runner_simple():%0A defn = model_definition(n=10, v=20)%0A r = rng()%0A data = %5B%5B1, 2, 3, 4, 5%5D, %5B2, 3, 4%5D%5D%0A view = d...
2bd52d823c9ae039dd0cc0adbabe7a47f003138e
Add unit tests
examples/ppo/unit_tests.py
examples/ppo/unit_tests.py
Python
0.000001
@@ -0,0 +1,2345 @@ +%0Aimport jax%0Aimport flax%0Afrom flax import nn%0Aimport numpy as onp%0A%0Aimport numpy.testing as onp_testing%0Afrom absl.testing import absltest%0A%0A#test GAE%0Afrom main import gae_advantages%0Aclass TestGAE(absltest.TestCase):%0A def test_gae_random(self):%0A # create random data, simulat...
4c76f9bc68451eb41338173ffbda460098d1e24e
make form reprocessing more error tolerant and verbose
corehq/apps/cleanup/management/commands/reprocess_error_forms.py
corehq/apps/cleanup/management/commands/reprocess_error_forms.py
from django.core.management.base import BaseCommand, CommandError, LabelCommand from corehq.apps.cleanup.xforms import iter_problem_forms, reprocess_form_cases from optparse import make_option from dimagi.utils.parsing import string_to_datetime class Command(BaseCommand): args = '<domain> <since>' help = ('Rep...
Python
0.000004
@@ -1145,16 +1145,90 @@ help))%0A%0A + succeeded = %5B%5D%0A failed = %5B%5D%0A error_messages = set()%0A @@ -1274,16 +1274,16 @@ since):%0A - @@ -1540,16 +1540,41 @@ yrun%22%5D:%0A + try:%0A @@ -1608,9 +1608,466 @@ s(form)%0A + ex...
6f2d36199b20069c9d7d5af3170f33f9147321ac
use deferred of request to allow adding callback from get_media_requests
scrapy/trunk/scrapy/contrib/pipeline/media.py
scrapy/trunk/scrapy/contrib/pipeline/media.py
from twisted.internet import defer from scrapy.utils.misc import mustbe_deferred, defer_result from scrapy.core import log from scrapy.core.engine import scrapyengine from scrapy.core.exceptions import DropItem, NotConfigured from scrapy.http import Request from scrapy.spider import spiders from scrapy.conf import set...
Python
0.000001
@@ -2140,16 +2140,36 @@ wad = + request.deferred or defer.D
b30a159d216113ce122506359ccf1d11767422bb
Handle non-string keys
src/sentry/utils/data_scrubber.py
src/sentry/utils/data_scrubber.py
""" sentry.utils.data_scrubber ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import re import six from sentry.constants import DEFAULT_SCRUBBED_FIELDS def varmap(func, va...
Python
0.025655
@@ -2209,37 +2209,36 @@ not -key: # key can be a NoneType +isinstance(key, basestring): %0A
d344c91008198927d45cd7a3330915bd9e8fd89f
Add The Fucking Weather module from yano
willie/modules/fuckingweather.py
willie/modules/fuckingweather.py
Python
0
@@ -0,0 +1,855 @@ +%22%22%22%0Afuckingweather.py - Willie module for The Fucking Weather%0ACopyright 2013 Michael Yanovich%0ACopyright 2013 Edward Powell%0A%0ALicensed under the Eiffel Forum License 2.%0A%0Ahttp://willie.dftba.net%0A%22%22%22%0Afrom willie import web%0Aimport re%0A%0Adef fucking_weather(willie, trigger...
27c955963bfc640f5e91d103a4aff8e2a897597c
Implement profiling
jtgpy/profiling.py
jtgpy/profiling.py
Python
0.000015
@@ -0,0 +1,671 @@ +from datetime import datetime%0Aimport logging%0A%0A%0Adef log_time(target, message, log_method=None, target_args=None, target_kwargs=None):%0A%09%22%22%22Execute target and log the start/elapsed time before and after execution%22%22%22%0A%0A%09logger = logging.info%0A%09if log_method is not None:%0A...
d9a6ea57ad7bb1d7f3716fe16a49a8a24edceb67
Fix migrations for python3
registrations/migrations/0010_auto_20180212_0802.py
registrations/migrations/0010_auto_20180212_0802.py
Python
0.000012
@@ -0,0 +1,1356 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.1 on 2018-02-12 08:02%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('registrations', '0009_auto_20171027_0928'),%0A %...
e3c6ebd09af5292c496e3a69af499d2a507ce7dd
add demo main file
demos/blog/main.py
demos/blog/main.py
Python
0
@@ -0,0 +1,2493 @@ +import asyncio%0Aimport logging%0Aimport pathlib%0Aimport yaml%0Aimport aiopg.sa%0A%0Aimport aiohttp_jinja2%0Aimport jinja2%0Afrom aiohttp import web%0A%0Aimport aiohttp_admin%0Afrom aiohttp_admin.backends.sa import SAResource%0Aimport db%0A%0APROJ_ROOT = pathlib.Path(__file__).parent.parent%0ATEMPL...
c4ee87fa4398eca3193331888086cb437436722e
Add some tests for hil_client
test/hil_client_test.py
test/hil_client_test.py
Python
0
@@ -0,0 +1,2458 @@ +%22%22%22%0AGeneral info about these tests%0A%0AThe tests assusme that the nodes are in the %3Cfrom_project%3E which is set to be the%0A%22slurm%22 project, since that is what we are testing here.%0A%0AIf all tests pass successfully, then nodes are back in their original state.%0A%0AClass TestHILRes...
085817b8444470c1e17ea25d4a406ce9fbcae2fc
fix previous fix. hello monday morning
test/test_freeze_app.py
test/test_freeze_app.py
# coding: utf-8 """ Test CLI following the recipe at http://dustinrcollins.com/testing-python-command-line-apps """ import os from unittest import TestCase from tempfile import mkdtemp from shutil import rmtree from copy import copy from six import StringIO from dataset import connect from dataset.util import FreezeE...
Python
0.999999
@@ -123,37 +123,23 @@ os%0A -from unittest import TestCase +import unittest %0Afro @@ -504,16 +504,25 @@ estCase( +unittest. TestCase
bf609b8a30c70bc26a1f2b41313e50859d2a3af6
Fix get_logs file
myriadeploy/get_logs.py
myriadeploy/get_logs.py
#!/usr/bin/env python import myriadeploy import subprocess import argparse # parse args parser = argparse.ArgumentParser(description='collect logs from workers') parser.add_argument("--worker", type=int, help='worker id') parser.add_argument("config", metavar='C', type=str, help='configuration file') arguments = par...
Python
0.000002
@@ -619,24 +619,27 @@ , port, path +, _ ) = node%0A
9293f4972e497636aab0d7ebc98e2a742a20a10c
Fix typo
acos_client/v30/slb/virtual_port.py
acos_client/v30/slb/virtual_port.py
# Copyright 2014, Jeff Buttars, A10 Networks. # # 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 appli...
Python
0.999999
@@ -3342,24 +3342,30 @@ server_name, + name, protocol, p
4f036669d604a902530e00ecc800b9baca6e69d1
Initialize stream getter for current dates games
streams.py
streams.py
Python
0
@@ -0,0 +1,103 @@ +import praw%0Aimport collections%0A%0Ar = praw.Reddit('Getter for stream links from /r/nbastreams by /u/me')%0A
50383f51794babceb89503d091d520c5c3032db3
add gc testing code
tests/_andre/test_gc.py
tests/_andre/test_gc.py
Python
0.000001
@@ -0,0 +1,439 @@ +%0A__author__ = %22Andre Merzky%22%0A__copyright__ = %22Copyright 2012-2013, The SAGA Project%22%0A__license__ = %22MIT%22%0A%0A%0Aimport gc%0Aimport sys%0Aimport saga%0Afrom pprint import pprint as pp%0A%0Atry :%0A%0A if True :%0A js1 = saga.job.Service ('ssh://localhost/bin/sh')%0A...
4158244e5e7d09ea6602d465a24e1a218c4d174a
Make function name more clearer (#406)
gittip/elsewhere/__init__.py
gittip/elsewhere/__init__.py
import random from aspen import log from aspen.utils import typecheck from gittip import db from psycopg2 import IntegrityError class RunawayTrain(Exception): pass def get_a_participant_id(): """Return a random participant_id. The returned value is guaranteed to have been reserved in the database. ...
Python
0.000721
@@ -172,24 +172,31 @@ %0A%0Adef get_a_ +random_ participant_ @@ -3296,16 +3296,23 @@ = get_a_ +random_ particip
b04e10af3c0ecc3258b476dbe58c758ece888349
add migration file required by new paperclip/mapentity
geotrek/common/migrations/0002_auto_20170323_1433.py
geotrek/common/migrations/0002_auto_20170323_1433.py
Python
0
@@ -0,0 +1,659 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport embed_video.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('common', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A mi...