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 |
|---|---|---|---|---|---|---|---|
2d320058c96f88348d8226fa4a827a6c2c973237 | Add Classical multidimensional scaling algorithm. | mds.py | mds.py | Python | 0.000001 | @@ -0,0 +1,1664 @@
+%22%22%22%0ASimple implementation of classical MDS.%0ASee http://www.stat.cmu.edu/~ryantibs/datamining/lectures/09-dim3-marked.pdf for more details.%0A%22%22%22%0A%0Aimport numpy as np%0Aimport numpy.linalg as linalg%0Aimport matplotlib.pyplot as plt%0A%0Adef square_points(size):%0A%09nsensors = siz... | |
fe128c1172070476ba09536bbbbe81c69a46ef57 | fix bgp reggression | ryu/services/protocols/bgp/operator/commands/show/route_formatter_mixin.py | ryu/services/protocols/bgp/operator/commands/show/route_formatter_mixin.py | import io
class RouteFormatterMixin(object):
fmtstr = ' {0:<3s} {1:<32s} {2:<8s} {3:<20s} {4:<15s} '\
'{5:<6s} {6:<6s} {7:<}\n'
@classmethod
def _format_family_header(cls):
ret = ''
ret += ('Status codes: * valid, > best\n')
ret += ('Origin codes: i - IGP, e - EGP, ? - in... | Python | 0 | @@ -1,17 +1,18 @@
import
-io
+six
%0A%0A%0Aclass
@@ -557,16 +557,142 @@
-msg = io
+if six.PY3:%0A import io%0A msg = io.StringIO()%0A else:%0A import StringIO%0A msg = StringIO
.Str
|
a78d879c9c097c32c58f5246d46a4a188b17d99c | Add workup vebose name change migration. | workup/migrations/0002_add_verbose_names.py | workup/migrations/0002_add_verbose_names.py | Python | 0 | @@ -0,0 +1,2539 @@
+# -*- 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 ('workup', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ... | |
d4a87c2131c02b3638743167ce32c779ece14fd5 | Create crawlerino.py | crawlerino.py | crawlerino.py | Python | 0.000005 | @@ -0,0 +1,2583 @@
+%22%22%22Simple web crawler, to be extended for various uses.%0A%0AWritten in Python 3, uses requests and BeautifulSoup modules.%0A%22%22%22%0A%0A%0Adef crawler(startpage, maxpages=100, singledomain=True):%0A %22%22%22Crawl the web starting from specified page.%0A%0A 1st parameter = starting p... | |
91facfcc42e001e2a598d6d06e55270ef9239b1d | add migration | actstream/migrations/0006_auto_20170329_2048.py | actstream/migrations/0006_auto_20170329_2048.py | Python | 0.000001 | @@ -0,0 +1,634 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.6 on 2017-03-29 20:48%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('actstream', '0005_auto_20161119_2211'),%0A %5D%0... | |
1e050f30e8307a75976a52b8f1258a5b14e43733 | Add middleware for static serving | wsgi_static.py | wsgi_static.py | Python | 0.000001 | @@ -0,0 +1,207 @@
+import wsgi_server%0Aimport os%0Afrom werkzeug.wsgi import SharedDataMiddleware%0A%0Aapplication = SharedDataMiddleware(wsgi_server.application, %7B%0A '/static': os.path.join(os.path.dirname(__file__), 'static')%0A%7D)%0A
| |
a086307e6aac341ed8a6596d0a05b7a8d198c7ec | Add command to dump and restore user pointers. | zephyr/management/commands/dump_pointers.py | zephyr/management/commands/dump_pointers.py | Python | 0 | @@ -0,0 +1,1046 @@
+from optparse import make_option%0Afrom django.core.management.base import BaseCommand%0Afrom zephyr.models import Realm, UserProfile%0Aimport simplejson%0A%0Adef dump():%0A pointers = %5B%5D%0A for u in UserProfile.objects.select_related(%22user__email%22).all():%0A pointers.append((u.... | |
769abf579f7bd082f7c6f4295edb49b41b252bce | Add empty alembic revision | alembic/versions/4784a128a6dd_empty_revision.py | alembic/versions/4784a128a6dd_empty_revision.py | Python | 0.000003 | @@ -0,0 +1,520 @@
+%22%22%22Empty revision%0A%0AThis is the empty revision that can be used as the base for future%0Amigrations.%0A%0AInitial database creation shall be done via %60metadata.create_all()%60 and%0A%60alembic stamp head%60.%0A%0ARevision ID: 4784a128a6dd%0ARevises:%0ACreate Date: 2017-12-13 00:48:12.07943... | |
4bf84b05b183916fd211f77ab8099ef14c9cec06 | Update migrations | app/timetables/migrations/0003_auto_20171107_1103.py | app/timetables/migrations/0003_auto_20171107_1103.py | Python | 0.000001 | @@ -0,0 +1,1250 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11 on 2017-11-07 11:03%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('timetables', '0002_auto_20171005_2209'),%0A %5D%0... | |
74135b8289fa4b6684c54d8c9e37671c75b92447 | add admin for area settings | adhocracy4/maps/admin.py | adhocracy4/maps/admin.py | Python | 0 | @@ -0,0 +1,641 @@
+from django.contrib import admin%0Afrom django.utils.translation import ugettext_lazy as _%0A%0Afrom . import models%0A%0A%0A@admin.register(models.AreaSettings)%0Aclass AreaSettingsAdmin(admin.ModelAdmin):%0A list_filter = ('module__project__organisation', 'module__project')%0A list_display = ... | |
2dce9ed68463b536f246f01b2ac5cb275df2453b | add polynomial | regression.py | regression.py | Python | 0.999999 | @@ -0,0 +1,1838 @@
+# coding: utf8%0Afrom datetime import datetime%0Aimport itertools%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0Afrom sklearn.preprocessing import PolynomialFeatures, Imputer%0Afrom sklearn.pipeline import make_pipeline%0Afrom sklearn.linear_model import Ridge, BayesianRidge%0Afrom utils i... | |
96fc5553bb958d41ea61fd809102344a354b20bd | unicode to str | quack/quack.py | quack/quack.py | #!/usr/bin/env python
"""Quack!!"""
import argparse
import git
import os
import shutil
import subprocess
import types
import yaml
_ARGS = None
def _setup():
"""Setup parser if executed script directly."""
parser = argparse.ArgumentParser(description='Quack builder')
parser.add_argument(
'-y', ... | Python | 0.999998 | @@ -2352,17 +2352,16 @@
%5B32m' +
-u
'%5Cu2713'
|
eb91b11930319369bc9cfc3b1b15c0b92fb4d85c | Add `OrganizationOption` tests based on `ProjectOption`. | tests/sentry/models/test_organizationoption.py | tests/sentry/models/test_organizationoption.py | Python | 0 | @@ -0,0 +1,1629 @@
+# -*- coding: utf-8 -*-%0A%0Afrom __future__ import absolute_import%0A%0Afrom sentry.models import OrganizationOption%0Afrom sentry.testutils import TestCase%0A%0A%0Aclass OrganizationOptionManagerTest(TestCase):%0A def test_set_value(self):%0A OrganizationOption.objects.set_value(self.org... | |
f264f8804c208f2b55471f27f92a9e8c1ab5d778 | Test our new happenings-by-year view. | tests/correlations/test_views.py | tests/correlations/test_views.py | Python | 0 | @@ -0,0 +1,620 @@
+# -*- coding: utf-8 -*-%0Aimport datetime%0Aimport pytest%0A%0Afrom django.core.urlresolvers import reverse%0A%0Afrom components.people.factories import GroupFactory, IdolFactory%0A%0A%0A@pytest.mark.django_db%0Adef test_happenings_by_year_view(client):%0A %5BGroupFactory(started=datetime.date(201... | |
43c4595ae26a7663538e712af37553c7a64fade7 | Add a couple unit tests for teuthology.parallel | teuthology/test/test_parallel.py | teuthology/test/test_parallel.py | Python | 0 | @@ -0,0 +1,762 @@
+from ..parallel import parallel%0A%0A%0Adef identity(item, input_set=None, remove=False):%0A if input_set is not None:%0A assert item in input_set%0A if remove:%0A input_set.remove(item)%0A return item%0A%0A%0Aclass TestParallel(object):%0A def test_basic(self):%0A ... | |
f370ee48c8aec312f9ea8a9ce1737214e51e2eaf | Disable repaint.key_mobile_sites_repaint. | tools/perf/benchmarks/repaint.py | tools/perf/benchmarks/repaint.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.
from core import perf_benchmark
from benchmarks import silk_flags
from measurements import smoothness
from telemetry import benchmark
import page_sets
cla... | Python | 0.000002 | @@ -1216,16 +1216,35 @@
aint()%0A%0A
+#crbug.com/499320%0A#
@benchma
@@ -1257,32 +1257,54 @@
bled('android')%0A
+@benchmark.Disabled()%0A
class RepaintKey
|
dd135680c168ee9a25158b10de4335c507dcccbf | Upgrade test to not make umask assumptions | integration/test_operations.py | integration/test_operations.py | from __future__ import with_statement
from StringIO import StringIO
import os
import posixpath
import shutil
from fabric.api import run, path, put, sudo, abort, warn_only, env, cd
from fabric.contrib.files import exists
from util import Integration
def assert_mode(path, mode):
remote_mode = run("stat -c \"%%a\... | Python | 0 | @@ -174,16 +174,23 @@
env, cd
+, local
%0Afrom fa
@@ -3657,16 +3657,242 @@
#
+ Ensure mode of local file, umask varies on eg travis vs various%0A # localhosts%0A source = 'whatever.txt'%0A try:%0A local(%22touch %25s%22 %25 source)%0A local(%22chmod 644 %25s%22 %25 ... |
3d523bca7377c0f4c80a4f697b0c41d340eb8200 | add a command to clear the celery queue | crate_project/apps/crate/management/clear_celery.py | crate_project/apps/crate/management/clear_celery.py | Python | 0.000001 | @@ -0,0 +1,334 @@
+import redis%0A%0Afrom django.conf import settings%0Afrom django.core.management.base import BaseCommand%0A%0A%0Aclass Command(BaseCommand):%0A%0A def handle(self, *args, **options):%0A r = redis.StrictRedis(host=settings.GONDOR_REDIS_HOST, port=settings.GONDOR_REDIS_PORT, password=settings... | |
33e7216ae9b367c509b5075496fce08d346743e2 | Implement channel limit | txircd/modules/rfc/cmode_l.py | txircd/modules/rfc/cmode_l.py | Python | 0.000001 | @@ -0,0 +1,1212 @@
+from twisted.plugin import IPlugin%0Afrom twisted.words.protocols import irc%0Afrom txircd.module_interface import IMode, IModuleData, Mode, ModuleData%0Afrom txircd.utils import ModeType%0Afrom zope.interface import implements%0A%0Aclass LimitMode(ModuleData, Mode):%0A implements(IPlugin, IModul... | |
ddc9a02ba64c24f8243bc299cd898bd337e5ce9a | isscalar predicate | datashape/predicates.py | datashape/predicates.py | from .util import collect, dshape
from .internal_utils import remove
from .coretypes import *
# https://github.com/ContinuumIO/datashape/blob/master/docs/source/types.rst
__all__ = ['isdimension', 'ishomogeneous', 'istabular', 'isfixed']
dimension_types = (Fixed, Var, Ellipsis)
isunit = lambda x: isinstance(x, Unit... | Python | 0.999798 | @@ -2467,28 +2467,255 @@
and isfixed(ds.subarray(1))%0A
+%0A%0Adef isscalar(ds):%0A %22%22%22 Has no dimensions%0A%0A %3E%3E%3E isscalar('int')%0A True%0A %3E%3E%3E isscalar('3 * int')%0A False%0A %3E%3E%3E isscalar('%7Bname: string, amount: int%7D')%0A True%0A %22%22%22%0A ds = dshape(ds)%0... |
7c24ffe52fe96339d14f522dc7c67122d01cead6 | add istabular predicate | datashape/predicates.py | datashape/predicates.py | from .util import collect, remove, dshape
from .coretypes import *
# https://github.com/ContinuumIO/datashape/blob/master/docs/source/types.rst
dimension_types = (Fixed, Var, Ellipsis)
isunit = lambda x: isinstance(x, Unit)
def isdimension(ds):
""" Is a component a dimension?
>>> isdimension(Fixed(10))
... | Python | 0.999995 | @@ -1974,12 +1974,434 @@
return True%0A
+%0A%0Adef istabular(ds):%0A %22%22%22 Can be represented by a two dimensional with fixed columns%0A%0A %3E%3E%3E istabular('var * 3 * int')%0A True%0A %3E%3E%3E istabular('var * %7Bname: string, amount: int%7D')%0A True%0A %3E%3E%3E istabular('var * 10 * 3 * i... |
9dd20f8361cff99329a5ab4b526e29edddac9a61 | add session.py | session.py | session.py | Python | 0.000001 | @@ -0,0 +1,1410 @@
+#!/usr/bin/python%0A#A quick and dirty interface to end a session %0A# This assumes systemd and xinitrc (for logout)%0A#By Charles Bos%0A%0Afrom tkinter import *%0Aimport os%0Aimport sys%0A%0Adef getWm() :%0A args = sys.argv%0A if len(args) == 1 : return %22-u $USER%22%0A else : return args... | |
c43d929f9ee2f21a7e93986171307cd0f17fa96c | add unittests of helpers | tests/test_helper.py | tests/test_helper.py | Python | 0 | @@ -0,0 +1,1823 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport unittest%0Afrom types import BuiltinFunctionType%0Afrom clime.helper import *%0A%0Aclass TestClimeHelper(unittest.TestCase):%0A%0A def test_autotype(self):%0A cases = ('string', '100', '100.0', None)%0A answers = ('string... | |
dd8496c61543b3e39c5ee3ccb8bc7b9f69e9487f | add tests for packet | tests/test_packet.py | tests/test_packet.py | Python | 0.000001 | @@ -0,0 +1,533 @@
+from zope.interface.verify import verifyClass, verifyObject%0Afrom ironman.packet import IPBusPacket%0Afrom ironman.interfaces import IIPbusPacket%0A%0Adef test_ipbus_packet_create():%0A obj = IPBusPacket()%0A assert obj is not None%0A%0Adef test_ipbus_packet_class_iface():%0A # Assure the c... | |
148788849fc98c59af7df5ddc157cfbcb6e4aa93 | Update our regex to match actual file names, we've changed them. Doh. | gettor/packages.py | gettor/packages.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
gettor_packages.py: Package related stuff
Copyright (c) 2008, Jacob Appelbaum <jacob@appelbaum.net>,
Christian Fromme <kaner@strace.org>
This is Free Software. See LICENSE for license information.
This module handles all package related function... | Python | 0.000004 | @@ -628,22 +628,18 @@
dle-.*-p
-anther
+pc
.dmg$%22,%0A
@@ -694,21 +694,25 @@
ndle-.*-
-tiger
+universal
.dmg$%22,%0A
|
bd0bdc543ba1e44ddc9d149fbaadd12ab051614d | Add migrations | accession/migrations/0003_auto_20191101_1625.py | accession/migrations/0003_auto_20191101_1625.py | Python | 0.000001 | @@ -0,0 +1,1234 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.25 on 2019-11-01 16:25%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('accession', '0002_auto_20191031_2139'),%0A %5D... | |
7b0ebe74cbaad610bb65f24cc2555d82e7d7a750 | read attachments path from settings, catch jpeg/png | apps/photos/views.py | apps/photos/views.py | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from rapidsms.webui.utils import render_to_response
from photos.models import Photo
import os
import settings
# default page - show all thumbnails by date
@login_required()
def ... | Python | 0 | @@ -765,28 +765,8 @@
h =
-'data/attachments' #
sett
@@ -815,16 +815,38 @@
s_path'%5D
+ # -%3E data/attachments
%0A%0A de
@@ -880,16 +880,17 @@
return
+(
filename
@@ -906,16 +906,76 @@
('.jpg')
+ or filename.endswith('.jpeg') or filename.endswith('.png'))
%0A %0A
@@ -1623,21 +1623,8 @@
%0A
- ou... |
fda4f436bbaea9215efa03648d2df8e413fb47dd | add class loader tests | test/test_loader.py | test/test_loader.py | Python | 0 | @@ -0,0 +1,1695 @@
+# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.%0A#%0A# The contents of this file are licensed under the Apache License version 2.0%0A# (the %22License%22); you may not use this file except in compliance with the%0A# License.%0A#%0A# Unless required by applicable law o... | |
dd75e1c5afb05c5d46adae465947fb3f893cdf6b | Create 7kyu_complete_the_pattern4.py | Solutions/7kyu/7kyu_complete_the_pattern4.py | Solutions/7kyu/7kyu_complete_the_pattern4.py | Python | 0.001969 | @@ -0,0 +1,105 @@
+def pattern(n):%0A l=list(range(1,n+1))%0A return '%5Cn'.join(''.join(map(str,l%5Bi:%5D)) for i in range(n))%0A
| |
422b5573b72cc2014893aa15758b9d0bc61baf05 | refactor from core.py | Synopsis/Formatters/HTML/DeclarationStyle.py | Synopsis/Formatters/HTML/DeclarationStyle.py | Python | 0.000202 | @@ -0,0 +1,2052 @@
+# $Id: DeclarationStyle.py,v 1.1 2003/11/15 19:55:06 stefan Exp $%0A#%0A# Copyright (C) 2000 Stephen Davies%0A# Copyright (C) 2000 Stefan Seefeld%0A# All rights reserved.%0A# Licensed to the public under the terms of the GNU LGPL (%3E= 2),%0A# see the file COPYING for details.%0A#%0A%0Aclass Style:%... | |
20cbfa3646bc38429ee202c0e77c32a9c5c614d9 | blotto.py | blotto.py | blotto.py | Python | 0.999968 | @@ -0,0 +1,1456 @@
+from ea import adult_selection%0Afrom ea import parent_selection%0Afrom ea import reproduction%0Afrom ea import main%0Afrom ea import binary_gtype%0A%0Adef fitness_test(population):%0A '''Naive fitness test for onemax, just the number of ones'''%0A return %5B(ind%5B0%5D, ind%5B1%5D, sum(ind%5B... | |
b8cc84245ae7f3ceda0e0cd92b6b2eecb0426ee3 | add start of peg generator | src/mugen/parser/peg.py | src/mugen/parser/peg.py | Python | 0 | @@ -0,0 +1,1739 @@
+#!/usr/bin/env python%0A%0Anext_var = 0%0Adef nextVar():%0A global next_var;%0A next_var += 1;%0A return next_var%0A%0Aclass Pattern:%0A def __init__(self):%0A pass%0A%0A def generate(self, result):%0A pass%0A%0Aclass PatternNot(Pattern):%0A def __init__(self, next):%... | |
82f15b2dae1b23b75a019362e5925c4a3591fa92 | Create InputNeuronGroup_multiple_inputs_1.py | examples/InputNeuronGroup_multiple_inputs_1.py | examples/InputNeuronGroup_multiple_inputs_1.py | Python | 0 | @@ -0,0 +1,1910 @@
+'''%0AExample of a spike generator (only outputs spikes)%0A%0AIn this example spikes are generated and sent through UDP packages. At the end of the simulation a raster plot of the %0Aspikes is created.%0A%0A'''%0A%0Afrom brian import *%0Aimport numpy%0A%0Afrom brian_multiprocess_udp import BrianConn... | |
765897a05a7aae6a89bfd62d8493fb14aa16048a | Create db_migrate.py | db_migrate.py | db_migrate.py | Python | 0.000003 | @@ -0,0 +1,852 @@
+#!venv/bin/python%0Aimport imp%0Afrom migrate.versioning import api%0Afrom app import db%0Afrom config import SQLALCHEMY_DATABASE_URI%0Afrom config import SQLALCHEMY_MIGRATE_REPO%0Av = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)%0Amigration = SQLALCHEMY_MIGRATE_REPO + ('/versions... | |
7e30de04cad1070eb84c1de0c370e950b5e2c783 | Annotate zerver.views.webhooks.pingdom. | zerver/views/webhooks/pingdom.py | zerver/views/webhooks/pingdom.py | # Webhooks for external integrations.
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
... | Python | 0 | @@ -69,16 +69,39 @@
e_import
+%0Afrom typing import Any
%0A%0Afrom d
@@ -144,16 +144,66 @@
ext as _
+%0Afrom django.http import HttpRequest, HttpResponse
%0A%0Afrom z
@@ -385,16 +385,62 @@
ook_view
+%0Afrom zerver.models import Client, UserProfile
%0A%0Aimport
@@ -446,16 +446,27 @@
t ujson%0A
+import six%0A
%0A... |
d8c359b27d371f5bd66825202860a0a376a2466c | add script to convert old plans to new ones | jsonQueries/old_to_new_plan.py | jsonQueries/old_to_new_plan.py | Python | 0 | @@ -0,0 +1,1370 @@
+#!/usr/bin/env python%0A%0Aimport json%0Aimport sys%0A%0Adef read_json(filename):%0A with open(filename, 'r') as f:%0A return json.load(f)%0A%0Adef uniquify_fragments(query_plan):%0A fragment_inv = %5B%5D%0A for worker in sorted(query_plan.keys()):%0A worker_plan = query_plan%... | |
f71ce70330f7dea86820f1d9cdc390ea972aaeca | add 2s-complement | algorithms/bit-manipulation/2s-complement.py | algorithms/bit-manipulation/2s-complement.py | Python | 0.999978 | @@ -0,0 +1,842 @@
+import sys%0A%0Adef ones(x):%0A uCount = x - ((x %3E%3E 1) & 033333333333) - ((x %3E%3E 2) & 011111111111);%0A return ((uCount + (uCount %3E%3E 3)) & 030707070707) %25 63;%0A%0Adef count(x):%0A if x %3E= 0:%0A if x == 0:%0A return 0%0A if x %25 2 == 0:%0A ... | |
173565f7f2b9ffa548b355a0cbc8f972f1445a50 | Add test coverage for rdopkg.guess version2tag and tag2version | tests/test_guess.py | tests/test_guess.py | Python | 0 | @@ -0,0 +1,1712 @@
+from rdopkg import guess%0Afrom collections import namedtuple%0Aimport pytest%0A%0AVersionTestCase = namedtuple('VersionTestCase', ('expected', 'input_data'))%0A%0A%0Adata_table_good = %5B%0A VersionTestCase(('1.2.3', None), '1.2.3'),%0A VersionTestCase(('1.2.3', 'vX.Y.Z'), 'v1.2.3'),%0A Ve... | |
e50060ca76c667b77db433ca03ef640140831dc9 | Add migration for dagman_metrics | migrations/004_add_dagman_metrics.py | migrations/004_add_dagman_metrics.py | Python | 0.000001 | @@ -0,0 +1,978 @@
+import migrations%0A%0Aconn = migrations.connect()%0A%0Acur = conn.cursor()%0A%0Acur.execute(%22%22%22%0Acreate table dagman_metrics (%0A id INTEGER UNSIGNED NOT NULL,%0A ts DOUBLE,%0A remote_addr VARCHAR(15),%0A hostname VARCHAR(256),%0A domain VARCHAR(256),%0A version VARCHAR(10),... | |
dc314e50a573f3ecb2cf41d1e08df29ea991d3b6 | Add migrations versions | migrations/versions/d71a3e9499ef_.py | migrations/versions/d71a3e9499ef_.py | Python | 0.000001 | @@ -0,0 +1,2515 @@
+%22%22%22empty message%0A%0ARevision ID: d71a3e9499ef%0ARevises: %0ACreate Date: 2017-11-21 23:19:12.740735%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = 'd71a3e9499ef'%0Adown_revision = None%0Abranch_labels = None%0Ad... | |
4933e4ca107516a667ae3449337746bf7e002cc2 | Create bkvm.py | bkvm.py | bkvm.py | Python | 0.000002 | @@ -0,0 +1,2112 @@
+#!/usr/bin/python%0A%0Aimport commands, time%0A%0Adef prepareTarget():%0A print %22prepare backup Target%22%0A print %22---------------------%22%0A cmd = %22mount -t cifs //10.0.0.9/public/BK%5C VM%5C XEN -o username=xxx,password=yyy /bak/%22%0A output = commands.getoutput(cmd)%0A cmd = %2... | |
bc8d68fbe63bd6add932947222b82e00e768e7bf | Add logger.debug calls in to make debugging easier | djangosaml2/backends.py | djangosaml2/backends.py | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | Python | 0.000001 | @@ -1489,16 +1489,134 @@
mpty')%0A%0A
+ logger.debug('attributes: %25s' %25 attributes)%0A logger.debug('attribute_mapping: %25s' %25 attribute_mapping)%0A
|
e050d9ce4fb4d63ec7857f581033258f87c805b0 | Create pyPdfMerger.py | pyPdfMerger.py | pyPdfMerger.py | Python | 0 | @@ -0,0 +1,1202 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0A%09TITLE:%09%09pyPdfMerger.py%0A%09AUTHOR: %09John Himics%0A%09EMAIL: %09%09john@johnhimics.com%0A%09TIMEZONE: %09EST%0A%09VERSION: %090%0A%09%0A%09DESCRIPTION: %09Merges pdf files together%0A%09%0A%09DEPENDANCIES: %09PyPDF2%0A%09%0A%22%22%22%0Afrom PyPDF2 im... | |
62e65ae978b703b6af0b594e958e79d467e83421 | add 63 | python/p063.py | python/p063.py | Python | 0.99912 | @@ -0,0 +1,426 @@
+def g(power):%0A count = 0%0A i = 1%0A min = 10**(power - 1)%0A max = 10**power - 1%0A%0A while True:%0A result = i**power%0A if result %3E= min:%0A if result %3C= max:%0A count += 1%0A else:%0A break%0A i += 1%0A... | |
600bf1bbce7db5f62d55537a33d4586fa2892d8a | Create conf.py | conf.py | conf.py | Python | 0.000001 | @@ -0,0 +1,4 @@
+#OK%0A
| |
45cb6df45df84cb9ae85fc8aa15710bde6a15bad | Add create image functional negative tests | nova/tests/functional/test_images.py | nova/tests/functional/test_images.py | Python | 0.000005 | @@ -0,0 +1,2585 @@
+# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or a... | |
18e2263a636e97519272a21562cbba4b978fcf49 | Create EmailForm | headlines/forms.py | headlines/forms.py | Python | 0 | @@ -0,0 +1,435 @@
+from flask_wtf import FlaskForm%0Afrom wtforms import StringField, TextAreaField, SubmitField%0Afrom wtforms.validators import DataRequired, Email%0A%0A%0Aclass EmailForm(FlaskForm):%0A %22%22%22 Form used to submit messages to the admin. %22%22%22%0A name = StringField('Name')%0A reply_to =... | |
61b21d1ec14e0be683f8da2b92b3ca2aa9fdcf59 | add sample for api caller | InvenTree/plugin/samples/integration/api_caller.py | InvenTree/plugin/samples/integration/api_caller.py | Python | 0 | @@ -0,0 +1,873 @@
+%22%22%22%0ASample plugin for calling an external API%0A%22%22%22%0Afrom django.utils.translation import ugettext_lazy as _%0A%0Afrom plugin import IntegrationPluginBase%0Afrom plugin.mixins import APICallMixin, SettingsMixin%0A%0A%0Aclass SampleApiCallerPlugin(APICallMixin, SettingsMixin, Integratio... | |
d5fcaf05d100d3fe709b34b8f6b839736773a130 | Create dict.py | dict.py | dict.py | Python | 0.000001 | @@ -0,0 +1,1476 @@
+import random%0Aa=%5B%22a%22,%22b%22,%22c%22,%22d%22,%22e%22,%22f%22,%22g%22,%22h%22,%22i%22,%22j%22,%22k%22,%22l%22,%22m%22,%22n%22,%22o%22,%22p%22,%22q%22,%22r%22,%22s%22%5C%0A ,%22t%22,%22u%22,%22v%22,%22w%22,%22x%22,%22y%22,%22z%22%5D%0Adef create():%0A dictionary=open(%22dictionary.py%22,%... | |
2fba29b90156e844d7d61a15c9ad9c37e2b5dfe2 | load template | examples/aimsun/load_template.py | examples/aimsun/load_template.py | Python | 0.000001 | @@ -0,0 +1,910 @@
+%22%22%22%0ALoad an already existing Aimsun template and run the simulation%0A%22%22%22%0A%0Afrom flow.core.experiment import Experiment%0Afrom flow.core.params import AimsunParams, EnvParams, NetParams%0Afrom flow.core.params import VehicleParams%0Afrom flow.envs import TestEnv%0Afrom flow.scenarios... | |
c6f6278c1915ef90e8825f94cc33a4dea4124722 | Add http directory listing with content display | network/http_server_cat.py | network/http_server_cat.py | Python | 0 | @@ -0,0 +1,2212 @@
+#!/bin/env python3%0Aimport http.server%0Aimport string%0Aimport click%0Aimport pathlib%0Aimport urllib.parse%0Aimport os%0A%0A%0A@click.command()%0A@click.argument(%22port%22, required=False)%0A@click.option(%22-s%22, %22--server%22, default=%220.0.0.0%22)%0Adef main(port, server):%0A if not por... | |
8fa81263cfcc63f6bf22ed2ad50103f91bc43b21 | Create hira.py | hira.py | hira.py | Python | 0.000002 | @@ -0,0 +1,484 @@
+#coding:utf-8%0Aimport hashlib%0A%0Astart = ord(u'%E3%81%82')%0Aend = ord(u'%E3%82%93')%0A%0Ahira = %5B%5D%0Aprint %22Create hiragana%22%0Afor i in range(start, end+1, 1):%0A hira.append(unichr(i).encode('utf-8'))%0A%0Anum = len(hira)%0Afor i4 in range(num):%0A for i3 in range(num):%0A ... | |
92bc1ad22b6147f61ef4b51b16e115109bc04596 | add build.gyp | build.gyp | build.gyp | Python | 0.000001 | @@ -0,0 +1,398 @@
+%7B%0A 'targets':%5B%0A %7B%0A 'target_name':'start_first',%0A 'type':'executable',%0A 'dependencies':%5B%5D,%0A 'defines':%5B%5D,%0A 'include_dirs':%5B%5D,%0A 'sources':%5B%0A 'start_first/opengl_first.c',%0A ... | |
45a0b65106f665872f14780e93ab9f09e65bbce3 | add genRandomGraph.py | ComplexCiPython/genRandomGraph.py | ComplexCiPython/genRandomGraph.py | Python | 0.000001 | @@ -0,0 +1,293 @@
+import networkx%0Aimport sys%0A%0Aif len(sys.argv) %3C 2:%0A%0A%09print (%22python genRandomGraph.py %5Boutput folder%5D%22);%0A%09input()%0A%09sys.exit(0);%0A%0AoutputPath = sys.argv%5B1%5D%0A%0AG=networkx.erdos_renyi_graph(100000,3/100000)%0Anetworkx.write_edgelist(G, outputPath + %22/genRandomGrap... | |
3b15fb1d43bad6d6cf2112538d1de8c1710d0272 | add test for within_page_range | freelancefinder/freelancefinder/tests/test_within_page_range_templatetag.py | freelancefinder/freelancefinder/tests/test_within_page_range_templatetag.py | Python | 0.000001 | @@ -0,0 +1,903 @@
+%22%22%22Test the within_page_range function.%22%22%22%0A%0Afrom ..templatetags.within_page_range import within_filter%0A%0A%0Adef test_in_range_above():%0A %22%22%22One page above current should be displayed.%22%22%22%0A test_page = 5%0A current_page = 4%0A%0A result = within_filter(test... | |
0c315f766b31c105c60b39746db977d6702955ca | Remove unneeded model attributes | successstories/views.py | successstories/views.py | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views.generic import CreateView, DetailView, ListView
from honeypot.decorators import check_honeypot
from .forms import StoryForm
from .models import Story, StoryCategory
... | Python | 0.000001 | @@ -1166,34 +1166,16 @@
(form)%0A%0A
- model = Story%0A
class St
@@ -1505,34 +1505,16 @@
tView):%0A
- model = Story%0A
temp
|
9abb8108f62451fb993a398c8165a4605e40ec4a | Add tests for JSONPResponseMiddleware | mapit/tests/test_middleware.py | mapit/tests/test_middleware.py | Python | 0 | @@ -0,0 +1,1965 @@
+from django.test import TestCase%0Afrom django.test.client import RequestFactory%0Afrom django.http import HttpResponse, HttpResponsePermanentRedirect%0A%0Afrom ..middleware import JSONPMiddleware%0A%0A%0Aclass JSONPMiddlewareTest(TestCase):%0A%0A def setUp(self):%0A self.middleware = JSON... | |
e20d3ff6147b857cb9a8efa32bfb4ee80610dd34 | Revert "dump" | dump/fastMessageReaderOriginal.py | dump/fastMessageReaderOriginal.py | Python | 0.000002 | @@ -0,0 +1,1383 @@
+#!/usr/bin/python%0A%0Aimport sys%0Aimport re%0A%0A# ============================================================================ %0A%0Aclass MessageReader:%0A%0A messageRegexp = r%22s*(%5Cw+)%5C%5B%5Cd+%5C%5D=(.*?)(?=%5Cs%5Cw+%5C%5B%5Cd+%5C%5D%7C$)%22;%0A%0A def __init__(self, fileName):%0A ... | |
f917c7ccfbe22a50049e76957a05f35eaaa46b2a | migrate child table | polling_stations/apps/addressbase/migrations/0010_remove_onsud_ctry_flag.py | polling_stations/apps/addressbase/migrations/0010_remove_onsud_ctry_flag.py | Python | 0.000002 | @@ -0,0 +1,326 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.20 on 2019-02-15 14:12%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B(%22addressbase%22, %220009_onsud_ced%22)%5D%0A%0A operations = %5Bm... | |
1553cdda2edc16368ba2281616923e849f09bdee | Create matching_{x,y}.py | hacker_rank/regex/repetitions/matching_{x,y}.py | hacker_rank/regex/repetitions/matching_{x,y}.py | Python | 0.998695 | @@ -0,0 +1,69 @@
+Regex_Pattern = r'%5E%5Cd%7B1,2%7D%5Ba-zA-Z%5D%7B3,%7D%5CW%7B0,3%7D$'%09# Do not delete 'r'.%0A
| |
527a53ee1e43f59462b94b50ea997058836a7031 | Create voicersss-inmoovservice-test.py | home/moz4r/Test/voicersss-inmoovservice-test.py | home/moz4r/Test/voicersss-inmoovservice-test.py | Python | 0 | @@ -0,0 +1,459 @@
+i01 = Runtime.createAndStart(%22i01%22, %22InMoov%22)%0Ai01.mouth = Runtime.createAndStart(%22i01.mouth%22, %22voiceRSS%22)%0A%0Apython.subscribe(i01.mouth.getName(),%22publishStartSpeaking%22)%0Apython.subscribe(i01.mouth.getName(),%22publishEndSpeaking%22)%0A%0Adef onEndSpeaking(text):%0A%09print %... | |
75980fc2e2f63e210f1e58e9a1d56c09072aa04e | add play_camera.py | python/video/play_camera.py | python/video/play_camera.py | Python | 0.000002 | @@ -0,0 +1,681 @@
+#!/usr/bin/env python3%0A# encoding: utf-8%0A# pylint: disable=no-member%0A%0A%22%22%22Play a video with OpenCV.%22%22%22%0A%0Aimport sys%0Aimport cv2%0A%0Adef main():%0A %22%22%22The main function of this module.%22%22%22%0A cv2.namedWindow('video', cv2.WINDOW_AUTOSIZE)%0A%0A cap = cv2.Vide... | |
6dfc5a3d7845633570b83aac06c47756292cf8ac | Add tests for get_uid() method for common DB models. | st2common/tests/unit/test_db_model_uids.py | st2common/tests/unit/test_db_model_uids.py | Python | 0 | @@ -0,0 +1,1948 @@
+# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You under the Apache License, Version 2.0%0A# (the %22License%22); you may not use this file except in compliance with%0A#... | |
5d64acfd475ca0bb0db2ef7c032fc4ee16df4f75 | remove highlight table | alembic/versions/186928676dbc_remove_highlights.py | alembic/versions/186928676dbc_remove_highlights.py | Python | 0.000005 | @@ -0,0 +1,1695 @@
+%22%22%22remove_highlights%0A%0ARevision ID: 186928676dbc%0ARevises: f163a00a02aa%0ACreate Date: 2019-06-01 15:14:13.999836%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '186928676dbc'%0Adown_revision = 'f163a00a02aa'%0Abranch_labels = None%0Adepends_on = None%0A%0Afrom a... | |
8658ad72c74306617e58ca82ff0f3fdba35bd353 | implement auto build database interface | app/tools/dbautocreat.py | app/tools/dbautocreat.py | Python | 0 | @@ -0,0 +1,892 @@
+#-*- coding:utf-8 -*-%0Aimport asyncio%0Aimport aiomysql%0Afrom tools.config import Config%0A%0A%0Aclass AutoCreate(obj):%0A%09def __init__(self):%0A%09%09pass%0A%09def _create_db(self):%0A%09%09pass%0A%09def _create_field_type(self):%0A%09%09pass%0A%09def _create_field_primary_key(self):%0A%09%09pas... | |
36b8c44f8c2554109ab4ab09add9ac10fae20781 | add entities orm | cliche/services/tvtropes/entities.py | cliche/services/tvtropes/entities.py | Python | 0.000406 | @@ -0,0 +1,2072 @@
+from sqlalchemy import Column, DateTime, ForeignKey, String%0Afrom sqlalchemy.ext.declarative import declarative_base%0Afrom sqlalchemy.orm import relationship%0A%0A%0ABase = declarative_base()%0A%0A%0A__all__ = 'Entity'%0A%0A%0Aclass Entity(Base):%0A namespace = Column(String, primary_key=True)%... | |
ad664a7722da63d783a2b9d73077d91a8a012057 | Create hello.py | Python/hello.py | Python/hello.py | Python | 0.999979 | @@ -0,0 +1,24 @@
+print(%22hello world!!!%22)%0A
| |
dfed8f837b5fe07445b3914b33c1dab1b0b5741b | add basic UAV object incl. very basic search algo | uav.py | uav.py | Python | 0 | @@ -0,0 +1,692 @@
+import random%0A%0Aclass Uav:%0A def __init__(x,y, worldMap):%0A self.x = x%0A self.y = y%0A self.worldMap = worldMap%0A self.sensorStrength = None%0A%0A def setMap(self, newMap):%0A self.worldMap = newMap%0A%0A def nextStep(self):%0A %22%22%22 where... | |
8d1946c9656ea6c29d4730a68cbf4610152cd98b | make migrations | poll/migrations/0002_vote_user_id.py | poll/migrations/0002_vote_user_id.py | Python | 0.000057 | @@ -0,0 +1,423 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('poll', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%0A ... | |
64109dddedb7441456ae8e255c6a4b20ccaa6a73 | Create ReinhardNorm.py | ReinhardNorm.py | ReinhardNorm.py | Python | 0.000001 | @@ -0,0 +1,2058 @@
+import numpy%0A%0Adef ReinhardNorm(I, TargetMu, TargetSigma):%0A'''%0APerforms Reinhard color normalization to transform the color characteristics of an image to %0Aa desired standard. The standard is defined by the mean and standard deviations of%0Athe target image in LAB color space defined by Rud... | |
ebabfa0e14bdfd061e248285b8f7b5473f5a676e | Create convert_to_morse.py | morse_code/convert_to_morse.py | morse_code/convert_to_morse.py | Python | 0.998175 | @@ -0,0 +1,791 @@
+from ConfigParser import SafeConfigParser%0Aimport string%0A%0Atarget = 'target.txt'%0A%0A%0Adef parse_ini():%0A parser = SafeConfigParser()%0A parser.read('conversion.ini')%0A morselist = list(string.ascii_uppercase)%0A number = 0%0A for i in morselist:%0A i = parser.get('CONVE... | |
fcb311ffd264821767f58c92e96101aa8086acf5 | rewrite DHKE.py as crypto.py | crypto.py | crypto.py | Python | 0.999999 | @@ -0,0 +1,2486 @@
+import random%0Aimport time%0A%0Atimestamp = int(time.time())%0Arandom.seed(timestamp)%0A%0A%0Adef gen_check(n):%0A if not isprime(n):%0A while not isprime(n):%0A n = random.randint(0, timestamp)%0A%0A%0Adef input_check(n):%0A if not isprime(n):%0A n = input(%22Sorry, ... | |
615e51ce1bf15c012a6c7cc2d026cb69bf0ce2b8 | Create MAIN.py | MAIN.py | MAIN.py | Python | 0.000002 | @@ -0,0 +1,2161 @@
+def pythagoras(SIDE, LEN1, LEN2):%0A %0A from math import sqrt # This is function is needed to work, it **SHOULD** be included with the default install. %0A%0A ANSWER = %22Error Code 1%22 # This should not logicaly happen if the user is not an idiot and follows the usage.%0A %0A%0A if... | |
cbe0d5b37d4055ea78568838c3fd4cc953342b80 | remove stale data | geoconnect/apps/gis_tabular/utils_stale_data.py | geoconnect/apps/gis_tabular/utils_stale_data.py | Python | 0.002077 | @@ -0,0 +1,1531 @@
+from datetime import datetime, timedelta%0A%0Afrom apps.gis_tabular.models import TabularFileInfo # for testing%0Afrom apps.gis_tabular.models import WorldMapTabularLayerInfo,%5C%0A WorldMapLatLngInfo, WorldMapJoinLayerInfo%0Afrom apps.worldmap_connect.models import WorldMapLayerInfo%0A%0... | |
cb56e0151b37a79e2ba95815555cde0633e167e7 | add client subscribe testing | samples/client_subscribe.py | samples/client_subscribe.py | Python | 0 | @@ -0,0 +1,700 @@
+import logging%0Afrom hbmqtt.client._client import MQTTClient%0Aimport asyncio%0A%0Alogger = logging.getLogger(__name__)%0A%0AC = MQTTClient()%0A%0A@asyncio.coroutine%0Adef test_coro():%0A yield from C.connect(uri='mqtt://iot.eclipse.org:1883/', username=None, password=None)%0A yield from C.sub... | |
c422b5019c6e638bce40a7fecef6977aa5e63ce0 | add __init__.py | python/18-package/parent/__init__.py | python/18-package/parent/__init__.py | Python | 0.00212 | @@ -0,0 +1,170 @@
+#!/usr/bin/env python%0A#-*- coding=utf-8 -*-%0A%0Aif __name__ == %22__main__%22:%0A print %22Package parent running as main program%22%0Aelse:%0A print %22Package parent initializing%22%0A%0A
| |
8d6a5c4092d4f092416fc39fc7faa8bb20e701c3 | Add a manage command to sync reservations from external hook .. hard coded first product only atm (cherry picked from commit 63a80b711e1be9a6047965b8d0061b676d8c50ed) | cartridge/shop/management/commands/syncreshooks.py | cartridge/shop/management/commands/syncreshooks.py | Python | 0 | @@ -0,0 +1,375 @@
+from django.core.management.base import BaseCommand%0Afrom django.core.management.base import CommandError%0Afrom mezzanine.conf import settings%0A%0Afrom cartridge.shop.models import *%0A%0Aclass Command(BaseCommand):%0A help = 'Sync reservations from external hook'%0A%0A def handle(self, *arg... | |
7e71b21f655ec35bd5ebd79aeb5dbec6945a77a7 | Add purdue harvester | scrapi/harvesters/purdue.py | scrapi/harvesters/purdue.py | Python | 0.999533 | @@ -0,0 +1,569 @@
+'''%0AHarvester for the Purdue University Research Repository for the SHARE project%0A%0AExample API call: http://purr.purdue.edu/oaipmh?verb=ListRecords&metadataPrefix=oai_dc%0A'''%0Afrom __future__ import unicode_literals%0A%0Afrom scrapi.base import OAIHarvester%0A%0A%0Aclass PurdueHarvester(OAIHa... | |
7ecfe7d20f8708a1dada5761cdc02905b0e370e5 | use correct separator | scripts/ci/wheel_factory.py | scripts/ci/wheel_factory.py | #!/usr/bin/env python
import requirements
import argparse
import glob
import os
parser = argparse.ArgumentParser()
parser.add_argument('file', help="requirements.txt", type=str)
parser.add_argument('wheeldir', help="wheeldir location", type=str)
args = parser.parse_args()
req_file = open(args.file, 'r')
for req in ... | Python | 0.000691 | @@ -383,36 +383,32 @@
eldir + os.path.
-path
sep + req.name +
@@ -461,20 +461,16 @@
os.path.
-path
sep + re
|
027a199924ee256170a2e369733a57fcc7483c88 | Add missing numeter namespace in poller | poller/numeter/__init__.py | poller/numeter/__init__.py | Python | 0.00005 | @@ -0,0 +1,56 @@
+__import__('pkg_resources').declare_namespace(__name__)%0A
| |
2022245c9172037bf71be29d0da53f1c47f6aac9 | guess user number: python3 | guess_user_number/python3/guess_user_number.py | guess_user_number/python3/guess_user_number.py | Python | 0.999999 | @@ -0,0 +1,455 @@
+#!/usr/bin/python%0A%0Amin=1%0Amax=100%0A%0Aprint(%22Think of a number from %22+str(min)+%22 to %22+str(max)+%22. Then, tell the computer if its guess is correct (Y), lower than the number (L), or higher than the number (H).%22)%0A%0Afound=False%0A%0Awhile not found:%0A%09mid = int((max-min)/2+min)%... | |
7420f49f8e1508fa2017c629d8d11a16a9e28c4a | add abstract biobox class | biobox_cli/biobox.py | biobox_cli/biobox.py | Python | 0.000001 | @@ -0,0 +1,1061 @@
+from abc import ABCMeta, abstractmethod%0Aimport biobox_cli.container as ctn%0Aimport biobox_cli.util.misc as util%0Aimport tempfile as tmp%0A%0Aclass Biobox:%0A __metaclass__ = ABCMeta%0A%0A @abstractmethod%0A def prepare_volumes(opts):%0A pass%0A%0A @abstractmethod%0A def... | |
4d1b006e5ba559715d55a88528cdfc0bed755182 | add import script for Weymouth | polling_stations/apps/data_collection/management/commands/import_weymouth.py | polling_stations/apps/data_collection/management/commands/import_weymouth.py | Python | 0 | @@ -0,0 +1,412 @@
+from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter%0A%0Aclass Command(BaseXpressDCCsvInconsistentPostcodesImporter):%0A council_id = 'E07000053'%0A addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017WPBC.TSV'%0A stations_name = 'pa... | |
2ce80e667de438fca20de7b4ab6847751b683e33 | Add digikey command. | src/commands/digikey.py | src/commands/digikey.py | Python | 0.000001 | @@ -0,0 +1,685 @@
+#%0A# Copyright (c) 2013 Joshua Hughes %3Ckivhift@gmail.com%3E%0A#%0Aimport urllib%0Aimport webbrowser%0A%0Aimport qmk%0A%0Aclass DigikeyCommand(qmk.Command):%0A %22%22%22Look up a part on Digi-Key.%0A%0A A new tab will be opened in the default web browser that contains the%0A search results... | |
8b4bbd23bf37fb946b664f5932e4903f802c6e0d | Add first pass at integration style tests | flake8/tests/test_integration.py | flake8/tests/test_integration.py | Python | 0 | @@ -0,0 +1,2378 @@
+from __future__ import with_statement%0A%0Aimport os%0Aimport unittest%0Atry:%0A from unittest import mock%0Aexcept ImportError:%0A import mock # %3C PY33%0A%0Afrom flake8 import engine%0A%0A%0Aclass IntegrationTestCase(unittest.TestCase):%0A %22%22%22Integration style tests to exercise di... | |
0d2adfcce21dd2efb5d781babec3e6b03464b6d5 | Add basic tests | tests/app/main/test_request_header.py | tests/app/main/test_request_header.py | Python | 0.000004 | @@ -0,0 +1,831 @@
+from tests.conftest import set_config_values%0A%0A%0Adef test_route_correct_secret_key(app_, client):%0A with set_config_values(app_, %7B%0A 'ROUTE_SECRET_KEY_1': 'key_1',%0A 'ROUTE_SECRET_KEY_2': '',%0A 'DEBUG': False,%0A %7D):%0A%0A response = client.get(%0A ... | |
77af87198d1116b77df431d9139b30f76103dd64 | Add migration for latitute and longitude of event | fellowms/migrations/0023_auto_20160617_1350.py | fellowms/migrations/0023_auto_20160617_1350.py | Python | 0.000001 | @@ -0,0 +1,608 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.5 on 2016-06-17 13:50%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('fellowms', '0022_event_report_url'),%0A %5D%0A%0A... | |
fb07837db870a5fdea3a98aa1381793b1b20d2c0 | Create main.py | main.py | main.py | Python | 0.000001 | @@ -0,0 +1,2041 @@
+import webapp2%0Aimport jinja2%0Aimport os%0Aimport urllib%0A%0Afrom google.appengine.api import users%0Afrom google.appengine.ext import ndb%0A%0A%0AJINJA_ENVIRONMENT = jinja2.Environment(%0A loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),%0A extensions=%5B'jinja2.ext.autoescape'%5... | |
b920f5aeecf7843fcc699db4a70a9a0f124fa198 | Add unit test for protonate.py | tests/test_protonate.py | tests/test_protonate.py | Python | 0 | @@ -0,0 +1,372 @@
+import propka.atom%0Aimport propka.protonate%0A%0A%0Adef test_protonate_atom():%0A atom = propka.atom.Atom(%0A %22HETATM 4479 V VO4 A1578 -19.097 16.967 0.500 1.00 17.21 V %22%0A )%0A assert not atom.is_protonated%0A p = propka.protonate.Protonate()%0A p.pr... | |
f502b9bb7c0cddda05cd85cf60f88f0a801b43d1 | Add docstrings | flocker/common/script.py | flocker/common/script.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""Helpers for flocker shell commands."""
import sys
from twisted.internet.task import react
from twisted.python import usage
from zope.interface import Interface
from .. import __version__
def flocker_standard_options(cls):
"""
Add various sta... | Python | 0.000005 | @@ -382,16 +382,97 @@
mands.%0A%0A
+ :param type cls: The %60class%60 to decorate.%0A :return: The decorated %60class%60.
%0A %22%22%22
@@ -551,32 +551,244 @@
s):%0A %22%22%22%0A
+ Set the default verbosity to %600%60 and then call the original%0A %60%60cls.__init__%60%60.%0A%0A ... |
addba07842f95e9b5bac3a97ddb4f81035bb2fc8 | Don't add args that return None names | ouimeaux/device/api/service.py | ouimeaux/device/api/service.py | import logging
from xml.etree import cElementTree as et
import requests
from .xsd import service as serviceParser
log = logging.getLogger(__name__)
REQUEST_TEMPLATE = """
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.o... | Python | 0.999303 | @@ -978,24 +978,91 @@
argument():%0A
+ name = arg.get_name()%0A if name:%0A
@@ -1103,16 +1103,20 @@
tting 0%0A
+
|
2bf763e39e91ef989c121bba420e4ae09ea0a569 | Add Diagonal Difference HackerRank Problem | algorithms/diagonal_difference/kevin.py | algorithms/diagonal_difference/kevin.py | Python | 0.000006 | @@ -0,0 +1,393 @@
+#!/usr/bin/env python%0A%0A%0Adef get_matrix_row_from_input():%0A return %5Bint(index) for index in input().strip().split(' ')%5D%0A%0A%0An = int(input().strip())%0Aprimary_diag_sum = 0%0Asecondary_diag_sum = 0%0Afor row_count in range(n):%0A row = get_matrix_row_from_input()%0A primary_diag... | |
9b0b3c474e250193730308b555034d458697e01b | Fix dispatching of WeMo switch devices. | homeassistant/components/wemo.py | homeassistant/components/wemo.py | """
homeassistant.components.wemo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WeMo device discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wemo/
"""
import logging
from homeassistant.components import discovery
from homeassistant.const import EVENT_H... | Python | 0 | @@ -685,21 +685,21 @@
,%0A 'S
-witch
+ocket
': DISC
|
edb28fffe19e2b0de3113b43aeb075119c9e5830 | Work in progress. Creating new data migration. | emgapi/migrations/0019_auto_20200110_1455.py | emgapi/migrations/0019_auto_20200110_1455.py | Python | 0 | @@ -0,0 +1,1710 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.24 on 2020-01-10 14:55%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Adef create_download_description(apps, schema_editor):%0A DownloadDescriptionLabel = apps.get_model(%22emgapi%22, %22DownloadDescripti... | |
d41274ce2a54d37c35f23c8c78de196e57667b0a | add google translate plugin | plugins_examples/translate.py | plugins_examples/translate.py | Python | 0 | @@ -0,0 +1,1111 @@
+#!/usr/bin/env python%0Aimport sys%0Aimport re%0Afrom googletrans import Translator%0Atranslator = Translator()%0A%0Aline = sys.stdin.readline()%0Awhile line:%0A match = re.search('%5E:(%5B%5E%5Cs%5D+) PRIVMSG (#%5B%5E%5Cs%5D+) :(.+)', line)%0A if not match:%0A line = sys.stdin.readline... | |
b450734eea74f5f3536a44ed40c006c3da13656c | Add diff.py | diff.py | diff.py | Python | 0.000001 | @@ -0,0 +1,2020 @@
+# vim: set et ts=4 sw=4 fdm=marker%0A%22%22%22%0AMIT License%0A%0ACopyright (c) 2016 Jesse Hogan%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy%0Aof this software and associated documentation files (the %22Software%22), to deal%0Ain the Software without restriction... | |
176af82121da5282842fd7e77809da9780ac57a5 | implement server pool. | rsocks/pool.py | rsocks/pool.py | Python | 0 | @@ -0,0 +1,895 @@
+from __future__ import unicode_literals%0A%0Aimport logging%0Aimport contextlib%0A%0Afrom .eventlib import GreenPool%0Afrom .utils import debug%0A%0A%0A__all__ = %5B'ServerPool'%5D%0A%0Alogger = logging.getLogger(__name__)%0Alogger.setLevel(logging.DEBUG if debug() else logging.INFO)%0Alogger.addHand... | |
416d2b0ffd617c8c6e58360fefe554ad7dc3057b | add example for discovering existing connections | examples/connections.py | examples/connections.py | Python | 0.000001 | @@ -0,0 +1,566 @@
+%0A%22%22%22%0APrint out a list of existing Telepathy connections.%0A%22%22%22%0A%0Aimport dbus.glib%0A%0Aimport telepathy%0A%0Aprefix = 'org.freedesktop.Telepathy.Connection.'%0A%0Aif __name__ == '__main__':%0A for conn in telepathy.client.Connection.get_connections():%0A conn_iface = conn... | |
ff53f699ac371266791487f0b863531dd8f5236a | Add hug 'hello_world' using to be developed support for optional URLs | examples/hello_world.py | examples/hello_world.py | Python | 0.000009 | @@ -0,0 +1,68 @@
+import hug%0A%0A%0A@hug.get()%0Adef hello_world():%0A return %22Hello world%22%0A
| |
397ab61df61d5acac46cf60ede38fa928fdacd7c | Create solution.py | data_structures/linked_list/problems/pos_num_to_linked_list/solution.py | data_structures/linked_list/problems/pos_num_to_linked_list/solution.py | Python | 0.000018 | @@ -0,0 +1,478 @@
+import LinkedList%0A%0A# Linked List Node inside the LinkedList module is declared as:%0A#%0A# class Node:%0A# def __init__(self, val, nxt=None):%0A# self.val = val%0A# self.nxt = nxt%0A#%0A%0A%0Adef ConvertPositiveNumToLinkedList(val: int) -%3E LinkedList.Node:%0A node... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.