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 |
|---|---|---|---|---|---|---|---|
0c9dcb8c23be8685bfe32a465f8e1b3023c95934 | Create manager_D3S.py | manager_D3S.py | manager_D3S.py | Python | 0.000003 | @@ -0,0 +1,1476 @@
+#!/usr/bin/env python%0Aimport argparse%0A%0Aimport kromek%0A%0A%0Adef main():%0A parser = argparse.ArgumentParser()%0A parser.add_argument('--transport', '-t', dest='transport', default='any')%0A parser.add_argument('--interval', '-i', dest='interval', default=1)%0A parser.add_argument(... | |
dc9449768dd93ec29a031b31c3a975c2db797252 | Create test_Deter_as_Server_and_Play_Audio.py | test_Deter_as_Server_and_Play_Audio.py | test_Deter_as_Server_and_Play_Audio.py | Python | 0.000001 | @@ -0,0 +1,1414 @@
+# DETER DEVICE%0A# this is test code for putting the deter device into server mode, and getting a message via bluetooth from the detection device, and%0A# then going ahead and playing scare sounds. You need to determine your MAC address. It is for the server in this case, so the MAC address%0A# of t... | |
7735ea4909d30a6592b3bcbcf2752fb3fba8ebb7 | Add Depth-First Search | dfs.py | dfs.py | Python | 0.000001 | @@ -0,0 +1,745 @@
+# -*- coding: utf-8 -*-%0Aimport draw%0Aimport grid%0Aimport util%0A%0Adef dfs(g, start, goal):%0A return dfs_rec(g, start, goal, %5Bstart%5D)%0A%0Adef dfs_rec(g, pos, goal, path):%0A if pos == goal:%0A return path%0A if len(path) %3E 50:%0A return None%0A%0A for n in g.neig... | |
58d1011b2758f537a3539321bea64cf1c77f39fe | Add spider for Au Bon Pain; closes #783 | locations/spiders/aubonpain.py | locations/spiders/aubonpain.py | Python | 0 | @@ -0,0 +1,2580 @@
+import scrapy%0Aimport re%0Aimport json%0Afrom locations.items import GeojsonPointItem%0Afrom locations.hours import OpeningHours%0A%0A%0Aclass AuBonPainSpider(scrapy.Spider):%0A name = %22aubonpain%22%0A download_delay = 0.5%0A allowed_domains = %5B%0A %22www.aubonpain.com%22,%0A ... | |
ab7006cd6a174273c026fda15e3471b9571ed0a6 | Add some simple tests | pages/tests.py | pages/tests.py | Python | 0.000029 | @@ -0,0 +1,1444 @@
+from django.test import TestCase%0Afrom pages.models import *%0A%0Aclass PagesTestCase(TestCase):%0A fixtures = %5B'tests'%5D%0A%0A def test_01_managers(self):%0A %22%22%22Check the managers%22%22%22%0A pages = Page.published.all()%0A for p in pages:%0A self.ass... | |
414c0a799f7fa1441150d6caae8447a135b9443a | Create sentiment-analysis.py | data-analysis/sentiment-Google-API/sentiment-analysis.py | data-analysis/sentiment-Google-API/sentiment-analysis.py | Python | 0.000454 | @@ -0,0 +1,750 @@
+import couchdb%0Afrom google.cloud import language%0A%0Alanguage_client = language.Client()%0Atry:%0A couch = couchdb.Server('http://localhost:15984/')%0A print(%22Connect to local db%22)%0Aexcept:%0A print (%22Cannot find CouchDB Server ... Exiting%5Cn%22)%0A print (%22----_Stack Trace_-... | |
0781d105e4182bdd8abf1a8c7185311a48273c28 | Add imgadm beacons for SmartOS | salt/beacons/smartos_imgadm.py | salt/beacons/smartos_imgadm.py | Python | 0 | @@ -0,0 +1,2860 @@
+# -*- coding: utf-8 -*-%0A'''%0ABeacon that fires events on image import/delete.%0A%0A.. code-block:: yaml%0A%0A ## minimal%0A # - check for new images every 1 second (salt default)%0A # - does not send events at startup%0A beacons:%0A imgadm: %5B%5D%0A%0A ## standard%0A # - c... | |
8b63dc73b4e3303d1b86faf42f635f3ce01e9da4 | Create helper script providing multiprocessing support. | run.py | run.py | Python | 0 | @@ -0,0 +1,2473 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0Aimport argparse%0Aimport subprocess as sub%0A%0A%0A### Parse command line arguments%0Aparser = argparse.ArgumentParser(description=%22M/M/1 queue simulation -- Helper script%22)%0Aparser.add_argument('reps', metavar='repetitions',%0A ... | |
401b98d0f3834eebc71342746beb8ce28a73d75f | Add check for AddToHueAndSaturation | checks/check_add_to_hue_and_saturation.py | checks/check_add_to_hue_and_saturation.py | Python | 0 | @@ -0,0 +1,998 @@
+from __future__ import print_function, division%0Aimport imgaug as ia%0Afrom imgaug import augmenters as iaa%0Aimport numpy as np%0Afrom skimage import data%0Aimport cv2%0Afrom itertools import cycle%0A%0AVAL_PER_STEP = 1%0ATIME_PER_STEP = 10%0A%0A%0Adef main():%0A image = data.astronaut()%0A%0A ... | |
e0c82bec30568eb845c71fb0335d6ac5edef18e9 | Add migration that had conflict from merge with master | corehq/apps/translations/migrations/0002_transifexblacklist.py | corehq/apps/translations/migrations/0002_transifexblacklist.py | Python | 0.000001 | @@ -0,0 +1,1649 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.18 on 2019-01-09 19:35%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('translations', '0001_initial'),%0A %5D%0A%0A ... | |
9f9ae5c088a91c6d901d2987b9031e71db0d7128 | fix version and usage | couchapp/dispatch.py | couchapp/dispatch.py | # -*- coding: utf-8 -*-
#
# This file is part of couchapp released under the Apache 2 license.
# See the NOTICE for more information.
import logging
import getopt
import sys
import couchapp.commands as commands
from couchapp.errors import AppError, CommandLineError
from couchapp.config import Config
logger = loggin... | Python | 0 | @@ -1780,16 +1780,22 @@
s.usage(
+conf,
*args, *
@@ -1905,16 +1905,22 @@
version(
+conf,
*args, *
|
6aeab650a43235a463cf9ff8c55b4cd22e6866c7 | Add mapping code | qanta/ingestion/annotated_mapping.py | qanta/ingestion/annotated_mapping.py | Python | 0.000145 | @@ -0,0 +1,1161 @@
+from unidecode import unidecode%0Afrom collections import defaultdict, Counter%0Aimport string%0Aimport re%0A%0APUNCTUATION = string.punctuation%0APAREN = re.compile(r'%5C(%5B%5E)%5D*%5C)')%0ABRACKET = re.compile(r'%5C%5B%5B%5E)%5D*%5C%5D')%0AMULT_SPACE = re.compile(r'%5Cs+')%0AANGLE = re.compile(r'... | |
28ccfa6f1a2cd58907105afd4844c865191d423d | Add a `more_tearDown` method to MpiTestCase. | distarray/testing.py | distarray/testing.py | import unittest
import importlib
import tempfile
import os
from uuid import uuid4
from functools import wraps
from distarray.error import InvalidCommSizeError
from distarray.mpiutils import MPI, create_comm_of_size
def temp_filepath(extension=''):
"""Return a random 8-character filename."""
tempdir = tempfil... | Python | 0 | @@ -1526,16 +1526,15 @@
t is
-%0A
4).
+%0A
Ov
@@ -1589,16 +1589,84 @@
setUp%60.%0A
+ Overload %60more_tearDown%60 to add more to the default %60tearDown%60.%0A
%22%22%22%0A
@@ -2064,16 +2064,21 @@
def
+more_
tearDown
@@ -2077,32 +2077,99 @@
tearDown(self):%0A
+ pass%0A%0A def tearD... |
b3df89c93a5d924b83d0dba6d83dd92fe2331f7c | Implementa a classe Agendamento conforme diagrama de classes | domain/Agendamento.py | domain/Agendamento.py | Python | 0.000001 | @@ -0,0 +1,182 @@
+from domain import IntervaloDeTempo%0Aclass Agendamento():%0A def __init__(self, intervalo, IDUsuario = None):%0A self.intervalo = intervalo%0A self.responsavel = IDUsuario%0A
| |
7ca606892f119f3eee33974f02ea3ecbf1e4bc56 | Apply Mark's fix to dv.clear. | distarray/testing.py | distarray/testing.py | import unittest
import importlib
import tempfile
import os
import six
import types
from uuid import uuid4
from functools import wraps
from distarray.error import InvalidCommSizeError
from distarray.mpiutils import MPI, create_comm_of_size
from IPython.parallel import Client
def temp_filepath(extension=''):
"""R... | Python | 0 | @@ -3316,16 +3316,26 @@
v.clear(
+block=True
)%0A%0A @
|
b41b6998dc14920193f22399804552209f7adcab | add migration script | osf/migrations/0078_ensure_schemas.py | osf/migrations/0078_ensure_schemas.py | Python | 0.000001 | @@ -0,0 +1,402 @@
+from __future__ import unicode_literals%0A%0Aimport logging%0A%0Afrom django.db import migrations%0Afrom osf.utils.migrations import ensure_schemas, remove_schemas%0A%0A%0Alogger = logging.getLogger(__file__)%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf',... | |
3037d356552634bc5d67568e97a9d7aedceb0fdf | Add description to email for non pyvideo events. | dj/scripts/email_title.py | dj/scripts/email_title.py | #!/usr/bin/python
# email_url.py
# emails the video URL to the presenters
from django.core.mail import get_connection, EmailMessage
from django.template import Context, Template
from process import process
from email_ab import email_ab
# from django.conf import settings
class email_title(email_ab):
ready_stat... | Python | 0 | @@ -1369,27 +1369,142 @@
l%7D%7D
-%7B%25 endif %25%7D%0A%7B%25 if 0
+%0A%7B%25 else %25%7Dand the Description:%0A === begin ===%0A %7B%7Bep.description%7D%7D %0A === end description ===%0A%7B%25 endif %25%7D%0A%7B%25 if ep.show.schedule_url
%25%7D%0A
@@ -1599,16 +1599,17 @@
f_url%7D%7D
+%0A
%7B%7Bep.sho
@@ -2... |
c98ff54d2888a0fdaa6634d065876d4cf5514b65 | Add compat file | pynetdicom3/compatibility.py | pynetdicom3/compatibility.py | Python | 0 | @@ -0,0 +1,166 @@
+%22%22%22Compatibility module for python2.7/python3.%22%22%22%0A%0Aimport sys%0A%0AIN_PYTHON2 = sys.version_info%5B0%5D == 2%0A%0Aif IN_PYTHON2:%0A import Queue as queue%0Aelse:%0A import queue%0A
| |
5be91f4e7b3607090e94fbf221628a359063823d | Use indexed text with sqlite | data/bag-brk/create_db.py | data/bag-brk/create_db.py | Python | 0.000001 | @@ -0,0 +1,929 @@
+import csv%0Aimport sqlite3%0A%0Aconn = sqlite3.connect('processed-lines.db')%0Ac = conn.cursor()%0A# c.execute('CREATE TABLE processed (cadastral_designation text, bag_pand_id text, match_type text, parcel_uri text, '%0A# 'dummy text, mother_parcel_match text, parcel_error text, timestamp ... | |
8279485c7c29453bea744ad137bb38552ac83bdb | Create master_script.py | scripts/hello_again/master_script.py | scripts/hello_again/master_script.py | Python | 0.000001 | @@ -0,0 +1,440 @@
+import subprocess%0Aimport os%0A%0AFNULL = open(os.devnull, 'w')%0Asubprocess.Popen('python live_stream.py', shell=True, stdout=FNULL, stderr=subprocess.STDOUT)%0Asubprocess.Popen('python processed_stream.py', shell=True, stdout=FNULL, stderr=subprocess.STDOUT)%0Asubprocess.Popen('python database_loo... | |
149631d1ad2733792feedf24d67575159289025c | set MOCK_FORENSIC_AUTH default to False | forensic/session.py | forensic/session.py | """
Copyright 2014 Sotera Defense Solutions, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writ... | Python | 0.998874 | @@ -911,19 +911,20 @@
_AUTH =
-Tru
+Fals
e%0AMOCK_U
|
7e5800d46d8dd49b421b3cdcd12701f64da994c3 | Add script for testing performance. | performance.py | performance.py | Python | 0 | @@ -0,0 +1,1538 @@
+import argparse%0D%0Aimport os.path%0D%0Aimport re%0D%0A%0D%0Aif __name__ == '__main__':%0D%0A%09parser = argparse.ArgumentParser(description='Runs combinations of performance tests.')%0D%0A%09parser.add_argument(%0D%0A%09%09'--config',%0D%0A%09%09dest = 'config',%0D%0A%09%09default = '',%0D%0A%09%0... | |
1440023d9a46b5abc0fe9e3a713d437185478102 | Create chucknorris.py | Codingame.com/chucknorris.py | Codingame.com/chucknorris.py | Python | 0.000001 | @@ -0,0 +1,805 @@
+import sys%0Aimport math%0A%0A# Auto-generated code below aims at helping you parse%0A# the standard input according to the problem statement.%0A%0Amessage = input()%0Abinaries = %5B%5D%0Afor ch in message:%0A binaries.append(bin(ord(ch))%5B2:%5D.zfill(7))%0A%0Astringer = %22%22%0A%0Azero = False%... | |
2edb50db002e773b66eb1f824894ee362846f86e | add example using 2 env vars | scripts/environment/dual_env_vars.py | scripts/environment/dual_env_vars.py | Python | 0 | @@ -0,0 +1,918 @@
+#!/usr/bin/env python%0Afrom argparse import ArgumentParser%0Afrom datetime import datetime%0Aimport os%0A%0Ainventory = %7B%0A 'all': %7B'vars': %7B'ansible_connection': 'local'%7D%7D,%0A 'ungrouped': %7B'hosts': %5B'localhost'%5D%7D,%0A '_meta': %7B'hostvars': %7B'localhost': %7B%0A ... | |
20cc61dd008fa4c1ced0d4726baaeba78d0d1f05 | Update get_posts example script for Python 3. | examples/get_posts.py | examples/get_posts.py | """
A simple example script to get all posts on a user's timeline.
Originally created by Mitchell Stewart.
<https://gist.github.com/mylsb/10294040>
"""
import facebook
import requests
def some_action(post):
""" Here you might want to do something with each post. E.g. grab the
post's message (post['message']) ... | Python | 0 | @@ -437,17 +437,17 @@
print
-
+(
post%5B'cr
@@ -458,16 +458,17 @@
d_time'%5D
+)
%0A%0A%0A# You
|
134dbd68cc4630442f1dddb9426207de93c1498b | Add a missing migration for Course.solution_visibility description | web/courses/migrations/0005_update_solution_visibility_text.py | web/courses/migrations/0005_update_solution_visibility_text.py | Python | 0.000785 | @@ -0,0 +1,616 @@
+# -*- 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 ('courses', '0004_course_institution'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFi... | |
fe5fa8bcde6c98e8dd66cf6190544d4ccf86175e | Add settings file for demo deployments | src/ggrc/settings/app_engine_demo.py | src/ggrc/settings/app_engine_demo.py | Python | 0 | @@ -0,0 +1,103 @@
+from app_engine import *%0A%0ACOMPANY = %22Reciprocity, Inc.%22%0ACOMPANY_LOGO_TEXT = %22Demo gGRC Implementation%22%0A
| |
8e54894906f8a67607deb1d81d42eb2a92fafe2e | add rabbit test code | rabbit-test.py | rabbit-test.py | Python | 0.000001 | @@ -0,0 +1,624 @@
+import time%0Aimport sys%0A%0Aimport stomp%0A%0Aclass MyListener(object):%0A def on_error(self, headers, message):%0A print 'received an error %25s' %25 message%0A%0A def on_connecting(self, host_and_port):%0A print host_and_port%0A %0A def on_message(self, headers, mess... | |
880d797a6e1f4e3a9182c647c0530976c1a65fc2 | Add FIWARE Doc Style | doc/conf.py | doc/conf.py | Python | 0 | @@ -0,0 +1,1104 @@
+# -*- coding: utf-8 -*-%0A%0Aimport os%0A%0Aon_rtd = os.environ.get('READTHEDOCS', None) == 'True'%0A%0Aextensions = %5B%5D%0Atemplates_path = %5B'/home/docs/checkouts/readthedocs.org/readthedocs/templates/sphinx', 'templates', '_templates', '.templates'%5D%0Asource_suffix = %5B'.rst', '.md'%5D%09%0... | |
1b5a6458c526a9789fab5d08fbbc5cece60f3b62 | add bootstrap file | bootstrap.py | bootstrap.py | Python | 0.000001 | @@ -0,0 +1,289 @@
+%0A%0Adef main():%0A parser = argparse.ArgumentParser(description='Initialize an Elm page')%0A%0A parser.add_argument('module_name')%0A parser.add_argument('destination')%0A args = parser.parse_args()%0A%0A bootstrap(args.module_name, args.destination)%0A%0Aif __name__ == '__main__':%0... | |
8054aa12d4d38b6600750527ed8552058ac216cd | Add 'choose/' from commit '7515ded12265f841375b584cb5da6601cf822a4f' | choose/choose.py | choose/choose.py | Python | 0.000082 | @@ -0,0 +1,1153 @@
+#!/usr/bin/env python%0A%0A# Copyright (C) 2016 Eddie Antonio Santos %3Ceasantos@ualberta.ca%3E%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as%0A# published by the Free Software Foundation, either versio... | |
92252975994dfd1c9923f2e135a1a1d9ca5621f5 | Disable password autocomplete on the login form | desktop/core/src/desktop/auth/forms.py | desktop/core/src/desktop/auth/forms.py | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | Python | 0 | @@ -2105,16 +2105,39 @@
ssword%22)
+, 'autocomplete': 'off'
%7D))%0A%0A d
|
287fe6a2945c97ca380bd19ff3720e42942495a6 | trim down email_title a bit. | dj/scripts/email_title.py | dj/scripts/email_title.py | #!/usr/bin/python
# email_title.py
# emails the preseter: title slide URL and some other details
from django.core.mail import get_connection, EmailMessage
from django.template import Context, Template
from process import process
from email_ab import email_ab
# from django.conf import settings
class email_title(ema... | Python | 0.000055 | @@ -702,17 +702,16 @@
f_url%7D%7D%0A
-%0A
Projecto
@@ -738,168 +738,8 @@
16:9
-%0APlease bring any adapters you need. If you have any special requests or have forgotten your adapter, please contact us ASAP and we will try to accommodate you.
%0A%0ATh
@@ -1175,20 +1175,16 @@
else %25%7D
-%0A
(is bla
@@ -1547,... |
bf6e9fd75b4d7d7d7f4c225ba6684e895b79160e | add sign up script | cgi-bin/signup.py | cgi-bin/signup.py | Python | 0.000001 | @@ -0,0 +1,2210 @@
+#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0A%0Afrom common import populate_html%0A%0Aimport os%0Aimport hashlib%0Aimport cgi%0Aimport MySQLdb%0Aimport smtplib%0A%0A%0Adef process_input():%0A # Load email and password%0A form = cgi.FieldStorage()%0A%0A email = form.get... | |
64fce7c67849f44492d55ccf8a745b252bf1368b | Add some tests for polynomial printing. | numpy/polynomial/tests/test_printing.py | numpy/polynomial/tests/test_printing.py | Python | 0 | @@ -0,0 +1,1935 @@
+import numpy.polynomial as poly%0Afrom numpy.testing import TestCase, run_module_suite, assert_%0A%0Aclass test_str(TestCase):%0A def test_polynomial_str(self):%0A res = str(poly.Polynomial(%5B0,1%5D))%0A tgt = 'poly(%5B0., 1.%5D)'%0A assert_(res, tgt)%0A%0A%0A def test_ch... | |
d251a2b2cd449ed5078b41b09f50003786f3bbde | Create script to pad and trim fastq reads to one length | seq_pad.py | seq_pad.py | Python | 0 | @@ -0,0 +1,1416 @@
+#!/usr/bin/python%0A%0A#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A__author__= 'Allison MacLeay'%0A%0Aimport sys%0Aimport os%0Aimport argparse%0Aimport glob%0Aimport gzip%0A%0A#-----------------------------------------%0A#%0... | |
19e3cd7256d5eb25eee8597f82bb2dd3fc019f03 | add a low-level random kick agent | example/low_level_random_kick_agent.py | example/low_level_random_kick_agent.py | Python | 0.000004 | @@ -0,0 +1,1608 @@
+#!/usr/bin/env python3%0A# encoding: utf-8%0A%0Afrom hfo import *%0Aimport argparse%0Aimport numpy as np%0Aimport math as m%0Aimport sys, os%0Aimport itertools%0A%0Adef rad_to_deg(rad):%0A return rad/m.pi*180%0Adef sign(x):%0A return (int(x%3E=0)-0.5)*2%0A%0Aif __name__ == '__main__':%0A parser =... | |
5eae0b790fb84ec77bc1f7a28706eecb9f25ef1f | Add another specific script | sauce/bin/add_dummy_users.py | sauce/bin/add_dummy_users.py | Python | 0.000002 | @@ -0,0 +1,3065 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22Add new users by CSV file%0A%0A@author: moschlar%0A%22%22%22%0A#%0A## SAUCE - System for AUtomated Code Evaluation%0A## Copyright (C) 2013 Moritz Schlarb%0A##%0A## This program is free software: you can redistribute it and/or modify%0A## it ... | |
795e1c4f939c784e7e3c8d96e55523469c41c117 | use a logging module | corehq/apps/cleanup/management/commands/check_case_integrity.py | corehq/apps/cleanup/management/commands/check_case_integrity.py | from collections import defaultdict
from optparse import make_option
from couchdbkit import ResourceNotFound
from django.core.management.base import BaseCommand
from casexml.apps.case.cleanup import rebuild_case
from casexml.apps.case.models import CommCareCase
from corehq.elastic import stream_es_query, ES_URLS
import... | Python | 0.000001 | @@ -352,16 +352,31 @@
ort csv%0A
+import logging%0A
from dim
@@ -409,16 +409,53 @@
hunked%0A%0A
+logger = logging.getLogger(__name__)%0A
%0Adef for
@@ -2499,38 +2499,44 @@
e%22:%0A
-print
+logger.info(
%22Case (%25s) from
@@ -2573,32 +2573,33 @@
ase_id, form_id)
+)
%0A elif ve
@@ -2643,30 +... |
0095e75ce94b3181d56f7783110cadd3d9730577 | add version 0.0.1 for initialize | __init__.py | __init__.py | Python | 0.000002 | @@ -0,0 +1,63 @@
+from __future__ import absolute_import%0D%0A%0D%0A__version__ = '0.0.1'
| |
4926dc06a94b83ec0cf446074b4c2277d4ebba20 | Reorder imports | bears/js/JSONFormatBear.py | bears/js/JSONFormatBear.py | import json
from collections import OrderedDict
from coalib.bearlib import deprecate_settings
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.LocalBear import LocalBear
from coalib.misc.Compatibility import JSONDecodeError
from coalib.results.Diff import Diff
from coalib.results.Result... | Python | 0 | @@ -42,16 +42,64 @@
edDict%0A%0A
+from coala_utils.param_convertion import negate%0A
from coa
@@ -380,56 +380,8 @@
ult%0A
-from coala_utils.param_convertion import negate%0A
%0A%0Acl
|
d25af87006ac21f55706c3a5579aec3c961b88e8 | Add script to download data from MDCS | download_mdcs_data.py | download_mdcs_data.py | Python | 0 | @@ -0,0 +1,1286 @@
+%22%22%22Fetch images from MDCS.%0A%22%22%22%0A%0Aimport json%0Aimport requests%0Aimport xmltodict%0A%0A%0Adef download_mdcs_data():%0A user = %22dwheeler%22%0A password = %2212345%22%0A mdcs_url = %22http://129.6.153.123:8000%22%0A schema_title = 'SemImage'%0A url = mdcs_url + %22/re... | |
3e73bbb51c7b5b214dc2c79e5a1cb8b00f243855 | Fix tests | corehq/apps/locations/tests/test_location_fixtures.py | corehq/apps/locations/tests/test_location_fixtures.py | from django.test import SimpleTestCase
from corehq.apps.locations.models import Location
from ..fixtures import _location_to_fixture, _location_footprint
class LocationFixturesTest(SimpleTestCase):
def test_metadata(self):
location = Location(
_id="unique-id",
domain="test-domain"... | Python | 0.000003 | @@ -73,24 +73,27 @@
import
+SQL
Location
%0Afrom ..
@@ -84,16 +84,30 @@
Location
+, LocationType
%0Afrom ..
@@ -240,16 +240,143 @@
(self):%0A
+ state = LocationType(%0A domain=%22test-domain%22,%0A name=%22state%22,%0A code=%22state%22,%0A )%0A%0A
@@ -386... |
ae0ef3a709e22774cf98f4c3010b66fb1be172bc | add class Datapoint | Datapoint.py | Datapoint.py | Python | 0.000001 | @@ -0,0 +1,1414 @@
+import re%0Afrom datetime import date%0A%0Aclass Datapoint:%0A def __init__(self, recipient, s_date=%2201.01.1970%22, value=0.0, comment=%22%22):%0A self.__Recipient = recipient%0A self.__Date = s_date%0A self.__Value = value%0A self.__Comment = comment%0A%0A def ge... | |
f6637b7fe03e9d72b8053972c444840921b84d6e | Add a registry that keeps track of tag->renderer/input mappings | common/lib/capa/capa/registry.py | common/lib/capa/capa/registry.py | Python | 0 | @@ -0,0 +1,1678 @@
+class TagRegistry(object):%0A %22%22%22%0A A registry mapping tags to handlers.%0A%0A (A dictionary with some extra error checking.)%0A %22%22%22%0A def __init__(self):%0A self._mapping = %7B%7D%0A%0A def register(self, cls):%0A %22%22%22%0A Register cls as a s... | |
6b6adc4dd4441f47f8d4e45a5f8473dbdfec275d | Move get_packs_base_path and get_pack_base_path to utils in st2common. | st2common/st2common/content/utils.py | st2common/st2common/content/utils.py | Python | 0 | @@ -0,0 +1,644 @@
+import os%0Aimport pipes%0A%0Afrom oslo.config import cfg%0A%0A__all__ = %5B%0A 'get_packs_base_path',%0A 'get_pack_base_path'%0A%5D%0A%0A%0Adef get_packs_base_path():%0A return cfg.CONF.content.packs_base_path%0A%0A%0Adef get_pack_base_path(pack_name):%0A %22%22%22%0A Return full abso... | |
effc03fbc0646b875e7cd586b04024dbdd12f806 | Create b.py | agc015/b.py | agc015/b.py | Python | 0.000018 | @@ -0,0 +1,289 @@
+def main():%0A floors = input()%0A%0A count = 0%0A%0A for i in range(len(floors)):%0A if floors%5Bi%5D == 'U':%0A count += (len(floors) - (i + 1)) + 2 * i%0A else:%0A count += 2 * (len(floors) - (i + 1)) + i%0A%0A print(count)%0A%0A%0Aif __name__ == '__... | |
b35e780364ca2d06902302b165ce2261ec6795a1 | Add tests for getting all toilets | ona_migration_script/test_migrate_toilet_codes.py | ona_migration_script/test_migrate_toilet_codes.py | Python | 0 | @@ -0,0 +1,1863 @@
+import json%0Aimport requests%0Afrom requests_testadapter import TestAdapter%0Aimport unittest%0A%0Aimport migrate_toilet_codes%0A%0A%0Aclass TestCreateSession(unittest.TestCase):%0A def test_create_session(self):%0A username = 'testuser'%0A password = 'testpass'%0A s = migra... | |
9826ccce540a945a8cb8bb788a8f993aa5aae553 | update stock reco permission | erpnext/patches/jan_mar_2012/update_stockreco_perm.py | erpnext/patches/jan_mar_2012/update_stockreco_perm.py | Python | 0 | @@ -0,0 +1,153 @@
+def execute():%0A%09import webnotes%0A%09webnotes.conn.sql(%22update %60tabDocPerm%60 set cancel = 1 where parent = 'Stock Reconciliation' and ifnull(submit, 0) = 1%22)%0A
| |
95ff3a585af98df894e5032da9e0e38622a3d9a9 | Add template field | kansha/alembic/versions/2b0edcfa57b4_add_templates.py | kansha/alembic/versions/2b0edcfa57b4_add_templates.py | Python | 0.000001 | @@ -0,0 +1,415 @@
+%22%22%22Add templates%0A%0ARevision ID: 2b0edcfa57b4%0ARevises: 24be36b8c67%0ACreate Date: 2015-11-24 17:50:13.280722%0A%0A%22%22%22%0A%0Aimport sqlalchemy as sa%0Afrom alembic import op%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = '2b0edcfa57b4'%0Adown_revision = '24be36b8c67'%0A%0... | |
b07f482c0cdc827b0b8d73bd920d9d302d006a91 | Test case for contact references (#15077) | erpnext/tests/test_search.py | erpnext/tests/test_search.py | Python | 0 | @@ -0,0 +1,623 @@
+from __future__ import unicode_literals%0Aimport unittest%0Aimport frappe%0Afrom frappe.contacts.address_and_contact import filter_dynamic_link_doctypes%0A%0Aclass TestSearch(unittest.TestCase):%0A%09#Search for the word %22clie%22, part of the word %22client%22 (customer) in french.%0A%09def test_co... | |
2539e398eccf6134ccdb0c608513c3c5812654b5 | Create File2Txt.py | File2Txt.py | File2Txt.py | Python | 0 | @@ -0,0 +1,730 @@
+from console import clear%0Afrom console import hud_alert%0Afrom os import remove%0A%0Adef drop_extension(filename):%0A%09dictionary = dict(enumerate(filename, start = 1))%0A%09try:%0A%09%09assert '.' in dictionary.values()%0A%09except AssertionError:%0A%09%09return filename%0A%09for (k, v) in dictio... | |
74c89b9fd6ac8f9d32192c0c0fbd5851230538e0 | add a script to run sandman. sandman can be used to edit te sqlite database through a browser. | sandman_run.py | sandman_run.py | Python | 0 | @@ -0,0 +1,243 @@
+#!venv/bin/python%0Afrom sandman import app%0Afrom sandman.model import activate%0A%0Afrom losseblaadjes import app as lossebladjes_app%0A%0Aapp.config%5B'SQLALCHEMY_DATABASE_URI'%5D = lossebladjes_app.config%5B'SQLALCHEMY_DATABASE_URI'%5D%0A%0Aactivate()%0A%0Aapp.run()%0A
| |
0df8ce131c5ed07b032060d9f460a328324c9974 | add simplistic google docs exporter | google-export/exporter.py | google-export/exporter.py | Python | 0.000004 | @@ -0,0 +1,993 @@
+import gdata.docs.service%0Aimport gdata.spreadsheet.service%0A%0Aapp_name = 'at.zeha.google-export-v0-github'%0Alogin_u = 'username@example.org'%0Alogin_p = 'password'%0Aexport_folder = '/home/username/google-export/data/'%0A%0A%0A%0Agd_client = gdata.docs.service.DocsService(source=app_name)%0Agd_c... | |
7320e6fd38babe5b7c2d5fbb5121d5845c57bb05 | Add problem75.py | euler_python/problem75.py | euler_python/problem75.py | Python | 0.000075 | @@ -0,0 +1,2195 @@
+%22%22%22%0Aproblem75.py%0A%0AIt turns out that 12 cm is the smallest length of wire that can be bent to form%0Aan integer sided right angle triangle in exactly one way, but there are many%0Amore examples.%0A%0A 12 cm: (3,4,5)%0A 24 cm: (6,8,10)%0A 30 cm: (5,12,13)%0A 36 cm: (9,12,15)%0A... | |
50dfd75a75ab6bc12c46ba0106ee73f4cd559e63 | Add other two test cases | sympy/parsing/tests/test_implicit_multiplication_application.py | sympy/parsing/tests/test_implicit_multiplication_application.py | from sympy.parsing.sympy_parser import (
parse_expr,
standard_transformations,
convert_xor,
implicit_multiplication_application,
implicit_multiplication,
implicit_application,
function_exponentiation,
split_symbols,
split_symbols_custom,
_token_splittable
)
from sympy.utilities.p... | Python | 0.000595 | @@ -2247,16 +2247,58 @@
xp(z)%5Ey'
+,%0A 'sin**2(E%5E(x))': 'sin(E%5E(x))**2'
%0A %7D%0A
@@ -5730,24 +5730,71 @@
**(3*x))**2'
+,%0A 'sin%5E2 (3x*E%5E(x))': 'sin(3*x*E%5Ex)**2'
%0A %7D%0A t
|
c7efac00035589f271b2c591489f3b32cabcc6e5 | Add very basic example. | examples/example1.py | examples/example1.py | Python | 0.000001 | @@ -0,0 +1,408 @@
+from datetime import datetime%0Afrom flask import Flask%0Afrom flask_json import FlaskJSON, JsonErrorResponse, json_response%0A%0Aapp = Flask(__name__)%0AFlaskJSON(app)%0A%0A%0A@app.route('/get_time')%0Adef get_time():%0A return json_response(time=datetime.utcnow())%0A%0A%0A@app.route('/raise_erro... | |
ff9ebfb2698c40da5af383b0e620191f4a893e7b | add skitai_pingpong_handler | skitai/tools/benchmark/skitai_pingpong_handler.py | skitai/tools/benchmark/skitai_pingpong_handler.py | Python | 0.000079 | @@ -0,0 +1,634 @@
+%22%22%22%0AThis module is copy of skitai.handler.pingpong_handler.py.%0AIt's not actually used by skitai, but for just your reference%0A%22%22%22%0A%0Afrom . import ssgi_handler%0A%0Aclass Handler (ssgi_handler.Handler):%0A%09def __init__(self, wasc):%0A%09%09self.wasc = wasc%09%09%0A%09%09%0A%09def... | |
5cae22b665c250935d7a0c3fdd0e583beff08500 | add nofollow to Link object | scrapy/link.py | scrapy/link.py | """
This module defines the Link object used in Link extractors.
For actual link extractors implementation see scrapy.contrib.linkextractor, or
its documentation in: docs/topics/link-extractors.rst
"""
class Link(object):
"""Link objects represent an extracted link by the LinkExtractor.
At the moment, it cont... | Python | 0 | @@ -385,16 +385,28 @@
, 'text'
+, 'nofollow'
%5D%0A%0A d
@@ -435,16 +435,32 @@
text=''
+, nofollow=False
):%0A
@@ -501,16 +501,49 @@
t = text
+%0A self.nofollow = nofollow
%0A%0A de
@@ -629,18 +629,53 @@
her.text
-%0A
+and self.nofollow == other.nofollow%0A
%0A
@@ -741,16 +741,38 @@... |
2f180a089450da5241836a1c6dc77f5116a5418d | Add c4_check_move | examples/c4_check_move.py | examples/c4_check_move.py | Python | 0.000012 | @@ -0,0 +1,1332 @@
+from keras.models import load_model%0Afrom capstone.game.games import Connect4 as C4%0Afrom capstone.game.players import AlphaBeta, GreedyQ, RandPlayer%0Afrom capstone.rl.value_functions import QNetwork%0Afrom capstone.game.utils import play_match%0A%0Aboard = %5B%5B' ', ' ', ' ', ' ', ' ', ' ', ' '... | |
56dcbdeb050ee7a55afc7634d9c26fc414cb34f9 | Replace global var by argument. | examples/mnist_conv_cc.py | examples/mnist_conv_cc.py | from __future__ import print_function
import gzip
import lasagne
import theano
import theano.tensor as T
from lasagne.layers import cuda_convnet
from mnist import _load_data
from mnist import create_iter_functions
from mnist import train
NUM_EPOCHS = 500
BATCH_SIZE = 600
LEARNING_RATE = 0.01
MOMENTUM = 0.9
def l... | Python | 0.000001 | @@ -1433,26 +1433,26 @@
shape=(
-BATCH_SIZE
+batch_size
, 1, inp
|
9bd132e7d8aea5b4db28902076520d961c0f6cdd | fix expunge api parameter issue | zstackwoodpecker/zstackwoodpecker/zstack_test/zstack_test_vm.py | zstackwoodpecker/zstackwoodpecker/zstack_test/zstack_test_vm.py | '''
zstack vm test class
@author: Youyk
'''
import zstackwoodpecker.header.vm as vm_header
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.net_operations as net_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.tag_ope... | Python | 0 | @@ -3578,24 +3578,31 @@
session_uuid
+ = None
):%0A v
@@ -3622,32 +3622,46 @@
_vm(self.vm.uuid
+, session_uuid
)%0A super(
|
bfbec3452bb518f9bd674a3782a56e45ee2e18da | Add quotes example | examples/quotes/quotes.py | examples/quotes/quotes.py | Python | 0 | @@ -0,0 +1,702 @@
+import sys%0Aprint(sys.version_info)%0Aimport random%0Aimport time%0A%0Aimport networkzero as nw0%0A%0Aquotes = %5B%0A %22Humpty Dumpty sat on a wall%22,%0A %22Hickory Dickory Dock%22,%0A %22Baa Baa Black Sheep%22,%0A %22Old King Cole was a merry old sould%22,%0A%5D%0A%0Amy_name = input(%... | |
9018954189a6556e6038d01e0766a336d62a91fd | Add __init__.py | choosealicense/__init__.py | choosealicense/__init__.py | Python | 0.006636 | @@ -0,0 +1,368 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0A choosealicense-cli%0A ~~~~~%0A%0A Bring http://choosealicense.com to your terminal.%0A%0A :copyright: (c) 2015 by lord63.%0A :license: MIT, see LICENSE for more details.%0A%22%22%22%0A%0A%0A__title__ = %22choosealicense-... | |
954301b5f3290a85d58d9d16a30c8c50c97e7283 | Add fuzzy match | form_matching/fuzzy_match.py | form_matching/fuzzy_match.py | Python | 0.000001 | @@ -0,0 +1,1960 @@
+'''%0A%09Tashlin Reddy%0A%09August 2020%0A%09Fuzzy Match strings in Columns of CSV file %0A'''%0A%0A%0A#read in dependencies%0A%0Aimport pandas as pd%0Aimport numpy as np%0Afrom fuzzywuzzy import fuzz%0A%0A%0A#read in csv form%0A%0Aform = pd.read_csv('form.csv')%0A#form = pd.read_csv('https...')%0A%... | |
32858d93d8fcb0adf3b0da54f607fddbc29926ad | refactor customerRegister | usermanage/views/customerRegister.py | usermanage/views/customerRegister.py | Python | 0.999986 | @@ -0,0 +1,1338 @@
+from django.shortcuts import render, redirect%0Afrom django.http import HttpResponseRedirect%0Afrom django.contrib.auth import login, authenticate, logout%0Afrom django.contrib.auth.models import User, Group%0Afrom django.contrib.auth.decorators import login_required, user_passes_test, permission_re... | |
8f6dd4e4825175b4be37bca85c466b51619c3b89 | Create list-iod-web-index.py | list-iod-web-index.py | list-iod-web-index.py | Python | 0.000003 | @@ -0,0 +1,1142 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport unirest%0Aimport time%0Aimport json%0Aimport pprint%0Aimport logging%0Aimport argparse%0A%0Aunirest.timeout(120)%0A%0AIODAPIKEY = os.environ.get('IODAPIKEY')%0A%0Aparser = argparse.ArgumentParser(description='List IOD connectors associated with the API k... | |
deac3ae3b0f19adcbe612cce7fe9cfbbc2c08c5f | Update to current year | docs/conf.py | docs/conf.py | import os
import sys
sys.path.insert(0, "..")
from praw import __version__
copyright = "2017, Bryce Boe"
exclude_patterns = ["_build"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"]
html_static_path = ["_static"]
html_theme = "sphinx_rtd_theme"
html_theme_options = {"collapse_navigation": True}
htmlhe... | Python | 0.000005 | @@ -90,10 +90,10 @@
%2220
-17
+20
, Br
|
2ea14af13a80b98609108f8824ff1d995b0fecfb | Create img2html.py | img2html.py | img2html.py | Python | 0.000126 | @@ -0,0 +1,1449 @@
+#!/usr/bin/env python%0A %0A# img to html v0.2%0A# will convert a non-svg image to html%0A#%0A# Gauntlet O. Manatee%0A# spukspital@openmailbox.org%0A %0Aimport os, sys%0Aimport Image%0A %0A %0Aimgname = raw_input(%22Enter the path to the .png file you want to convert.%5Cn(I recommend .png, though it... | |
cff78bad619c7fb1e8c9067dedbf6afc38de90d5 | Create 'Python.py'. | P/Python.py | P/Python.py | Python | 0.003145 | @@ -0,0 +1,168 @@
+for i in range (0, 10, 1):%0A print ((%22 %22 * (10 - i)) + (%22*%22 * (i * 2 + 1)))%0A%0Afor i in range (10, -1, -1):%0A print ((%22 %22 * (10 - i)) + (%22*%22 * (i * 2 + 1)))%0A%0Araw_input ()
| |
16525e1e249d8506f605569c5d6d87b1988e890d | Create PushOver.py | PushOver.py | PushOver.py | Python | 0 | @@ -0,0 +1,2654 @@
+import sys%0A#Making compatible for Python 3 and 2.%0Aif sys.version_info %3C (3, 0, 0):%0A import urllib%0Aelse:%0A import urllib2.parse as urllib%0A%0Aimport urllib2%0A%0A%0Aclass Sounds(object):%0A Short_Pushover = 'pushover'%0A Short_Bike = 'bike'%0A Short_Bugle = 'bugle'%0A Sh... | |
d782809746cfb403358bdfb10215b70c96498264 | Introduce a live camera viewer with Qt. | QtViewer.py | QtViewer.py | Python | 0 | @@ -0,0 +1,928 @@
+#! /usr/bin/env python%0A# -*- coding:utf-8 -*- %0A%0A%0A#%0A# Qt interface to display AVT cameras%0A#%0A%0A%0A#%0A# External dependencies%0A#%0Afrom PyQt4 import QtGui, QtCore%0A%0A%0A#%0A# Window to display a camera%0A#%0Aclass QtViewer( QtGui.QWidget ) :%0A%0A%09#%0A%09# Initialisation%0A%09#%0A%0... | |
70ed3c4044b425f2b679da3f0a3f33a9f7e6381a | introduce data gatherer for finding new versions of various libraries | data/gatherer.py | data/gatherer.py | Python | 0 | @@ -0,0 +1,2123 @@
+%22%22%22Gatherer of software components for further identification by the Cuckoo%0ASandbox team.%0A%0AThis file uploads as many relevant software components as possible so that the%0ACuckoo Sandbox team may be able to add support for more versions of certain%0Asoftware packages. E.g., currently we ... | |
3bf112fcd3f42716bcf7dad0561280f52fc6a31f | add django-cron suppo | link_report/cron.py | link_report/cron.py | Python | 0.000001 | @@ -0,0 +1,425 @@
+# This file works with our fork of django-cron.%0A# It's use is optional%0A# Use any means you like to run scheduled jobs.%0A%0A%0Afrom django_cron import cronScheduler%0Afrom django_cron import Job%0Afrom django_cron import DAY%0Afrom link_report.utils import update_sentry_404s%0A%0A%0Aclass RunUpda... | |
02d7e423416ab90bdc4db6428c51efaf6f33a4c6 | Create templatetag for put a settings var into context | dbaas/dbaas/templatetags/settings_tags.py | dbaas/dbaas/templatetags/settings_tags.py | Python | 0 | @@ -0,0 +1,231 @@
+from django import template%0Afrom django.conf import settings%0A%0Aregister = template.Library()%0A%0A%0A@register.assignment_tag()%0Adef setting(var_name):%0A %22%22%22%0A Get a var from settings%0A %22%22%22%0A return getattr(settings, var_name)%0A
| |
0c329e33d9b2c0a4101791f4a5597631c61b2255 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
7ff5cafea31631605883e22d022a5e4bcede336f | exit more gracefully if no repository id is given | __init__.py | __init__.py | # reviewboard extension for mercurial
import os, errno, re
from mercurial import cmdutil, hg, ui, patch, util
from mercurial.i18n import _
from mercurial import demandimport
demandimport.disable()
from reviewboard import ReviewBoard, ReviewBoardError
def postreview(ui, repo, rev='tip', **opts):
'''post changeset... | Python | 0.000001 | @@ -2694,13 +2694,19 @@
:',
-'%5Cd+'
+%22%5B0-9%5D+%22, 0
)%0A
|
7aabf3383b8386602ed77500ad3b4914028c97a4 | add tuple | python/tuple/tuple/src/tuple/tuple.py | python/tuple/tuple/src/tuple/tuple.py | Python | 0.998576 | @@ -0,0 +1,177 @@
+#!/usr/bin/python%0A%0Alst = %5B10, 20, 30%5D%0A%0Aprint %22lst = %25s%22 %25 lst%0A%0Alst%5B1%5D = 15%0A%0Aprint %22lst = %25s%22 %25 lst%0A%0Atpl = (100, 200, 300)%0A%0Aprint tpl%5B0%5D%0Aprint tpl%5B1%5D%0Aprint tpl%5B2%5D%0A%0A#tpl%5B1%5D = 150%0A
| |
9ca2291f49188b5ecd6df09fd5230e321eb91b2d | Add FileHandler tests. | test_logbook.py | test_logbook.py | import unittest
import logbook
class BasicAPITestCase(unittest.TestCase):
def test_basic_logging(self):
logger = logbook.Logger('Test Logger')
handler = logbook.TestHandler()
with handler.contextbound(bubble=False):
logger.warn('This is a warning. Nice hah?')
assert ... | Python | 0 | @@ -1,12 +1,52 @@
+import logbook%0A%0Aimport os%0Aimport shutil%0A
import unitt
@@ -56,23 +56,24 @@
%0Aimport
-logbook
+tempfile
%0A%0A%0Aclass
@@ -77,16 +77,15 @@
ass
-BasicAPI
+Logbook
Test
@@ -113,17 +113,16 @@
e):%0A
-%0A
def
test
@@ -121,26 +121,13 @@
def
-test_basic_logging
+setUp
(sel
@@ -138,... |
0a501aca74224581228cf695d8d7d46d845ef8df | Create BPLY.py | BPLY.py | BPLY.py | Python | 0 | @@ -0,0 +1,45 @@
+import AXUV20%0Aimport surface%0Aimport geometry%0A
| |
d1e6f060edd7b09f84892df95611fc3f52a6fb5a | Rename results file | crowdastro/experiment/results.py | crowdastro/experiment/results.py | Python | 0.000001 | @@ -0,0 +1,2562 @@
+%22%22%22Object for storing experimental results.%0A%0AMatthew Alger%0AThe Australian National University%0A2016%0A%22%22%22%0A%0Aimport h5py%0Aimport numpy%0A%0A%0Aclass Results(object):%0A %22%22%22Stores experimental results.%22%22%22%0A%0A def __init__(self, path, methods, n_splits, n_exam... | |
52f5eb3e39d7cc01d2d149d87eb63086028ca265 | add integration tests for settings | okupy/tests/integration/test_settings.py | okupy/tests/integration/test_settings.py | Python | 0 | @@ -0,0 +1,3275 @@
+# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python%0A%0Afrom django.conf import settings%0Afrom django.test import TestCase%0Afrom django.test.client import Client%0Afrom mockldap import MockLdap%0A%0Afrom okupy.tests import vars%0A%0A%0Aclass SettingsIntegrationTests(TestCase):%0A @classmethod... | |
fd540540fa269279502b89ef83f1daaf38210162 | move only module to __init__.py | __init__.py | __init__.py | Python | 0.00002 | @@ -0,0 +1,1729 @@
+import requests, re, json%0Aimport lxml.etree%0Aimport lxml.html.soupparser%0A%0Auser_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14'%0A%0Ajson_getter = re.compile(r'trulia%5C.propertyData%5C.set%5C((.*?)%5C);')%0A%0Ad... | |
5f80b313c436bdac9eb8db4e9f835a210833c106 | Add __init__.py. | __init__.py | __init__.py | Python | 0.000084 | @@ -0,0 +1,110 @@
+import messages%0Afrom connection import Connection%0Afrom monitor import Monitor%0Afrom publisher import Publisher%0A
| |
c5f16d5d8c85383a3735b871962f70509109ebd7 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
974ba258850d556b25372e2941c0742d5812a78f | Adding an OpenID authentcation process test. | test/internet_tests/test_openid_authentication.py | test/internet_tests/test_openid_authentication.py | Python | 0.99984 | @@ -0,0 +1,1239 @@
+# Generated by the windmill services transformer%0Afrom windmill.authoring import WindmillTestClient%0A%0Adef test_openid_authentication():%0A client = WindmillTestClient(__name__)%0A client.open(url='https://www.hampr.com/')%0A client.waits.forPageLoad(timeout=20000)%0A client.waits.for... | |
a3e3b5f0964d700732d623a3dcafb0056f4eb1eb | Update __version__ | djstripe/__init__.py | djstripe/__init__.py | from __future__ import unicode_literals
import warnings
from django import get_version as get_django_version
__title__ = "dj-stripe"
__summary__ = "Django + Stripe Made Easy"
__uri__ = "https://github.com/pydanny/dj-stripe/"
__version__ = "0.5.0"
__author__ = "Daniel Greenfeld"
__email__ = "pydanny@gmail.com"
__li... | Python | 0.000006 | @@ -242,11 +242,15 @@
%220.
-5
+7
.0
+-dev
%22%0A%0A_
|
57bd45f13a091dd6fe40ecd960dc7e6b00d60def | support for epics ioc to host XRF scan plans. | profile_xf05id1/startup/30-scanutils.py | profile_xf05id1/startup/30-scanutils.py | Python | 0 | @@ -0,0 +1,1635 @@
+from ophyd import EpicsSignal,EpicsSignalRO,Device%0Afrom ophyd import Component as Cpt%0A%0Aclass SRXScanRecord(Device):%0A%0A class OneScan(Device):%0A p1s = Cpt(EpicsSignal, 'P1-S')%0A p2s = Cpt(EpicsSignal, 'P2-S')%0A p1i = Cpt(EpicsSignal, 'P1-I')%0A p2i = Cpt(Epi... | |
71c8e8e3d6395b51a453e591bee882cd3e024d26 | Create solve-the-equation.py | Python/solve-the-equation.py | Python/solve-the-equation.py | Python | 0.000246 | @@ -0,0 +1,1251 @@
+# Time: O(n)%0A# Space: O(n)%0A%0A# Solve a given equation and return the value of x in the form of string %22x=#value%22.%0A# The equation contains only '+', '-' operation, the variable x and its coefficient.%0A#%0A# If there is no solution for the equation, return %22No solution%22.%0A#%0A# If th... | |
97bf042815dff04a87b3321d1c269036ab9e7794 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
73ce4aafc7eed616adb36a9b9f7268b696fbd489 | Create __init__.py | __init__.py | __init__.py | Python | 0.000016 | @@ -0,0 +1,44 @@
+from source import networkviz as networkviz%0A
| |
4dc7c6be7b3f6741e787731801b4d853c1f24f1f | Add mkerefuse.__main__ module | mkerefuse/__main__.py | mkerefuse/__main__.py | Python | 0.000162 | @@ -0,0 +1,1507 @@
+#!/usr/bin/env python3%0A%22%22%22%0A%0ALooks up addresses to discover future garbage and/or recycle pickup dates%0Awithin the city of Milwaukee, WI%0A%0AUsage:%0A mkerefuse --help%0A mkerefuse %5Boptions%5D%0A%0AOptions:%0A -a, --address STRING House number%0A -d, --direction STR... | |
bf05dd9c1b39c8752aae60997fe5aca6e5572584 | Create gae_pylint_plugin.py | gae_pylint_plugin.py | gae_pylint_plugin.py | Python | 0.000002 | @@ -0,0 +1,429 @@
+from astroid import MANAGER%0Afrom astroid import scoped_nodes%0A%0ANDB_PROPERTIES = %5B%0A 'DateTimeProperty',%0A 'StringProperty',%0A 'KeyProperty',%0A 'StructuredProperty'%0A%5D%0A%0A%0Adef register(linter):%0A pass%0A%0A%0Adef transform(modu):%0A if modu.name == 'google.appengin... | |
e0ae0c605fd30f4f303abf390aaa6cbfa18cee39 | Bump version 1.22.3 | geocoder/__init__.py | geocoder/__init__.py | #!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
"""
Geocoder
~~~~~~~~
Simple and consistent geocoding library written in Python.
Many online providers such as Google & Bing have geocoding services,
these providers do not include Python libraries and have different
JSON responses between each... | Python | 0 | @@ -642,19 +642,19 @@
_ = '1.2
-1.2
+2.3
'%0A__lice
|
463de112add0178b6e3aa13b75bc7ae8dc26b612 | Create __openerp__.py | __openerp__.py | __openerp__.py | Python | 0.005291 | @@ -0,0 +1,1617 @@
+# -*- encoding: utf-8 -*-%0A%7B%0A 'name': 'Message box dialog',%0A 'application': False,%0A 'version': '8.0.r1.0',%0A 'category': 'General',%0A 'description': '''%0AAllows to ask a question through a dialog.%0A%0AVia a wizard your question is asked.%0AButtons can be hidden or their l... | |
cf060a473bb2412f97301ab72f96a57d370bc79f | Add IncrementalModel | models/rasmachine/incremental_model.py | models/rasmachine/incremental_model.py | Python | 0.000001 | @@ -0,0 +1,904 @@
+import pickle%0Afrom indra.assemblers import PysbAssembler%0A%0Aclass IncrementalModel(object):%0A def __init__(self, fname=None):%0A if fname is None:%0A self.stmts = %7B%7D%0A else:%0A try:%0A self.stmts = pickle.load(open(fname, 'rb'))%0A ... | |
12e7e7b29a91e67755c5d9b9e29b4a8614def1bc | Add module disable framework | motobot/core_plugins/disable_module.py | motobot/core_plugins/disable_module.py | Python | 0.000001 | @@ -0,0 +1,2407 @@
+from motobot import command, request, IRCLevel, Priority, Notice, split_response%0A%0A%0A@request('GET_PLUGINS')%0Adef disabled_request(bot, context, channel):%0A disabled = context.database.get(%7B%7D).get(channel.lower(), set())%0A return filter_plugins(bot.plugins, disabled)%0A%0A%0Adef fil... | |
7c4e265808440c8e670651660909e61498c496a0 | add dijkstrashortreach | algorithms/graph-theory/dijkstrashortreach/dijkstrashortreach.py | algorithms/graph-theory/dijkstrashortreach/dijkstrashortreach.py | Python | 0.999957 | @@ -0,0 +1,1563 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# @Author: Zeyuan Shang%0A# @Date: 2015-12-26 16:28:23%0A# @Last Modified by: Zeyuan Shang%0A# @Last Modified time: 2015-12-26 16:28:36%0Aimport sys%0Aimport queue%0A%0Aclass Vertex:%0A def __init__(self):%0A self.edges = %7B%7D%0A%0A ... | |
8ee4cef9689ee8a73e3952d46dc93908208b84ea | Add second passing test | maximum_equality.py | maximum_equality.py | Python | 0 | @@ -0,0 +1,3029 @@
+'''%0AMaximum equality%0A================%0A%0AYour colleague Beta Rabbit, top notch spy and saboteur, has been working tirelessly to discover a way to break into Professor Boolean's lab and rescue the rabbits being held inside. He has just excitedly informed you of a breakthrough - a secret bridge ... | |
cd325c15dd23d1047dc0ca8fc5108ee93e38568d | Create บวกลบธรรมดา.py | บวกลบธรรมดา.py | บวกลบธรรมดา.py | Python | 0.000001 | @@ -0,0 +1,500 @@
+__author__ = '%E0%B8%A7%E0%B8%A3%E0%B8%A3%E0%B8%93%E0%B8%9E%E0%B8%87%E0%B8%A9%E0%B9%8C'%0A#import re%0Aprint(%22Text%22)%0Aa = input(%22Text%22)%0Aif a.find(%22+%22):%0A s = a.split(%22+%22)%0A in1 = int(s%5B0%5D)%0A in2 = int(s%5B1%5D)%0A cal = in1 + in2%0Aelif a.find(%22-%22):%0A s =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.