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 |
|---|---|---|---|---|---|---|---|
c76c7b19afdf364ade2b7d0793cbdb14cb315131 | add smalltalk like object model | smalltalk_like/obj_model.py | smalltalk_like/obj_model.py | Python | 0.000002 | @@ -0,0 +1,1482 @@
+class Base(object):%0A%0A def __init__(self, cls, fields):%0A self.cls = cls%0A self.fields = fields%0A%0A def read_attribute(self, field_name):%0A return self.fields.get(field_name)%0A%0A def write_attribute(self, field_name, value):%0A self.fields%5Bfield_name%... | |
5bcd31440322d19262b694a5df299f43af577e5e | Create app.py | app.py | app.py | Python | 0.000003 | @@ -0,0 +1,143 @@
+from flask import Flask%0A%0A%0Aapp = Flask(__name__)%0A%0A@app.route(%22/%22)%0Adef hello():%0A return %22Hello World!%22%0A%0Aif __name__ == %22__main__%22:%0A app.run() %0A
| |
f6624531e47c599af42e75d84708359eaa982569 | Solve AoC 2020-12-25/1 | adventofcode2020/25.py | adventofcode2020/25.py | Python | 0.999999 | @@ -0,0 +1,700 @@
+%0Adef loop_size_finder(inp, subject_number=7):%0A i = 1%0A c = 0%0A%0A while i != inp:%0A i *= subject_number%0A i %25= 20201227%0A c += 1%0A%0A return c%0A%0A%0Adef transformer(iterations, subject_number=7):%0A i = 1%0A%0A for _ in range(0, iterations):%0A ... | |
b5433672a4e27db4e8f8698c311d05055462ac00 | Create main file | annotate_clin_virus.py | annotate_clin_virus.py | Python | 0.000001 | @@ -0,0 +1,2541 @@
+import timeit%0Aimport subprocess%0Aimport glob%0Aimport sys%0Aimport argparse%0A%0Astart = timeit.default_timer()%0A%0A# This program runs some shit and does some shit about clinical virus samples%0A# Gonna write more as I need too%0A%0A# parser = argparse.ArgumentParser(description= 'Annotate a se... | |
92aaff39dbd670f65dcbdeb34a2a506e0fcdf58b | add basic show_urls test | tests/management/commands/test_show_urls.py | tests/management/commands/test_show_urls.py | Python | 0 | @@ -0,0 +1,670 @@
+# -*- coding: utf-8 -*-%0Afrom django.core.management import call_command%0Afrom django.utils.six import StringIO%0A%0A%0Adef test_show_urls_format_dense():%0A out = StringIO()%0A call_command('show_urls', stdout=out)%0A%0A output = out.getvalue()%0A assert %22/admin/%5Ctdjango.contrib.ad... | |
74a4f56d28497de89415f29ca3e1d6298c2fdd23 | Create drivers.py | chips/sensor/simulation/drivers.py | chips/sensor/simulation/drivers.py | Python | 0.000001 | @@ -0,0 +1,371 @@
+# This code has to be added to the corresponding __init__.py%0A%0ADRIVERS%5B%22simulatedsensors%22%5D = %5B%22PRESSURE%22, %22TEMPERATURE%22, %22LUMINOSITY%22, %22DISTANCE%22, %22HUMIDITY%22,%0A %22COLOR%22, %22CURRENT%22, %22VOLTAGE%22, %22POWER%22,%0A ... | |
0d77fe363b6e6e8b1a0424cec7631cf13b669968 | add linear simulation | epistasis/simulate/linear.py | epistasis/simulate/linear.py | Python | 0.000012 | @@ -0,0 +1,2387 @@
+__doc__ = %22%22%22Submodule with various classes for generating/simulating genotype-phenotype maps.%22%22%22%0A%0A# ------------------------------------------------------------%0A# Imports%0A# ------------------------------------------------------------%0A%0Aimport numpy as np%0Afrom gpmap.gpm impo... | |
14e637720d6c80ed88232130b00385ceb4d451da | Create manual/__init__.py | app/tests/manual/__init__.py | app/tests/manual/__init__.py | Python | 0.000294 | @@ -0,0 +1,195 @@
+%22%22%22%0AManual test module.%0A%0ANote that while %60TEST_MODE%60 should be set an environment variable for the%0Aunit and integration tests, we want that off here so we can test against%0Alocal config data.%0A%22%22%22%0A
| |
5bd4534b375efed2ce5026a64228a45a9acc1d64 | add parallel runner | microscopes/kernels/parallel.py | microscopes/kernels/parallel.py | Python | 0.001425 | @@ -0,0 +1,1582 @@
+%22%22%22Contains a parallel runner implementation, with support%0Afor various backends%0A%0A%22%22%22%0A%0Afrom microscopes.common import validator%0Aimport multiprocessing as mp%0A%0A%0Adef _mp_work(args):%0A runner, niters = args%0A runner.run(niters)%0A return runner.get_latent()%0A%0Ac... | |
0cdc87edc4d5e4c967e7bc5bd35c5b30151d5a6e | Create admin_pages.py | evewspace/API/admin_pages.py | evewspace/API/admin_pages.py | Python | 0.000001 | @@ -0,0 +1,118 @@
+from core.admin_page_registry import registry%0A%0Aregistry.register('SSO', 'sso_admin.html', 'API.change_ssoaccesslist')%0A
| |
48190b463bcbafc0b1d3af6c41677a295237e3ba | Add missing file | 3rdParty/V8/V8-5.0.71.39/build/has_valgrind.py | 3rdParty/V8/V8-5.0.71.39/build/has_valgrind.py | Python | 0.000006 | @@ -0,0 +1,666 @@
+#!/usr/bin/env python%0A# Copyright 2016 the V8 project authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0Aimport os%0A%0ABASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))%0AVALGRIND_DIR = o... | |
ccce1108e1deab466fd72c022949fa05fa807a3a | add initial files for launch | synth.py | synth.py | Python | 0.000001 | @@ -0,0 +1,1123 @@
+# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for ... | |
f480a0a8d51c5c059a05165f30f64bb310299ee3 | Add 'rescore' command | project/apps/api/management/commands/rescore.py | project/apps/api/management/commands/rescore.py | Python | 0.999783 | @@ -0,0 +1,521 @@
+from django.core.management.base import (%0A BaseCommand,%0A)%0A%0Afrom apps.api.models import (%0A Contestant,%0A Appearance,%0A Performance,%0A)%0A%0A%0Aclass Command(BaseCommand):%0A help = %22Command to denormailze data.%22%0A%0A def handle(self, *args, **options):%0A ps ... | |
d4a7bbe27b285e455a3beafefd22fc493edeb161 | Add unittest for eventlogger config validation. | test/test_config_eventlogger.py | test/test_config_eventlogger.py | Python | 0 | @@ -0,0 +1,1770 @@
+#!/usr/bin/env python2%0Aimport unittest%0Aimport subprocess%0Aimport threading%0Aimport tempfile%0Aimport os%0A%0Afrom testdc import *%0A%0ADAEMON_PATH = './astrond'%0ATERMINATED = -15%0AEXITED = 1%0A%0Aclass ConfigTest(object):%0A def __init__(self, config):%0A self.config = config%0A ... | |
78c9f392a02c0fdb72294e08a3d5ce78262443f5 | Create 1.py | 1.py | 1.py | Python | 0.000001 | @@ -0,0 +1,4 @@
+u=1%0A
| |
d596bfbbfa725111fb4c0f6d4abf6789669f06de | Create sets.py | sets.py | sets.py | Python | 0.000001 | @@ -0,0 +1,406 @@
+#!/usr/bin/env python2%0A%0A'''%0AGenerates automatically one array, a.%0APrints an ordered list with only unique elems%0A'''%0A%0Aimport random%0A%0ASIZE_LIST_A = 10%0Aa = %5B%5D%0A%0A%0Adef populate_arrays():%0A for i in range(0, SIZE_LIST_A):%0A a.append(random.randint(1, 100))%0A%0A%0Aif __na... | |
563b9e1f826433179a5e3c5e611d40efc8736c4a | Create Hexbin Example | altair/examples/hexbins.py | altair/examples/hexbins.py | Python | 0 | @@ -0,0 +1,1503 @@
+%22%22%22%0AHexbin Chart%0A-----------------%0AThis example shows a hexbin chart.%0A%22%22%22%0Aimport altair as alt%0Afrom vega_datasets import data%0A%0Asource = data.seattle_weather()%0A%0A# Size of the hexbins%0Asize = 15%0A# Count of distinct x features%0AxFeaturesCount = 12%0A# Count of distin... | |
8118dc283eececdd074bac675c57975ceeba3739 | Create gateway.py | Gateway/gateway.py | Gateway/gateway.py | Python | 0.000001 | @@ -0,0 +1,56 @@
+%5C%5C This will be the Gateway.py file for the RPi Gateway%0A
| |
2c0ce3c64720122bf2fdd80aeb2ff8359873ac83 | Test that noindex flag will only show robots metatag when set | municipal_finance/tests/test_analytics.py | municipal_finance/tests/test_analytics.py | Python | 0 | @@ -0,0 +1,546 @@
+from django.test import TestCase%0Afrom django.conf import settings%0A%0A%0Aclass TestAnalytics(TestCase):%0A%0A def test_noindex_flag(self):%0A response = self.client.get('/')%0A self.assertEqual(response.status_code, 200)%0A self.assertTrue('%3Cmeta name=%22robots%22 content... | |
11dd2daf7dd125e0be6a604dd22ae25efed16226 | Update at 2017-07-20 14-05-11 | test.py | test.py | Python | 0 | @@ -0,0 +1,2269 @@
+import json%0Afrom pathlib import Path%0A%0Aimport numpy as np%0Aimport pandas as pd%0A%0Aimport tensorflow as tf%0Afrom keras.backend.tensorflow_backend import set_session%0Aconfig = tf.ConfigProto()%0Aconfig.gpu_options.allow_growth = True%0Aset_session(tf.Session(config=config))%0A%0Afrom keras.m... | |
0c76fa59e77786c577f0750c65f97d24eb3c4157 | Test script | test.py | test.py | Python | 0.000001 | @@ -0,0 +1,2744 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%0Aimport tensorflow as tf%0Aimport numpy as np%0Aimport os%0Aimport time%0Aimport datetime%0Aimport tables%0Afrom sklearn.metrics import f1_score,confusion_matrix%0A%0A%0A%0A# ===================== Preparation des donn%C3%A9es ===============... | |
77effff7ece070eabb3853ba918d40b7eb1c3de5 | Create sc.py | sc.py | sc.py | Python | 0.000005 | @@ -0,0 +1,1191 @@
+#!/usr/bin/env python%0Aimport soundcloud%0Afrom clize import clize, run%0Afrom subprocess import call%0A %0A %0A@clize%0Adef sc_load(tracks='', likes='', tags='', group=''):%0A opts = %7B%7D%0A if likes:%0A method = 'favorites'%0A elif tracks or group:%0A method = 'tracks'%0A... | |
2055fc1eda896103931eaba5fb01238506aaac1a | Add signup in urls | urls.py | urls.py | from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from okupy.login.views import *
from okupy.user.views import *
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', mylogin),
url(r'^$', user),
url(r'^admin/', include(admin.site.urls)),
)
| Python | 0 | @@ -149,16 +149,49 @@
import *
+%0Afrom okupy.signup.views import *
%0A%0Aadmin.
@@ -286,16 +286,46 @@
user),%0A
+ url(r'%5Esignup/', signup),%0A
url(
|
d5b6299b802810748584b06242f614550155a283 | Create app.py | app.py | app.py | Python | 0.000003 | @@ -0,0 +1,1381 @@
+from flask import Flask, request%0Aimport requests%0Aimport json%0Aimport traceback%0Aimport random%0Aimport os%0A%0Afrom urllib.parse import urlencode%0Afrom urllib.request import Request, urlopen%0A%0Aapp = Flask(__name__)%0A%0A@app.route('/', methods=%5B'GET', 'POST'%5D)%0Adef main():%0A # if ... | |
4ff22a24a7d681a3c62f7d7e4fe56c0032a83370 | Improve logging | app.py | app.py | import bottle
from bottle import get, post, static_file, request, route, template
from bottle import SimpleTemplate
from configparser import ConfigParser
from ldap3 import Connection, LDAPBindError, LDAPInvalidCredentialsResult, Server
from ldap3 import AUTH_SIMPLE, SUBTREE
from os import path
@get('/')
def get_index... | Python | 0.00001 | @@ -832,57 +832,211 @@
-return error(%22Username or password is incorrect!%22
+print(%22Unsuccessful attemp to change password for: %25s%22 %25 form('username'))%0A return error(%22Username or password is incorrect!%22)%0A%0A print(%22Password successfully changed for: %25s%22 %25 form('username')
)%0A... |
b720ecf75634718a122c97bcff29129e321aa9b2 | Add cat.py. | cat.py | cat.py | Python | 0.000007 | @@ -0,0 +1,628 @@
+%22%22%22%0AUsage: cat.py %5BFILE%5D...%0AConcatenate FILE(s), or standard input, to standard output.%0A%0A%22%22%22%0Aimport sys%0A%0A%0Adef iter_files(paths):%0A for path in paths:%0A try:%0A yield open(path, 'rb')%0A except (IOError, OSError) as e:%0A print(%... | |
3b58283f613fc827e024c8d971d89c24fc2b3ed0 | Create knn.py | knn.py | knn.py | Python | 0.00005 | @@ -0,0 +1,1086 @@
+import numpy as np%0Aimport pandas as pd%0Afrom sklearn import metrics%0Afrom sklearn.cross_validation import train_test_split%0Afrom sklearn.neighbors import KNeighborsClassifier%0Afrom sklearn.decomposition import PCA%0A%0A#Read training data and split into train and test data%0Adata=pd.read_csv('... | |
1faa3c76d1c752de02149af34954ed538fe10fa1 | Add test | app/tests/test_data.py | app/tests/test_data.py | Python | 0.000005 | @@ -0,0 +1,383 @@
+import unittest%0A%0Afrom app import data%0A%0A%0Aclass TestProjects(unittest.TestCase):%0A def test_load(self) -%3E None:%0A projects = data.Projects.load()%0A self.assertNotEqual(projects.data, %7B%7D)%0A self.assertIn('Python', projects.data)%0A self.assertIn('Git Br... | |
5813474651299998fb27c64c6d179a0a59bbe28c | Create otc.py | otc.py | otc.py | Python | 0.000002 | @@ -0,0 +1,1366 @@
+def tick(a,b,c):%0A if a == 'help':%0A msg = '%5Eotc %7Bcurrency%7D, specify a 2nd currency for rates, add --last/high/low etc for that alone.'%0A return msg%0A import urllib2,json,StringIO%0A a = a.lower()%0A b = b.lower()%0A c = c.lower()%0A%0A if b.startswith('-'):... | |
bf678628cf98b1c18a75f09fa15d26526ea0e3ac | Add gender choices fields | accelerator/migrations/0028_add_gender_fields.py | accelerator/migrations/0028_add_gender_fields.py | Python | 0.000001 | @@ -0,0 +1,1577 @@
+from __future__ import unicode_literals%0A%0Afrom django.conf import settings%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('accelerator', '0027_add_gender_choices_object'),%0A %5D%0A%0A operations = %5B%0A ... | |
bac06acb1e6255040f371232776f3da75fb9247a | Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field. | osf/migrations/0069_auto_20171127_1119.py | osf/migrations/0069_auto_20171127_1119.py | Python | 0 | @@ -0,0 +1,2152 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.7 on 2017-11-27 17:19%0Afrom __future__ import unicode_literals%0Aimport logging%0A%0Afrom django.db import migrations%0Afrom osf.models import PreprintService%0Alogger = logging.getLogger(__name__)%0A%0Adef add_preprint_doi_created(apps, schema_e... | |
167a6497d79a4a18badd5ea85a87e7eefcd02696 | Add init file to the root acceptance tests folder | test/acceptance/__init__.py | test/acceptance/__init__.py | Python | 0 | @@ -0,0 +1,1075 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACopyright 2014 Telefonica Investigaci%C3%B3n y Desarrollo, S.A.U%0A%0AThis file is part of fiware-orion-pep%0A%0Afiware-orion-pep is free software: you can redistribute it and/or%0Amodify it under the terms of the GNU Affero General Public License as%0Apublished... | |
d290b3b2cc15a3bab907ed3847da709ab31edace | disable unpredictable tests | tests/acceptance/test_api.py | tests/acceptance/test_api.py | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class ApiTokensTest(AcceptanceTestCase):
def setUp(self):
super(ApiTokensTest, self).setUp()
self.user = self.create_user('foo@example.com')
self.login_as(self.user)
self.path = '/api/'
def... | Python | 0 | @@ -472,32 +472,34 @@
tokens')%0A
+ #
self.browser.cl
@@ -522,32 +522,34 @@
-token')%0A
+ #
self.browser.wa
@@ -572,32 +572,34 @@
oading')%0A
+ #
self.browser.sn
@@ -630,32 +630,34 @@
token')%0A
+ #
self.browser.cl
@@ -675,32 +675,34 @@
rimary')%0A
+ #
self.browser.wa
... |
8fa776fd2fa63a44cb048a39fe7359ee9366c5e8 | Add basic Processor tests | tests/003-test-processor.py | tests/003-test-processor.py | Python | 0.000001 | @@ -0,0 +1,2333 @@
+import time%0Aimport random%0Aimport multiprocessing%0Afrom functools import wraps%0A%0Atry:%0A import queue%0Aexcept ImportError:%0A import Queue as queue%0A%0Aimport t%0Aimport bucky.processor%0Aimport bucky.cfg as cfg%0Acfg.debug = True%0A%0A%0Adef processor(func):%0A @wraps(func)%0A ... | |
0b185bb6a30cb7c9b02c80051a8426dc736da3d6 | Add sample WSGI app | examples/wsgi.py | examples/wsgi.py | Python | 0 | @@ -0,0 +1,1781 @@
+%0Aimport cgi%0Aimport json%0Afrom wsgiref import simple_server%0A%0Aimport falcon%0A%0Afrom mclib import mc_info%0A%0Aclass MCInfo(object):%0A%0A def on_get(self, req, resp):%0A%0A host = req.get_param('host', required=True)%0A port = req.get_param_as_int('port', min=1024,%0A ... | |
b097075f7606563fc8ae80274e73b74dedd8129f | prepare a new folder "resources" for json files to replace python dynamic_resources | src/alfanous/Data.py | src/alfanous/Data.py | Python | 0.000014 | @@ -0,0 +1,128 @@
+'''%0ACreated on Jun 15, 2012%0A%0A@author: assem%0A'''%0A%0A%0Aclass Configs:%0A pass%0A%0A%0Aclass Indexes:%0A pass%0A%0Aclass Ressources:%0A pass%0A
| |
b171eb0c77f2d68051b48145f4e49275ed6860b9 | Add tests for signup code exists method | account/tests/test_models.py | account/tests/test_models.py | Python | 0 | @@ -0,0 +1,1823 @@
+from django.conf import settings%0Afrom django.core import mail%0Afrom django.core.urlresolvers import reverse%0Afrom django.test import TestCase, override_settings%0A%0Afrom django.contrib.auth.models import User%0A%0Afrom account.models import SignupCode%0A%0A%0Aclass SignupCodeModelTestCase(TestC... | |
6c55d840ed22ec584c6adad15d89d9888b408d88 | [128. Longest Consecutive Sequence][Accepted]committed by Victor | 128-Longest-Consecutive-Sequence/solution.py | 128-Longest-Consecutive-Sequence/solution.py | Python | 0.999951 | @@ -0,0 +1,1005 @@
+class Solution(object):%0A def longestConsecutive(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A # idea something like bucket sort, %0A # put the element n at the (start,end) bucket, everytime%0A # check n-1 o... | |
f5140f87e0e4326fe189b2f5f3ff3ac90f8db5c8 | Add new heroku_worker.py to run as a Heroku worker process | blockbuster/heroku_worker.py | blockbuster/heroku_worker.py | Python | 0.000001 | @@ -0,0 +1,328 @@
+import redis%0Afrom rq import Worker, Queue, Connection%0Aimport os%0A%0AREDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:32769/1')%0Aprint(REDIS_URL)%0A%0Alisten = %5B'default'%5D%0A%0Aconn = redis.from_url(REDIS_URL)%0A%0Aif __name__ == '__main__':%0A with Connection(conn):%0A w... | |
0722624244d107b19a006f07fd884d47597e4eb1 | Add utility class to filter text through external program | lib/filter.py | lib/filter.py | Python | 0 | @@ -0,0 +1,1808 @@
+from subprocess import Popen%0Afrom subprocess import PIPE%0Afrom subprocess import TimeoutExpired%0Aimport threading%0A%0Afrom Dart import PluginLogger%0Afrom Dart.lib.plat import supress_window%0A%0A%0A_logger = PluginLogger(__name__)%0A%0A%0Aclass TextFilter(object):%0A '''Filters text through... | |
c7da0ed13838150f0276c4c9f425390822b5b43b | Add serializers for API models. | vinotes/apps/api/serializers.py | vinotes/apps/api/serializers.py | Python | 0 | @@ -0,0 +1,900 @@
+from django.contrib.auth.models import User%0Afrom rest_framework import serializers%0Afrom .models import Note, Trait, Wine, Winery%0A%0A%0Aclass WinerySerializer(serializers.ModelSerializer):%0A class Meta:%0A model = Winery%0A fields = ('id', 'name')%0A%0A%0Aclass WineSerializer(s... | |
383c67da4729886602227b715f65390427ccd8bc | Create w3_1.py | w3_1.py | w3_1.py | Python | 0.000482 | @@ -0,0 +1,23 @@
+print (%22Hello World!%22)%0A
| |
66afbaab9abe51a83d6ea9765b7b8b70d045115e | Create question2.py | dingshubo/question2.py | dingshubo/question2.py | Python | 0.999772 | @@ -0,0 +1,551 @@
+#_*_ coding:utf-8 _*_%0A%0A#!/user/bin/python%0A%0Aimport random%0A%0Anumber_random = random.randint(1,100)%0A%0A%0A%0Afor chance in range(5): #%E7%8E%A9%E5%AE%B6%E6%9C%895%E6%AC%A1%E6%9C%BA%E4%BC%9A%0A%0A number_player=input('%E8%AF%B7%E8%BE%93%E5%85%A5%E4%B8%80%E4%B8%AA1-100%E4%B9%8B%E9%97%B4... | |
3189cd139b868d74caf35aa5b7a80f748f21c231 | add tool to process brian's files | scripts/import/import_brian_files.py | scripts/import/import_brian_files.py | Python | 0 | @@ -0,0 +1,239 @@
+import glob%0Aimport os%0A%0Aos.chdir(%22c%22)%0Afor filename in glob.glob(%22*%22):%0A tokens = filename.split(%22_%22)%0A huc12 = tokens%5B1%5D%0A typ = tokens%5B2%5D.split(%22.%22)%5B1%5D%0A newfn = %22/i/%25s/%25s/%25s%22 %25 (typ, huc12, filename)%0A os.rename(filename, newfn)
| |
5806747564a9b2d35663b4e2612b23d1f5c3e961 | Version bump to 1.8 | pyglui/__init__.py | pyglui/__init__.py | __version__ = '1.7'
| Python | 0 | @@ -14,7 +14,7 @@
'1.
-7
+8
'%0A
|
7e17363eaf8d17f0d595ca5199e59a51c7b1df65 | Add the core social_pipeline. | oneflow/core/social_pipeline.py | oneflow/core/social_pipeline.py | Python | 0 | @@ -0,0 +1,1770 @@
+# -*- coding: utf-8 -*-%0Au%22%22%22%0ACopyright 2013-2014 Olivier Cort%C3%A8s %3Coc@1flow.io%3E.%0A%0AThis file is part of the 1flow project.%0A%0AIt provides %7Bpython,django%7D-social-auth pipeline helpers.%0A%0A1flow is free software: you can redistribute it and/or modify%0Ait under the terms of... | |
ee533a5e2a4eff99641383741e1cbe8e57c43e1f | add typing stub/compat package | gosubl/typing.py | gosubl/typing.py | Python | 0 | @@ -0,0 +1,1996 @@
+try:%0A%0A # ST builds %3E= 4000%0A%0A from mypy_extensions import TypedDict%0A from typing import Any%0A from typing import Callable%0A from typing import Dict%0A from typing import Generator%0A from typing import IO%0A from typing import Iterable%0A from typing import It... | |
2761e3bfd8d2c8281db565e54f6e3ea687bd5663 | add backfill problem_id script | private/scripts/extras/backfill_problem_id.py | private/scripts/extras/backfill_problem_id.py | Python | 0.000001 | @@ -0,0 +1,1859 @@
+%22%22%22%0A Copyright (c) 2015-2019 Raj Patel(raj454raj@gmail.com), StopStalk%0A%0A Permission is hereby granted, free of charge, to any person obtaining a copy%0A of this software and associated documentation files (the %22Software%22), to deal%0A in the Software without restriction, i... | |
a3de0337f6e3511cc3381f92f7bbc384d7667dfd | Create xmas.py | xmas.py | xmas.py | Python | 0.999876 | @@ -0,0 +1,587 @@
+gifts=%5B'A Partridge in a Pear Tree', 'Two Turtle Doves, and', 'Three French Hens', 'Four Calling Birds', 'Five Golden Rings', 'Six Geese-a-Laying', 'Seven Swans-a-Swimming', 'Eight Maids-a-Milking', 'Nine Ladies Dancing', 'Ten Lords-a-Leaping', 'Eleven Pipers Piping', 'Twelve Drummers Drumming'%5D%... | |
8fa4888dbf82d225f52b6df347372a0381c08237 | Add __main__.py for running python -m grip. | grip/__main__.py | grip/__main__.py | Python | 0.000006 | @@ -0,0 +1,226 @@
+%22%22%22%5C%0AGrip%0A----%0A%0ARender local readme files before sending off to Github.%0A%0A:copyright: (c) 2014 by Joe Esposito.%0A:license: MIT, see LICENSE for more details.%0A%22%22%22%0A%0Afrom command import main%0A%0A%0Aif __name__ == '__main__':%0A main()%0A
| |
95874a5e06ff70d1cbea49321549beee5cc5abba | Create an example of storing units in HDF5 | examples/store_and_retrieve_units_example.py | examples/store_and_retrieve_units_example.py | Python | 0.000001 | @@ -0,0 +1,1342 @@
+%22%22%22%0AAuthor: Daniel Berke, berke.daniel@gmail.com%0ADate: October 27, 2019%0ARequirements: h5py%3E=2.10.0, unyt%3E=v2.4.0%0ANotes: This short example script shows how to save unit information attached%0Ato a %60unyt_array%60 using %60attrs%60 in HDF5, and recover it upon reading the file.%0AI... | |
4fe50fda289be7db3fb96450e713eb8f1a815026 | Add weighted linear algorithm | autoscaler/server/scaling/algorithms/weighted.py | autoscaler/server/scaling/algorithms/weighted.py | Python | 0.000596 | @@ -0,0 +1,1158 @@
+import math%0A%0Afrom autoscaler.server.request_history import RequestHistory%0Afrom autoscaler.server.scaling.utils import parse_interval%0A%0A%0Aclass WeightedScalingAlgorithm:%0A def __init__(self, algorithm_config):%0A self.interval_seconds = parse_interval(%0A algorithm_con... | |
5cb215814c5cd4e2c0b7b1e4561886094be5e315 | version bump | djangocms_column/__init__.py | djangocms_column/__init__.py | __version__ = "1.3"
| Python | 0.000001 | @@ -14,7 +14,7 @@
%221.
-3
+4
%22%0A
|
a726625e13ac08d0b6c2c686de476b6e78bc0f48 | Add unit test for _skeleton | dlstats/fetchers/test__skeleton.py | dlstats/fetchers/test__skeleton.py | Python | 0.000001 | @@ -0,0 +1,700 @@
+import unittest%0Afrom datetime import datetime%0Afrom _skeleton import Dataset%0A%0Aclass DatasetTestCase(unittest.TestCase):%0A def test_full_example(self):%0A self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr',dimension_list=%5B%7B'name':'COUNTRY... | |
e54c82c336827c1fc835837006885c245a05e5cb | Add html stripper for announcements | html_stripper.py | html_stripper.py | Python | 0 | @@ -0,0 +1,426 @@
+from html.parser import HTMLParser%0A%0Aclass HTMLStripper(HTMLParser):%0A def __init__(self):%0A super().__init__()%0A self.reset()%0A self.strict = False%0A self.convert_charrefs= True%0A self.fed = %5B%5D%0A def handle_data(self, d):%0A self.fed.appe... | |
20830e9fb2785eda94bf9e7c0dab70d476bc82b4 | Add `sample_settings.py` | sample_settings.py | sample_settings.py | Python | 0 | @@ -0,0 +1,536 @@
+# Rename this file to %60settings.py%60 in deployment%0A%0A# supported_subreddits = 'india'%0Asupported_subreddits = 'india+indianbooks'%0Auser_agent = ('Goodreads, v0.1. Gives info of the book whenever goodreads'%0A 'link to a book is posted. (by /u/avinassh)')%0Ascopes = %5B'identity',... | |
638c6383acf4431c95327fd0cbdb535e115e027d | Create admin util for user management. | flow-admin.py | flow-admin.py | Python | 0 | @@ -0,0 +1,3670 @@
+#!/usr/bin/env python%0A#%0A# To ensure you can import rhizo-server modules set PYTHONPATH%0A# to point to rhize-server base dir.%0A# E.g.%0A# export PYTHONPATH=/home/user/rhizo-server/%0A#%0A%0Afrom optparse import OptionParser%0A%0Afrom main.users.auth import c... | |
55dd21610a2ed1befed6b4560528e8a6bf3602e2 | Define function to retrieve imgur credentials | imgur_cli/cli.py | imgur_cli/cli.py | Python | 0.000006 | @@ -0,0 +1,1209 @@
+import argparse%0Aimport logging%0Aimport os%0A%0Aimport imgurpython%0A%0Afrom collections import namedtuple%0A%0Alogger = logging.getLogger(__name__)%0A%0Adef imgur_credentials():%0A ImgurCredentials = namedtuple('ImgurCredentials', %5B'client_id', 'client_secret', 'access_token', 'refresh_token... | |
d3ebb800c88be18861608f8b174cc652223ac67c | Add utils.py with get_options function | apps/ivrs/utils.py | apps/ivrs/utils.py | Python | 0.000001 | @@ -0,0 +1,151 @@
+def get_options(question_number):%0A if question_number == 2:%0A return %22 Press 4 or 5 %22%0A else:%0A return %22 Press 1 for Yes or 2 for No%22%0A
| |
2c8752cd586f6d02ce8da4bc3a79660889ed7f3f | Add some minimal testing for BandRCModel to the test suite. | climlab/tests/test_bandrc.py | climlab/tests/test_bandrc.py | Python | 0 | @@ -0,0 +1,1127 @@
+import numpy as np%0Aimport climlab%0Aimport pytest%0A%0A# The fixtures are reusable pieces of code to set up the input to the tests.%0A# Without fixtures, we would have to do a lot of cutting and pasting%0A# I inferred which fixtures to use from the notebook%0A# Latitude-dependent grey radiation.ip... | |
27899a91fc6cdf73dccc7f9c5c353b05d2433c42 | add example participant client inbound drop rule for blackholing | pclnt/blackholing_test.py | pclnt/blackholing_test.py | Python | 0 | @@ -0,0 +1,266 @@
+ %7B%0A %22inbound%22: %5B%0A %7B%0A %22cookie%22: 3,%0A %22match%22: %7B%0A %22eth_src%22: %2208:00:27:89:3b:9f%22%0A %7D,%0A %22action%22: %7B%0A %22drop%22: 0%0A %7D%0A ... | |
cd910f95753a138e2df48a1370e666bee49ad1dd | Add py solution for 693. Binary Number with Alternating Bits | py/binary-number-with-alternating-bits.py | py/binary-number-with-alternating-bits.py | Python | 0.000085 | @@ -0,0 +1,211 @@
+class Solution(object):%0A def hasAlternatingBits(self, n):%0A %22%22%22%0A :type n: int%0A :rtype: bool%0A %22%22%22%0A power_2 = (n %5E (n %3E%3E 1)) + 1%0A return (power_2 & -power_2) == power_2%0A
| |
b34c0ec439a997705799136e56a926649bd93e52 | add new function to test whether an object is completely within the bounds of an image | plantcv/plantcv/within_frame.py | plantcv/plantcv/within_frame.py | Python | 0.000054 | @@ -0,0 +1,1171 @@
+import cv2 as cv2%0Aimport numpy as np%0A%0Adef within_frame(img, obj):%0A '''%0A This function tests whether the plant object is completely in the field of view%0A Input:%0A img - an image with the bounds you are interested in%0A obj - a single object, preferably after calling pcv.im... | |
c4040803cb670f913bc8743ee68f5a5f0721d4f8 | Add game logic | backend/game.py | backend/game.py | Python | 0.000059 | @@ -0,0 +1,1122 @@
+# All game related code%0A%0Aimport json%0Aimport random%0A%0A%0Aclass Game():%0A def __init__(self):%0A self.players = %7B%7D%0A self.turn = None%0A self.running = False%0A%0A def add_player(self, conn, data):%0A player = Player(conn, data)%0A self.players%5... | |
69e22c778a576f746784270fa9971a6399433f92 | Add docstring to UnivariateFilter. | examples/plot_feature_selection.py | examples/plot_feature_selection.py | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | Python | 0 | @@ -1591,24 +1591,30 @@
import univ
+ariate
_selection %0A
@@ -1612,16 +1612,33 @@
lection
+as univ_selection
%0A# As a
@@ -1789,37 +1789,33 @@
v_selection.
-Univ
Select
-ion
+Fpr
(%0A
@@ -1907,17 +1907,16 @@
tor.
-p
_
+p
values
-_
)%0Asc
@@ -2358,16 +2358,16 @@
eight',%0A
+
@@ -2382,... |
1beec05941a6a34452bea6e9f60a1673c0f0925f | add base test case file | keen/tests/base_test_case.py | keen/tests/base_test_case.py | Python | 0.000001 | @@ -0,0 +1,22 @@
+__author__ = 'dkador'%0A
| |
1fa849f1a0eadad9573b677d3904986d76f900eb | Create main.py | challenge_2/python/wost/main.py | challenge_2/python/wost/main.py | Python | 0.000001 | @@ -0,0 +1,724 @@
+%22%22%22%0APython 3.6:%0A :: Counts all the instances of all the elements in a list.%0A :: Returns all the instances with a count of 1.%0A%22%22%22%0A%0Adef find_one_in_list(a_list):%0A a_dict = %7B%7D%0A %0A for char in a_list:%0A if char not in a_dict.keys():%0A a_dict%5Bchar%5D = 1%0... | |
ac4679b4dcbbc3b2a29230233afc138f98cf2c42 | Add the basics | anvil.py | anvil.py | Python | 0.006448 | @@ -0,0 +1,1782 @@
+import gzip%0Aimport io%0Aimport nbt.nbt%0Aimport pathlib%0Aimport re%0Aimport zlib%0A%0Aclass Region:%0A def __init__(self, path):%0A if isinstance(path, str):%0A path = pathlib.Path(path)%0A with path.open('rb') as f:%0A data = f.read()%0A self.loc... | |
702abe6dc661fbcda04f743edc56d2938098cefa | Add checkJSON file function only for checking a JSON file against a specified schema | src/main/python/convertfiles/checkJSON.py | src/main/python/convertfiles/checkJSON.py | Python | 0 | @@ -0,0 +1,2438 @@
+#!/nfs/projects/c/ci3_jwaldo/MONGO/bin/python%0A%22%22%22%0AThis function will check an existing JSON newline delimited file%0Aagainst a specified schema%0A%0AInput is a newline delimited JSON file and schema file%0AOutput is a summary printout of statistics%0A%0AUsage:%0Apython checkJSON %5B-option... | |
7330f9f1423fe7ee169569957d537441b6d72c08 | Create 0106_us_city_synonyms.py | 2019/0106_us_city_synonyms.py | 2019/0106_us_city_synonyms.py | Python | 0.00367 | @@ -0,0 +1,830 @@
+#%25%25%0A%22%22%22%0ANPR 2019-01-06%0Ahttps://www.npr.org/2019/01/06/682575357/sunday-puzzle-stuck-in-the-middle%0A%0AName a major U.S. city in 10 letters. If you have the right one, you can rearrange its letters to get two 5-letter words that are synonyms. What are they?%0A%22%22%22%0A%0Aimport sys... | |
2f08053dc04470c9a1e4802e0e90c198bb5eae63 | Update app/views/account/__init__.py | app/views/account/__init__.py | app/views/account/__init__.py | Python | 0 | @@ -0,0 +1,101 @@
+from flask import Blueprint%0A%0Aaccount = Blueprint(%0A 'account',%0A __name__%0A)%0A%0Afrom . import views%0A
| |
5470661c6f171f1e9da609c3bf67ece21cf6d6eb | Add example for response status code | examples/return_400.py | examples/return_400.py | Python | 0.000001 | @@ -0,0 +1,150 @@
+import hug%0Afrom falcon import HTTP_400%0A%0A@hug.get()%0Adef only_positive(positive: int, response):%0A if positive %3C 0:%0A response.status = HTTP_400
| |
34f44cd57baf9f0a548d728e90ca0c67f47b08a1 | Add tests for Resource | tests/test_resource.py | tests/test_resource.py | Python | 0 | @@ -0,0 +1,648 @@
+import unittest%0A%0Aimport soccermetrics%0Afrom soccermetrics import __api_version__%0Afrom soccermetrics.rest import SoccermetricsRestClient%0Afrom soccermetrics.rest.resource import Resource%0A%0Aclass ResourceTest(unittest.TestCase):%0A%0A def setUp(self):%0A base_url = %22http://api-su... | |
0b0d77ca77cf5359175836d68fc0bcce3829d731 | Create change_config.py | static/scripts/change_hostname/change_config.py | static/scripts/change_hostname/change_config.py | Python | 0.000002 | @@ -0,0 +1,754 @@
+import os, sys%0Afrom change_gluu_host import Installer, FakeRemote, ChangeGluuHostname%0A%0Aname_changer = ChangeGluuHostname(%0A old_host='%3Ccurrent_hostname%3E',%0A new_host='%3Cnew_hostname%3E',%0A cert_city='%3Ccity%3E',%0A cert_mail='%3Cemail%3E',%0A cert_state='%3Cstate_or_regi... | |
3cb39bc8be7fdf857ebbdd2f78cbb617b2dda104 | Create PowofTwo_003.py | leetcode/231-Power-of-Two/PowofTwo_003.py | leetcode/231-Power-of-Two/PowofTwo_003.py | Python | 0.000009 | @@ -0,0 +1,138 @@
+class Solution:%0A # @param %7Binteger%7D n%0A # @return %7Bboolean%7D%0A def isPowerOfTwo(self, n):%0A return n %3E 0 and (n & n - 1 is 0)%0A
| |
90987fccd2f604a5224e5b1cf8f91073b173fdc8 | Splitting a sentence by ending characters | split_sentences.py | split_sentences.py | Python | 1 | @@ -0,0 +1,535 @@
+%22%22%22 Splitting a sentence by ending characters %22%22%22%0A%0Aimport re%0A%0Ast1 = %22 Another example!! Let me contribute 0.50 cents here?? %5C%0A How about pointer '.' character inside the sentence? %5C%0A Uni Mechanical Pencil Kurutoga, Blue, 0.3mm (M310121P.33). %5C%0A ... | |
98d8716192bfb6b4223d84855f647e2b698b5f19 | Add test for viewport inspection | tests/test_viewport.py | tests/test_viewport.py | from tests.base import IntegrationTest
class TestViewportsTaskGeneration(IntegrationTest):
viminput = """
=== Work tasks | +work ===
"""
vimoutput = """
=== Work tasks | +work ===
* [ ] tag work task #{uuid}
"""
tasks = [
dict(description="tag work task", tags=['work']),
... | Python | 0.000001 | @@ -32,16 +32,39 @@
ionTest%0A
+from time import sleep%0A
%0A%0Aclass
@@ -2481,28 +2481,777 @@
rt task%5B'tags'%5D == %5B'home'%5D%0A
+%0A%0Aclass TestViewportInspection(IntegrationTest):%0A%0A viminput = %22%22%22%0A === Work tasks %7C +work ===%0A * %5B %5D tag work task #%7Buuid%7D%0A %22%22%22%0A%0... |
5e2a14af770ca07cdf6f3674ef54668a0a433078 | hello py | helloworld.py | helloworld.py | Python | 0.99991 | @@ -0,0 +1,20 @@
+print %22Hello World%22;
| |
edd28dc68b91af78da1a1d576fcb9dcb83ebd0c8 | Create lin_reg.py | lin_reg.py | lin_reg.py | Python | 0.00001 | @@ -0,0 +1,1419 @@
+#!/usr/bin/python%0A%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom scipy.signal import square%0A%0A#Mean Square error function%0Adef costf(X, y, theta):%0A m = y.shape%5B0%5D%0A #print m%0A return (1.0/m)*np.sum(np.power(np.dot(X,theta) - y, 2))%0A%0A#Gradient of error funct... | |
dc854dc41929b027f393c7e341be51193b4ca7b9 | Create SearchinRSArr_001.py | leetcode/033-Search-in-Rotated-Sorted-Array/SearchinRSArr_001.py | leetcode/033-Search-in-Rotated-Sorted-Array/SearchinRSArr_001.py | Python | 0 | @@ -0,0 +1,648 @@
+class Solution:%0A # @param %7Binteger%5B%5D%7D nums%0A # @param %7Binteger%7D target%0A # @return %7Binteger%7D%0A def search(self, nums, target):%0A l, r = 0, len(nums) - 1%0A %0A while l %3C= r:%0A m = (l + r) / 2%0A if nums%5Bm%5D == target:%... | |
a33fa25ce2537b0eb8dc33002a80aa71320c17a2 | fix to sysUpTime OID | pysnmp/entity/rfc3413/ntforg.py | pysnmp/entity/rfc3413/ntforg.py | import time
try:
from sys import version_info
except ImportError:
version_info = ( 0, 0 ) # a really early version
from pysnmp.entity.rfc3413 import config
from pysnmp.proto.proxy import rfc2576
from pysnmp.proto.api import v2c
from pysnmp.smi import error
vacmID = 3
class NotificationOriginator:
def __... | Python | 0.015655 | @@ -4315,23 +4315,16 @@
ime.name
- + (0,)
, sysUpT
|
a10554b81d4def386b016698c1e7dd771cecd35b | fix automatic testing | python/qidoc/test/test_qidoc.py | python/qidoc/test/test_qidoc.py | ## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
import os
import tempfile
import unittest
import qidoc.core
import qibuild
class TestQiDoc(unittest.TestCase):
def setUp(self):
self.tmp ... | Python | 0.000225 | @@ -1047,55 +1047,8 @@
f):%0A
- qidoc_cfg = self.qidoc_builder.config%0A%0A
@@ -2067,78 +2067,8 @@
))%0A%0A
- self.assertEqual(qidoc_cfg.templates.repo, %22aldeb-templates%22)%0A
%0A%0A
|
3205e44282f2a5e6a266c99d5c1e29f3e5fc132c | fix tests | tests/py/test_pages.py | tests/py/test_pages.py | from __future__ import print_function, unicode_literals
from aspen import Response
from gratipay.security.user import SESSION
from gratipay.testing import Harness
from gratipay.wireup import find_files
class TestPages(Harness):
def browse(self, **kw):
alice = self.make_participant('alice', claimed_time... | Python | 0.000001 | @@ -2166,25 +2166,29 @@
= %22
-small weekly cash
+give money every week
%22%0A
@@ -2836,15 +2836,9 @@
= %22
-About t
+T
eams
@@ -3076,13 +3076,8 @@
rt %22
-Page
Not
@@ -5761,14 +5761,9 @@
= %22
-goes u
+U
ncla
@@ -6178,88 +6178,20 @@
-expected1 = %22bob%22%0A expected2 = %22cancelled 1 tip%2... |
b57c24b23fa9566178455da895ea63baf6e16ff4 | Test cases to verify parsing of bitwise encoded PIDs | tests/scanner_tests.py | tests/scanner_tests.py | Python | 0 | @@ -0,0 +1,2007 @@
+from shadetree.obd.scanner import decode_bitwise_pids%0A%0ADURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 '%0AJETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 '%0A%0A%0Adef test_decode_bitwise_pids_durango():%0A %22%22%22%0A Verify we correctly parse information about supported PIDs on ... | |
0eb28e89a5c5453a8337e031dd71a5019d828aab | Remove radmin credentials from create_heat_client | trove/common/remote.py | trove/common/remote.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... | Python | 0.000006 | @@ -2388,112 +2388,8 @@
ent(
-username=context.user,%0A password=%22radmin%22,%0A
toke
|
7a9bb7d412ccfa4921dc691232c1192bbb2789cd | Add rudimentary swarming service. | dashboard/dashboard/services/swarming_service.py | dashboard/dashboard/services/swarming_service.py | Python | 0.000001 | @@ -0,0 +1,1910 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Functions for interfacing with the Chromium Swarming Server.%0A%0AThe Swarming Server is a task distribution service. It... | |
1a3839a083293200862ea21283c9c4d82a836846 | Add test for profiles. | tests/test_catalyst.py | tests/test_catalyst.py | Python | 0 | @@ -0,0 +1,809 @@
+%0Afrom vdm.catalyst import DisambiguationEngine%0A%0Adef pretty(raw):%0A %22%22%22%0A Pretty print xml.%0A %22%22%22%0A import xml.dom.minidom%0A xml = xml.dom.minidom.parseString(raw)%0A pretty = xml.toprettyxml()%0A return pretty%0A%0A%0Adef test_profile():%0A #Basic info a... | |
15b69945a209515c236d8ed788e824a895ef6859 | Create uvcontinuum.py | xmps/color_selection/uvcontinuum.py | xmps/color_selection/uvcontinuum.py | Python | 0.000006 | @@ -0,0 +1 @@
+%0A
| |
4826764c24fca8204322f88adfde75968b3985ee | add wrapper to start bucky from source tree | bucky.py | bucky.py | Python | 0 | @@ -0,0 +1,92 @@
+#!/usr/bin/env python%0A%0Aimport bucky.main%0A%0Aif __name__ == '__main__':%0A bucky.main.main()%0A%0A
| |
c757c6ad714afb393c65c1b82bca31de357332fc | Add test coverage for utility module | python/util_test.py | python/util_test.py | Python | 0 | @@ -0,0 +1,1864 @@
+#%0A# (C) Copyright IBM Corp. 2017%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless requir... | |
8ee2f2b4c3a0ac40c6b7582a2cf3724f30f41dae | Add data migration | workshops/migrations/0035_auto_20150107_1205.py | workshops/migrations/0035_auto_20150107_1205.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0034_auto_20150107_1200'),
]
operations = [
migrations.RenameModel(
old_name='Project',
... | Python | 0.999708 | @@ -101,16 +101,300 @@
tions%0A%0A%0A
+def copy_project_to_tags(apps, schema_editor):%0A Event = apps.get_model('workshops', 'Event')%0A for event in Event.objects.all().exclude(project=None):%0A tag = event.project%0A print('add %7B%7D to %7B%7D'.format(tag, event))%0A event.tags.add(tag)%0... |
660d04ac87ea05032a0c19b293fd237bda15fad9 | tempson main class | tempson/tempson.py | tempson/tempson.py | Python | 0.999092 | @@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-%0A%0Adef render():%0A print %221234%22%0A
| |
3c2c6002cf25dab301044f2dc4c2c3bbd99e121e | add script file | get-polymer-imports.py | get-polymer-imports.py | Python | 0.000002 | @@ -0,0 +1,1677 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport sys%0A%0A#rootDir = %22bower_components%22%0A%0AnumArgs = len(sys.argv)%0A%0Aif numArgs %3C= 1:%0A print 'usage: get_all_imports.py %3Cbower_components directory%3E %5Bprefix (default %22..%22)%5D'%0A exit(1)%0A%0ArootDir = sys.argv%5B1%5D%0A%0Aif ... | |
30dcfef191666951a4084a4b9d9c135c9edb5de8 | Create check.py | check.py | check.py | Python | 0.000001 | @@ -0,0 +1,1476 @@
+# -*- coding: utf-8 -*-%0A%0A__author__ = 'https://github.com/password123456/'%0A%0Aimport sys%0Areload(sys)%0Asys.setdefaultencoding('utf-8')%0A%0Aimport requests%0A%0Aclass bcolors:%0A HEADER = '%5C033%5B95m'%0A OKBLUE = '%5C033%5B94m'%0A OKGREEN = '%5C033%5B92m'%0A WARNING = '%5C033%5... | |
c5ae855af4c999ab2cbf6d4b5c77a0f04a84c13a | Update design-search-autocomplete-system.py | Python/design-search-autocomplete-system.py | Python/design-search-autocomplete-system.py | # Time: O(p^2), p is the length of the prefix
# Space: O(p * t + s), t is the number of nodes of trie
# , s is the size of the sentences
class TrieNode(object):
def __init__(self):
self.__TOP_COUNT = 3
self.infos = []
self.leaves = {}
def insert(self, s, times... | Python | 0.000001 | @@ -882,16 +882,17 @@
bject):%0A
+%0A
def
@@ -2078,17 +2078,16 @@
%0A%0A
-%0A
# Your A
|
0b9810227b91b7ee7bb58cee2dccec992c752768 | add xmpp plugin | gozerlib/plugs/xmpp.py | gozerlib/plugs/xmpp.py | Python | 0 | @@ -0,0 +1,695 @@
+# gozerlib/plugs/xmpp.py%0A#%0A#%0A%0A%22%22%22 xmpp related commands. %22%22%22%0A%0A## gozerlib imports%0A%0Afrom gozerlib.commands import cmnds%0Afrom gozerlib.examples import examples%0Afrom gozerlib.fleet import fleet%0A%0A## commands%0A%0Adef handle_xmppinvite(bot, event):%0A %22%22%22 invit... | |
e1fad0e5759908b3c1f6d3bafa2110cb4c26b7e1 | Add get_jpp_env command... | km3pipe/shell.py | km3pipe/shell.py | Python | 0 | @@ -0,0 +1,957 @@
+# coding=utf-8%0A# cython: profile=True%0A# Filename: shell.py%0A# cython: embedsignature=True%0A# pylint: disable=C0103%0A%22%22%22%0ASome shell helpers%0A%0A%22%22%22%0Afrom __future__ import division, absolute_import, print_function%0A%0Aimport os%0A%0Afrom .logger import logging%0A%0A__author__ =... | |
1360a7031d4389f2ecdef24ce3190a88e5f8f794 | add trivial pjit tests | tests/pjit_test.py | tests/pjit_test.py | Python | 0.000144 | @@ -0,0 +1,2016 @@
+# Copyright 2018 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# https://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ... | |
cce409a910a19d93a2b674be1899f49d95800d74 | use logging.error() instead of print() | static_aid/DataExtractor_ArchivesSpace.py | static_aid/DataExtractor_ArchivesSpace.py | import json
import logging
import os
import requests
import sys
from static_aid import config
from static_aid.DataExtractor import DataExtractor
class DataExtractor_ArchivesSpace(DataExtractor):
def _run(self):
lastExport = self.lastExportTime()
self.makeDestinations()
headers = self.aut... | Python | 0.000027 | @@ -1153,38 +1153,46 @@
e:%0A
-print
+logging.error(
'Authentication
@@ -1309,42 +1309,54 @@
fig.
-configFilePath%0A print e
+CONFIG_FILE_PATH)%0A logging.error(e)
%0A
@@ -1417,14 +1417,22 @@
-print
+logging.error(
'Aut
@@ -1547,22 +1547,25 @@
fig.
-configFilePath
+C... |
7c1b0d4efd000fee8f065f2f5815075833811331 | Change file location and rename | scripts/reporting/svn_report.py | scripts/reporting/svn_report.py | Python | 0.000001 | @@ -0,0 +1,2669 @@
+'''%0AThis file creates a .csv file containing the name of each laptop and its last changed date%0A'''%0Aimport argparse%0Aimport csv%0Afrom datetime import datetime, timezone%0Aimport os%0Aimport svn.local%0Aimport pandas as pd%0A%0A'''%0AConstants -- paths for reports, default save names, SLA, col... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.