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 |
|---|---|---|---|---|---|---|---|
0f1003cf17acdb3ee9b9614131f7e8d7c9cebb41 | add list of events | yaranullin/events.py | yaranullin/events.py | Python | 0 | @@ -0,0 +1,1060 @@
+# yaranullin/events.py%0A#%0A# Copyright (c) 2012 Marco Scopesi %3Cmarco.scopesi@gmail.com%3E%0A#%0A# Permission to use, copy, modify, and distribute this software for any%0A# purpose with or without fee is hereby granted, provided that the above%0A# copyright notice and this permission notice appea... | |
39f2b145aebbc68ce8e07bc38ff553d5414393bb | add handcontrolmacros.py, not used for now | software/ddapp/src/python/ddapp/handcontrolmacros.py | software/ddapp/src/python/ddapp/handcontrolmacros.py | Python | 0 | @@ -0,0 +1,2905 @@
+%0A%0Aclass HandControlMacros(object):%0A%0A @staticmethod%0A def openLeft():%0A handcontrolpanel.panel.ui.leftButton.click()%0A handcontrolpanel.panel.ui.openButton.animateClick()%0A%0A @staticmethod%0A def openRight():%0A handcontrolpanel.panel.ui.rightButton.click... | |
252e81efb687fecc1961a908444d0f096e9587b5 | rename pieChart example | examples/pieChart.py | examples/pieChart.py | Python | 0.000003 | @@ -0,0 +1,882 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0AExamples for Python-nvd3 is a Python wrapper for NVD3 graph library.%0ANVD3 is an attempt to build re-usable charts and chart components%0Afor d3.js without taking away the power that d3.js gives you.%0A%0AProject location : https://github.... | |
e8e8a07ba70ff3defbc529b6619054001cb692b0 | Add RemoveOutliers python example | src/python/RemoveOutliers.py | src/python/RemoveOutliers.py | Python | 0 | @@ -0,0 +1,831 @@
+%22%22%22%0A%3E%3E%3E from pyspark.context import SparkContext%0A%3E%3E%3E sc = SparkContext('local', 'test')%0A%3E%3E%3E b = sc.parallelize(%5B1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1000%5D)%0A%3E%3E%3E sorted(removeOutliers(b).collect()%0A%5B1, 2, 3, 4, 5, 6, 7, 8, 9, 10%5D%0A%22%22%22%0A%0Aimport sys%0Aim... | |
2c651b7083ec368ebf226364a1a1aba5f5ec147e | Add migration for datetime change. | fjord/feedback/migrations/0003_auto__chg_field_simple_created.py | fjord/feedback/migrations/0003_auto__chg_field_simple_created.py | Python | 0 | @@ -0,0 +1,1808 @@
+# -*- coding: utf-8 -*-%0Aimport datetime%0Afrom south.db import db%0Afrom south.v2 import SchemaMigration%0Afrom django.db import models%0A%0A%0Aclass Migration(SchemaMigration):%0A%0A def forwards(self, orm):%0A%0A # Changing field 'Simple.created'%0A db.alter_column('feedback_sim... | |
b4fe0a903e5a7bff2dca0c6c7c66613d27d14ef9 | add defalt tests | actionslog/tests/__init__.py | actionslog/tests/__init__.py | Python | 0.000001 | @@ -0,0 +1,202 @@
+%22%22%22Test model definitions.%22%22%22%0A%0Afrom __future__ import unicode_literals%0A%0Afrom django.core.management import call_command%0A%0A%0Acall_command('makemigrations', verbosity=0)%0Acall_command('migrate', verbosity=0)
| |
6e77dbbad4cde687ab112c7c0a5da2a958a3ea42 | Add synthtool scripts (#3765) | java-websecurityscanner/google-cloud-websecurityscanner/synth.py | java-websecurityscanner/google-cloud-websecurityscanner/synth.py | Python | 0.000001 | @@ -0,0 +1,1342 @@
+# Copyright 2018 Google LLC%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/licenses/LICENSE-2.0%0A#%0A# Unless required by a... | |
4677085404e41dac88b92418bbc46c6a1dea30df | Add snapshot function. | src/main/python/pgshovel/snapshot.py | src/main/python/pgshovel/snapshot.py | Python | 0.998964 | @@ -0,0 +1,3196 @@
+import collections%0Afrom contextlib import contextmanager%0A%0Afrom psycopg2.extensions import ISOLATION_LEVEL_REPEATABLE_READ%0A%0A%0A@contextmanager%0Adef prepare(connection, table):%0A %22%22%22%0A Prepares a function that can be used to take a consistent snapshot of a set%0A of capture... | |
6aaaa2fcc5f8c58609dceee31b6f9a72a9871bae | fix polygonvisual example | examples/basics/visuals/polygon_visual.py | examples/basics/visuals/polygon_visual.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Demonstration of Polygon and subclasses
"""
import sys
import numpy as np
from vispy import app, gloo, visuals
from vispy.visuals import transforms
# vertex positions o... | Python | 0.000002 | @@ -2763,16 +2763,17 @@
transfor
+m
= trans
@@ -2837,150 +2837,8 @@
n)%0A%0A
- for v in self.visuals:%0A v.tr_sys = transforms.TransformSystem(self)%0A v.tr_sys.visual_to_document = v.transform%0A%0A
|
635ed78543b3e3e8fe7c52fa91ee8516d617249d | Add client sample for test - Connect to server - Receive data from server - Strip the data and print | data-travel/test_client.py | data-travel/test_client.py | Python | 0 | @@ -0,0 +1,261 @@
+from socket import *%0A%0Ahost = '127.0.0.1'%0Aport = 1234%0Abufsize = 1024%0Aaddr = (host, port)%0A%0Aclient = socket(AF_INET, SOCK_STREAM)%0Aclient.connect(addr)%0A%0Awhile True:%0A data = client.recv(bufsize)%0A if not data:%0A break%0A print data.strip()%0Aclient.close()
| |
40c19953e55e11a8b7e48e9894d8dd2322d6bd11 | Add engine zoom functions | temp_volume.py | temp_volume.py | Python | 0 | @@ -0,0 +1,3184 @@
+#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0A%0Afrom OCC.STEPControl import STEPControl_Reader%0Afrom OCC.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity%0Afrom OCC.Display.SimpleGui import init_display%0Afrom OCC.gp import gp_Ax1, gp_Pnt, gp_Dir, gp_Trsf%0Afrom OCC.BR... | |
e9979dc54b884c8a300cc3d663e44c793b7afd57 | Add script term-weight.py, computting term-weight for query/bidword. | term-weight.py | term-weight.py | Python | 0 | @@ -0,0 +1,2141 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8%0A%0Afrom codecs import open%0Afrom argparse import ArgumentParser%0A%0Adef load_entropy_dict(entropy_file):%0A%0A entropy_dict = %7B%7D%0A with open(entropy_file, 'r') as fd:%0A for line in fd:%0A splited_line = line.strip().split(... | |
769a255fbcaf1b657f1a76ff89d3ffa6998e4ada | Support unix socket connections in redis pool | src/sentry/utils/redis.py | src/sentry/utils/redis.py | from __future__ import absolute_import
from threading import Lock
import rb
from redis.connection import ConnectionPool
from sentry.exceptions import InvalidConfiguration
from sentry.utils.versioning import (
Version,
check_versions,
)
_pool_cache = {}
_pool_lock = Lock()
def _shared_pool(**opts):
ke... | Python | 0 | @@ -303,24 +303,51 @@
ol(**opts):%0A
+ if 'host' in opts:%0A
key = '%25
@@ -363,24 +363,28 @@
%25 (%0A
+
opts%5B'host'%5D
@@ -381,24 +381,28 @@
ts%5B'host'%5D,%0A
+
opts
@@ -415,24 +415,28 @@
'%5D,%0A
+
opts%5B'db'%5D,%0A
@@ -431,24 +431,123 @@
opts%5B'db'%5D,%0A
... |
3222504bd076368c7a3069f9accf2627ad1dab86 | Add __init__ to repo root for subclassing | __init__.py | __init__.py | Python | 0 | @@ -0,0 +1,34 @@
+from rivescript import RiveScript%0A
| |
849adb1ea4c6ff46145e18dbe4fd949b5d5a4d7d | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
4d8aaca73a8dbe8895ca4a523828fbb7ecd3fc7f | Add __init__ file | __init__.py | __init__.py | Python | 0.00026 | @@ -0,0 +1,23 @@
+from snapbill import *%0A
| |
959ffbd37cb4a7821f7a2676c137be54cad171a8 | fix not authenticated requests | src/sentry/web/frontend/twofactor.py | src/sentry/web/frontend/twofactor.py | from __future__ import absolute_import
import six
import time
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.translation import ugettext as _
from sentry import options
from sentry.web.frontend.base import BaseView
from sentry.web.forms.accounts import TwoFactorForm
from sentry.web.help... | Python | 0.000032 | @@ -607,24 +607,31 @@
e):%0A
+assert
auth.login(r
@@ -3603,47 +3603,8 @@
None
- or not request.user.is_authenticated()
:%0A
|
b64e7af67161fecb7aec8797497e1d3a4f3e91fe | complete 35 circular primes | 35-circular-primes.py | 35-circular-primes.py | Python | 0.000001 | @@ -0,0 +1,484 @@
+from utils import prime_gen%0A%0Adef rotate(l):%0A for x in range(len(l)):%0A yield l%5B-x:%5D + l%5B:-x%5D%0A%0Adef circular_primes():%0A p = prime_gen()%0A while True:%0A prime = next(p)%0A if prime %3E 1_000_000:%0A break%0A else:%0A s.add... | |
313e9cae068192fe11ad10ea0b5c05061b0e5c60 | Add unit test for _validate_key_file_permissions in ec2 module | tests/unit/cloud/clouds/ec2_test.py | tests/unit/cloud/clouds/ec2_test.py | Python | 0.000001 | @@ -0,0 +1,1380 @@
+# -*- coding: utf-8 -*-%0A%0A# Import Python libs%0Afrom __future__ import absolute_import%0Aimport os%0Aimport tempfile%0A%0A# Import Salt Libs%0Afrom salt.cloud.clouds import ec2%0Afrom salt.exceptions import SaltCloudSystemExit%0A%0A# Import Salt Testing Libs%0Afrom salttesting import TestCase, s... | |
22f57f6490826b99e35b80d85837c95921cd6c97 | add test to reproduce keyerror | tests/unit/dht/test_routingtable.py | tests/unit/dht/test_routingtable.py | Python | 0 | @@ -0,0 +1,2420 @@
+import unittest%0A%0Afrom lbrynet.dht import contact, routingtable, constants%0A%0A%0Aclass KeyErrorFixedTest(unittest.TestCase):%0A %22%22%22 Basic tests case for boolean operators on the Contact class %22%22%22%0A%0A def setUp(self):%0A own_id = (2 ** constants.key_bits) - 1%0A ... | |
0202f0bd4358d68917af19910bb4e1f0a3dda602 | Add usb bridge test(CDC & HID) | scripts/avalon-usb2iic-test.py | scripts/avalon-usb2iic-test.py | Python | 0 | @@ -0,0 +1,2376 @@
+#!/usr/bin/env python2.7%0A%0A# This script aim to make a loopback test on cdc or hid.%0A# The statics is used for comparison, it is not accurate.%0A%0Afrom serial import Serial%0Afrom optparse import OptionParser%0Aimport time%0Aimport binascii%0Aimport usb.core%0Aimport usb.util%0Aimport sys%0A%0A... | |
33028c8955e8d1b65416e52169a53b40d9a0dbe4 | add new package : rt-tests (#14174) | var/spack/repos/builtin/packages/rt-tests/package.py | var/spack/repos/builtin/packages/rt-tests/package.py | Python | 0 | @@ -0,0 +1,743 @@
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass RtTests(Package):%0A %22%22%22%0A Suite of real-time ... | |
058380775fcfed77373512946c4a32b9df4aac87 | add benchmark for signal.lfilter. Follow-up of gh-4628. | benchmarks/benchmarks/signal_filtering.py | benchmarks/benchmarks/signal_filtering.py | Python | 0 | @@ -0,0 +1,786 @@
+from __future__ import division, absolute_import, print_function%0A%0Aimport numpy as np%0A%0Atry:%0A from scipy.signal import lfilter, firwin%0Aexcept ImportError:%0A pass%0A%0Afrom .common import Benchmark%0A%0A%0Aclass Lfilter(Benchmark):%0A param_names = %5B'n_samples', 'numtaps'%5D%0A ... | |
4c925c6134e705dd5f304a983c66ad60ce6bf901 | add diagnostic | scripts/plots/huc12_flowpath_counts.py | scripts/plots/huc12_flowpath_counts.py | Python | 0.000001 | @@ -0,0 +1,1978 @@
+%22%22%22Diagnostic on HUC12 flowpath counts.%22%22%22%0A%0Aimport numpy as np%0Aimport cartopy.crs as ccrs%0Afrom matplotlib.patches import Polygon%0Aimport matplotlib.colors as mpcolors%0Afrom geopandas import read_postgis%0Afrom pyiem.util import get_dbconn%0Afrom pyiem.plot.use_agg import plt%0A... | |
3a285bcb6bf06df1d0e8f60a8e754280a9f05dd9 | Copy arp_request.py to arp_fake.py. | arp_fake.py | arp_fake.py | Python | 0 | @@ -0,0 +1,1256 @@
+#!/usr/local/bin/python2.7%0A# send Address Resolution Protocol Request %0A# expect Address Resolution Protocol response and check all fields%0A# RFC 826 An Ethernet Address Resolution Protocol%0A# Packet Generation%0A%0Aimport os%0Afrom addr import *%0Afrom scapy.all import *%0A%0Aarp=ARP(op='who-... | |
734fdc5f331414556b61486bf956ed27e4b077dc | Indent was off on the content generation piece with attachments, would have run the encoding part more often than necessary | django_mailgun/__init__.py | django_mailgun/__init__.py | import requests
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from requests.packages.urllib3.filepost import encode_multipart_formdata
class MailgunAPIError(Exception):
pass
class MailgunBackend(BaseEmailBackend)... | Python | 0 | @@ -2509,28 +2509,24 @@
-
content, hea
@@ -2568,20 +2568,16 @@
t_data)%0A
-
|
05635750a53a5a6f72a90eecea74a08e11a11ca8 | Add 37signals products | services/thirtysevensignals.py | services/thirtysevensignals.py | Python | 0.000001 | @@ -0,0 +1,911 @@
+from werkzeug.urls import url_decode%0Aimport foauth.providers%0A%0A%0Aclass ThirtySevenSignals(foauth.providers.OAuth2):%0A # General info about the provider%0A alias = '37signals'%0A name = '37signals'%0A provider_url = 'https://37signals.com/'%0A docs_url = 'https://github.com/37sig... | |
470085c992a393522a13a5b6d8243f30fff57a80 | add activate_this.py | env/Scripts/activate_this.py | env/Scripts/activate_this.py | Python | 0.000001 | @@ -0,0 +1,1137 @@
+%22%22%22By using execfile(this_file, dict(__file__=this_file)) you will%0Aactivate this virtualenv environment.%0A%0AThis can be used when you must use an existing Python interpreter, not%0Athe virtualenv bin/python%0A%22%22%22%0A%0Atry:%0A __file__%0Aexcept NameError:%0A raise AssertionError... | |
b9fb314ddac3d7a4bc12555b5df1bca4324de038 | Move proper_movies priority back. fix #1192 | flexget/plugins/filter/proper_movies.py | flexget/plugins/filter/proper_movies.py | import logging
from sqlalchemy.schema import Index
from sqlalchemy.sql.expression import desc
from flexget.event import fire_event
from flexget.manager import Base
from flexget.plugin import register_plugin, priority, get_plugin_by_name, PluginError
from flexget.utils.log import log_once
from flexget.utils.titles.movie... | Python | 0.000101 | @@ -1742,27 +1742,8 @@
ot%0A%0A
- @priority(512)%0A
|
7e3fb49043503dc6aa5375c4e27ea770052e615c | Add audiofile_source example | examples/audiofile_source.py | examples/audiofile_source.py | Python | 0.000002 | @@ -0,0 +1,1240 @@
+import sys%0Afrom time import sleep%0Aimport librosa%0Aimport numpy as np%0Afrom audiostream import get_output%0Afrom audiostream.sources.thread import ThreadSource%0A%0A%0Aclass MonoAmplitudeSource(ThreadSource):%0A %22%22%22A data source for float32 mono binary data, as loaded by libROSA/soundf... | |
9dbd9d7b409afe18677a69d72339d040043a9087 | add urls to the audio appl | armstrong/apps/audio/urls.py | armstrong/apps/audio/urls.py | Python | 0.000001 | @@ -0,0 +1,445 @@
+from django.conf.urls.defaults import *%0Afrom armstrong.apps.audio import views as AudioViews%0A%0Aurlpatterns = patterns('',%0A%0A url(r'%5E$', AudioViews.AudioPublicationList.as_view(),%0A name='audio_list'),%0A%0A url(r'%5Eupload/$', AudioViews.AudioPublicationCreateView.as_v... | |
a7850bb9629891c77f74c05efdfb9e0aa1c4186d | Update top of screen display. | examples/canvas/tesselate.py | examples/canvas/tesselate.py | '''
Tesselate Demonstration
=======================
This demonstrates the experimental library for tesselating polygons. You
should see a hollow square with some buttons below it. You can click and
drag to create additional shapes, watchin the number of vertexes and elements
at the top of the screen. The 'debug' butto... | Python | 0 | @@ -1617,16 +1617,45 @@
%5D
+ # the 'hollow square' shape
%0A
@@ -3994,16 +3994,29 @@
text = %22
+Shapes: %7B%7D -
Vertex:
@@ -4049,24 +4049,31 @@
%0A
+ count,
tess.vertex
@@ -4163,32 +4163,133 @@
self.shape = %5B%5D%0A
+ self.ids.status.text = %22Shapes: %7B%7D - Vertex: %7B%... |
914f06c999f5c540c2feb6ab8825c1ced4246ed2 | Support sessions | muffin/plugins/session.py | muffin/plugins/session.py | Python | 0 | @@ -0,0 +1,2705 @@
+import base64%0Aimport hashlib%0Aimport hmac%0Aimport time%0Aimport asyncio%0A%0Aimport ujson as json%0A%0Afrom . import BasePlugin%0A%0A%0Aclass SessionPlugin(BasePlugin):%0A%0A %22%22%22 Support sessions. %22%22%22%0A%0A name = 'session'%0A defaults = %7B%0A 'secret': 'InsecureSecr... | |
977ec87292c10e21b22f9fe77b248ee83a87147d | Add basic tests | tests/tests.py | tests/tests.py | Python | 0.000001 | @@ -0,0 +1,786 @@
+import unittest%0Afrom textinator import calculate_size%0A%0Aclass CalculateSizeTestCase(unittest.TestCase):%0A %22%22%22Tests for calculate_size()%22%22%22%0A%0A def test_width_no_height(self):%0A self.assertEqual(calculate_size((1920, 1080), (20, None)),%0A (20, 11))... | |
a36606beffbd65dc5e09e89aea312e6be2552be0 | Create sort_date.py | apps/camera/file_sweeper/sort_date.py | apps/camera/file_sweeper/sort_date.py | Python | 0.000075 | @@ -0,0 +1,93 @@
+ %0A#-*-coding:utf8-*-%0A#!/usr/bin/python%0A# Author : Jeonghoonkang, github.com/jeonghoonkang%0A
| |
2fa7048351f249b3731d15e04cfb917083074eca | add arabic morphological analysis demo | arabic-morphological-analysis-demo.py | arabic-morphological-analysis-demo.py | Python | 0.000006 | @@ -0,0 +1,1917 @@
+# coding: utf-8%0A%0Aimport sys%0A##################################################################%0Adef usage():%0A%09print 'Usage: ', sys.argv%5B0%5D, '%3Cinputfile%3E %3Coutputfile%3E'%0A##################################################################%0A%0Aif len(sys.argv) %3C 3: usage(); sys... | |
46200af23e98aefbde2140cd63d850d7ae5c5632 | Create EuclideanAlgorithm.py | EuclideanAlgorithm.py | EuclideanAlgorithm.py | Python | 0.99957 | @@ -0,0 +1,290 @@
+trueA = input('Larger number: ')%0AtrueB = input('Smaller number: ')%0A%0Aa = trueA%0Ab = trueB%0A%0Awhile a %25 b != 0:%0A oldA = a%0A equation = str(a) + ' = ' + str(a/b) + ' * ' + str(b) + ' + ' + str(a%25b)%0A print(equation)%0A a = b%0A b = oldA %25 b%0A %0Agcf = b%0A%0Aprint('The GC... | |
e9ed96d606e2fc8db1e9e36978b48d725f925bb0 | Add octogit.__main__ for testing | octogit/__main__.py | octogit/__main__.py | Python | 0 | @@ -0,0 +1,30 @@
+from . import cli%0Acli.begin()%0A
| |
c10d60911d870910d389668f6c99df694e9d914c | add registry test | sncosmo/tests/test_registry.py | sncosmo/tests/test_registry.py | Python | 0 | @@ -0,0 +1,479 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst%0A%22%22%22Test registry functions.%22%22%22%0A%0Aimport numpy as np%0Aimport sncosmo%0A%0Adef test_register():%0A disp = np.array(%5B4000., 4200., 4400., 4600., 4800., 5000.%5D)%0A trans = np.array(%5B0., 1., 1., 1., 1., 0.%5D)%0A... | |
872dcfd02b9c136d781abf15df38c71a234f82c0 | remove unneeded sleep | mzalendo/hansard/tests.py | mzalendo/hansard/tests.py | import os
import datetime
import time
from django.test import TestCase
from hansard.models import Source
class HansardTest(TestCase):
def setUp(self):
source = Source(
name = 'Test Source',
url = 'http://www.mysociety.org/robots.txt',
date = datetime.date( 2001, 11, 1... | Python | 0.001585 | @@ -1394,54 +1394,8 @@
e()%0A
- time.sleep(2) # let things get synced%0A
|
910358e7cf3d8b996593c5d8eedf5c97bd0c6b67 | Test template for Monitor | azure-mgmt/tests/test_mgmt_monitor.py | azure-mgmt/tests/test_mgmt_monitor.py | Python | 0 | @@ -0,0 +1,1186 @@
+%EF%BB%BF# coding: utf-8%0A%0A#-------------------------------------------------------------------------%0A# Copyright (c) Microsoft Corporation. All rights reserved.%0A# Licensed under the MIT License. See License.txt in the project root for%0A# license information.%0A#-----------------------------... | |
cf4829ae46ef994c9f558dcc2f08743833b8a6fb | Add mineTweets.py | mineTweets.py | mineTweets.py | Python | 0 | @@ -0,0 +1,1113 @@
+import json%0Aimport tweepy%0Afrom tweepy import OAuthHandler%0Afrom tweepy import Stream%0Afrom tweepy.streaming import StreamListener%0A%0A#App credentials%0Aconsumer_key = %22%22%0Aconsumer_secret = %22%22%0Aaccess_token = %22%22%0Aaccess_secret = %22%22%0A%0Aauth = OAuthHandler(consumer_key, con... | |
fc919fecd5af80d27d3352b80fce5ed214ca4d41 | True False | task_14.py | task_14.py | Python | 0.999999 | @@ -0,0 +1,176 @@
+#!user/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22docstring%22%22%22%0A%0AIS_TRUE = True%0AIS_FALSE = False%0AIS_NONE = None%0A%0Aprint IS_TRUE == 1, IS_FALSE and 0%0A%0AINTEGER_EQUIV = 'True False'%0A
| |
0d56fb071628dc3f33c90d7f806371c076303551 | add autoGonk -- hopefully our self-determining "brain" to automate this | autoGonk.py | autoGonk.py | Python | 0 | @@ -0,0 +1,214 @@
+%22%22%22%0AautoGonk -- testing out auto-determining which interfaces serve which function%0A%22%22%22%0A%0Aclass ArpTable():%0A arpTable = %7B%7D%0A %0A pass%0A%0Aclass RouteTable():%0A routeTable = %7B%7D%0A %0A pass%0A%0Aclass IP():%0A pass
| |
9d7d043a36f6e5a2fc599287a087eb806a58d73a | test to_xml survey | testXml.py | testXml.py | Python | 0 | @@ -0,0 +1,3489 @@
+from xml.etree import ElementTree%0Afrom xml.etree.ElementTree import Element%0Afrom xml.etree.ElementTree import SubElement%0Aimport xml.etree.cElementTree as ET%0Afrom app import db, models%0Afrom app.models import Section, Survey, Consent, Question, QuestionText, QuestionLikertScale%0A%0Adef surv... | |
3d35a84d92123fcf530cb366d60de0f2c45d1c18 | test python interpreter | test/test_interpreter_layer.py | test/test_interpreter_layer.py | Python | 0.000062 | @@ -0,0 +1,422 @@
+# This code is so you can run the samples without installing the package%0Aimport sys%0Aimport os%0Asys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))%0A#%0A%0A%0Aimport cocos%0Afrom cocos.director import director%0Aimport pyglet%0A %0A%0Aif __name__ == %22__main__%22:%0A dir... | |
1d089833b47fe740d6dfaea89f94b1c9d1946c1e | enable evented based on socket | openerp/__init__.py | openerp/__init__.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" OpenERP core library."""
#----------------------------------------------------------
# Running mode flags (gevent, prefork)
#----------------------------------------------------------
# Is the server running with ge... | Python | 0 | @@ -286,45 +286,49 @@
---%0A
-# Is the
+def is_
server
-
+_
running
-
+_
with
-
+_
gevent
-.%0A
+():%0A
impo
@@ -338,24 +338,12 @@
sys%0A
-evented = False%0A
+
if s
@@ -388,22 +388,233 @@
-evented = True
+ import socket%0A import gevent.socket%0A if socket.socket is gevent.soc... |
51c0ef015f0bccd367d9efceb5f97574f2749e97 | Fix importing breakpad from an interactive python prompt. | breakpad.py | breakpad.py | # 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.
"""Breakpad for Python.
Sends a notification when a process stops on an exception.
It is only enabled when all these conditions are met:
1. hostname ... | Python | 0.000048 | @@ -11,18 +11,18 @@
t (c) 20
-09
+11
The Chr
@@ -3626,16 +3626,24 @@
est' in
+getattr(
sys.modu
@@ -3661,17 +3661,19 @@
__'%5D
-.
+, '
__file__
and
@@ -3668,16 +3668,22 @@
__file__
+', '')
and%0A
|
74a22516a368d98c8c71818c39d84208c9ecca66 | add buildbot.py | buildbot.py | buildbot.py | Python | 0.000001 | @@ -0,0 +1,2619 @@
+%EF%BB%BF#!/usr/bin/env python%0A# encodingsak: utf-8%0A%0Aimport os%0Aimport sys%0Aimport json%0Aimport subprocess%0A%0Aproject_name = 'hex'%0A%0A%0Adef run_command(args):%0A print(%22Running: %7B%7D%22.format(args))%0A sys.stdout.flush()%0A subprocess.check_call(args)%0A%0A%0Adef get_tool... | |
0bc48dc1dd66178bec8d9bb3dc86a26baad240ee | use module-level function instead of a factory class | rap/servicefactory.py | rap/servicefactory.py | Python | 0 | @@ -0,0 +1,1028 @@
+%22%22%22 Factory of RoutingService classes %22%22%22%0A%0Aimport json%0Afrom .mb import MapboxRouter%0Afrom .graphhopper import GraphHopperRouter%0A%0A# from . import mapzen%0A# from . import google%0A# from . import here%0A# from . import tomtom%0A%22%22%22 Factory method of creating concrete rout... | |
162e7dd6595b0d9303ecb1da66893ee353ba413b | Add a first small file watcher that counts words | tracker.py | tracker.py | Python | 0.000001 | @@ -0,0 +1,1355 @@
+import os%0Aimport sys%0Aimport time%0Aimport logging%0Afrom watchdog.observers import Observer%0Afrom watchdog.events import FileSystemEventHandler%0Afrom watchdog.events import FileModifiedEvent%0A%0Aclass GamificationHandler(FileSystemEventHandler):%0A%09%0A%09def __init__(self, filename):%0A%09%... | |
6c10f4d98443b23424a01659afd5194c3edff141 | Add conflict inspector script | inspect_conflicts.py | inspect_conflicts.py | Python | 0.000001 | @@ -0,0 +1,2374 @@
+import oursql%0Aimport sys%0Aimport simplejson as json%0A%0Afrom wikidataeditor import Site%0A%0Aconfig = json.load(open('config.json', 'r'))%0A%0Adb = oursql.connect(host=%22wikidatawiki.labsdb%22, db=%22wikidatawiki_p%22, read_default_file=%22~/replica.my.cnf%22)%0Acur = db.cursor()%0A%0Awd = Site... | |
c4c52c98f4c8596b4f19c88fb64e1b0af4f9c4cd | Add New Test Which Monitors Output | tests/test_monitor_progress.py | tests/test_monitor_progress.py | Python | 0.000001 | @@ -0,0 +1,1887 @@
+pytest_plugins = %22pytester%22%0A%0A%0Adef test_simple_example(testdir):%0A %22%22%22 Run the simple example code in a python subprocess and then compare its%0A stderr to what we expect to see from it. We run it in a subprocess to%0A best capture its stderr. We expect to see match... | |
94c2f4ef1c553e3dd0a543bcaf01cd176c97e551 | fix `get_function_from_rule()` | gittip/utils/i18n.py | gittip/utils/i18n.py | from __future__ import print_function, unicode_literals
import os
import re
from aspen.utils import utcnow
from babel.dates import format_timedelta
import babel.messages.pofile
from babel.numbers import (
format_currency, format_decimal, format_number, format_percent
)
ternary_re = re.compile(r'(.*)\?(.*):(.*)'... | Python | 0.000008 | @@ -301,23 +301,35 @@
e(r'
+ *
(.*)
-%5C?(.*):
+ *%5C? *(.*) *: *
(.*)
+ *
')%0Aa
@@ -353,10 +353,14 @@
e(r'
-&&
+ *&& *
')%0Ao
@@ -383,12 +383,16 @@
e(r'
+ *
%5C%7C%5C%7C
+ *
')%0A%0A
@@ -533,22 +533,21 @@
r'(%5C
-1) and (%5C2) or
+2) if %5C1 else
(%5C3
@@ -579,19 +579,21 @@
re.sub('
+
and
+
', rule)
... |
2a47a563d5cc16f14edc0fb56a1af2848eccde57 | Add simple wrapper for a heap. | txrudp/heap.py | txrudp/heap.py | Python | 0 | @@ -0,0 +1,1592 @@
+%22%22%22Simple heap used as reorder buffer for received messages.%22%22%22%0A%0Aimport collections%0Aimport heapq%0A%0A%0Aclass EmptyHeap(Exception):%0A%0A %22%22%22Raised when popping from empty heap.%22%22%22%0A%0A%0Aclass Heap(collections.Sequence):%0A%0A %22%22%22%0A A min-heap for obj... | |
06c3086401e8cb221a1a665598fe75a1886d7f37 | test python script for test-NN added. | example/test-NN/test_nn.py | example/test-NN/test_nn.py | Python | 0 | @@ -0,0 +1,1403 @@
+#!/usr/bin/env python%0A%22%22%22%0ATest pmd run about NN potential.%0A%0AUsage:%0A test_nn.py %5Boptions%5D%0A%0AOptions:%0A -h, --help Show this message and exit.%0A%22%22%22%0Afrom __future__ import print_function%0A%0Aimport os%0Afrom docopt import docopt%0Aimport unittest%0A%0A__author__ = %... | |
bc356875eaf52bca2b1c04548a51e0372e7948aa | Create tcpServer_SocketServer.py | tcpServer_SocketServer.py | tcpServer_SocketServer.py | Python | 0.000021 | @@ -0,0 +1,607 @@
+#/bin/python%0A%0Aimport SocketServer%0Aimport socket%0A%0ASERVER_ADDRESS = (%220.0.0.0%22, 8888)%0A%0Aclass EchoHandler(SocketServer.BaseRequestHandler):%0A%0A def handle(self):%0A %0A print %22Received a connection from: %22, self.client_address%0A data = %22start%22%0A while len(data):%... | |
650ff2c99a84da2c023d7bab27f83c8639e7fcfd | Fix PhantomJS configuration error; #442 | judge/pdf_problems.py | judge/pdf_problems.py | import errno
import io
import json
import os
import shutil
import subprocess
import tempfile
import uuid
from django.conf import settings
from django.utils.translation import ugettext
HAS_PHANTOMJS = os.access(getattr(settings, 'PHANTOMJS', ''), os.X_OK)
HAS_WKHTMLTOPDF = os.access(getattr(settings, 'WKHTMLTOPDF', ''... | Python | 0 | @@ -3810,20 +3810,23 @@
MJS_PDF_
-ZOOM
+TIMEOUT
', 5.0)
|
d680d6a20890d3bbce96792fa1e86df28956a859 | Add a thread helper module | helpers/threading.py | helpers/threading.py | Python | 0.000001 | @@ -0,0 +1,348 @@
+from threading import Thread, Lock%0A%0Alist_lock = Lock()%0A%0Adef run_in_thread(app):%0A def wrapper(fn):%0A def run(*args, **kwargs):%0A app.logger.info('Starting thread: %7B%7D'.format(fn.__name__))%0A t = Thread(target=fn,%0A args=args,%0A kwargs=kwa... | |
0d22cad3e34e7834e96e37b0268f624b45e7296f | add tests for outdoor shops | test/674-outdoor-shops.py | test/674-outdoor-shops.py | Python | 0 | @@ -0,0 +1,1472 @@
+#http://www.openstreetmap.org/node/3056897308%0Aassert_has_feature(%0A 16, 11111, 25360, 'pois',%0A %7B 'kind': 'fishing', 'min_zoom': 16 %7D)%0A%0A#http://www.openstreetmap.org/node/1467729495%0Aassert_has_feature(%0A 16, 10165, 24618, 'pois',%0A %7B 'kind': 'hunting', 'min_zoom': 16 %7... | |
3a9960849d1c9c7b519c9eb88aa3dc58c60b1eb3 | Create 3-blink.py | Code/3-blink.py | Code/3-blink.py | Python | 0.000007 | @@ -0,0 +1,825 @@
+#Import Libraries%0Aimport time #A collection of time related commands%0Aimport RPi.GPIO as GPIO #The GPIO commands%0A%0A#Set the GPIO pin naming mode%0AGPIO.setmode(GPIO.BCM)%0AGPIO.setwarnings(False)%0A%0A#Set pins 18, 23 and 24 to be output%0AGPIO.setup(18,GPIO.OUT)%0AGPIO.setup(23,GPI... | |
0ec1a3f3760b5977c036bc092b8b88647b3d4674 | Allow LogDevice to build without Submodules (#71) | build/fbcode_builder/specs/rocksdb.py | build/fbcode_builder/specs/rocksdb.py | Python | 0.000002 | @@ -0,0 +1,485 @@
+#!/usr/bin/env python%0A# Copyright (c) Facebook, Inc. and its affiliates.%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0A%0Adef fbcode_builder_spec(builder):%0A builder.add_option(%2... | |
26fa3f083468acb2155d811ce65d4d4d6aafe53b | Integrate LLVM at llvm/llvm-project@4b33ea052ab7 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "58a47508f03546b4fce668fad751102b94feacfd"
LLVM_SHA256 = "b3106ecc8ad56ecf9cd72c8a47117342e7641ef5889acb1d9093bcd0f2920d59"
tf_http_archive(
... | Python | 0.000001 | @@ -160,133 +160,133 @@
= %22
-58a47508f03546b4fce668fad751102b94feacfd%22%0A LLVM_SHA256 = %22b3106ecc8ad56ecf9cd72c8a47117342e7641ef5889acb1d9093bcd0f2920d59
+4b33ea052ab7fbceed4c62debf1145f80d66b0d7%22%0A LLVM_SHA256 = %22b6c61a6c81b1910cc34ccd9800fd18afc2dc1b9d76c640dd767f9e550f94c8d6
%22%0A%0A
|
0cf2ce2331120c20de0cab384c5fdec763c25c68 | Add a simple markov chain to compare output with RNN | min-char-rnn/markov-model.py | min-char-rnn/markov-model.py | Python | 0 | @@ -0,0 +1,1285 @@
+# Simple Markov chain model for character-based text generation.%0A#%0A# Only tested with Python 3.6+%0A#%0A# Eli Bendersky (http://eli.thegreenplace.net)%0A# This code is in the public domain%0Afrom __future__ import print_function%0A%0Afrom collections import defaultdict, Counter%0Aimport random%0... | |
73d44969b1baa7ca1bce08800e36f8aad0d2d116 | Add journal_id in context for account_move_line search | addons/account_payment/wizard/wizard_payment_order.py | addons/account_payment/wizard/wizard_payment_order.py | ##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences r... | Python | 0.000049 | @@ -1592,16 +1592,55 @@
dbname)%0A
+%09order_obj = pool.get('payment.order')%0A
%09line_ob
@@ -1674,16 +1674,183 @@
line')%0A%0A
+%09payment = order_obj.browse(cr, uid, data%5B'id'%5D,%0A%09%09%09context=context)%0A%09ctx = ''%0A%09if payment.mode:%0A%09%09ctx = '''context=%22%7B'journal_id': %25d%7D%22''' %25 payme... |
80c749e8b8395f20305c04c480fbf39400f1b5a4 | Add failing test for index route | features/tests/test_index.py | features/tests/test_index.py | Python | 0 | @@ -0,0 +1,971 @@
+from django.test import TestCase%0A%0Aclass TestIndex(TestCase):%0A %22%22%22Verify the index page is served properly%22%22%22%0A%0A def test_root(self):%0A # Fetch page from '/'%0A reponse = self.client.get('/')%0A # Should respond OK%0A self.assertEqual(reponse.sta... | |
3f7b54496826f496863de545a601c23c2c06427a | Add first-party JavaScript build rule library | shipyard2/shipyard2/rules/javascripts.py | shipyard2/shipyard2/rules/javascripts.py | Python | 0.000001 | @@ -0,0 +1,1722 @@
+%22%22%22Helpers for writing rules for first-party JavaScript packages.%22%22%22%0A%0A__all__ = %5B%0A 'define_package',%0A 'find_package',%0A%5D%0A%0Aimport dataclasses%0Aimport logging%0A%0Aimport foreman%0A%0Afrom g1 import scripts%0Afrom g1.bases.assertions import ASSERT%0A%0Afrom shipyard... | |
18b98aff76c0b69748b5dd4b8ca27bd8d8b8aec8 | Add PassiveAggressiveClassifier to benchmark | model_code/PassiveAggressiveClassifier.py | model_code/PassiveAggressiveClassifier.py | Python | 0.000003 | @@ -0,0 +1,2508 @@
+import sys%0Aimport pandas as pd%0Afrom sklearn.linear_model import PassiveAggressiveClassifier%0Afrom sklearn.cross_validation import StratifiedShuffleSplit%0Afrom sklearn.preprocessing import StandardScaler%0Aimport itertools%0A%0Adataset = sys.argv%5B1%5D%0A%0A# Read the data set into memory%0Ain... | |
6a74915c3f197ef197a34514c7ff313ac0a68d2f | Add migration to delete existing cache values | corehq/apps/fixtures/migrations/0002_rm_blobdb_domain_fixtures.py | corehq/apps/fixtures/migrations/0002_rm_blobdb_domain_fixtures.py | Python | 0.000001 | @@ -0,0 +1,637 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.7 on 2017-09-08 10:23%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0Afrom corehq.blobs import get_blob_db%0Afrom corehq.sql_db.operations import HqRunPython%0A%0AFIXTURE_BUCKET = 'domain-fixtures'%0A%0A%0Adef r... | |
e184b806c6170aad2bdee87c051ea6400e1d954e | Add unit tests for the Document class | tests/parser_test.py | tests/parser_test.py | Python | 0 | @@ -0,0 +1,1771 @@
+import unittest%0A%0Afrom clippings.parser import Document%0A%0A%0Aclass DocumentTest(unittest.TestCase):%0A%0A def test_create_document(self):%0A title = 'Haunted'%0A authors = %5B'Chuck Palahniuk'%5D%0A document = Document(title, authors)%0A%0A self.assertEqual(title... | |
98006f7b27195153c1eb5d19b5902b60b0ffd963 | add unit tests for events.py | tests/test_events.py | tests/test_events.py | Python | 0 | @@ -0,0 +1,611 @@
+#!/usr/bin/env python%0A# vim: set sts=4 sw=4 et:%0A%0Aimport unittest%0Aimport events%0Aimport rpc%0A%0Aclass TestEventsRPC(unittest.TestCase):%0A%0A def testEvent(self, cls=None):%0A cls = events.Event%0A e = cls()%0A e2 = rpc.rpc_decode(cls, rpc.rpc_encode(e))%0A self.ass... | |
e9cfb095ac4261c8bf959d1c9b904256c267178f | Add basic unit test about /variables endpoint | openfisca_web_api/tests/test_variables.py | openfisca_web_api/tests/test_variables.py | Python | 0.000001 | @@ -0,0 +1,798 @@
+# -*- coding: utf-8 -*-%0A%0A%0Aimport json%0A%0Afrom nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance%0Afrom webob import Request%0A%0Afrom . import common%0A%0A%0Adef setup_module(module):%0A common.get_or_load_app()%0A%0A%0Adef test_basic_call():%0A req = Request... | |
bcfccc8d7b19895f793e63289dcbbf9bf1ed834b | add unittest for home view | commute_together/commute_together/tests/test_views.py | commute_together/commute_together/tests/test_views.py | Python | 0 | @@ -0,0 +1,435 @@
+from datetime import timedelta, datetime%0A%0Afrom django.test import TestCase%0Afrom django.core.urlresolvers import reverse%0Afrom django.contrib.auth.models import User%0A%0Afrom commute_together.models import MeetingModel, StationModel%0A%0A%0Aclass HomePageTest(TestCase):%0A%09fixtures = %5B'Sta... | |
ff673561c87bd16938a7c3f4d7609f91afbe9078 | add a script to perform the event averaging for the HBT correlation function | ebe_scripts/average_event_HBT_correlation_function.py | ebe_scripts/average_event_HBT_correlation_function.py | Python | 0 | @@ -0,0 +1,1877 @@
+#! /usr/bin/env python%0A%22%22%22%0A This script performs event averaging for the HBT correlation function%0A calculated from event-by-event simulations%0A%22%22%22%0A%0Afrom sys import argv, exit%0Afrom os import path%0Afrom glob import glob%0Afrom numpy import *%0A%0A# define colors%0Apur... | |
fb4a30c27bc0009683cd49e94429db3656ec8364 | Apply pyload patch by rynan. Fix #1267 | flexget/plugins/output/pyload.py | flexget/plugins/output/pyload.py | # -*- coding: utf-8 -*-
from urllib import urlencode
from urllib2 import urlopen, URLError, HTTPError
from logging import getLogger
from flexget.plugin import register_plugin, get_plugin_by_name, PluginError, DependencyError
from flexget import validator
log = getLogger('pyload')
try:
import simplejson as json
e... | Python | 0.000001 | @@ -1113,16 +1113,17 @@
_ = '0.2
+1
'%0A%0A D
@@ -1649,24 +1649,78 @@
ey='queue')%0A
+ advanced.accept('boolean', key='multihoster')%0A
adva
@@ -3695,19 +3695,20 @@
entry%5B'
-nam
+titl
e'%5D)%0A
@@ -3830,20 +3830,17 @@
dest =
-True
+1
if conf
@@ -3880,21 +3880,41 @@
E) else
-False
+0... |
c23d2711757a68f1348f8353aba7b3ec2d17a1d6 | Structure prediction boilerplate | smact/structure_prediction/prediction.py | smact/structure_prediction/prediction.py | Python | 0.000001 | @@ -0,0 +1,1557 @@
+%22%22%22Structure prediction implementation.%22%22%22%0A%0Afrom typing import Generator, List, Tuple, Optional%0A%0Afrom .database import StructureDB%0Afrom .mutation import CationMutator%0Afrom .structure import SmactStructure%0A%0A%0Aclass StructurePredictor:%0A %22%22%22Provides structure pre... | |
3d5955767d81f45e796ab2af0707533375681774 | add runtests-windows.py script | tests/runtests-windows.py | tests/runtests-windows.py | Python | 0 | @@ -0,0 +1,1219 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%0Aimport os%0Aimport sys%0Aimport glob%0Aimport unittest%0A%0Aos.environ%5B'PYGTK_USE_GIL_STATE_API'%5D = ''%0Asys.path.insert(0, os.path.dirname(__file__))%0Asys.argv.append('--g-fatal-warnings')%0A%0Aimport gobject%0Agobject.threads_init()%0A%0... | |
ae6fd841e4ea780288a4f0cb3408a4a74211add1 | check test results | tests/test_api_actions.py | tests/test_api_actions.py | import os
from vent.api.actions import Action
def test_add():
""" Test the add function """
instance = Action()
status = instance.add('bad')
assert type(status) == tuple
assert status[0] == False
status = instance.add('https://github.com/cyberreboot/vent', build=False)
assert type(status) ... | Python | 0.000001 | @@ -1574,32 +1574,60 @@
tatus) == tuple%0A
+ assert status%5B1%5D = None%0A
assert statu
@@ -4345,24 +4345,52 @@
es('start')%0A
+ assert cores%5B1%5D == None%0A
assert c
|
fffb2a38870afd0c9a6d1ab5efd36b75f98c9a9a | test the deprecation class. | tests/test_deprecation.py | tests/test_deprecation.py | Python | 0.000001 | @@ -0,0 +1,350 @@
+from brownant import Brownant, BrownAnt%0A%0A%0Adef test_deprecation(recwarn):%0A app = BrownAnt()%0A warning = recwarn.pop(DeprecationWarning)%0A%0A assert isinstance(app, Brownant)%0A assert issubclass(warning.category, DeprecationWarning)%0A assert %22Brownant%22 in str(warning.mess... | |
ac1d552494f0161836139e8065ee0fa58077d796 | Add Selenium test for storage expiration. | tests/test_integration.py | tests/test_integration.py | # coding: utf-8
from __future__ import unicode_literals
import os
from xml.etree import ElementTree as ET
try:
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.wait import WebDriverWait
except ImportError:
webdriver = None
f... | Python | 0 | @@ -4370,22 +4370,21 @@
version_
-button
+panel
= self.
@@ -4412,18 +4412,10 @@
_by_
-class_name
+id
('Ve
@@ -4432,39 +4432,220 @@
Panel')%0A
- version_panel =
+%0A # Version panel isn't loaded%0A with self.assertRaises(NoSuchElementException):%0A version_panel.find_element_by_tag_... |
404c9b70cf9b6c27e0fb16be1556d01b5077a4f4 | Add test cases for 500 error with slow responses | tests/test_regressions.py | tests/test_regressions.py | Python | 0 | @@ -0,0 +1,1440 @@
+%22%22%22%0A%0A%22%22%22%0Aimport time%0Aimport logging%0Aimport unittest%0A%0Afrom flask import Flask%0Aimport mock%0A%0Afrom flask.ext.limiter.extension import C, Limiter%0A%0A%0Aclass RegressionTests(unittest.TestCase):%0A%0A def build_app(self, config=%7B%7D, **limiter_args):%0A app = ... | |
5e67c16d06786e5ed5e74e40a2c29131ec011748 | rename app to doc | corehq/apps/domainsync/management/commands/copy_doc.py | corehq/apps/domainsync/management/commands/copy_doc.py | from couchdbkit import Database
from dimagi.utils.couch.database import get_db
from django.core.management.base import LabelCommand, CommandError
from corehq.apps.domainsync.config import DocumentTransform, save
class Command(LabelCommand):
help = "Copy any couch doc"
args = '<sourcedb> <doc_id> (<domain>)'
... | Python | 0.000008 | @@ -524,19 +524,19 @@
-app
+doc
_id = ar
@@ -599,27 +599,27 @@
ne%0A%0A
-app
+doc
_json = sour
@@ -627,19 +627,19 @@
edb.get(
-app
+doc
_id)%0A
@@ -666,19 +666,19 @@
-app
+doc
_json%5B'd
@@ -725,19 +725,19 @@
ansform(
-app
+doc
_json, s
|
e56a0ca2d788bc3b865f6d18ad42e5feadb47566 | 添加新的数据格式,增加uuid实现 | upgrade/upgrade_from_3.py | upgrade/upgrade_from_3.py | Python | 0 | @@ -0,0 +1,1157 @@
+import hashlib%0Aimport json%0Aimport shutil%0Aimport uuid%0A%0Afrom common import file%0A%0A%0Adef add_id(list_item):%0A list_item%5B%22uuid%22%5D = str(uuid.uuid4())%0A return list_item%0A%0A%0Adef main():%0A shutil.copyfile(%22./config/page.json%22, %22./config/page.json.bak%22)%0A pa... | |
91b8239d858d60bbcd70e17870648a87b2d6da02 | add wip installer | local/bin/dotfiles.py | local/bin/dotfiles.py | Python | 0.000001 | @@ -0,0 +1,2515 @@
+#!/usr/bin/env python3%0A%0Aimport os%0Aimport sys%0A%0Adef exec_hook(hook):%0A with open(hook) as f:%0A exec(compile(f.read(), config_file, 'exec'), globals(), locals())%0A%0A#def generate_hook(dotfile):%0A%0Adef install_hook(dotfile, dotfilesdir):%0A # Fix relpath output%0A if dotfile.starts... | |
83041a8b132ce61910fdd0b6d9c24d020e857a04 | add test for compute_disparity_map timeout | tests/block_matching_test.py | tests/block_matching_test.py | Python | 0.000001 | @@ -0,0 +1,648 @@
+import os%0Aimport pytest%0A%0Aimport s2p%0Afrom tests_utils import data_path%0A%0A%0Adef test_compute_disparity_map_timeout(timeout=1):%0A %22%22%22%0A Run a long call to compute_disparity_map to check that the timeout kills it.%0A %22%22%22%0A img = data_path(os.path.join(%22input_pair%... | |
e8b09ed22bfe19c355b3dc315f0e831ac43f0c0d | Update code.py | code.py | code.py | Python | 0.000001 | @@ -0,0 +1,344 @@
+import web%0Aimport json%0A%0Aurls = (%0A '/', 'index'%0A)%0A%0A%0Aclass index:%0A def GET(self):%0A db = web.database(dbn='mysql', user='user', pw='password', db='test')%0A table = db.select('pw_policy')%0A return json.dumps(table%5B0%5D) + %22 hello world2%22%0A%0Aif __na... | |
e8bcdebaa9af0affa152a91ad489447d1cc4ba8f | Create main.py | main.py | main.py | Python | 0.000001 | @@ -0,0 +1,2462 @@
+# Released under MIT License %0A# Created By Agneeth Mazumdar%0A%0Afrom PIL import Image%0Afrom pptx import Presentation%0Afrom pptx.util import Inches%0Aimport urllib%0Aimport os%0Aimport csv%0A%0Aprs = Presentation()%0A%0Adef read_csv():%0A%0A names = %5B%5D%0A urls = %5B%5D%0A %0A wit... | |
72f43fc9c8aecc9fd8f240cfc37500cad4bc7858 | Test for math.assert_close() | tests/commit/math/test__functions.py | tests/commit/math/test__functions.py | Python | 0.000015 | @@ -0,0 +1,1283 @@
+from unittest import TestCase%0A%0Afrom phi import math%0A%0A%0Adef assert_not_close(*tensors, rel_tolerance, abs_tolerance):%0A try:%0A math.assert_close(*tensors, rel_tolerance, abs_tolerance)%0A raise BaseException(AssertionError('1 != 0'))%0A except AssertionError:%0A ... | |
27f187d3cc5725b6ed912e15ecafb38a44cc4992 | Add unit tests for new service util | tests/unit/utils/test_win_service.py | tests/unit/utils/test_win_service.py | Python | 0 | @@ -0,0 +1,2029 @@
+# Import Python Libs%0Aimport os%0A%0A# Import Salt Libs%0Aimport salt.utils.platform%0A%0A# Import Salt Testing Libs%0Afrom tests.support.mock import patch, MagicMock%0Afrom tests.support.unit import TestCase, skipIf%0A%0Atry:%0A import salt.utils.win_service as win_service%0A from salt.excep... | |
60b9041f76a88dddaf627458d98a357974a6a302 | Add __init__.py | __init__.py | __init__.py | Python | 0.006636 | @@ -0,0 +1,2 @@
+ %0A
| |
482218b20ea6281c49be7edd66370c778b301c7f | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
fa5ffd2f2f51607703912209b5876cb8f951df88 | Add simple testing driver | test.py | test.py | Python | 0.000002 | @@ -0,0 +1,247 @@
+import parser%0A%0Ap = parser.Parser()%0Ainput = %5B'-c mango', '--create mango', 'c mango',%0A '--create kiwi c guava lemon', '--create'%5D%0A%0Afor i in input:%0A ret = p.parse(i)%0A print('--------')%0A print(i)%0A print(ret)%0A print('--------')%0A
| |
775edf9fec8bbe32dceef3efc1e1cffc642ae61c | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1,112 @@
+__all__ = %5B%22SINGLE%22%5D%0A%0Aimport SINGLE%0A#from SINGLE import SINGLE%0A#from choose_h import *%0A#from fitSINGLE import *%0A
| |
a0705902dcf335cadeee717fbbdcbb247bc14645 | Move wsgi.py to project directory | wsgi.py | wsgi.py | Python | 0 | @@ -0,0 +1,395 @@
+%22%22%22%0AWSGI config for backstage project.%0A%0AIt exposes the WSGI callable as a module-level variable named %60%60application%60%60.%0A%0AFor more information on this file, see%0Ahttps://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/%0A%22%22%22%0A%0Aimport os%0A%0Afrom django.core.wsgi i... | |
b9283871a8be5ee0f289cb6181023a8366f530bd | modify response example | examples/middleware/modify_response/modify_response.py | examples/middleware/modify_response/modify_response.py | Python | 0.000002 | @@ -0,0 +1,607 @@
+#!/usr/bin/env python%0Aimport sys%0Aimport logging%0Aimport json%0A%0A%0Alogging.basicConfig(filename='middleware.log', level=logging.DEBUG)%0Alogging.debug('Middleware is called')%0A%0A%0Adef main():%0A data = sys.stdin.readlines()%0A # this is a json string in one line so we are interested i... | |
4e18da98f3398e1cc3b4c8f76bc8f81529baff3c | Add doc modification script | docs.py | docs.py | Python | 0 | @@ -0,0 +1,436 @@
+import glob%0A%0Afor filename in glob.glob(%22target/doc/serenity/**/*.html%22):%0A print('Parsing %7B%7D'.format(filename))%0A with open(filename) as f:%0A content = f.read()%0A%0A new_content = content.replace('%3Cnav class=%22sidebar%22%3E%5Cn', '%3Cnav class=%22sidebar%22%3E%3Cimg... | |
94cfd557b604947a1e2ce23fc67bf82c508439ff | change request.base_payout from float to numeric (decimal) | evesrp/migrate/versions/4198a248c8a_.py | evesrp/migrate/versions/4198a248c8a_.py | Python | 0 | @@ -0,0 +1,2605 @@
+%22%22%22Move from using floats for ISK to numeric types.%0A%0ARevision ID: 4198a248c8a%0ARevises: 45024170cf6%0ACreate Date: 2014-06-18 14:34:25.967159%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '4198a248c8a'%0Adown_revision = '45024170cf6'%0A%0Afrom decimal import De... | |
314b195160d539101dd3c3fa53e6f870fd2ee083 | add beautiful-triplets | contest/world-codesprint-april/beautiful-triplets/beautiful-triplets.py | contest/world-codesprint-april/beautiful-triplets/beautiful-triplets.py | Python | 0.999144 | @@ -0,0 +1,401 @@
+# -*- coding: utf-8 -*-%0A# @Author: Zeyuan Shang%0A# @Date: 2016-04-30 19:35:03%0A# @Last Modified by: Zeyuan Shang%0A# @Last Modified time: 2016-04-30 19:38:26%0A%0Aif __name__ == %22__main__%22:%0A%09n, d = map(int, raw_input().split())%0A%09a = map(int, raw_input().split())%0A%09ele = set()%0... | |
69f323bba974ea73963c8da63a3c3b8326fffc6e | Create RevLinkedList_002.py | leetcode/206-Reverse-Linked-List/RevLinkedList_002.py | leetcode/206-Reverse-Linked-List/RevLinkedList_002.py | Python | 0 | @@ -0,0 +1,530 @@
+# Definition for singly-linked list.%0A# class ListNode(object):%0A# def __init__(self, x):%0A# self.val = x%0A# self.next = None%0A%0Aclass Solution(object):%0A def reverseList(self, head):%0A %22%22%22%0A :type head: ListNode%0A :rtype: ListNode%0A ... | |
ced07a1f5d0d5c3c460bda1de29381ba7aff0c87 | add knn | 4/KNN.py | 4/KNN.py | Python | 0.999999 | @@ -0,0 +1,2450 @@
+# -*- coding: utf-8 -*-%0Aimport csv%0Aimport random%0Aimport math%0Aimport operator%0Aimport os%0A%0Adef loadDataSet(fileName, split, trainingSet=%5B%5D, testSet=%5B%5D):%0A with open(fileName, %22rb%22) as csvFile:%0A lines = csv.reader(csvFile)%0A dataSet = list(lines)%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.