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 |
|---|---|---|---|---|---|---|---|
a7728b466f5cacb662566e9e71ebc661ae40271a | Create max_end3.py | Python/CodingBat/max_end3.py | Python/CodingBat/max_end3.py | Python | 0.000011 | @@ -0,0 +1,189 @@
+# http://codingbat.com/prob/p135290%0A%0Adef max_end3(nums):%0A max = nums%5B0%5D if (nums%5B0%5D %3E nums%5B-1%5D) else nums%5B-1%5D # or use max(arg1, arg2)%0A for i in range(3):%0A nums%5Bi%5D = max%0A return nums%0A
| |
6ae82ecdd749b936289b496a10faa2caf1aa94c6 | Add first version of the code | bibsort.py | bibsort.py | Python | 0.000002 | @@ -0,0 +1,2718 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport re%0Afrom collections import OrderedDict%0Aimport codecs%0A%0Aclass BibEntry:%0A %0A def __init__(self, **kwargs):%0A self.data = %7B%7D%0A for key, value in kwargs.iteritems():%0A self.data%5Bkey%5D = value%0... | |
2428467d8c0d9c70a4931e1bd1b5971c9f45a0b7 | add function | function.py | function.py | Python | 0.000355 | @@ -0,0 +1,39 @@
+def foo(x,y):%0A print(x+y)%0A%0Afoo(3,4)%0A
| |
9873891a9f26edc51a22e51b5910615a7e08d410 | Create WaterLevel.py | device/src/WaterLevel.py | device/src/WaterLevel.py | Python | 0.000001 | @@ -0,0 +1,311 @@
+#Water level sensor.%0A#VCC %0A#GND%0A#AO %3C--%3E ADC Port(A7) Analog data%0A%0A#AO is the specific value.%0A%0Aimport pyb%0A%0Aadc = pyb.ADC(Pin('A7')) # create an analog object from a pin%0Aadc = pyb.ADC(pyb.Pin.board.A7)%0A# read an analog value%0Adef getWaterLevel(): %0A pri... | |
d43d4f29752bfae8a4d2e337f5523cd5fc7888d8 | add Trimplementation of Kadane's algorithm | dp/kadane-_algorithm/py/TrieToSucceed_kadane.py | dp/kadane-_algorithm/py/TrieToSucceed_kadane.py | Python | 0 | @@ -0,0 +1,1315 @@
+#!/usr/bin/python3%0A%22%22%22%0AThis module contains an implementation of Kadane's algorithm to determine the%0Amaximum sum of a subarray.%0A%22%22%22%0A%0Adef kadane(list_obj=None):%0A %22%22%22%0A Find maximum sum of a subarray%0A%0A :param list list_int: list of objs%0A :return: maxi... | |
3b1b708b739f43bdac86784b27838c80d179572b | solved day 17 | 17/main.py | 17/main.py | Python | 0.999067 | @@ -0,0 +1,2269 @@
+import collections%0Aimport unittest%0A%0A%0Adef gen_valid_combinations(liters, container_sizes):%0A first_container_capacity = container_sizes%5B0%5D%0A if len(container_sizes) == 1:%0A if liters == first_container_capacity:%0A yield %5B1%5D%0A elif liters == 0:%0A yield %5B0%5D%0... | |
4d196f4f897ac6d2c590803d491192e340ec475e | fetch option order example | examples/py/async-binance-fetch-option-order.py | examples/py/async-binance-fetch-option-order.py | Python | 0.999999 | @@ -0,0 +1,875 @@
+# -*- coding: utf-8 -*-%0A%0Aimport asyncio%0Aimport os%0Aimport sys%0Afrom pprint import pprint%0A%0Aroot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))%0Asys.path.append(root + '/python')%0A%0Aimport ccxt.async_support as ccxt # noqa: E402%0A%0A%0Aasync def main():%... | |
08e43e8bfd150252b3e05ff62ee25cdf0e519f20 | Revert #830 because it broke the case when the main script is not in path. | meson.py | meson.py | #!/usr/bin/env python3
# Copyright 2016 The Meson development team
# 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 appl... | Python | 0 | @@ -654,16 +654,380 @@
ys, os%0A%0A
+def main():%0A thisfile = __file__%0A if not os.path.isabs(thisfile):%0A thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile))%0A if __package__ == '':%0A thisfile = os.path.dirname(thisfile)%0A%0A # The first argument *must* be an absolute path... |
27b2e87a8653961fbba45962e9e6ec1d20904a03 | Create demo_lcd.py | 20x4LCD/demo_lcd.py | 20x4LCD/demo_lcd.py | Python | 0.000001 | @@ -0,0 +1,228 @@
+import lcddriver%0Afrom time import *%0A%0Alcd = lcddriver.lcd()%0A%0Alcd.lcd_display_string(%22Hello world%22, 1)%0Alcd.lcd_display_string(%22My name is%22, 2)%0Alcd.lcd_display_string(%22picorder%22, 3)%0Alcd.lcd_display_string(%22I am a Raspberry Pi%22, 4)%0A
| |
e4a4e8d43c1b4c63ac32467a8e49a5b81f8f2fa3 | Create roundrobin.py | roundrobin.py | roundrobin.py | Python | 0.000369 | @@ -0,0 +1,1698 @@
+import string%0Afrom game import Game%0A%0Aclass RoundRobin(object):%0A %0A def __init__(self, teams_count):%0A self.teams = generateTeams(teams_count)%0A self.current_round = 0%0A %0A def getRound(self):%0A games = %5B%5D%0A teams_count = len(self.teams)%0A ... | |
6787d62bf6f77dbf0fd5cbfeb3fad98298d596af | Add track_instance_changes note in disable_group_policy_check_upcall | nova/conf/workarounds.py | nova/conf/workarounds.py | # Copyright 2016 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Python | 0.000104 | @@ -5206,16 +5206,155 @@
compute.
+%0A%0ARelated options:%0A%0A* %5Bfilter_scheduler%5D/track_instance_changes also relies on upcalls from the%0A compute service to the scheduler service.
%0A%22%22%22),%0A%5D
|
d1eac9803adbf9b91b22ce62a4bdf5db790b6265 | Create ShodanToCSV.py | ShodanToCSV.py | ShodanToCSV.py | Python | 0 | @@ -0,0 +1,1693 @@
+#!/usr/bin/env python%0A#%0A# Search shodan, output to CSV%0A# To ensure comma as seperator, all comma's in os and header field (if any) are replaced for ;;;%0A# To ensure row integrity all newlines (%5Cn) are replaced by #NWLN%0A# Author: Jeroen%0A%0Aimport shodan%0Aimport sys%0Aimport os%0Afrom op... | |
9be177007ce95f2b9e47225a46effe7b7682ba38 | Create StockReader.py | StockReader.py | StockReader.py | Python | 0 | @@ -0,0 +1,825 @@
+#econogee, 1/28/2016%0A#Stock Data Retrieval Script%0A%0Aimport os%0Aimport numpy as np%0Aimport urllib2%0A%0Astartday = str(0)%0Astartmonth = str(1)%0Astartyear = str(2005)%0A%0Aendday = str(30)%0Aendmonth = str(1)%0Aendyear = str(2016)%0A%0A%0Asymbols = %5B%5D%0Awith open('stocklist.csv') as f:%0A ... | |
706da9008e8101c03bb2c7754b709209897cd952 | Add Organization Administrator model. | app/soc/models/org_admin.py | app/soc/models/org_admin.py | Python | 0 | @@ -0,0 +1,870 @@
+#!/usr/bin/python2.5%0A#%0A# Copyright 2008 the Melange authors.%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/LICEN... | |
2e3349b75fffb9a9f3906d065bc8f141eef02d38 | Add run_wsgi | run_wsgi.wsgi | run_wsgi.wsgi | Python | 0.000005 | @@ -0,0 +1,277 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport sys%0A%0Asys.stdout = sys.stderr%0A%0AINTELLIDATA_DIR = os.path.dirname(__file__)%0A%0Asys.path.insert(0, INTELLIDATA_DIR)%0Aos.chdir(INTELLIDATA_DIR)%0A%0Aimport config%0A%0Afrom intellidata import app as application%0Aapplication.config.from_object('con... | |
b8bb92e083983ad6a01ab41702846865d2cf2f4d | fix the auth_version | rally/plugins/openstack/verification/tempest/config.py | rally/plugins/openstack/verification/tempest/config.py | # Copyright 2014: Mirantis Inc.
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Python | 0.000137 | @@ -2934,20 +2934,52 @@
n =
-url_path%5B1:3
+%5Bv for v in url_path.split(%22/%22) if v%5D%5B-1%5D%5B:2
%5D%0A
|
a086e7328ca920f269812a87be095ce638467f95 | Add youtube-dl library sample of operation | crawler/youtube_dl_op_sample.py | crawler/youtube_dl_op_sample.py | Python | 0 | @@ -0,0 +1,994 @@
+#!/usr/bin/env python2%0A#-*- coding: utf-8 -*-%0A%0Aimport sys%0Aimport youtube_dl%0A%0A%0Adef main():%0A if len(sys.argv) %3C 2:%0A print(%22Usage: youtube_dl_op_sample.py URL%22)%0A return%0A%0A opts = %7B %0A 'forceurl': True,%0A 'quiet': True,%0A ... | |
a083baddd853514a5697e3a98eea4251c2ce5487 | Create __openerp__.py | __openerp__.py | __openerp__.py | Python | 0.005291 | @@ -0,0 +1,442 @@
+%7B%0A %22name%22: %22Product price based on margin with formula sale_price=cost_price/margin%22,%0A %22version%22: %228.0.0.1%22,%0A %22author%22: %223nodus%22,%0A 'category': 'Product',%0A %22website%22: %22http://www.3nodus.com/%22,%0A %22license%22: %22AGPL-3%22,%0A %22depend... | |
22a3a6aa70c2960983887717b98cab2149a18d89 | Fix #121: don't accept tells to bot | plugins/tell.py | plugins/tell.py | " tell.py: written by sklnd in July 2009"
" 2010.01.25 - modified by Scaevolus"
import time
from util import hook, timesince
def db_init(db):
"check to see that our db has the tell table and return a dbection."
db.execute("create table if not exists tell"
"(user_to, user_from, message, ... | Python | 0 | @@ -1934,32 +1934,43 @@
chan='', db=None
+, conn=None
):%0A %22.tell %3Cn
@@ -2285,19 +2285,20 @@
user_to
-==
+in (
user_fro
@@ -2298,32 +2298,52 @@
ser_from.lower()
+, conn.nick.lower())
:%0A return
|
ca83457b4a003527cad9c9d57402c53e4571299c | add python opt and logging boilerplate code | sandbox/python/boilerplate_code/python_opt_log.py | sandbox/python/boilerplate_code/python_opt_log.py | Python | 0 | @@ -0,0 +1,1230 @@
+#!/usr/bin/env python%0A%0Aimport argparse%0Aimport logging%0Aimport os%0Aimport sys%0Aimport re%0Alogger = None%0A%0Adef my_function(blah):%0A return%0Aif __name__ == %22__main__%22:%0A FORMAT = '%25(levelname)s %25(asctime)-15s %25(name)-20s %25(message)s'%0A%0A parser = argparse.Argument... | |
1058a9cb6e667c850f56b6003038496b77c359c5 | Add tool to fix links. | website/tools/append_index_html_to_internal_links.py | website/tools/append_index_html_to_internal_links.py | Python | 0 | @@ -0,0 +1,2555 @@
+%22%22%22Script to fix the links in the staged website.%0AFinds all internal links which do not have index.html at the end and appends%0Aindex.html in the appropriate place (preserving anchors, etc).%0A%0AUsage:%0A From root directory, after running the jekyll build, execute%0A 'python tools/appen... | |
ede7a61e1c1a77438bc027b41a5a9cb03eb6328c | raise a timeout in nrpe_poller test, so windows connect() has enought time | test/test_modules_nrpe_poller.py | test/test_modules_nrpe_poller.py | #!/usr/bin/env python
# Copyright (C) 2009-2010:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | Python | 0 | @@ -2054,17 +2054,17 @@
n -u -t
-1
+5
-c chec
|
8bf248f304e7188e279a37ff06c8fc41f54e1df8 | Add console log | Logging.py | Logging.py | Python | 0.000003 | @@ -0,0 +1,249 @@
+%0Afrom GulpServer.Settings import Settings%0A%0A%0A%0Auser_settings = None%0A%0A%0A%0Adef plugin_loaded():%0A%09global user_settings%0A%09user_settings = Settings()%0A%0A%0A%0A%0A%0Aclass Console(object):%0A%0A%09def log(self, *args):%0A%0A%09%09if user_settings.get('dev'):%0A%09%09%09print(*args)%0... | |
8f84ea073b24589327a89368ef7488ebaacbab75 | Drop Python 2.6 workaround. | gcloud/exceptions.py | gcloud/exceptions.py | # Copyright 2014 Google Inc. 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 | @@ -1210,60 +1210,16 @@
t__(
-)%0A # suppress deprecation warning under 2.6.x
+message)
%0A
|
9451bfccaf9e2782dc0b1e7670f61ce765b8e7c2 | Update for Issue #163 | tamper/nonrecursivereplacement.py | tamper/nonrecursivereplacement.py | Python | 0 | @@ -0,0 +1,1147 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0ACopyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)%0ASee the file 'doc/COPYING' for copying permission%0A%22%22%22%0A%0Aimport random%0Aimport re%0A%0Afrom lib.core.common import singleTimeWarnMessage%0Afrom lib.core.enums import PRIORITY%0A%0A__pri... | |
ae3005089da6edc4d4488b8619dcbee9e556fc22 | Fix typo | pylxd/client.py | pylxd/client.py |
# Copyright (c) 2015 Canonical Ltd
#
# 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... | Python | 0.999189 | @@ -1325,16 +1325,17 @@
.connect
+i
on)%0A
|
9e090675765a2c0c6412ee51d1e0e007404a30fd | Create k-diff-pairs-in-an-array.py | Python/k-diff-pairs-in-an-array.py | Python/k-diff-pairs-in-an-array.py | Python | 0.002165 | @@ -0,0 +1,1484 @@
+# Time: O(n)%0A# Space: O(n)%0A%0A# Total Accepted: 5671%0A# Total Submissions: 20941%0A# Difficulty: Easy%0A# Contributors: murali.kf370%0A# Given an array of integers and an integer k, %0A# you need to find the number of unique k-diff pairs in the array.%0A# Here a k-diff pair is defined as an in... | |
9f66f31d42a16d8b9536a9cb160e454118ff4369 | Add tests for UninstallPathSet | tests/unit/test_req_uninstall.py | tests/unit/test_req_uninstall.py | Python | 0 | @@ -0,0 +1,1367 @@
+import os%0Aimport shutil%0Aimport sys%0Aimport tempfile%0A%0Aimport pytest%0Afrom mock import Mock%0A%0Afrom pip.locations import running_under_virtualenv%0Afrom pip.req.req_uninstall import UninstallPathSet%0A%0Aclass TestUninstallPathSet(object):%0A def setup(self):%0A if running_under_... | |
8d8f89c82511b86fb87cef5db3bad633283283cc | Add missing migrations in develop branch | modelview/migrations/0044_auto_20191007_1227.py | modelview/migrations/0044_auto_20191007_1227.py | Python | 0.000001 | @@ -0,0 +1,1445 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.25 on 2019-10-07 10:27%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('modelview', '0043_merge_20190425_1036'),%0A %5... | |
7612b8012a6550d207111c853ffbb59c1d2c9e4c | Add Go to platform list | src/sentry/constants.py | src/sentry/constants.py | """
sentry.constants
~~~~~~~~~~~~~~~~
These settings act as the default (base) settings for the Sentry-provided
web-server
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging... | Python | 0 | @@ -1812,24 +1812,34 @@
'flask',%0A
+ 'go',%0A
'ios',%0A
|
4a25572283448a820cf55008e81405f3eb84a072 | Add test for unicode in env (#345) | tests/system/verbs/catkin_build/test_unicode_in_env.py | tests/system/verbs/catkin_build/test_unicode_in_env.py | Python | 0 | @@ -0,0 +1,531 @@
+import os%0A%0Afrom ....utils import catkin_success%0A%0Afrom ...workspace_factory import workspace_factory%0A%0A%0Adef test_catkin_build_with_unicode_in_env():%0A with workspace_factory() as wf:%0A wf.create_package('foo', depends=%5B'bar'%5D)%0A wf.create_package('bar')%0A w... | |
53f91164ce93a01c2ad628fd49109a5fa8917ecb | Extend datasource model schema (#2342) | timesketch/migrations/versions/180a387da650_extend_datasource_model_with_total_file_.py | timesketch/migrations/versions/180a387da650_extend_datasource_model_with_total_file_.py | Python | 0 | @@ -0,0 +1,759 @@
+%22%22%22Extend datasource model with total file events field%0A%0ARevision ID: 180a387da650%0ARevises: 75af34d75b1e%0ACreate Date: 2022-09-26 13:04:10.336534%0A%0A%22%22%22%0A# This code is auto generated. Ignore linter errors.%0A# pylint: skip-file%0A%0A%0A# revision identifiers, used by Alembic.%0... | |
63dc7fb2586824b6a6de52b1ba80e6196d80ff42 | Create credentials.py | credentials.py | credentials.py | Python | 0.000001 | @@ -0,0 +1,126 @@
+# add your primary statsnz key here%0A# available from https://statisticsnz.portal.azure-api.net/%0Astatsnz_key = %22MY_SECRET_KEY%22%0A
| |
41e21884418cdd2b525b4f02d1cfa4ed9ea2c000 | Add bug test for 9268 (#65) | bugs/issue_9268.py | bugs/issue_9268.py | Python | 0 | @@ -0,0 +1,421 @@
+# RUN: %25PYTHON %25s%0A# XFAIL: *%0A%0Aimport iree.compiler.tools.tflite as iree_tflite%0A%0A# https://github.com/iree-org/iree/issues/9268%0Air = '''%0Afunc.func @main(%25a : tensor%3Cf32%3E, %25b : tensor%3Cf32%3E) -%3E tensor%3C*xf32%3E %7B%0A %25val = %22tfl.add%22(%25a, %25b) %7Bfused_activati... | |
8c401af5bb7c3678de4091b88d81e04ddf248705 | Remove unused 'fahrenheit' config option | src/collectors/lmsensors/lmsensors.py | src/collectors/lmsensors/lmsensors.py | # coding=utf-8
"""
This class collects data from libsensors. It should work against libsensors 2.x
and 3.x, pending support within the PySensors Ctypes binding:
[http://pypi.python.org/pypi/PySensors/](http://pypi.python.org/pypi/PySensors/)
Requires: 'sensors' to be installed, configured, and the relevant kernel
mod... | Python | 0.000004 | @@ -945,48 +945,8 @@
e(%7B%0A
- 'fahrenheit': %22True/False%22,%0A
@@ -1283,42 +1283,8 @@
s',%0A
- 'fahrenheit': 'True',%0A
|
f3e1b1404f32cd0195aa8148d1ab4285cf9ad352 | Add class BaseSpider | Spiders.py | Spiders.py | Python | 0.000001 | @@ -0,0 +1,359 @@
+'''%0D%0ACreated on 2 %D1%81%D0%B5%D0%BD%D1%82. 2016 %D0%B3.%0D%0A%0D%0A@author: garet%0D%0A'''%0D%0A%0D%0A%0D%0Aclass BaseSpider():%0D%0A %0D%0A def __init__(self):%0D%0A pass%0D%0A%0D%0A def AddUrls(self, urls):%0D%0A pass%0D%0A%0D%0A def Routing(self, url):%0D%0A p... | |
e5be29bc3c5a77493fe64bb3fc8b52611cc13469 | Add tests for Generic Interface. | zerver/tests/test_outgoing_webhook_interfaces.py | zerver/tests/test_outgoing_webhook_interfaces.py | Python | 0 | @@ -0,0 +1,2369 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import%0Afrom __future__ import print_function%0Afrom typing import Any%0A%0Aimport mock%0Aimport json%0A%0Afrom requests.models import Response%0Afrom zerver.lib.test_classes import ZulipTestCase%0Afrom zerver.outgoing_webhooks.generic impor... | |
1f80f3cc606d9c42e41e30108e97f776b02803c5 | Create abcprob.py | abcprob.py | abcprob.py | Python | 0.99997 | @@ -0,0 +1,1526 @@
+# by beepingmoon, 2014-07-22%0A# abc problem, http://rosettacode.org/wiki/ABC_Problem%0A%0Aimport time%0A%0Aclass Blok:%0A%09def __init__(self, znaki, czyDostepny = True):%0A%09%09self.znaki = znaki%0A%09%09self.czyDostepny = czyDostepny%0A%0A%09def sprawdzZnaki(self, znak):%0A%09%09for z in self.zn... | |
b7b29a00b1a2e448d78c8f3c4333753668589e16 | Create __init__.py | etc/__init__.py | etc/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
e1ea3859b08a14c80ccd65fc5551336bdc760f96 | add biggan projukti blog | corpus_builder/spiders/public_blog/biggan_projukti.py | corpus_builder/spiders/public_blog/biggan_projukti.py | Python | 0 | @@ -0,0 +1,921 @@
+# -*- coding: utf-8 -*-%0Aimport scrapy%0Afrom scrapy.linkextractors import LinkExtractor%0Afrom scrapy.spiders import Rule%0A%0Afrom corpus_builder.templates.spider import CommonSpider%0A%0A%0Aclass BigganProjuktiSpider(CommonSpider):%0A name = 'biggan_projukti'%0A allowed_domains = %5B'www.bi... | |
204e6fc49bcc739f1e5c53bfbfc3eb7e86a7640c | Add windows autostart. | StartAtBoot.py | StartAtBoot.py | Python | 0 | @@ -0,0 +1,333 @@
+import sys%0A%0Aif sys.platform.startswith('win'):%0A from PyQt4.QtCore import QSettings%0A RUN_PATH = %22HKEY_CURRENT_USER%5C%5CSoftware%5C%5CMicrosoft%5C%5CWindows%5C%5CCurrentVersion%5C%5CRun%22%0A%0A settings = QSettings(RUN_PATH, QSettings.NativeFormat)%0A settings.setValue(%22Anki%2... | |
7919fa239e597c0358b518740aa2657b49caddbf | add oop_advance | src/python27/oop_advance/slots.py | src/python27/oop_advance/slots.py | Python | 0.000133 | @@ -0,0 +1,603 @@
+# -*- coding: utf-8 -*-%0Aclass Student(object):%0A pass%0A%0As = Student()%0As.name = 'Tim Ho'%0Aprint s.name%0A%0A%0Adef set_age(self, age):%0A self.age = age%0A%0Afrom types import MethodType%0As.set_age = MethodType(set_age, s, Student)%0As.set_age(25)%0Aprint s.age%0A%0As2 = Student()%0A# ... | |
f576b7b151c6c74eea668e66fff54ab2c33f39d6 | add 100 | Volume2/100.py | Volume2/100.py | Python | 0.999998 | @@ -0,0 +1,144 @@
+if __name__ == %22__main__%22:%0A b, n, L = 85, 120, 10 ** 12%0A while n %3C= L:%0A b, n = 3 * b + 2 * n - 2, 4 * b + 3 * n - 3%0A print b, n%0A
| |
68efa8a0fb206da8cd1410d74572520f558ebded | Create apriori.py | apriori.py | apriori.py | Python | 0.000006 | @@ -0,0 +1,1960 @@
+def preprocessing(data):%0A %22%22%22 preprocesses data to be applicable to apriori%0A %0A Parameters%0A ----------%0A data : tbd%0A %0A Returns%0A ---------%0A list of sets%0A %22%22%22%0A pass%0A%0A%0Aclass apriori():%0A %22%22%22 Frequent Itemsets using the apr... | |
8adf39f011d8290c07f01e807b65373e40b4c314 | Create score.py | score.py | score.py | Python | 0.000008 | @@ -0,0 +1,1775 @@
+%22%22%22 Requires sox and text2wave (via festival)%0A%22%22%22%0A%0Afrom pippi import dsp%0Afrom pippi import tune%0Aimport subprocess%0Aimport os%0A%0Adef sox(cmd, sound):%0A path = os.getcwd()%0A filename_in = '/proc-in'%0A filename_out = '/proc-out.wav'%0A%0A dsp.write(sound, filenam... | |
0af5dbce55d6e9cc2b53f4f2538001a4c1b7dfa4 | version 1.2 | setup.py | setup.py | #!/usr/bin/env python
#
# Copyright 2012-2014 Ravello Systems, 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... | Python | 0.000001 | @@ -773,12 +773,8 @@
'1.2
-.dev
',%0A
|
0ac53ef31a47c61382557b9fb3ba588fd4e1ae67 | Add first working setup.py script | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1215 @@
+from setuptools import setup, find_packages%0A%0Asetup(name='pygame_maker',%0A version='0.1',%0A description='ENIGMA-like pygame-based game engine',%0A classifiers=%5B%0A 'Development Status :: 2 - Pre-Alpha',%0A 'License :: OSI Approved :: GNU Lesser General Public License v2... | |
1c608e69ecf61484ea1210fe0d6dc8d116c583d3 | Update homepage in setup.py | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='linaro-django-pagination',
version=version,
description="linaro-django-pagination",
long_description=open("README").read(),
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :... | Python | 0 | @@ -555,32 +555,28 @@
http
+s
://
-launchpad.net/linaro-
+github.com/zyga/
djan
@@ -588,17 +588,16 @@
gination
-/
',%0A l
|
565ff051cabe9eaec6f24df6e8c31115e0a4eed8 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,314 @@
+#!/usr/bin/env python%0Afrom setuptools import setup%0A%0Asetup(name='VSTools',%0A version='0.1',%0A description='Easy use Visual Studio msbuild with python. ',%0A author='eternnoir',%0A author_email='eternnoir@gmail.com',%0A url='https://github.com/eternnoir/VSTools',%0A ... | |
b164ec6fae6ea9a6734ac58ddd8c3b89f73713fe | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,248 @@
+%0Afrom distutils.core import setup%0A%0Asetup(%0A name='django-classy-settings',%0A version='0.1',%0A description='Simple class-based settings for Django',%0A author='Curtis Maloney',%0A author_email='curtis@tinbrain.net',%0A packages=%5B'cbs',%5D,%0A)%0A
| |
fa4ce6dc15e8b47c5978c476db7801473820af0d | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-%0A%0A
| |
8e8fbf8b63239915736b788b7f1c8ac21a48c190 | Add a basic setup.py script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,348 @@
+from distutils.core import setup%0Afrom coil import __version__ as VERSION%0A%0Asetup(%0A name = 'coil',%0A version = VERSION,%0A author = 'Michael Marineau',%0A author_email = 'mike@marineau.org',%0A description = 'A powerful configuration language',%0A license = 'MIT',%0A packa... | |
d074995f8ce5a62104525b1f3cfed10ace12c3bc | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,282 @@
+from setuptools import setup%0A%0Asetup(name=%22feature%22,%0A version=%220.1%22,%0A url=%22https://github.com/slyrz/feature%22,%0A description=%22Easy feature engineering.%22,%0A long_description=open('README.md').read(),%0A packages=%5B'feature', 'feature.plugin'%5D,%0A ... | |
699ac33eec57fa49e2c1917d2bf17950bd6e6474 | Create setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,844 @@
+%22%22%22Setup script of mots-vides%22%22%22%0Afrom setuptools import setup%0Afrom setuptools import find_packages%0A%0Aimport mots_vides%0A%0Asetup(%0A name='mots-vides',%0A version=mots_vides.__version__,%0A%0A description='Python library for managing stop words in many languages.',%0A ... | |
959580ea313e4445374e8ee9f32e1a8822dd5beb | add setup script for install | setup.py | setup.py | Python | 0 | @@ -0,0 +1,430 @@
+from setuptools import setup%0A%0Asetup(name='hlm_gibbs',%0A version='0.0.1',%0A description='Fit spatial multilevel models and diagnose convergence',%0A url='https://github.com/ljwolf/hlm_gibbs',%0A author='Levi John Wolf',%0A author_email='levi.john.wolf@gmail.com',%0A ... | |
dca7a5f766b7e2fd5cfc346cbc358faafa1ec9f1 | add setup.py file | setup.py | setup.py | Python | 0 | @@ -0,0 +1,392 @@
+try:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0Afrom distutils.extension import Extension%0A%0Alibname=%22vgdl%22%0Asetup(%0Aname = libname,%0Aversion=%221.0%22,%0Adescription='A video game description language (VGDL) built on top pf pygame',%... | |
1618d8afeca1b667b4439d62b3727528dcba9159 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,151 @@
+from setuptools import setup%0A%0Asetup(%0A name='django-filebased-email-backend-ng',%0A packages=(%0A 'django_filebased_email_backend_ng',%0A )%0A)%0A
| |
95d1f63ce4d9698f8ab4b64757e3669c75accbbd | throw on some more setup.py pypi classifiers | setup.py | setup.py | from distutils.core import setup
setup(
name='django-object-actions',
version='0.0.1',
author="The Texas Tribune",
author_email="cchang@texastribune.org",
maintainer="Chris Chang",
# url
packages=['django_object_actions'],
include_package_data=True, # automatically include things from... | Python | 0 | @@ -571,16 +571,214 @@
jango%22,%0A
+ %22Intended Audience :: Developers%22,%0A %22License :: OSI Approved :: Apache Software License%22,%0A %22Operating System :: OS Independent%22,%0A %22Programming Language :: Python :: 2%22,%0A
%5D,%0A)
|
591b9be8d03cf2ecd12eed1bd36f9d762e91195c | Add setup.py for package installation | setup.py | setup.py | Python | 0 | @@ -0,0 +1,602 @@
+from setuptools import setup%0A%0A%0Asetup(%0A name='simplio',%0A version='0.1',%0A description='Simplest-case command-line input/output',%0A long_description=(%0A 'Simplio is a Python function decorator that applies an input file '%0A 'object and an output file object as ar... | |
0abe1e173b73770b5f2ee81f57f21c41466e5c61 | Add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,503 @@
+#!/usr/bin/env python%0A%0Aimport os.path%0Afrom setuptools import find_packages, setup%0A%0Asetup(%0A%09name = 'technic-solder-client',%0A%09version = '1.0',%0A%09description = 'Python implementation of a Technic Solder client',%0A%09author = 'Cadyyan',%0A%09url ... | |
af49ecf6ce12b2fa909733c17569c7231c343190 | add simple sql shell | shell.py | shell.py | Python | 0.000003 | @@ -0,0 +1,1055 @@
+# simple interactive shell for MSSQL server%0Aimport pytds%0Aimport os%0A%0A%0Adef main():%0A conn = pytds.connect(dsn=os.getenv(%22HOST%22, %22localhost%22), user=os.getenv(%22SQLUSER%22, %22sa%22), password=os.getenv(%22SQLPASSWORD%22))%0A while True:%0A try:%0A sql = input... | |
93e2d3d72099b854f854abc44a79b2c4edb74af8 | add basic file splitter | split.py | split.py | Python | 0 | @@ -0,0 +1,499 @@
+#!/usr/bin/python%0A%0A# This Source Code Form is subject to the terms of the Mozilla Public%0A# License, v. 2.0. If a copy of the MPL was not distributed with this%0A# file, You can obtain one at http://mozilla.org/MPL/2.0/.%0A%0A%0A# Echo all output starting with the line after the line that starts... | |
3d44701308fe1c32d8ae2efab609d5e7bcd563c0 | Create ajastin.py | ajastin.py | ajastin.py | Python | 0.000115 | @@ -0,0 +1,740 @@
+def downloader():%0A%09#import downloader%0A #downloader.main()%0A return 0%0A%0Adef lampotila():%0A%09Tnow = 15%0A%09#import lampotila%0A%09#lampotila.main()%0A%09return Tnow%0A%09%0A%0Adef main():%0A%09%0A%09import time %0A%09from datetime import datetime %0A%09n... | |
c45da8544bd3e4f85073e61cfba417862ce66fc2 | add 'Appeaser' strategy | axelrod/strategies/appeaser.py | axelrod/strategies/appeaser.py | Python | 0.004212 | @@ -0,0 +1,632 @@
+from axelrod import Player%0A%0Aclass Appeaser(Player):%0A %22%22%22%0A A player who tries to guess what the opponent wants, switching his %0A behaviour every time the opponent plays 'D'.%0A %22%22%22%0A def strategy(self, opponent):%0A %22%22%22%0A Start with 'C', switch... | |
d29a94809f6f58e053a646d796fe9e55a51b334e | Initialize Ch. 1 caesarHacker | books/CrackingCodesWithPython/Chapter01/caesarHacker.py | books/CrackingCodesWithPython/Chapter01/caesarHacker.py | Python | 0.00232 | @@ -0,0 +1,1444 @@
+# Caesar Hacker improved%0A# Rewritten as function for importing%0A# SPOILERS: Chapter 6 (caesarHacker), Chapter 7 (functions)%0A%0Aimport books.CrackingCodesWithPython.Chapter01.config%0A%0A%0Adef hackCaesar(message):%0A%0A # Loop through every possible key:%0A for key in range(len(books.Crac... | |
03fce72b60eb8cad2368447cf23f72f8084f4a4b | Add py solution for 575. Distribute Candies | py/distribute-candies.py | py/distribute-candies.py | Python | 0.000002 | @@ -0,0 +1,199 @@
+class Solution(object):%0A def distributeCandies(self, candies):%0A %22%22%22%0A :type candies: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A return min(len(candies) / 2, len(set(candies)))%0A
| |
d34dcf1179e6e5c2b864627266ae1788d10142aa | Add Chuanping Yu's solutions to Problem02 | Week01/Problem02/cyu_02.py | Week01/Problem02/cyu_02.py | Python | 0 | @@ -0,0 +1,312 @@
+#!/usr/bin/env python3%0A%0A%22%22%22This script is written by Chuanping Yu, on Jul 24, 2017,%0Afor the Assignment#1 in IDEaS workshop%22%22%22%0A%0A#Problem 2%0AFIB = %5B%5D%0AF = 1%0AS = 0%0AFIB.append(F)%0AFIB.append(F)%0Awhile F %3C= 4000000:%0A F = FIB%5B-1%5D + FIB%5B-2%5D%0A FIB.append(F... | |
5eb9a910096f3e0000499390541a83bc50fb73ce | add binheap | binheap.py | binheap.py | Python | 0.000841 | @@ -0,0 +1,1121 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0A%0Aclass BinHeap(object):%0A%0A def __init__(self, iterable=None):%0A self.list = %5B%5D%0A if iterable:%0A for item in iterable:%0A self.push(item)%0A%0A def push(self, value):%0A ... | |
4f0e9a14286f21d835e36e549ebee80419e46cec | test game | blocker.py | blocker.py | Python | 0.000006 | @@ -0,0 +1,170 @@
+#!/usr/bin/env python%0A%0Aclass Blocker:%0A def __init__(self):%0A print 'Blocker v1.0'%0A return%0A%0A def run(self):%0A return%0A%0Agame = Blocker()%0Agame.run()%0A
| |
769019be1331fa58e363fba37957ec90ab6f8163 | add code for more precise arbtirage math (WiP) | arbmath.py | arbmath.py | Python | 0 | @@ -0,0 +1,2353 @@
+import decimal%0Afrom decimal import Decimal%0A%0Aclass ExchangeModel(object);%0A def __init__(self, depths, tradeApi):%0A self.depths = depths;%0A self.tradeApi = tradeApi%0A self.symbols = %5Bkey%5B:3%5D for key, value in depths%5D + %5Bkey%5B3:%5D for key, value in depths%5D%0A self.... | |
cd5e6a14bb0a67d6558b691f6b55f7918c4d4970 | Create new package (#6384) | var/spack/repos/builtin/packages/r-fnn/package.py | var/spack/repos/builtin/packages/r-fnn/package.py | Python | 0 | @@ -0,0 +1,2106 @@
+##############################################################################%0A# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
f68175870692d128fb2a01795d20605bb2e17aa9 | Add initial functional tests | functional_tests/test_evexml.py | functional_tests/test_evexml.py | Python | 0.000001 | @@ -0,0 +1,1465 @@
+%22%22%22Functional tests for the xml api part of aniauth project.%0A%0AThis is a temporary app as EVE Online's xml api is deprecated and will be%0Adisabled March 2018.%0A%0A%22%22%22%0Afrom django.contrib.staticfiles.testing import StaticLiveServerTestCase%0Afrom django.test import tag%0Afrom djang... | |
6a7b32e271a264aad763fbd28749ac1258cf041f | Add dialplan filestring module | wirecurly/dialplan/filestring.py | wirecurly/dialplan/filestring.py | Python | 0 | @@ -0,0 +1,789 @@
+import logging%0Afrom wirecurly.exc import *%0Afrom wirecurly.dialplan.expression import *%0Aimport os%0A%0Alog = logging.getLogger(__name__)%0A%0A__all__ = %5B'FileString'%5D%0A%0Aclass FileString(object):%0A%09'''%0A%09%09Filestring oject to use with playback app in dialplan.%0A%09'''%0A%0A%09def _... | |
6ce84d454ef18f7b7dfc988195bfacb4e69e8c3f | add CRUD test cases for Snippet | hackathon_starter/hackathon/unittests/testsnippets.py | hackathon_starter/hackathon/unittests/testsnippets.py | Python | 0 | @@ -0,0 +1,2095 @@
+from hackathon.models import Snippet%0Afrom rest_framework import status%0Afrom rest_framework.test import APITestCase%0A%0A%0Aclass SnippetViewTestCase(APITestCase):%0A def setUp(self):%0A self.s1 = Snippet.objects.create(title='t1', code=%22%22%22print(%22Hello, World.%22)%22%22%22)%0A ... | |
f59749db263291f481c4bdc9f6ede2f6de6cb6d4 | Create foundation for input file generation (csv for connectivity table, etc.) | create_input_files.py | create_input_files.py | Python | 0 | @@ -0,0 +1,463 @@
+import csv%0Aimport argparse%0Aimport itertools%0A%0Afrom thermo_utils import csv_row_writer, read_csv_rows%0A%0A# Read input/output arguments%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('-o','--output',required=True)%0Aparser.add_argument('-d','--dof',required=True)%0A# parser.add_arg... | |
9f6df0b93a7a6911d9e7eee0e4fe87e34ea52832 | Create main entrypoint of cli | shub_cli/cli.py | shub_cli/cli.py | Python | 0 | @@ -0,0 +1,1778 @@
+%22%22%22%0AScrapinghub CLI%0A%0AUsage:%0A shub-cli jobs%0A shub-cli jobs %5B-t TAG1,TAG2%5D %5B-l LACK1,LACK2%5D %5B-s SPIDER%5D %5B-e STATE%5D %5B-c COUNT%5D%0A shub-cli job -id %3Cid%3E%0A%0AOptions:%0A -t TAG1,TAG2 Description.%0A -l LACK1,LACK2 Description.%0A -s SPIDER Descript... | |
6bce6ca2ae91b2eebad1d32ed970969ea5e423a2 | String reverse done | Text/reverse.py | Text/reverse.py | Python | 0.999408 | @@ -0,0 +1,219 @@
+# -*- coding: cp1252 -*-%0A%22%22%22%0AReverse a String Enter a string and the program%0Awill reverse it and print it out.%0A%22%22%22%0A%0Astring = raw_input(%22Whatchu wanna say to me? %22)%0Aprint %22You say %25s, I say %25s%22 %25 (string, string%5B::-1%5D)%0A
| |
087829b024ea9c5b2028c3f13786578be6dfd702 | fix the bug of loading all cifar data | load_data.py | load_data.py | # encoding: utf-8
"""
@author: ouwj
@position: ouwj-win10
@file: load_data.py
@time: 2017/4/26 14:33
"""
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='bytes')
return dic... | Python | 0.000001 | @@ -621,18 +621,16 @@
%0A
- #
for i i
@@ -651,18 +651,16 @@
%0A
- #
dat
|
54404541913185a54fea75353d9fffc72ddc2ff6 | Create discovery_diag.py | python/discovery_diag.py | python/discovery_diag.py | Python | 0 | @@ -0,0 +1,893 @@
+import requests%0Aimport json%0A%0A%0Arequests.packages.urllib3.disable_warnings()%0As = requests.Session()%0A%0Adef netmriLogin( temp, querystring ):%0A username = %22admin%22%0A password = %22infioblox%22%0A url = %22https://demo-netmri.infoblox.com/api/3.3%22 + temp%0A response = s.req... | |
b3c408845a6aba2e5bc15509f7d06800fb9e6c8b | multiples of 3 or 5 | 1-10/1.py | 1-10/1.py | Python | 0.999834 | @@ -0,0 +1,245 @@
+def sum_of_multiples_of_three_or_five(n):%0A result = sum(%5Bx for x in range(1, n) if x %25 3 == 0 or x %25 5 == 0%5D)%0A return result%0A%0Adef main():%0A n = 10**3%0A print(sum_of_multiples_of_three_or_five(n))%0A%0Aif __name__ == %22__main__%22:%0A main()%0A
| |
35f4f5bbea5b291b8204a2ca30acddebfad86d3e | Create 2004-4.py | 2004-4.py | 2004-4.py | Python | 0.000009 | @@ -0,0 +1,490 @@
+times = input()%0A%0Ai = 0%0Awhile i %3C times:%0A %0A length = input()%0A %0A ascents = 0%0A descents = 0%0A plateaus = 0%0A maxA = 0%0A maxD = 0%0A maxP = 0%0A %0A sequence = %5B%5D%0A %0A j = 0%0A while j %3C length:%0A %0A currentNum = input() %0A sequence.append(current... | |
f228b0d76a5c619e45d40d4d0da12059cb2668e9 | Create warlock.py | hsgame/cards/minions/warlock.py | hsgame/cards/minions/warlock.py | Python | 0.000001 | @@ -0,0 +1,252 @@
+import hsgame.targeting%0Afrom hsgame.constants import CHARACTER_CLASS, CARD_RARITY, MINION_TYPE%0Afrom hsgame.game_objects import MinionCard, Minion, Card%0A#from hsgame.cards.battlecries import %0A%0A__author__ = 'randomflyingtaco'%0A#let the train wreck begin%0A%0A
| |
97fcef753647bfbdab0381b30d1533bdce36aeb9 | fix admin | django-pyodbc/contrib/admin/models/models.py | django-pyodbc/contrib/admin/models/models.py | Python | 0 | @@ -0,0 +1,2084 @@
+from django.db import models%0Afrom django.contrib.contenttypes.models import ContentType%0Afrom django.contrib.auth.models import User%0Afrom django.utils.translation import ugettext_lazy as _%0Afrom django.utils.encoding import smart_unicode%0Afrom django.utils.safestring import mark_safe%0A%0AADD... | |
0ace48790374ea75ba2c6cbc51678e3240c22a88 | Create Differ.py | Differ.py | Differ.py | Python | 0 | @@ -0,0 +1,479 @@
+%0Afile1 = raw_input('%5Bfile1:%5D ')%0Amodified = open(file1,%22r%22).readlines()%5B0%5D%0A%0Afile2 = raw_input('%5Bfile2:%5D ')%0Api = open(file2, %22r%22).readlines()%5B0%5D # %5B:len(modified)%5D%0A%0Aresultado = %22%22.join( x for x,y in zip(modified, pi) if x != y)%0Aresultado2 = %22%22.join( x... | |
8a4d5ccd64433994854815e6c20e1fde08ec1998 | remove self.query_get_clause from trial balance report | addons/account/report/account_balance.py | addons/account/report/account_balance.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Python | 0 | @@ -2407,84 +2407,8 @@
ds)%0A
- self.query_get_clause = data%5B'form'%5D.get('query_line', False) or ''%0A
|
60de63d2fc53c020649bc21576765366f310cf56 | fix by adding migration | src/polls/migrations/0006_auto_20171114_1128.py | src/polls/migrations/0006_auto_20171114_1128.py | Python | 0.000001 | @@ -0,0 +1,748 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.5 on 2017-11-14 10:28%0Afrom __future__ import unicode_literals%0A%0Aimport django.contrib.postgres.fields.jsonb%0Aimport django.core.serializers.json%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A depend... | |
a5d5dde8c523aa28452d790e7f0291c1cf52aacb | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest. | tests/external/py2/testfixture_test.py | tests/external/py2/testfixture_test.py | Python | 0 | @@ -0,0 +1,1233 @@
+#!/usr/bin/env python%0A# ----------------------------------------------------------------------%0A# Copyright (C) 2013 Numenta Inc. All rights reserved.%0A#%0A# The information and source code contained herein is the%0A# exclusive property of Numenta Inc. No part of this software%0A# may be used, r... | |
b0c74bcf7dd4120684a944a7cd8cc005bee039f5 | Create BogoBogo.py | Challenge-175/01-Easy/BogoBogo.py | Challenge-175/01-Easy/BogoBogo.py | Python | 0.000001 | @@ -0,0 +1,647 @@
+import random%0A%0Adef bogosort(n, m):%0A%09i = 0%0A%09while n != m:%0A%09%09n = ''.join(random.sample(n,len(n)))%0A%09%09i += 1%0A%09print(i, 'iterations')%0A%09return i%0A%0Adef bogobogosort(n, m):%0A%09i = 0 #number of iterations%0A%09j = 2 #number of elements%0A%09while n%5B:j%5D != m:%0A%09%09n ... | |
84b932df5520901645c6d999abddea1191654a34 | create skeleton of a proper in place quicksort | algorithms/sorting/quicksort_ip.py | algorithms/sorting/quicksort_ip.py | Python | 0.00004 | @@ -0,0 +1,418 @@
+from random import randint%0A%0A%0Adef partition(unsorted, start, end, pivot):%0A pass%0A%0A%0Adef choose_pivot(start, end):%0A pass%0A%0A%0Adef quicksort(unsorted, start=0, end=None):%0A pass%0A%0A%0Aif __name__ == '__main__':%0A unsorted = %5B3,345,456,7,879,970,7,4,23,123,45,467,578,78... | |
60002062970a2f83725355911dde73673c5875a5 | Add a snippet. | python/pyqt/pyqt5/button_clic_event_as_class.py | python/pyqt/pyqt5/button_clic_event_as_class.py | Python | 0.000002 | @@ -0,0 +1,1642 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2015 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%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 t... | |
6f5843fb04cfa2ed2082b340f282223ec374f9f6 | copy group descriptions to text table | alembic/versions/49ed2a435cf_group_description.py | alembic/versions/49ed2a435cf_group_description.py | Python | 0 | @@ -0,0 +1,1474 @@
+revision = '49ed2a435cf'%0Adown_revision = '5927719682b'%0A%0Aimport uuid%0Afrom datetime import datetime%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy import sql%0Aimport jinja2%0A%0A%0Adef random_uuid():%0A return str(uuid.uuid4())%0A%0A%0Adef upgrade():%0A text = sql.... | |
f18fd5c4ad61adb56ac7524a006ce9977aa06a31 | Add worker to send queue mails | mailing/management/commands/send_queued_mails_worker.py | mailing/management/commands/send_queued_mails_worker.py | Python | 0 | @@ -0,0 +1,457 @@
+# -*- coding: utf-8 -*-%0A# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS%0Afrom django.core.management.base import BaseCommand%0A%0Afrom ...utils import send_queued_mails%0Aimport time%0A%0Aclass Command(BaseCommand):%0A help = %22%22%22Send mails with %60status%60 Mail.STATUS_PENDING and havi... | |
5a7081c5c46a050566477adda19d30844192ceb2 | Add migration to add authtokens for existing users | src/mmw/apps/user/migrations/0002_auth_tokens.py | src/mmw/apps/user/migrations/0002_auth_tokens.py | Python | 0 | @@ -0,0 +1,584 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Afrom django.conf import settings%0Afrom django.contrib.auth.models import User%0Afrom rest_framework.authtoken.models import Token%0A%0A%0Adef add_auth_tokens_to_users(apps, schema_editor... | |
31b309c1f5981a10207e85950ef8139018afd37c | add roles urls | src/python/expedient/clearinghouse/roles/urls.py | src/python/expedient/clearinghouse/roles/urls.py | Python | 0.000001 | @@ -0,0 +1,303 @@
+'''%0ACreated on Jul 29, 2010%0A%0A@author: jnaous%0A'''%0Afrom django.conf.urls.defaults import patterns, url%0A%0Aurlpatterns = patterns(%22expedient.clearinghouse.roles.views%22,%0A url(r%22%5Econfirm/(?P%3Cproj_id%3E%5Cd+)/(?P%3Creq_id%3E%5Cd+)/(?P%3Callow%3E%5Cd)/(?P%3Cdelegate%3E%5Cd)/$%22, ... | |
14e55d45428c617507c5c161f4d33154849f63a5 | Create Endings.py | Edabit/Endings.py | Edabit/Endings.py | Python | 0.000002 | @@ -0,0 +1,164 @@
+#!/usr/bin/env python3%0A'''%0ACreate a function that adds a string ending to each member in a list.%0A'''%0Adef add_ending(lst, ending):%0A%09return %5Bi + ending for i in lst%5D%0A
| |
ab53993b708b3f9cf3b5762664fef58bae99ea20 | Add some code to auto-remove Ltac | recursive_remove_ltac.py | recursive_remove_ltac.py | Python | 0.000001 | @@ -0,0 +1,856 @@
+import re%0A%0A__all__ = %5B%22recursively_remove_ltac%22%5D%0A%0ALTAC_REG = re.compile(r'%5E%5Cs*(?:Local%5Cs+%7CGlobal%5Cs+)?Ltac%5Cs+(%5B%5E%5Cs%5D+)', re.MULTILINE)%0A%0Adef recursively_remove_ltac(statements, exclude_n=3):%0A %22%22%22Removes any Ltac statement which is not used later in%0A ... | |
cd6eebfecab9b93863e7e20acec1ba0481f6b95f | Fix benchmark naming in reporting | tensorflow/python/eager/benchmarks_test_base.py | tensorflow/python/eager/benchmarks_test_base.py | # Copyright 2017 The TensorFlow Authors. 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.000478 | @@ -1439,16 +1439,64 @@
)%0A %7D%0A
+ benchmark_name = self._get_benchmark_name()%0A
self
@@ -1513,16 +1513,25 @@
nchmark(
+%0A
iters=nu
@@ -1571,10 +1571,31 @@
s=extras
+, name=benchmark_name
)%0A
|
19b77a282b1ade7788ae394f22ac0bd7b0a2ce76 | document target_column when Y is dataframe | tensorflow/python/estimator/inputs/pandas_io.py | tensorflow/python/estimator/inputs/pandas_io.py | # Copyright 2017 The TensorFlow Authors. 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.000011 | @@ -2905,16 +2905,76 @@
umn %60y%60.
+ This parameter%0A is not used when %60y%60 is a %60DataFrame%60.
%0A%0A Retu
|
dccb0f292c86da942c5e4493a5e117e5f3047a05 | add aiohttp exercise | aiohttp_ext.py | aiohttp_ext.py | Python | 0 | @@ -0,0 +1,752 @@
+import asyncio%0A%0Afrom aiohttp import web%0A%0Aasync def index(request):%0A await asyncio.sleep(0.5)%0A return web.Response(body=b'%3Ch1%3EIndex%3C/h1%3E',content_type='text/html')%0A%0Aasync def hello(request):%0A await asyncio.sleep(0.5)%0A text = '%3Ch1%3Ehello, %25s%3C/h1%3E' %25 re... | |
5788864141c2b635a3c0b8358d868fa7e2b5e789 | Create Pedido_Cadastrar.py | backend/Models/Turma/Pedido_Cadastrar.py | backend/Models/Turma/Pedido_Cadastrar.py | Python | 0 | @@ -0,0 +1,460 @@
+from Framework.Pedido import Pedido%0Afrom Framework.ErroNoHTTP import ErroNoHTTP%0A%0Aclass PedidoCadastrar(Pedido):%0A%0A%09def __init__(self,variaveis_do_ambiente):%0A%09%09super(PedidoCadastrar, self).__init__(variaveis_do_ambiente)%0A try: %0A %0A%09%09%09self.letra = self.corpo%5B'letr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.