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 |
|---|---|---|---|---|---|---|---|
a8efd5e94c206a9bbaf4a523fda7513acc2afa7f | add test-room-list.py | tests/twisted/avahi/test-room-list.py | tests/twisted/avahi/test-room-list.py | Python | 0.000007 | @@ -0,0 +1,1140 @@
+from saluttest import exec_test%0Afrom avahitest import AvahiAnnouncer, AvahiListener%0Afrom avahitest import get_host_name%0Aimport avahi%0A%0Afrom xmppstream import setup_stream_listener, connect_to_stream%0Afrom servicetest import make_channel_proxy%0A%0Afrom twisted.words.xish import xpath, domi... | |
81f9e6b245e81d653184579ca0c78b4d5559e715 | Create config-lite.py | config-lite.py | config-lite.py | Python | 0.000001 | @@ -0,0 +1,320 @@
+##%0A## User configuration file - edit these settings to suit your own project%0A##%0Afile_path = '/home/pi/RPi-RTL/images/' ## path to save images%0Afile_prefix = 'img_' ## prefix before timestamp.jpg, if needed - e.g. a project number%0Ause_timestamp = True ## True = timestamp in filename, F... | |
b0f112c6ab2a8860e9032adcccc4c90a4c43d5c3 | Create __init__.py | maya/python/playblast/timeUnitConvasion/__init__.py | maya/python/playblast/timeUnitConvasion/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
ea7d0f63507860f0777ad426771abfad9c578d8e | make sure ^regex matches longer string | src/collectors/processmemory/test/testprocessmemory.py | src/collectors/processmemory/test/testprocessmemory.py | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch, Mock
from diamond.collector import Collector
from processmemory import ProcessMem... | Python | 0.000028 | @@ -2364,32 +2364,149 @@
%0A %7D,%0A
+ %7B'name': 'barein',%0A 'pid': 9997,%0A 'rss': 1,%0A 'vms': 1%0A %7D,%0A
%7B'ex
@@ -2565,33 +2565,33 @@
'pid': 999
-8
+6
,%0A '
@@ -4247,17 +4247,17 @@
r.rss',
-1
+2
)%0A ... |
76ccb3e14da170000c8071203e931eeb8bc7c642 | Add a test case for deepcopy | tests/test_deepcopy.py | tests/test_deepcopy.py | Python | 0.000016 | @@ -0,0 +1,559 @@
+from tests.models import (%0A Cat,%0A Location,%0A)%0Aimport copy%0A%0Afrom rest_framework.test import APITestCase%0A%0A%0Aclass DeepcopyTestCase(APITestCase):%0A def test_cat(self):%0A home = Location(name='Home', blob='ILUVU')%0A papa = Cat(name='Papa')%0A kitkat = Cat... | |
880a15054ab5fbc49afe2aafce584fd423e511fa | Define constants module | napalm_iosxr/constants.py | napalm_iosxr/constants.py | Python | 0.000003 | @@ -0,0 +1,725 @@
+%22%22%22Constants for the IOS-XR driver.%22%22%22%0A%0Afrom __future__ import unicode_literals%0A%0Afrom napalm_base.constants import * # noqa%0A%0ASR_638170159_SOLVED = False%0A# this flag says if the Cisco TAC SR 638170159%0A# has been solved%0A#%0A# %22XML Agent Does not retrieve correct BGP rou... | |
47d770c6008116dd72c6c6b4572a0a92faa39e66 | Add test file for update.py | test/test_update.py | test/test_update.py | Python | 0 | @@ -0,0 +1,1086 @@
+#! /usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport os%0Aimport sys%0Aimport logging%0A%0Abasedir = os.path.realpath('..')%0Aif basedir not in sys.path:%0A sys.path.append(basedir)%0A%0Aimport update as up%0A%0A# logging%0ALOGFORMAT_STDOUT = %7B%0A logging.DEBUG: '%25(module)s:%25(fun... | |
7101dac32926e0f1403b44a93a6f5882a0aa5d2e | Create woc32p3.py | woc32p3.py | woc32p3.py | Python | 0.000007 | @@ -0,0 +1,1215 @@
+#!/bin/python3%0A%0Aimport sys%0A%0Adef boolProd(m1, m2):%0A %0A%0Adef circularWalk(n, s, t, r_0, g, seed, p):%0A # Complete this function%0A dist = %5B%5D%0A boolMatrix = %5B%5B%5D for w in range(n)%5D%0A for w in range(n):%0A for e in range(n):%0A boolMatrix%5Bw%5D... | |
97b933815dcbc179e25bc9c1c16cfa1153036ae1 | Add performance test for epsilon convolution | performance_tests/epsilon_convolution.py | performance_tests/epsilon_convolution.py | Python | 0.000026 | @@ -0,0 +1,1161 @@
+#!/usr/bin/python3%0A%0A'''%0AConvolution%0A'''%0A%0Afrom __future__ import print_function%0A%0Aimport numpy as np%0Aimport cProfile%0Aimport random%0Aimport matplotlib.pyplot as plt%0A%0Adef eps(s, t_membran):%0A return np.exp(-s / t_membran)%0A%0Adef small_spiketrain():%0A # 1000 timesteps%0... | |
5e27bf30286265f6ce2ba82a8a2edbae2bb421ae | add tests | test_tracemalloc.py | test_tracemalloc.py | Python | 0 | @@ -0,0 +1,1716 @@
+import os%0Aimport sys%0Aimport time%0Aimport tracemalloc%0Aimport unittest%0A%0AEMPTY_STRING_SIZE = sys.getsizeof(b'')%0A%0Adef get_lineno():%0A frame = sys._getframe(1)%0A return frame.f_lineno%0A%0Adef allocate_bytes(size):%0A filename = __file__%0A lineno = get_lineno() + 1%0A dat... | |
fc3ac8ca281bccc2f50c9f1fdd9a16b0c8658a01 | Add GDP test | platforms/m3/programming/goc_gdp_test.py | platforms/m3/programming/goc_gdp_test.py | Python | 0.000062 | @@ -0,0 +1,467 @@
+#!/usr/bin/env python2%0A%0Aimport code%0Atry:%0A%09import Image%0Aexcept ImportError:%0A%09from PIL import Image%0A%0Aimport gdp%0A%0Agdp.gdp_init()%0Agcl_name = gdp.GDP_NAME(%22edu.umich.eecs.m3.test01%22)%0Agcl_handle = gdp.GDP_GCL(gcl_name, gdp.GDP_MODE_RA)%0A%0A#j = Image.open('/tmp/capture1060.... | |
db43b2fe5c713ea91e189fb464d479142c5b7134 | tuple begins | think_python/tuples.py | think_python/tuples.py | Python | 0.999996 | @@ -0,0 +1,1344 @@
+%0Adef min_max(t):%0A%09return min(t),max(t)%0A%0Asum = 0%0Adef sumall(*args):%0A%09%22%22%22sum(1,2,3) gives invalid o/p%0A%09%22%22%22%0A%09global sum%0A%09for i in args:%0A%09%09sum += i%0A%09return sum%0A%0A%0Aprint 'Tuples are a seq of vals , indexed by integers ~ list'%0A%0At1 = 'a',%0Aprint '... | |
b3624916b29d25d1baec7c55da4cc7184e724812 | Add tests for LocalizedFieldsAdminMixin | tests/test_admin.py | tests/test_admin.py | Python | 0 | @@ -0,0 +1,2746 @@
+from django.apps import apps%0Afrom django.contrib import admin%0Afrom django.contrib.admin.checks import check_admin_app%0Afrom django.db import models%0Afrom django.test import TestCase%0A%0Afrom localized_fields.fields import LocalizedField%0Afrom localized_fields.admin import LocalizedFieldsAdmi... | |
cf090648a8c88b7f30eaa925358ff175cbcb976c | use dtype float32 | examples/ensemble/plot_gradient_boosting_quantile.py | examples/ensemble/plot_gradient_boosting_quantile.py | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
from sklearn.ensemble import GradientBoost... | Python | 0.000012 | @@ -611,16 +611,41 @@
=100)).T
+%0AX = X.astype(np.float32)
%0A%0A# Obse
@@ -756,16 +756,41 @@
+= noise
+%0Ay = y.astype(np.float32)
%0A%0A# Mesh
@@ -873,16 +873,16 @@
its MSE%0A
-
xx = np.
@@ -919,16 +919,43 @@
1000)).T
+%0Axx = xx.astype(np.float32)
%0A%0Aalpha
|
296ab4d527558a77cb635ea0754078c66bbd5462 | bump version to 1.0.0 pre | admin_sso/__init__.py | admin_sso/__init__.py | VERSION = (0, 1, 3,)
__version__ = '.'.join(map(str, VERSION))
# Do not use Django settings at module level as recommended
try:
from django.utils.functional import LazyObject
except ImportError:
pass
else:
class LazySettings(LazyObject):
def _setup(self):
from admin_sso import default_s... | Python | 0 | @@ -8,16 +8,22 @@
= (
-0, 1, 3,
+1, 0, 0, 'pre'
)%0A__
|
608896368fecb8c6fd6b0920280440b2720851ae | Update __init__.py | tendrl/node_agent/node_sync/__init__.py | tendrl/node_agent/node_sync/__init__.py | import gevent
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.message import Message
from tendrl.commons import sds_sync
from tendrl.commons.utils import time_utils
from tendrl.node_agent.node_sync import cluster_contexts_sync
from tendrl.node_agent.node_... | Python | 0.000002 | @@ -1873,32 +1873,43 @@
_index_sync.sync
+, _sync_ttl
)%0A sy
|
d32058b6a6d3db162b79628cadc9fa061672a297 | Add django sync db after migrate if using south | blues/django.py | blues/django.py | from fabric.context_managers import cd
from fabric.decorators import task, runs_once
from fabric.operations import prompt
from refabric.api import run, info
from refabric.context_managers import shell_env
from refabric.contrib import blueprints
from . import virtualenv
from .application.project import virtualenv_path... | Python | 0 | @@ -1199,24 +1199,76 @@
e --merge')%0A
+ manage('syncdb --noinput') # TODO: Remove?%0A
else:%0A
|
60fa72f1d6c21eda46124db02f1907046f8e3cb4 | Add boot_switch.py | boot_switch.py | boot_switch.py | Python | 0.000002 | @@ -0,0 +1,1368 @@
+import pyb%0A%0Asw = pyb.Switch()%0A# 1 - Red%0A# 2 - Green%0A# 3 - Yellow%0A# 4 - Blue%0Apyb.LED(2).off() # Turn Greem LED off since normal boot turns it on%0Aled = pyb.LED(1)%0Aleds = (pyb.LED(4), pyb.LED(3), pyb.LED(2))%0A%0Atry:%0A import boot_mode%0A persisted_mode = boot_mode.mode%0A ... | |
2bb33986002a1e1e5152b311662a200db717aa78 | change school object | migrations/versions/2ae4701a60b4_.py | migrations/versions/2ae4701a60b4_.py | Python | 0.000016 | @@ -0,0 +1,889 @@
+%22%22%22empty message%0A%0ARevision ID: 2ae4701a60b4%0ARevises: 013b5c571b68%0ACreate Date: 2016-09-11 15:43:53.495932%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '2ae4701a60b4'%0Adown_revision = '013b5c571b68'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A... | |
f2693a72f99a2d414b7ee76d0f542535aa0d9ec0 | Remove debug prints | checkers/rstripped.py | checkers/rstripped.py | def check(process_output, judge_output, **kwargs):
from itertools import izip
process_lines = process_output.split('\n')
judge_lines = judge_output.split('\n')
if 'filter_new_line' in kwargs:
process_lines = filter(None, process_lines)
judge_lines = filter(None, judge_lines)
print pr... | Python | 0.000001 | @@ -305,54 +305,8 @@
es)%0A
- print process_lines%0A print judge_lines%0A
@@ -352,31 +352,8 @@
s):%0A
- print %22fail 1%22%0A
@@ -500,35 +500,8 @@
():%0A
- print %22fail 2%22%0A
|
143bd8066ed53f7a1f70664f89dfd7323aba8e57 | Create 07.py | 02/qu/07.py | 02/qu/07.py | Python | 0 | @@ -0,0 +1,550 @@
+# Define a procedure, is_friend, that takes%0A# a string as its input, and returns a%0A# Boolean indicating if the input string%0A# is the name of a friend. Assume%0A# I am friends with everyone whose name%0A# starts with either 'D' or 'N', but no one%0A# else. You do not need to check for%0A# lower ... | |
f7d15618c661f1e7f555ce9d9a12fdbc851e76c9 | fix handling of version | octave_kernel/_version.py | octave_kernel/_version.py | Python | 0 | @@ -0,0 +1,23 @@
+__version__ = '0.33.1'%0A
| |
b7b088fc8e46376c8cb4608738c9dffcdb7d5dec | Add a test to verify filedes.subprocess.Popen()'s close_fds | tests/subprocess.py | tests/subprocess.py | Python | 0.000001 | @@ -0,0 +1,1631 @@
+from __future__ import absolute_import%0A%0Afrom filedes.test.base import BaseFDTestCase%0Afrom filedes.subprocess import Popen%0Afrom filedes import get_open_fds%0Afrom subprocess import PIPE, STDOUT%0Aimport filedes%0A%0A%0Aclass SubprocessTests(BaseFDTestCase):%0A def testPopenCloseFds(self):%... | |
be9d5ffc427c7303d6c85a091d2508021cc330dd | Add utility tests | tests/test_utils.py | tests/test_utils.py | Python | 0.000001 | @@ -0,0 +1,368 @@
+import numpy as np%0Aimport scarab%0Afrom nose.tools import *%0A%0Afrom common.utils import *%0A%0A%0Adef test_binary():%0A a = binary(1, size=5)%0A assert_true(np.all(a == %5B0, 0, 0, 0, 1%5D))%0A a = binary(2, size=3)%0A assert_true(np.all(a == %5B0, 1, 0%5D))%0A%0Adef test_encrypt_inde... | |
32c32d38d1305b92bcda07efaadd3b29dbf4ac31 | add piling-up | python/containers/piling-up/piling-up.py | python/containers/piling-up/piling-up.py | Python | 0.00007 | @@ -0,0 +1,531 @@
+from collections import deque%0A%0Aif __name__ == %22__main__%22:%0A T = int(raw_input())%0A for _ in xrange(T):%0A n = int(raw_input())%0A sl = deque(map(int, raw_input().split()))%0A ans = %5B%5D%0A while len(sl) %3E 0:%0A if sl%5B0%5D %3E= sl%5B-1%5D:%0... | |
5c57882c74cf8dad132b255a285566c7329a1569 | add google reader starred python example | pythonexamples/addGoogleReaderStarred.py | pythonexamples/addGoogleReaderStarred.py | Python | 0 | @@ -0,0 +1,2923 @@
+#!/usr/bin/python%0A%0Aimport sys%0Asys.path.append('../lib/py') # unnecessary if libZotero is installed separately%0Aimport json%0Aimport time%0Aimport argparse%0Afrom libZotero import zotero%0A%0Aparser = argparse.ArgumentParser(description='Add starred items from google reader to your Zotero lib... | |
2e7252fab4667047c04b540040d5ad2287a73299 | Add management command to import geolocation data | parrainage/app/management/commands/import_geoloc.py | parrainage/app/management/commands/import_geoloc.py | Python | 0.000001 | @@ -0,0 +1,1387 @@
+# Copyright 2017 Rapha%C3%ABl Hertzog%0A#%0A# This file is subject to the license terms in the LICENSE file found in%0A# the top-level directory of this distribution.%0A%0Aimport argparse%0Afrom datetime import datetime%0Aimport csv%0Aimport logging%0Aimport sys%0A%0Afrom django.core.management.base... | |
3d7640a014d110f5600dc317b16585874934b3e7 | check updates for amazon linux | check_updates_amazonlinux.py | check_updates_amazonlinux.py | Python | 0 | @@ -0,0 +1,982 @@
+#!/usr/bin/python%0A%0Aimport subprocess,sys,json%0A%0AMETRIC_UNITS=%7B'Available_Updates':'count','Security_Updates':'count'%7D%0APLUGIN_VERSION=%221%22%0AHEARTBEAT=%22true%22%0A%0Aclass datacollector:%0A def __init__(self):%0A self.data=%7B%7D%0A self.data%5B'plugin_version'%5D=PLU... | |
73bb34ad6e481f5ebcc3623d7f63af87986d3cc7 | Create new package. (#5642) | var/spack/repos/builtin/packages/r-affycomp/package.py | var/spack/repos/builtin/packages/r-affycomp/package.py | Python | 0 | @@ -0,0 +1,1695 @@
+##############################################################################%0A# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
2ea0f3c172f80e8ca5dc55d1ab6416707d4ba485 | Add motor configuration | core/mongo.py | core/mongo.py | Python | 0.000002 | @@ -0,0 +1,127 @@
+from motor.motor_tornado import MotorClient%0A%0Adef mongo_configurations(config):%0A return MotorClient(config.get('MONGO_URI'))%0A
| |
679b94772232e20095692361a43d48834ed383f3 | Create flight.py | flight.py | flight.py | Python | 0.000054 | @@ -0,0 +1,1717 @@
+'''%0ACreated on Aug 12, 2015%0A%0A@author: sadhna01%0A'''%0A'''%0ACreated on Aug 12, 2015%0A%0A@author: sahil.singla01%0A'''%0A%0Aclass Flight:%0A def __init__(self):%0A self.__flight_id=None%0A self.__flight_name=None%0A self.__source=None%0A self.__destination=None%... | |
be4abd8d3b54ab66f89c88e56cb948d5bf5f5725 | Add the static info gatherer | stoneridge_info_gatherer.py | stoneridge_info_gatherer.py | Python | 0 | @@ -0,0 +1,1289 @@
+#!/usr/bin/env python%0A%0Atry:%0A import configparser%0Aexcept ImportError:%0A import ConfigParser as configparser%0A%0Aimport json%0Aimport os%0Aimport platform%0A%0Aimport stoneridge%0A%0Aclass StoneRidgeInfoGatherer(object):%0A def run(self):%0A info_file = os.path.join(stoneridg... | |
daf6ef7990cb56c960f5099dcee5ebc93596dba0 | Add verifier | coliziune/verifier.py | coliziune/verifier.py | Python | 0.000006 | @@ -0,0 +1,697 @@
+def verify(n, m, b, first, second):%0A s1, s2 = 0, 0%0A for i in range(len(first)):%0A s1 += (int(first%5Bi%5D) + 1) * b ** (n-i)%0A s2 += (int(second%5Bi%5D) + 1) * b ** (n-i)%0A return s1 %25 m == s2 %25 m%0A%0Awith open('coliziune.in') as fin, open('coliziune.out') as fout:%... | |
e1a836a5f0bf45854ae634134984a69517c4c1e0 | fix wrong variable name was used | django_object_actions/utils.py | django_object_actions/utils.py | from functools import wraps
from django.conf.urls import patterns
from django.contrib import messages
from django.db.models.query import QuerySet
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
class D... | Python | 0.000003 | @@ -1521,17 +1521,25 @@
name=
-x
+tool_name
,%0A
@@ -1577,17 +1577,25 @@
label',
-x
+tool_name
),%0A
|
3dfe72a6da11e8223a66e86fabf67146e1d4cb1f | Add base error type for user code | app/common/errors.py | app/common/errors.py | Python | 0.000001 | @@ -0,0 +1,109 @@
+from __future__ import unicode_literals, absolute_import, division%0A%0A%0Aclass BaseAppError(Exception):%0A pass%0A
| |
f8373cefae048b8d60db06d9527c45375d49549e | Add locust test script. | testing/cloudControllerLocustTester.py | testing/cloudControllerLocustTester.py | Python | 0 | @@ -0,0 +1,242 @@
+from locust import HttpLocust, TaskSet, task%0A%0Aclass WebsiteTasks(TaskSet):%0A @task%0A def index(self):%0A self.client.get(%22/service%22)%0A%0Aclass WebsiteUser(HttpLocust):%0A task_set = WebsiteTasks%0A min_wait = 1000%0A max_wait = 1000%0A
| |
85c6aad62db7c7c5daa47eff871fbd1483c8dff9 | Add a gdb viewer for skbitmap. | tools/gdb/bitmap.py | tools/gdb/bitmap.py | Python | 0.000007 | @@ -0,0 +1,2380 @@
+# Copyright 2017 Google Inc.%0A#%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22%0AVisualize bitmaps in gdb.%0A%0A(gdb) source %3Cpath to this file%3E%0A(gdb) sk_bitmap %3Csymbol%3E%0A%0AThis should pop up a window with the bit... | |
5a2394f8445350387adc30dd5bc818971aefc91d | Add work for Exercise 25. | lpthw/ex25.py | lpthw/ex25.py | Python | 0 | @@ -0,0 +1,980 @@
+def break_words(stuff):%0A %22%22%22This function will brea up words for us.%22%22%22%0A words = stuff.split(' ')%0A return words%0A%0Adef sort_words(words):%0A %22%22%22Sorts the words.%22%22%22%0A return sorted(words)%0A%0Adef print_first_word(words):%0A %22%22%22Prints the first ... | |
f8e78cdf12142b214f7f6513dc858abffc133789 | add test suite for issues and bugs | test_project/test_project/test_bugs.py | test_project/test_project/test_bugs.py | Python | 0 | @@ -0,0 +1,1157 @@
+import unittest%0Aimport transaction%0Aimport testing.postgresql%0Aimport webtest%0Aimport urllib%0Afrom pyramid.paster import get_app%0Afrom sqlalchemy import create_engine%0A%0Afrom .models import (%0A DBSession,%0A Base%0A)%0A%0Afrom . import test_data%0A%0Aclass TestBugs(unittest.TestCase)... | |
650b0db8f27f90d1092ffd4295ec154c33f25cde | test commit | pid.py | pid.py | Python | 0.000001 | @@ -0,0 +1,570 @@
+#!/usr/bin/env python%0A#coding: utf-8%0A%09%0Aimport jpype,time,os%0A%0A#%E5%BC%80%E5%90%AFJVM%EF%BC%8C%E4%B8%94%E6%8C%87%E5%AE%9Ajar%E5%8C%85%E4%BD%8D%E7%BD%AE%0Ajarpath = os.path.join(os.path.abspath('.'), '/work/appiumframework/apps/')%0Aprint(jarpath, jpype.getDefaultJVMPath())%0Ajpype.startJVM(... | |
abab11646518f78019d44542c277cadfbb354c1a | add computation of temperature within a season | scripts/feature/temperature_in_season.py | scripts/feature/temperature_in_season.py | Python | 0.999066 | @@ -0,0 +1,2017 @@
+import psycopg2%0Aimport numpy%0Aimport datetime%0ACOOP = psycopg2.connect(database='coop', host='iemdb', user='nobody')%0Acursor = COOP.cursor()%0A%0A# 50 to 120%0Ain_summer = numpy.zeros( (70,))%0Acounts = numpy.zeros( (70,))%0Ain_jja = numpy.zeros( (70,))%0Acofreq = numpy.zeros( (70,))%0A%0Afor y... | |
4d3217808680a9b5e15f3067eae2b472d526ca8f | Revert of Update smoothness_controller to use results.AddValue(...) (https://codereview.chromium.org/380803002/) | tools/perf/measurements/smoothness_controller.py | tools/perf/measurements/smoothness_controller.py | # Copyright 2014 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.
import sys
from measurements import smooth_gesture_util
from telemetry.timeline.model import TimelineModel
from telemetry.page import page_measurement
from t... | Python | 0.000047 | @@ -483,43 +483,8 @@
ess%0A
-from telemetry.value import scalar%0A
%0A%0ARU
@@ -4254,68 +4254,9 @@
.Add
-Value(scalar.ScalarValue(%0A results.current_page,
+(
r.na
@@ -4275,17 +4275,16 @@
r.value)
-)
%0A%0A def
|
6e62c6e65376c890adb4c3f56159ba8cc857d565 | Create new_file.py | new_file.py | new_file.py | Python | 0.000006 | @@ -0,0 +1,88 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22A new file%22%22%22%0A%0Aprint 'New files rule!'%0A
| |
ef56a72b73bd408bb51d235b2274eef8766e0277 | add simple watch_notify stress test | teuthology/task/watch_notify_stress.py | teuthology/task/watch_notify_stress.py | Python | 0.000017 | @@ -0,0 +1,2189 @@
+import contextlib%0Aimport logging%0A%0Afrom ..orchestra import run%0A%0Alog = logging.getLogger(__name__)%0A%0A@contextlib.contextmanager%0Adef task(ctx, config):%0A %22%22%22%0A Run test_stress_watch%0A%0A The config should be as follows:%0A%0A test_stress_watch:%0A clients: %5B... | |
1c68c6b3da5677ce0847eb563bfea0ed3d8810a0 | add language detection tween (from PATH_INFO) | amnesia/translations/tweens.py | amnesia/translations/tweens.py | Python | 0 | @@ -0,0 +1,457 @@
+# -*- coding: utf-8 -*-%0A%0Adef path_info_lang_tween_factory(handler, registry):%0A%0A def path_info_lang_tween(request):%0A%0A if not hasattr(request, '_LOCALE_'):%0A if request.path_info_peek() in ('en', 'fr'):%0A lang = request.path_info_pop()%0A els... | |
38d340c2a866a445160393029fa3b0c07131818a | Create test-tport.py | test/python/test-tport.py | test/python/test-tport.py | Python | 0.000002 | @@ -0,0 +1,2787 @@
+import os%0Aimport sys%0Afrom tibrv.tport import *%0Afrom tibrv.status import *%0Afrom tibrv.tport import *%0Aimport unittest%0A%0Aclass TransportTest(unittest.TestCase):%0A%0A @classmethod%0A def setUpClass(cls):%0A status = Tibrv.open()%0A if status != TIBRV_OK:%0A r... | |
b45b425414da5fc65f171b6f81c5983aade98fb6 | Add run.py | run.py | run.py | Python | 0.000009 | @@ -0,0 +1,477 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0AThis script generates all the relevant figures from the experiment.%0A%0A%22%22%22%0A%0Afrom Modules.processing import *%0Afrom Modules.plotting import *%0A%0Adef main():%0A save = True%0A savetype = %22.pdf%22%0A plot_perf_curves(save=save, savetype=sav... | |
103f1fe13a8a807a0bfc93df5e4b1a17281e28b4 | Create tool instance and run from command line | run.py | run.py | Python | 0 | @@ -0,0 +1,204 @@
+#!/usr/bin/env python%0Afrom performance_testing.command_line import Tool%0A%0A%0Adef main():%0A tool = Tool(config='config.yml', output_directory='result')%0A tool.run()%0A%0Aif __name__ == '__main__':%0A main()%0A
| |
0700ce9be37ada187105c5f38983092b6bba9762 | Test new backend methods | test/util/test_backend.py | test/util/test_backend.py | Python | 0.000001 | @@ -0,0 +1,2013 @@
+# -*- encoding: utf-8 -*-%0Afrom __future__ import print_function%0Aimport unittest%0Aimport mock%0Afrom autosklearn.util.backend import Backend%0A%0A%0Aclass BackendModelsTest(unittest.TestCase):%0A%0A class BackendStub(Backend):%0A%0A def __init__(self, model_directory):%0A se... | |
faffa1c83e599730105f1fe38b253aafb2b00d18 | Add headerimage tests | src/zeit/content/cp/browser/blocks/tests/test_headerimage.py | src/zeit/content/cp/browser/blocks/tests/test_headerimage.py | Python | 0 | @@ -0,0 +1,1165 @@
+import zeit.cms.testing%0Aimport zeit.content.cp%0Aimport zeit.content.cp.centerpage%0A%0A%0Aclass TestHeaderImage(zeit.cms.testing.BrowserTestCase):%0A%0A layer = zeit.content.cp.testing.ZCML_LAYER%0A%0A def setUp(self):%0A super(TestHeaderImage, self).setUp()%0A with zeit.cms.t... | |
bdd532cccf504dc9fbf21a9e72b8185dc910ec94 | Add management command for running the task for validating all data catalogs. | thezombies/management/commands/validate_all_data_catalogs.py | thezombies/management/commands/validate_all_data_catalogs.py | Python | 0.000001 | @@ -0,0 +1,379 @@
+from django.core.management.base import NoArgsCommand%0Afrom thezombies.tasks.main import validate_data_catalogs%0A%0A%0Aclass Command(NoArgsCommand):%0A %22%22%22Validate all of the agency data catalogs%22%22%22%0A%0A def handle_noargs(self):%0A validator_group = validate_data_catalogs.... | |
0dbc7432bf78850dee10b8d814b1d9eb74fa5afc | add test wing defender play | soccer/gameplay/plays/testing/test_wing_defender.py | soccer/gameplay/plays/testing/test_wing_defender.py | Python | 0.000001 | @@ -0,0 +1,681 @@
+import play%0Aimport behavior%0Aimport constants%0Aimport robocup%0Aimport tactics.positions.wing_defender%0Aimport main%0A%0Aclass TestWingDefender(play.Play):%0A def __init__(self):%0A super().__init__(continuous=True)%0A%0A self.add_transition(behavior.Behavior.State.start,%0A ... | |
a2086c9c5c11586b04ca934bdad838babad087ee | add a mk-wof-config utility script | utils/mk-wof-config.py | utils/mk-wof-config.py | Python | 0 | @@ -0,0 +1,2813 @@
+#!/usr/bin/env python%0A%0Aimport sys%0Aimport os%0Aimport json%0Aimport random%0Aimport logging%0Aimport socket%0A%0Aimport mapzen.whosonfirst.placetypes%0A%0Aif __name__ == '__main__':%0A%0A import optparse%0A opt_parser = optparse.OptionParser()%0A%0A opt_parser.add_option('-w', '--wof',... | |
0fb8dec880b7a48002929fc54c6e337be63afa05 | Add missing manage.py | travis_ci/manage.py | travis_ci/manage.py | Python | 0.00001 | @@ -0,0 +1,252 @@
+#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22travis_ci.settings%22)%0A%0A from django.core.management import execute_from_command_line%0A%0A execute_from_command_line(sys.argv)%0A
| |
24e14b7d53e43f1574971ff5b6eee6d0185df23a | Add tests for retrieving/updating reverse fks | rest_framework/tests/nested_relations.py | rest_framework/tests/nested_relations.py | Python | 0 | @@ -0,0 +1,2472 @@
+from copy import deepcopy%0Afrom django.db import models%0Afrom django.test import TestCase%0Afrom rest_framework import serializers%0A%0A%0A# ForeignKey%0A%0Aclass ForeignKeyTarget(models.Model):%0A name = models.CharField(max_length=100)%0A%0A%0Aclass ForeignKeySource(models.Model):%0A name ... | |
78fa851ffa6a9594dbbd41a6d572674552d76c85 | Install constants file. | txrudp/constants.py | txrudp/constants.py | Python | 0 | @@ -0,0 +1,369 @@
+%22%22%22Constants governing operation of txrudp package.%22%22%22%0A%0A# %5Bbytes%5D%0AUDP_SAFE_PACKET_SIZE = 1000%0A%0A# %5Blength%5D%0AWINDOW_SIZE = 65535 // UDP_SAFE_PACKET_SIZE%0A%0A# %5Bseconds%5D%0ATIMEOUT = 0.7%0A%0A# %5Bseconds%5D%0A_MAX_PACKET_DELAY = 20%0A%0A# If a packet is retransmitted ... | |
9d550e9403560a84a75aad55a91ca661fcef7957 | Implement a hook for Issue #41 | aspen/hooks/options200.py | aspen/hooks/options200.py | Python | 0.000002 | @@ -0,0 +1,222 @@
+%0Afrom aspen import Response%0A%0Adef hook(request):%0A %22%22%22A hook to return 200 to an 'OPTIONS *' request%22%22%22%0A if request.line.method == %22OPTIONS%22 and request.line.uri == %22*%22:%0A raise Response(200)%0A return request%0A%0A
| |
632b3530f6b04d82bc66299d34137d3a76fb8f90 | add a test for only loading N items parameter | tests/test_special_feeds.py | tests/test_special_feeds.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
libG(oogle)Reader
Copyright (C) 2010 Matt Behrens <askedrelic@gmail.com> http://asktherelic.com
Python library for working with the unofficial Google Reader API.
Unit tests for feeds. Requires mechanize for automated oauth authenication.
"""
try:
import unitte... | Python | 0 | @@ -1379,24 +1379,355 @@
.isRead())%0A%0A
+ def test_loading_item_count(self):%0A ca = ClientAuthMethod(username,password)%0A reader = GoogleReader(ca)%0A container = SpecialFeed(reader, ReaderUrl.READING_LIST)%0A container.loadItems(loadLimit=5)%0A%0A self.assertEqual(5, len(cont... |
8ee78c14af3b9974ad96cf85f6ea32c4e254f958 | Add calcurse-dateutil | contrib/calcurse-dateutil.py | contrib/calcurse-dateutil.py | Python | 0.000568 | @@ -0,0 +1,1764 @@
+#!/usr/bin/env python3%0A%0Aimport argparse%0Aimport datetime%0A%0A%0Adef get_date(s):%0A return datetime.datetime.strptime(s, '%25Y-%25m-%25d').date()%0A%0A%0Aparser = argparse.ArgumentParser('calcurse-dateutil')%0Aparser.add_argument('--date', type=get_date, action='store', dest='date')%0Aparse... | |
bbf1e1532ef1827c808c60fe8f7459a438789aaf | work on csv collection | smappdragon/collection/csv_collection.py | smappdragon/collection/csv_collection.py | Python | 0 | @@ -0,0 +1,1194 @@
+import os%0Aimport unicodecsv%0A%0Afrom smappdragon.tools.tweet_parser import TweetParser%0Afrom smappdragon.collection.base_collection import BaseCollection%0A%0Aclass CsvCollection(BaseCollection):%0A '''%0A method that tells us how to%0A create the CsvCollection object%0A '''%... | |
755f6f701c5bef733531c33da2b1a0918a9f84dc | add daemonize | tsutil/daemonize.py | tsutil/daemonize.py | Python | 0.000002 | @@ -0,0 +1,1049 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# @Author: Turbidsoul Chen%0A# @Date: 2014-03-07 17:11:20%0A# @Last Modified by: Turbidsoul Chen%0A# @Last Modified time: 2014-07-16 15:52:49%0A%0A%0Aimport os%0Aimport sys%0A%0A%0Adef daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev... | |
e8235b10c610aae51213e8f090e3bf692f99adcc | Add the cbtf-lanl spack build package. cbtf-lanl is LANLs contribution to the CBTF project. It contains psTool and memTool which are example tools, showing use case examples for CBTF. | var/spack/packages/cbtf-lanl/package.py | var/spack/packages/cbtf-lanl/package.py | Python | 0 | @@ -0,0 +1,2519 @@
+################################################################################%0A# Copyright (c) 2015 Krell Institute. All Rights Reserved.%0A#%0A# This program is free software; you can redistribute it and/or modify it under%0A# the terms of the GNU General Public License as published by the Free... | |
e3842cfbdfbf5c28e70916080fe4ce1ffad7c75c | Add bleu-score calculator | CA4011/bleu-score.py | CA4011/bleu-score.py | Python | 0 | @@ -0,0 +1,432 @@
+print((lambda n,p,t,r:min(1,len(t)/len(r))*__import__(math).pow(p(n,t,r,1)*p(n,t,r,2)*p(n,t,r,3)*p(n,t,r,4),0.25))(lambda s,l:%5Bs%5Bi:i+l%5Dfor i in range(len(s)-l+1)%5D,lambda n,t,r,s:(lambda T,R:sum(%5Bg in R and(R.remove(g)or 1)for g in T%5D)/len(T)if len(T+R)else 1)(%5B.join(x)for x in n(t,s)%5D... | |
adbe1d4f06028ba13e21386f7d62939d4b2eb740 | Add PatchELF package | var/spack/packages/patchelf/package.py | var/spack/packages/patchelf/package.py | Python | 0 | @@ -0,0 +1,525 @@
+from spack import *%0A%0Aclass Patchelf(Package):%0A %22%22%22PatchELF is a small utility to modify the dynamic linker and RPATH of ELF executables.%22%22%22%0A%0A homepage = %22https://nixos.org/patchelf.html%22%0A url = %22http://nixos.org/releases/patchelf/patchelf-0.8/patchelf-0.8.t... | |
b4d6fc7ed10bb7e424797aaa8bcfff8ad738cd97 | Add __init__ file to permit import as module | __init__.py | __init__.py | Python | 0.000004 | @@ -0,0 +1 @@
+%0A
| |
195eba54a45e8d841e1e9574938bef1d2440eb06 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
2124026b3b6468789f599a2bc5382e69e3d27310 | Add __main__.py | __main__.py | __main__.py | Python | 0.001431 | @@ -0,0 +1,95 @@
+#! usr/bin/env python2%0A%0Aimport PlayAsOne%0A%0Aif __name__ == '__main__':%0A PlayAsOne.PlayAsOne()%0A
| |
b46e223340ecb4c4056eb89fa08aaff64fceaa09 | Add command | mangaki/mangaki/management/commands/findneighbors.py | mangaki/mangaki/management/commands/findneighbors.py | Python | 0.001952 | @@ -0,0 +1,973 @@
+from django.core.management.base import BaseCommand, CommandError%0Afrom django.contrib.auth.models import User%0Afrom mangaki.models import Neighborship, Rating%0Afrom collections import Counter%0A%0Aclass Command(BaseCommand):%0A args = ''%0A help = ''%0A def handle(self, *args, **options)... | |
7627d58460c3683e51f944e49dc9ab31c8beda06 | Create default_gateway_checker.py | mk-verificator/networking/default_gateway_checker.py | mk-verificator/networking/default_gateway_checker.py | Python | 0.000003 | @@ -0,0 +1,934 @@
+#!/usr/bin/env python%0A%0Aimport json%0Aimport salt.client as client%0A%0Adef main():%0A local = client.LocalClient()%0A %0A netstat_info = local.cmd('*', 'cmd.run', %5B'ip r %7C sed -n 1p'%5D)%0A # %7Bnode:%22default via 10.xxx.xxx.xxx dev ethx%22, %7D%0A%0A groups = %7B%7D%0A for... | |
12c50dbac8179b92272136c512e034f6782027df | Introduce a GlobalStack class | cura/Settings/GlobalStack.py | cura/Settings/GlobalStack.py | Python | 0 | @@ -0,0 +1,757 @@
+# Copyright (c) 2017 Ultimaker B.V.%0A# Cura is released under the terms of the AGPLv3 or higher.%0A%0Afrom UM.MimeTypeDatabase import MimeType, MimeTypeDatabase%0Afrom UM.Settings.ContainerStack import ContainerStack%0Afrom UM.Settings.ContainerRegistry import ContainerRegistry%0A%0Aclass CannotSetN... | |
f5ef5c2a986d56495069c7ccad5e56fb097ea17b | Create t.py | t.py | t.py | Python | 0.000001 | @@ -0,0 +1,387 @@
+from appJar import gui%0Aimport sys%0A%0Akeyfilename = %22%22%0Akeyfileinuse = False%0Aport = sys.argv%5B4%5D%0Aip = sys.argv%5B1%5D%0Ausername = sys.argv%5B2%5D%0Apassword = sys.argv%5B3%5D%0A#The stuff above takes args from login.py%0Abalance = 0%0A#Gets balance%0Aapp = gui(%22HODLER ADMIN%22, %224... | |
5439a712f1f33117561ca0448d8a88ff53ec8979 | Add initial spin_fort test (#5658) | pokemongo_bot/test/spin_fort_test.py | pokemongo_bot/test/spin_fort_test.py | Python | 0.000001 | @@ -0,0 +1,2147 @@
+import os%0Aimport pickle%0Aimport unittest%0A%0Afrom mock import MagicMock, patch%0Afrom pokemongo_bot.cell_workers.spin_fort import SpinFort%0Afrom pokemongo_bot.inventory import Items%0A%0Aconfig = %7B%0A %22spin_wait_min%22: 0,%0A %22spin_wait_max%22: 0,%0A %22daily_spin_limit%22: 100,%0A%7D%... | |
0eeff1ec1498f98d624dad90a60d24ab44cc31de | Fix cleanvcf.py when handling chromosome changes Arvados-DCO-1.1-Signed-off-by: Jiayong Li <jli@curii.com> refs #14992 | cwl-version/preprocess/gvcf/filterclean/src/cleanvcf.py | cwl-version/preprocess/gvcf/filterclean/src/cleanvcf.py | #!/usr/bin/env python
from __future__ import print_function
import sys
def is_header(line):
"""Check if a line is header."""
return line.startswith('#')
# FIELD index
# CHROM 0, POS 1, REF 3
def main():
previous_CHROM = ""
previous_end_POS = 0
for line in sys.stdin:
if not is_header(li... | Python | 0.000005 | @@ -740,17 +740,34 @@
d_POS =
-0
+POS + len(REF) - 1
%0A
|
d2c26cdfb9077aa5e3e8f9a5e2b89c8085bdd2d9 | Create RLU_back_propagation.py | Neural-Networks/RLU_back_propagation.py | Neural-Networks/RLU_back_propagation.py | Python | 0.000002 | @@ -0,0 +1,1750 @@
+# back propagation algorithm%0A%0Afrom numpy import *%0A%0Adef back_propagation(y, A, MEGA_THETA, xi):%0A%09# assume y, A, xi are 1-D column vectors (row-less)%0A%09# assume MEGA_THETA is 2-D array%0A%09%0A%09# define useful constants%0A%09L = size(xi)%0A%09a = A%5B-xi%5B-1%5D:%5D%5B:, newaxis%5D %0... | |
9ec9dca1bc599a3a4234881029f9dfff5f0a2e63 | Add vacation_overlap. | problem/bench/db/vacation_overlap.py | problem/bench/db/vacation_overlap.py | Python | 0.000003 | @@ -0,0 +1,1369 @@
+#! /usr/bin/env python%0A%0A%22%22%22Al and Ben will each take vacations, with overlap.%0AHow short staffed will the office be, on a daily basis?%0A%22%22%22%0A%0Aimport datetime as dt%0A%0Aimport sqlalchemy as sa%0A%0A%0Aclass Vacation:%0A%0A def __init__(self):%0A self.engine = sa.create... | |
1dc52c2139e535b487cd9082259ac74802313132 | Create Wiki_XML.py | week4-5/Wiki_XML.py | week4-5/Wiki_XML.py | Python | 0.000002 | @@ -0,0 +1,1970 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Tue Sep 27 14:25:47 2017%0A%0A@author: Laurent Vermue (lauve@dtu.dk)%0A%22%22%22%0Aimport xml.etree.ElementTree as ET%0Aimport time%0Aimport re%0Afrom bz2file import BZ2File%0Aimport sqlite3%0Afrom psutil import virtual_memory... | |
4900617f38a912fbf386c6a87c55627d87dd59fd | Add test_assign.py | python/test/function/test_assign.py | python/test/function/test_assign.py | Python | 0.00003 | @@ -0,0 +1,1376 @@
+# Copyright (c) 2017 Sony Corporation. 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/licenses/LICENSE-... | |
768a75647f38763e4361deb15b44d35e0fd8b13f | put in actual args for add | vent/api/actions.py | vent/api/actions.py | import json
import os
from vent.api.plugins import Plugin
from vent.api.templates import Template
from vent.helpers.meta import Version
class Action:
""" Handle actions in menu """
def __init__(self, **kargs):
self.plugin = Plugin(**kargs)
def add(self, repo, tools=None, overrides=None, version="HEAD... | Python | 0 | @@ -506,39 +506,16 @@
(s) %22%22%22%0A
- args = locals()%0A
s
@@ -567,20 +567,575 @@
gin.add(
-args
+repo,%0A tools=None,%0A overrides=None,%0A version=%22HEAD%22,%0A branch=%22mas... |
b9044185e572c811ebe8a8fc89d54f141b0466fb | Add getCurrentConfig method to track.py | play-server/track.py | play-server/track.py | Python | 0.000001 | @@ -0,0 +1,275 @@
+import configmanager%0Aimport osascript%0A%0AAPP_CONFIG_PATH = %22applications/%22%0A%0AapplicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)%0A#TODO: Make this user choosable%0AcurrentApplication = %22radiant%22%0A%0Adef getCurrentConfig():%0A%09return applicationConfigs%5BcurrentApplica... | |
5426b2be91d7cd42e70d074e305b6e6b705dd67b | Improve multy ordering in admin change list: http://code.djangoproject.com/ticket/389 | misc/admin.py | misc/admin.py | Python | 0 | @@ -0,0 +1,1742 @@
+from django.contrib.admin.views.main import ChangeList%0A%0A%0Aclass SpecialOrderingChangeList(ChangeList):%0A %22%22%22%0A Override change list for improve multiordering in admin change list.%0A %60Django will only honor the first element in the list/tuple ordering attribute; any others wi... | |
554862c81e084f55a1b42db60b1275bf7b90868d | Function to work out useful things for spatial data: TwoPoinDistanceKm | Geography.py | Geography.py | Python | 0.999937 | @@ -0,0 +1,2912 @@
+#!/usr/local/sci/bin/python%0A%0A#***************************************%0A# Code to work out useful things from spatial data:%0A#%0A#1. TwoPointDistanceKm%0A# Distance between two points in space in km%0A# Needs latitudes (-90 to 90) and longitudes (-180 to 180)%0A# www.johndcook.com/python_... | |
edca5c6332d8301da5473e204a10e82acf47c40f | Add mixin_demo.py | mixin_demo.py | mixin_demo.py | Python | 0.000001 | @@ -0,0 +1,2301 @@
+import time%0A%0A%0Aclass Mixin(object):%0A mixins = %7B%7D%0A def __init__(self, target, mixin, key=%22%22):%0A self.key = key.upper() + %22_CALCULATION_MODE%22%0A self.target = target%0A self.mixin = mixin%0A%0A def __enter__(self):%0A return self._load()%0A%0A... | |
95d855743e9f37e87397c9be7ffc9b888320a4ac | Add the init method to the note model. | model/note.py | model/note.py | Python | 0 | @@ -0,0 +1,147 @@
+class NoteModel(Query):%0A def __init__(self, db):%0A self.db = db%0A self.table_name = %22note%22%0A super(NoteModel, self).__init__()
| |
5854334b3ed9b20886e0dd62e21094e7df0fdad0 | add basic test for schema | tests/test_schema.py | tests/test_schema.py | Python | 0.000002 | @@ -0,0 +1,310 @@
+from __future__ import absolute_import%0A%0A# import pytest%0A%0Aimport schematec.schema%0A# import schematec.converters as converters%0A# import schematec.validators as validators%0A# import schematec.exc as exc%0A%0A%0Adef test_empty_schema_with_empty_value():%0A schema = schematec.schema.Schema... | |
655fc717469c2f8fa49b4c55e4f0a1768b045758 | add quick sort | Python/quick_sort.py | Python/quick_sort.py | Python | 0.000001 | @@ -0,0 +1,858 @@
+arr = %5B134,53,4,234,23,452,3,5,43,534,3,5,435,345%5D%0A%0Adef sort(arr):%0A%09low = 0%0A%09high = len(arr)-1%0A%09quick_sort(arr,low,high)%0A%0Adef get_pivot(arr,low,high):%0A%09mid = (high + low) // 2%0A%09pivot = high%0A%09if arr%5Blow%5D %3C arr%5Bmid%5D:%0A%09%09pivot = mid%0A%09elif arr%5Blow%... | |
b75e72c5a0a8aa328afa03dee593daaa8400e96a | Add nosetest | test_utaskweb.py | test_utaskweb.py | Python | 0.000172 | @@ -0,0 +1,1247 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A#%0Aimport requests%0Afrom bs4 import BeautifulSoup%0A%0Aimport utaskweb%0A%0A%0Adef assert_text_obj(obj):%0A unicode_obj = unicode(obj)%0A assert type(unicode_obj) == unicode%0A%0A%0Adef test_get_text_if_exists():%0A node1 = BeautifulSoup('... | |
2448b2608ab4d32c4d80c1bbd2a09063197524e6 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1,27 @@
+import product_attachments%0A
| |
8e83b41a4796d62868a113ccb1e949a2d09bafac | Test throwing future callback | python/test/test_servicedirectory.py | python/test/test_servicedirectory.py | Python | 0.000001 | @@ -0,0 +1,412 @@
+import time%0Afrom qi import ServiceDirectory%0Afrom qi import Session%0A%0A%0Adef main():%0A def raising(f):%0A raise Exception(%22woops%22)%0A%0A local = %22tcp://127.0.0.1:5555%22%0A sd = ServiceDirectory()%0A sd.listen(local)%0A%0A s = Session()%0A s.connect(local)%0A ... | |
d50d43854596522f7cef8712e0599b39c71b027b | Add initial jenkins python script for jenkins tests | tests/jenkins.py | tests/jenkins.py | Python | 0 | @@ -0,0 +1,774 @@
+#!/usr/bin/env python%0A'''%0AThis script is used to test salt from a jenkins server, specifically%0Ajenkins.satstack.com.%0A%0AThis script is intended to be shell centric!!%0A'''%0A%0Aimport subprocess%0Aimport hashlib%0Aimport random%0Aimport optparse%0A%0A%0Adef run(platform, provider):%0A '''%... | |
4cddb31cd5054ff146f4bab8471367dcc48297c4 | Create server2.py | server2.py | server2.py | Python | 0.000001 | @@ -0,0 +1,1203 @@
+# -*- coding: UTF-8 -*-%0A%0Aimport socket, threading, string%0A%0Adebug = True%0A%0A_connector = None%0A_running = True%0A%0A_host = '0.0.0.0'%0A_port = 2222%0A_maxClient = 10%0A_recvBuffer = 1024%0A%0Adef printd (aString):%0A if debug:%0A print aString%0A%0Aclass talkToClient (threading.... | |
13fd2335eb8b8b93e5330fe9bcc125557bffb198 | Add missing migration for verbose_name alter | ecommerce/extensions/payment/migrations/0012_auto_20161109_1456.py | ecommerce/extensions/payment/migrations/0012_auto_20161109_1456.py | Python | 0.000002 | @@ -0,0 +1,569 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('payment', '0011_paypalprocessorconfiguration'),%0A %5D%0A%0A operations = %5B%0A migratio... | |
65c1ddc6837a36b87992304e2d364b5eb6e8d0d9 | add selenium test | tests/seltest.py | tests/seltest.py | Python | 0.000003 | @@ -0,0 +1,239 @@
+from selenium import webdriver%0Aimport pytest%0A%0A%0Adef test_selenium_basic():%0A driver = webdriver.Firefox()%0A driver.get(%22localhost:5000%22)%0A bod = driver.get_element_by_tag_name('body')%0A assert %22Hello%22 in bod.text%0A%0A driver.quit()%0A
| |
98262d909ad612684df9dfe6f98ee3c8217df2ce | Create __init__.py | FAFT_2048-points_C2C/__init__.py | FAFT_2048-points_C2C/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
a301a90ed9cc570c3de1fdcd4c6908512cfd1183 | add require_billing_admin decorator | corehq/apps/accounting/decorators.py | corehq/apps/accounting/decorators.py | Python | 0.000001 | @@ -0,0 +1,772 @@
+from django.http import Http404%0Afrom corehq import BillingAccountAdmin%0A%0A%0Adef require_billing_admin():%0A def decorate(fn):%0A %22%22%22%0A Decorator to require the current logged in user to be a billing admin to access the decorated view.%0A %22%22%22%0A def wra... | |
c38d3695c0b056da3014951ee842bae4f817b657 | Add serialization unit-test | chimenea/tests/test_obsinfo.py | chimenea/tests/test_obsinfo.py | Python | 0.000009 | @@ -0,0 +1,608 @@
+from __future__ import absolute_import%0Afrom unittest import TestCase%0Aimport json%0Afrom chimenea.obsinfo import ObsInfo%0A%0A%0A%0Aclass TestObsInfoSerialization(TestCase):%0A def setUp(self):%0A self.obs = ObsInfo(name='foo',%0A group='fooish',%0A ... | |
a6703a7cbbc738fc72343be8c582bdfae1b69a44 | Fix small pep8 issue | openstack_dashboard/dashboards/admin/instances/forms.py | openstack_dashboard/dashboards/admin/instances/forms.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Kylin OS, 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
#
#... | Python | 0 | @@ -1124,16 +1124,20 @@
+
attrs=%7B'
|
0d7706db887bb5d1522f3de39b9fe1533f80fd8d | Add original script version, still not fit for general use | dota2parser.py | dota2parser.py | Python | 0 | @@ -0,0 +1,837 @@
+from bs4 import BeautifulSoup%0Aimport urllib.request%0Aimport MySQLdb%0A%0Adb = MySQLdb.connect(user=%22%22, passwd=%22%22, db=%22%22)%0Ac = db.cursor()%0Ac.execute(%22SELECT id, name FROM heroes WHERE active=1%22)%0Aheroes = c.fetchall()%0A%0Afor hero_id, hero_name in heroes:%0A%09hero_url = 'https... | |
a8e2f22bcc521aedc216d0d1849b6e4f58ede443 | Add old matrix file | matrix.py | matrix.py | Python | 0.000001 | @@ -0,0 +1,791 @@
+''' Cover the screen in green ones and zeroes, as if in the Matrix. '''%0Aimport time, sys%0Aimport random%0Afrom console import getTerminalSize%0A%0AESC = '%5C033'%0A%0Adef getLine(cols):%0A ''' Create a matrix line. '''%0A CHOICES = '000111 '%0A line = ''.join(random.choice(CHOICES) for _ ... | |
0f84eb57024bb856c10a6326a3827cb91e4d20c2 | Put the contents of a pyui file onto the clipboard | pyui_to_clipboard.py | pyui_to_clipboard.py | Python | 0 | @@ -0,0 +1,228 @@
+import clipboard%0Afilename = 'put_your_filename_here.pyui' # edit this line before running%0Awith open(filename) as in_file:%0A clipboard.set(in_file.read())%0Aprint('The contents of %7B%7D are now on the clipboard.'.format(filename))%0A
| |
6126ef6028449abab49994bbbe555ecf591ad910 | Work on comets tracking | plugins/Scripts/Plugins/Test_In_Vivo_Comets_Tracking.py | plugins/Scripts/Plugins/Test_In_Vivo_Comets_Tracking.py | Python | 0.000001 | @@ -0,0 +1,2068 @@
+# @Float(label=%22Sigma 1%22, required=true, value=4.2) sigma1%0A# @Float(label=%22Sigma 2%22, required=true, value=1.25) sigma2%0A# @Boolean(label=%22Do thresholding ?%22, required=true, value=true) do_thresholding%0A# @Boolean(label=%22Show intermediates images (for debugging)%22, required=true, v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.