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
5dc22c0a30b2e326665f67df1d85cd2ae0243c00
Increase the sleep timeout to 4 seconds to prevent the main thread from quitting
resources/site-packages/pulsar/main.py
resources/site-packages/pulsar/main.py
import threading import xbmc from pulsar.rpc import server_thread from pulsar.monitor import PulsarMonitor from pulsar.daemon import pulsard_thread def main(): # Make sure the XBMC jsonrpc server is started. xbmc.startServer(xbmc.SERVER_JSONRPCSERVER, True) # Start the JSONRPC thread threading.Thread...
Python
0
@@ -556,9 +556,9 @@ eep( -1 +4 000)
3352646b1cc03c5f6ba2c6c9478d5bcc76099e7b
publication date can be null
activities/migrations/0024_null_publication_date.py
activities/migrations/0024_null_publication_date.py
Python
0.999999
@@ -0,0 +1,713 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('activities', '0023_invitation'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%...
fe5100f5d13ed7461619c8beff791d40306f83ff
Remove annoying SQL view that prevents some operations
addons/document/migrations/8.0.2.1/pre-migration.py
addons/document/migrations/8.0.2.1/pre-migration.py
Python
0
@@ -0,0 +1,1078 @@ + # -*- coding: utf-8 -*-%0A##############################################################################%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as%0A# published by the Free Software Foundation, eit...
935115215259ce011f3f0b46781655119413e720
Add a directives file for pygments support.
pelican/rstdirectives.py
pelican/rstdirectives.py
Python
0
@@ -0,0 +1,1254 @@ +# -*- coding: utf-8 -*-%0Afrom docutils import nodes%0Afrom docutils.parsers.rst import directives, Directive%0Afrom pygments.formatters import HtmlFormatter%0Afrom pygments import highlight%0Afrom pygments.lexers import get_lexer_by_name, TextLexer%0A%0AINLINESTYLES = False%0ADEFAULT = HtmlFormatte...
1b22ec95ec7a659031e59b5a14d018028b29485b
Create hcf.py
math/highest_common_factor/cpp/hcf.py
math/highest_common_factor/cpp/hcf.py
Python
0.000001
@@ -0,0 +1,1018 @@ +%0A#A python program to determine the highest common factor of positive integers only.%0A%0Adef hcf(x, y):%0A%0A #set the highest common factor to 1%0A %0A hcf = 1%0A %0A #To check if one of the number is divisible by the other%0A %0A if x %25 y == 0:%0A return y%0A %0...
3a6f724e7d31c1f42bfd426623dcaec3cdd642a8
add utils for multi gpus
multi_gpus.py
multi_gpus.py
Python
0
@@ -0,0 +1,1410 @@ +import tensorflow as tf%0Aimport numpy as np%0A%0Adef average_gradients(tower_grads):%0A %22%22%22Calculate the average gradient for each shared variable across all towers.%0A%0A Note that this function provides a synchronization point across all towers.%0A%0A Args:%0A tower_grads: List of lis...
6463b8165f964dc7e068143d5e8b22a7e2f00ff5
Fix deCONZ change entity_id bug (#22974)
homeassistant/components/deconz/deconz_device.py
homeassistant/components/deconz/deconz_device.py
"""Base class for deCONZ devices.""" from homeassistant.core import callback from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from .const import DOMAIN as DECONZ_DOMAIN class Decon...
Python
0
@@ -1091,90 +1091,8 @@ %22%22%22%0A - if self.unsub_dispatcher is not None:%0A self.unsub_dispatcher()%0A @@ -1164,27 +1164,83 @@ +del self. -_device = None +gateway.deconz_ids%5Bself.entity_id%5D%0A self.unsub_dispatcher() %0A%0A
a2ec630cde4e36cc391ac5eee560c8097c8ceab3
Copy in constants file from master
cea/technologies/constants.py
cea/technologies/constants.py
Python
0
@@ -0,0 +1,730 @@ +%22%22%22%0AConstants used throughout the cea.technologies package.%0A%0AHistory lesson: This is a first step at removing the %60cea.globalvars.GlobalVariables%60 object.%0A%22%22%22%0A%0A# Heat Exchangers%0AU_cool = 2500.0 # W/m2K%0AU_heat = 2500.0 # W/m2K%0AdT_heat = 5.0 # K - pinch delta at d...
77b9961cbf6b4ce6d453bbc974b0c695308fdd83
add import script for Broxbourne (closes #1167)
polling_stations/apps/data_collection/management/commands/import_broxbourne.py
polling_stations/apps/data_collection/management/commands/import_broxbourne.py
Python
0
@@ -0,0 +1,406 @@ +from data_collection.management.commands import BaseDemocracyCountsCsvImporter%0A%0Aclass Command(BaseDemocracyCountsCsvImporter):%0A council_id = 'E07000095'%0A addresses_name = 'local.2018-05-03/Version 1/Democracy Club - Polling Districts-2018- Broxbourne.csv'%0A stations_name = 'local.20...
e8e8c20422248fa4c394efbe1b8f04adbc006674
Add lc0111_minimum_depth_of_binary_tree.py
lc0111_minimum_depth_of_binary_tree.py
lc0111_minimum_depth_of_binary_tree.py
Python
0.000032
@@ -0,0 +1,815 @@ +%22%22%22Leetcode 111. Minimum Depth of Binary Tree%0AEasy%0A%0AURL: https://leetcode.com/problems/minimum-depth-of-binary-tree/%0A%0AGiven a binary tree, find its minimum depth.%0A%0AThe minimum depth is the number of nodes along the shortest path from the%0Aroot node down to the nearest leaf node.%...
312bbdefa256413b4891cd0e13e6ccf3c614541f
Add datetime header to Crank
util.py
util.py
Python
0
@@ -0,0 +1,209 @@ +%22%22%22%0Autil%0A===%0ACommon utilities across the Crank system.%0A%22%22%22%0Afrom datetime import datetime%0A%0A%0ADATETIME_FORMAT = '%25Y %25b %25d @ %25H%25M'%0A%0A%0Adef get_timestamp_header():%0A return datetime.now().strftime(DATETIME_FORMAT)%0A
776efb9c76f29fa7e15066fa38d3fbb06f959e61
update 040.py
040_1.py
040_1.py
Python
0
@@ -0,0 +1,769 @@ +#! /usr/bin/python%0A# %E5%BE%97%E5%88%B0%E6%95%B0%E5%AD%97n%E7%9A%84%E7%AC%ACbit%E4%BD%8D(%E4%BB%8E%E5%B7%A6%E8%B5%B7)%0Adef getNbit(n, bit):%0A return int(str(n)%5Bbit%5D)%0A%0A%0Adef cham(n):%0A t = thresh()%0A while 1:%0A low, high, bit = t.next()%0A if n %3C= high: #%E8%8B...
a737acb0310c11618802ed8610cf8b7d3bafd543
Add Python EC2 example change_instance_security_groups.py
python/example_code/ec2/change_instance_security_groups.py
python/example_code/ec2/change_instance_security_groups.py
Python
0
@@ -0,0 +1,3022 @@ +# snippet-comment:%5BThese are tags for the AWS doc team's sample catalog. Do not remove.%5D%0A# snippet-sourcedescription:%5Bcreate_instance.py demonstrates how to create an Amazon EC2 instance.%5D%0A# snippet-service:%5Bec2%5D%0A# snippet-keyword:%5BAmazon Elastic Compute Cloud (Amazon EC2)%5D%0A#...
c94de10cc97a4e948e2cf35f7b29cdf20c11f2ab
Add poisson sphere benchmark
convergence_tests/sphere_poisson.py
convergence_tests/sphere_poisson.py
Python
0.000039
@@ -0,0 +1,1837 @@ +from __future__ import absolute_import, division%0Afrom firedrake import *%0Aimport numpy as np%0A%0A%0Adef poisson_sphere(MeshClass, refinement, hdiv_space):%0A %22%22%22Test hybridizing lowest order mixed methods on a sphere.%22%22%22%0A mesh = MeshClass(refinement_level=refinement)%0A me...
e36e809699d387368d5c7edb478961c04692787f
Create BlockSelection.py
Documents/GitHub/BlockSelection.py
Documents/GitHub/BlockSelection.py
Python
0
@@ -0,0 +1,1366 @@ +import pygame%0Aimport random%0A%0ABLACK = ( 0, 0, 0)%0AWHITE = (255, 255, 255)%0ARED = (255, 0, 0)%0A %0Aclass Block(pygame.sprite.Sprite):%0A %0A def __init__(self, color, width, height):%0A super(Block, self).__init__()%0A self.image = pygame.Surface(%5Bwidth, height%5...
10c83fbc01dee9d95290466338f262abffc12a3e
Create a folder in a datacenter if not exists
samples/create_folder_in_datacenter.py
samples/create_folder_in_datacenter.py
Python
0.000001
@@ -0,0 +1,2799 @@ +#!/usr/bin/env python%0A%22%22%22%0AWritten by Chinmaya Bharadwaj%0AGithub: https://github.com/chinmayb/%0AEmail: acbharadwaj@gmail.com%0A%0ACreate a folder in a datacenter%0A%22%22%22%0Afrom __future__ import print_function%0A%0Afrom pyVmomi import vim%0A%0Afrom pyVim.connect import SmartConnect, D...
7a781a7cb9da6ab585f9b2ea72df991b4def19dd
Write entry/Preparations list test
whats_fresh/whats_fresh_api/tests/views/entry/test_list_preparations.py
whats_fresh/whats_fresh_api/tests/views/entry/test_list_preparations.py
Python
0
@@ -0,0 +1,1061 @@ +from django.test import TestCase%0Afrom django.core.urlresolvers import reverse%0Afrom whats_fresh_api.models import *%0Afrom django.contrib.gis.db import models%0Aimport json%0A%0A%0Aclass ListPreparationTestCase(TestCase):%0A fixtures = %5B'test_fixtures'%5D%0A%0A def test_url_endpoint(self)...
e0344625a6a2b9640481622a12c4dd810f5ca4c5
merge overlapping pairs (set BQ to 0)
bam-merge-pairs.py
bam-merge-pairs.py
Python
0
@@ -0,0 +1,1283 @@ +%22%22%22%0AIn order to avoid double counting of bases in overlapping paired end reads,%0Athis script accept mapped reads in SAM format, use the position to determine%0Aoverlap, and set the lower base-quality of pair overlap to 0.%0AIt is assumed that the reads are name-sorted as when they come from...
6f9f87ec8fe3d19de7b995288fa799e36a5c50d5
add mont test
tools/harness/tests/tommath.py
tools/harness/tests/tommath.py
Python
0
@@ -0,0 +1,1245 @@ +##########################################################################%0A# Copyright (c) 2016, ETH Zurich.%0A# All rights reserved.%0A#%0A# This file is distributed under the terms in the attached LICENSE file.%0A# If you do not find this file, copies can be found by writing to:%0A# ETH Zurich D...
a26ba96db8ac3149e457f2eaab0ef55e2b68d4cb
add 114
python/114_flatten_binary_tree_to_linked_list.py
python/114_flatten_binary_tree_to_linked_list.py
Python
0.999996
@@ -0,0 +1,1316 @@ +%22%22%22%0AGiven a binary tree, flatten it to a linked list in-place.%0A%0AFor example,%0AGiven%0A%0A 1%0A / %5C%0A 2 5%0A / %5C %5C%0A 3 4 6%0AThe flattened tree should look like:%0A 1%0A %5C%0A 2%0A %5C%0A 3%0A %5C%0A ...
85f67084f44419bf9d44439133314e6ffdadfea0
Introduce OvnNbctlDaemonContext
rally_ovs/plugins/ovs/context/ovnnbctl_daemon.py
rally_ovs/plugins/ovs/context/ovnnbctl_daemon.py
Python
0
@@ -0,0 +1,1593 @@ +# Copyright 2020 Red Hat, Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ...
ce44189d905f783b3963ac71057fe201f52faf64
Add new sample
detect_face/detect_face_video_swap.py
detect_face/detect_face_video_swap.py
Python
0
@@ -0,0 +1,1106 @@ +# coding:utf-8%0Aimport cv2%0A%0Acap = cv2.VideoCapture(0)%0Acascade_path = %22../opencv/data/haarcascades/haarcascade_frontalface_default.xml%22%0Acascade = cv2.CascadeClassifier(cascade_path)%0A%0A_response, frame = cap.read()%0Aminsize = (int(frame.shape%5B0%5D * 0.08), int(frame.shape%5B1%5D * 0...
bb4bc52c8adfac9de97f9407924a38ef56f9d31d
Fix path issue
powerline/lib/vcs/git.py
powerline/lib/vcs/git.py
# vim:fileencoding=utf-8:noet import os import re import errno from powerline.lib.vcs import get_branch_name as _get_branch_name, get_file_status _ref_pat = re.compile(br'ref:\s*refs/heads/(.+)') def branch_name_from_config_file(directory, config_file): try: with open(config_file, 'rb') as f: raw = f.read() ...
Python
0.000001
@@ -1207,13 +1207,8 @@ d, ' -.git/ info
160961a5ef75b8cf83d2683c5965701b5eb1d818
fix middleware
mysqlapi/settings.py
mysqlapi/settings.py
# Copyright 2014 mysqlapi authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import os ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = int(os.environ.get("MYSQLAPI_DEBUG", 1)) != 0 TEMPLATE_DEBUG = DEBUG ADMINS = () MANAGERS ...
Python
0.000027
@@ -8,17 +8,17 @@ ight 201 -4 +5 mysqlap @@ -2923,16 +2923,25 @@ %22,%0A %22 +mysqlapi. api.midd
210133ea4a6dfd314470d8d08c6c6431fa12f7be
train svm classifier
process_ims/train_svm.py
process_ims/train_svm.py
Python
0.999222
@@ -0,0 +1,2046 @@ +from sklearn.svm import SVC%0Afrom sklearn.cross_validation import train_test_split%0Afrom sklearn.metrics import classification_report%0Afrom sklearn.grid_search import GridSearchCV%0A%0A# load pca fit%0ApcaFG = pk.load(open('pickle_files/pcaFG.pk', 'rb'))%0A# load training data%0Atraining_data = p...
bbd732720fc25f5c47147c6f4c2c05ad1c180b35
Add api_subscribe_request.py
devicehive/api_subscribe_request.py
devicehive/api_subscribe_request.py
Python
0.000008
@@ -0,0 +1,1238 @@ +class ApiSubscribeRequest(object):%0A %22%22%22Api request class.%22%22%22%0A%0A def __init__(self, transport):%0A self._transport = transport%0A self._action = None%0A self._request = %7B%7D%0A self._params = %7B'method': 'GET',%0A 'url': Non...
01268f69a07e6922a095dedd9a5008273510c670
add docstring
corehq/apps/hqwebapp/templatetags/proptable_tags.py
corehq/apps/hqwebapp/templatetags/proptable_tags.py
import collections import datetime import itertools import types import dateutil import pytz from django import template from django.template.defaultfilters import yesno from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.html import escape from dimagi...
Python
0.000005
@@ -1,12 +1,505 @@ +%22%22%22%0AA collection of templatetags and helper functions for declaratively defining a%0Aproperty table layout with multiple (optionally named) tables of some number of%0Arows of possibly differing length, where each row consists of a number of names%0Aand values which are calculated based on an...
f78a485000ef8dacb584db1f03b7157b79bd5fe7
Add module for mocking node.get() with Responses
d1_libclient_python/src/d1_client/tests/mock_get.py
d1_libclient_python/src/d1_client/tests/mock_get.py
Python
0
@@ -0,0 +1,2362 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# This work was created by participants in the DataONE project, and is%0A# jointly copyrighted by participating institutions in DataONE. For%0A# more information on DataONE, see our web site at http://dataone.org.%0A#%0A# Copyright 2009-2016 Dat...
ae05372f0a2f4b152fc700593e9a2b99612c9d69
create tag models manager tags via slug
tags/models.py
tags/models.py
Python
0
@@ -0,0 +1,856 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom django.db import models%0Afrom django.utils.translation import ugettext_lazy as _%0Afrom django.template.defaultfilters import slugify%0A%0A%0Aclass Tag(models.Model):%0A name = models.CharField(_(u'Name'), max_length=150, unique=True,%0A ...
6e1d2ce723fbdf4f37147f1f1cb692c4fb705c12
handle cache file on disk
Cache.py
Cache.py
Python
0.000001
@@ -0,0 +1,3045 @@ +'''maintain a pickled cache file on disk'''%0Aimport cPickle as pickle%0Aimport os%0Aimport pdb%0Aimport time%0Aimport unittest%0A%0Aif False:%0A # example%0A class Cache(object):%0A pass%0A%0A def read_data(dictionary):%0A 'return the data; it will be pickled and written to t...
dace8d98f938e6c977ea99558afa00d70c8eb6ff
Add /
dmopc/urls.py
dmopc/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from judge.views import RegistrationView, ActivationView, TemplateView admin.autodiscover() register_patterns = patterns('', url(r'^activate/complete/$', TemplateView.as_view(template_nam...
Python
0
@@ -3382,163 +3382,8 @@ '),%0A - url(r'%5Euser/(%5Cw+)/submissions/$', 'judge.views.all_user_submissions'),%0A url(r'%5Euser/(%5Cw+)/submissions/(%5Cd+)$', 'judge.views.all_user_submissions'),%0A @@ -4019,32 +4019,33 @@ .submissions'),%0A +%0A url(r'%5Eprobl @@ -4089,32 +4089,107 @@ _submissions'),%...
0287d807b8b03e5adf30e95c53504378f0bb2f8d
Add basic implementation
derivative.py
derivative.py
Python
0.000002
@@ -0,0 +1,1526 @@ +from __future__ import division%0A%0Aclass Dual(object):%0A%09def __init__(self, a=0.0, b=0.0):%0A%09%09self.a = a%0A%09%09self.b = b%0A%0A%09def __add__(self, other):%0A%09%09if isinstance(other, Dual):%0A%09%09%09return Dual(self.a + other.a, self.b + other.b)%0A%09%09else:%0A%09%09%09return Dual(...
8223e9ffa61a2772a7a6f52244c5f1bbde4956b8
Add py solution for 409. Longest Palindrome
py/longest-palindrome.py
py/longest-palindrome.py
Python
0.998206
@@ -0,0 +1,418 @@ +from collections import Counter%0Aclass Solution(object):%0A def longestPalindrome(self, s):%0A %22%22%22%0A :type s: str%0A :rtype: int%0A %22%22%22%0A counter = Counter(s)%0A odd = 0%0A ans = 0%0A for char, cnt in counter.iteritems():%0A ...
8223d62c22d4c4f7a66e1e468de53556796a03a9
Write a function that print something n times including relatives spaces
src/functions/exercise7.py
src/functions/exercise7.py
Python
0.999965
@@ -0,0 +1,576 @@ +%22%22%22Module docstring.%0A%0AThis serves as a long usage message.%0A%22%22%22%0Aimport sys%0Aimport getopt%0A%0Adef main():%0A # parse command line options%0A try:%0A opts, args = getopt.getopt(sys.argv%5B1:%5D, %22h%22, %5B%22help%22%5D)%0A except getopt.error, msg:%0A prin...
98c07739702fbf3951ccd0359d04be80a303d9ce
Add a fontname to TachyFont Jar file mapper.
run_time/src/gae_server/font_mapper.py
run_time/src/gae_server/font_mapper.py
Python
0
@@ -0,0 +1,1103 @@ +%22%22%22%0A Copyright 2014 Google Inc. All rights reserved.%0A%0A Licensed under the Apache License, Version 2.0 (the %22License%22);%0A you may not use this file except in compliance with the License.%0A You may obtain a copy of the License at%0A%0A http://www.apache.org/licenses/LICENSE-...
4074c4fae998ac1bb6f49bb47b34f4890dc90532
Add integration tests for pylast.py
test_pylast.py
test_pylast.py
Python
0
@@ -0,0 +1,2508 @@ +#!/usr/bin/env python%0A%22%22%22%0AIntegration (not unit) tests for pylast.py%0A%22%22%22%0Aimport datetime%0Aimport time%0Aimport unittest%0A%0Aimport pylast%0A%0Aclass TestSequenceFunctions(unittest.TestCase):%0A%0A def setUp(self):%0A self.username = %22TODO%22%0A password_hash ...
52cf67258e5f1e6378fec2794cc3abb1d5b394e9
copia de serialCom sem a comunicacao serial
testeLogica.py
testeLogica.py
Python
0
@@ -0,0 +1,939 @@ +import serial%0D%0Aimport time%0D%0A%0D%0A############################%0D%0Adef num(s):%0D%0A try:%0D%0A retorno = int(s)%0D%0A if retorno %3E 100 : return 100%0D%0A if retorno %3C 0 : return 0%0D%0A return int(s)%0D%0A except ValueError:%0D%0A return 0%0D%0A ...
fb5ef2e7bf3b3315ab6491ec46dd97114162b7c6
Add tests directory and dummy objects for use in developing and running unit tests.
pywikibot/tests/dummy.py
pywikibot/tests/dummy.py
Python
0
@@ -0,0 +1,944 @@ +# -*- coding: utf-8 -*-%0D%0A%22%22%22Dummy objects for use in unit tests.%22%22%22%0D%0A#%0D%0A# (C) Pywikipedia bot team, 2007%0D%0A#%0D%0A# Distributed under the terms of the MIT license.%0D%0A#%0D%0A__version__ = '$Id: $'%0D%0A%0D%0A# add in any other attributes or methods that are needed for te...
862016c070155fa44ed082a47d969ecacbba8aae
add TagAlias class (broken)
anormbookmarker/TagAlias.py
anormbookmarker/TagAlias.py
Python
0
@@ -0,0 +1,3064 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A# MIT License%0A%0Afrom sqlalchemy import Column%0A#from sqlalchemy import ForeignKey%0A#from sqlalchemy import UniqueConstraint%0A#from sqlalchemy import CheckConstraint%0Afrom sqlalchemy import Integer%0A#from sqlalchemy import Unicode%0Afrom sqla...
871a49b8d1e18c675cb7b5e6730cf8ebd4c56e36
Create q1.py
2013/q1.py
2013/q1.py
Python
0.000046
@@ -0,0 +1,410 @@ +# A solution to the British Informatics Olympiad 2012 Question 1%0A%0Afrom time import strftime, gmtime%0A%0A# number of minutes%0Aa = -1%0A# number of minutes%0Ab = 0%0A%0Ai = input()%0A%0Afast = %5Bint(x) for x in i.split()%5D%0A%0Aactual = 0%0A%0Awhile a != b:%0A if a == -1:%0A a = 0%0A ...
4785a42d218e75a49f9e5c270f159a17c7e22bcd
add count_clonotypes.py
count_clonotypes.py
count_clonotypes.py
Python
0.000016
@@ -0,0 +1,1196 @@ +import sys%0A%0A%0Adef count_clonotypes_in_files(link_path):%0A%0A%09def get_sequence(words):%0A%09%09tmp = 0%0A%09%09res = ''%0A%0A%09%09try:%0A%09%09%09tmp = float(words%5B2%5D)%0A%09%09%09res = words%5B3%5D%0A%09%09except Exception:%0A%09%09%09res = words%5B2%5D%0A%0A%09%09if not res: print(%22Em...
3def1498495e0abf230a3deb3873f6c502f3c6ad
Add management command for removing content rotation's settings on sections
molo/core/management/commands/remove_content_rotation_settings_from_sections.py
molo/core/management/commands/remove_content_rotation_settings_from_sections.py
Python
0
@@ -0,0 +1,622 @@ +from __future__ import absolute_import, unicode_literals%0A%0Afrom django.core.management.base import BaseCommand%0Afrom molo.core.models import SectionPage%0A%0A%0Aclass Command(BaseCommand):%0A def handle(self, **options):%0A SectionPage.objects.all().update(%0A content_rotatio...
ea67a84c83fb11237383102c4c447f70c4b83e64
Add solution to 114.
114/114.py
114/114.py
Python
0.000014
@@ -0,0 +1,1998 @@ +%22%22%22%0AA row measuring seven units in length has red blocks with a minimum length of%0Athree units placed on it, such that any two red blocks (which are allowed to be%0Adifferent lengths) are separated by at least one black square. There are%0Aexactly seventeen ways of doing this.%0A%0AHow many...
e67594c61ad6c317a60a3e3d6cd15d7e447649fc
373. Find K Pairs with Smallest Sums. Minheap
p373_heapq.py
p373_heapq.py
Python
0.999999
@@ -0,0 +1,1393 @@ +import heapq%0Aimport unittest%0A%0A%0Aclass Solution(object):%0A def kSmallestPairs(self, nums1, nums2, k):%0A %22%22%22%0A :type nums1: List%5Bint%5D%0A :type nums2: List%5Bint%5D%0A :type k: int%0A :rtype: List%5BList%5Bint%5D%5D%0A %22%22%22%0A ...
d563e6aed8061d4e439bdad9ece1a9383d00cff2
add parse_wadl.py, a first attempt to parse this wadl
parse_wadl.py
parse_wadl.py
Python
0.000002
@@ -0,0 +1,1138 @@ +#!/usr/bin/env python%0A%0Aimport os%0Aimport xml.parsers.expat%0A%0Afilename = 'samples/cloud-images/wadl/image-2.0.wadl'%0A%0Adef start_resource(name,attrs):%0A print('start resource: ', attrs)%0Adef start_resources(name,attrs):%0A print('start resources ', attrs)%0A%0Astart_dispatch = %7B%0...
656d65a484cc4319ba67e4e4bb4cee8adb37136a
copy from hadoop
copy_from_hadoop.py
copy_from_hadoop.py
Python
0
@@ -0,0 +1,1077 @@ +import subprocess%0Aimport argparse%0A%0ACMD_BASE = %22hadoop fs -copyToLocal%22%0A%0A''' Script to experiment output files from hdfs to dst '''%0A%0Adef copy_from_hadoop(src, dst):%0A p = subprocess.Popen(%22 %22.join(%5BCMD_BASE, src, dst%5D), shell=True, executable='/bin/bash')%0A p...
fa60d9857b4412edf5f8f59fa5b65914ee38a279
add d18 (not working, too tired)
d18.py
d18.py
Python
0.000002
@@ -0,0 +1,2171 @@ +#!/bin/env python3%0A%0Awith open(%22d18.txt%22) as f:%0A state1 = f.read().splitlines()%0A%0Afor i in range(0, len(state1)):%0A state1%5Bi%5D = list(state1%5Bi%5D)%0A%0Anew_state = 2%0Adim_x = len(state1)%0Adim_y = len(state1%5B0%5D)%0Astate2 = %5B%5B%22.%22%5D*(dim_y)%5D*(dim_x)%0A%0A%0Adef ...
a610154749d081e613b8bf58acf62af55958de9c
Automate the update of the version number in setup.py.
rev.py
rev.py
Python
0.000002
@@ -0,0 +1,407 @@ +import fileinput%0Aimport re%0Aimport sys%0A%0Apattern = re.compile(%22%5Cs*version='(%5B0-9.%5D+)',%22)%0Aline = %22%22%0Amaj = %22%22 %0Amin = %22%22 %0Aver = %22%22 %0A%0Afor line in fileinput.FileInput(%22setup.py%22, inplace=1):%0A m = pattern.match(line) %0A if m:%0A version = m.gr...
47a575a69b6a55cc188aa7ccecf9d15719efe405
Include base test class
tests/check.py
tests/check.py
Python
0
@@ -0,0 +1,1172 @@ +from unittest import TestCase%0Aimport os%0A%0A%0Aclass Check(TestCase):%0A%0A __test__ = False%0A%0A @property%0A def this_check(self):%0A raise NotImplementedError%0A%0A def check(self, lst):%0A if isinstance(lst, basestring):%0A lst = %5Blst%5D%0A%0A er...
11c4fedc55a32f27b4aebd44cc03ba1f5d1e6357
add board_build_example
examples/build/board_build_example.py
examples/build/board_build_example.py
Python
0.000001
@@ -0,0 +1,2496 @@ +%0A%22%22%22%0AThis file contains a general function to run the build for %0Avarious boards. %0A%0A %3E%3E python example_build_boards.py --board=%3Cboard name%3E%0A%22%22%22%0Aimport argparse%0A%0Aimport rhea.build as build %0Afrom rhea.build.boards import get_board%0Afrom rhea.build.boards impor...
4d579e832bb5c6b300ccd77859ea1fc6644f20c7
Create asda.py
asda.py
asda.py
Python
0.000009
@@ -0,0 +1,7 @@ +sasd=2%0A
67a4cdb0a17ea899f6f7954c9acd5e1829500790
Fix test-case: do not import SSDP_PORT and SSDP_ADDR, but define.
coherence/upnp/core/test/test_ssdp.py
coherence/upnp/core/test/test_ssdp.py
# -*- coding: utf-8 -*- # Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2014, Hartmut Goebel <h.goebel@goebel-consult.de> """ Test cases for L{upnp.core.sspd} """ from twisted.trial import unittest from twisted.internet import protocol from twisted.test import proto_hel...
Python
0.000001
@@ -360,45 +360,9 @@ sdp%0A -from coherence.upnp.core.ssdp import +%0A SSDP @@ -366,18 +366,24 @@ SDP_PORT -, += 1900%0A SSDP_ADD @@ -383,16 +383,36 @@ SDP_ADDR + = '239.255.255.250' %0A%0Assdp_n
4e2172b8bd0953fd706f6c11029f9e4cfeb55407
Add tests for the registry's root object's Component interface
tests/registryd/test_root_component.py
tests/registryd/test_root_component.py
Python
0
@@ -0,0 +1,1458 @@ +import pytest%0Aimport dbus%0A%0ACOMPONENT_IFACE = 'org.a11y.atspi.Component'%0A%0ACOORD_TYPE_WINDOW = 1%0ALAYER_WIDGET = 3%0A%0Adef test_contains(registry_root, session_manager):%0A assert registry_root.Contains(0, 0, COORD_TYPE_WINDOW, dbus_interface=COMPONENT_IFACE) == False%0A%0Adef test_get_...
f7a1595e39eeb754290c62e9194868d98d9755f4
Add test for symbol selection
tests/symbols/test_symbol_selection.py
tests/symbols/test_symbol_selection.py
Python
0
@@ -0,0 +1,2959 @@ +import pytest%0A%0Afrom tests.symbols import get_symbols%0Afrom thinglang.compiler.errors import NoMatchingOverload%0Afrom thinglang.compiler.references import Reference%0Afrom thinglang.lexer.values.identifier import Identifier%0Afrom thinglang.parser.values.named_access import NamedAccess%0Afrom t...
08e6aa3410ef406ccdd0db452fbbb2762f137261
Revert "Use codecs.open() with utf-8"
cities_light/geonames.py
cities_light/geonames.py
from __future__ import unicode_literals import six import codecs import time import os import os.path import zipfile import logging try: from urllib.request import urlopen except ImportError: from urllib import urlopen from .settings import * class Geonames(object): logger = logging.getLogger('cities_l...
Python
0
@@ -49,22 +49,8 @@ six%0A -import codecs%0A impo @@ -2461,15 +2461,8 @@ e = -codecs. open
1ee1068d0203b591a734837d72f2f8a38c40399a
Add new project String -> MethodAndOperator.py
StartWithPython/StartWithPython/String/MethodAndOperator.py
StartWithPython/StartWithPython/String/MethodAndOperator.py
Python
0.000013
@@ -0,0 +1,1736 @@ +#STRING(2) %0Aprint('%5Cn%5Ct%5CtSTRING(2)%5Ct%5Ct%5Cn')%0A%0Auser = 'Tuna'%0A%0Aprint(user%5B0%5D)%09%09%09%09%09%09%09%09# use it if you want a specif letter of a string%0Aprint(user%5B1%5D)%09%09%09%09%09%09%09%09# ...%0Aprint(user%5B2%5D)%09%09%09%09%09%09%09%09# ...%0Aprint(user%5B3%5D)%09%09%0...
e9b2131da038c7e65dde33c04ee7c5888063827c
Add a test suite for json_marshal.bzl.
internal/common/json_marshal_test.bzl
internal/common/json_marshal_test.bzl
Python
0.999991
@@ -0,0 +1,1380 @@ +%22%22%22Unit tests for json marshaling.%0A%0ANote, this cannot live next to the file it tests, because that file is in%0Athird_party bazel rules, and bazel doesn't support skylark testing yet.%0A%22%22%22%0A%0Aload(%22//third_party/bazel_skylib/lib:unittest.bzl%22, %22asserts%22, %22unittest%22)%0A...
698d838ed225f42c7acee40c564e0f15aefa16ef
Add code to support optional debugging
conpaas-director/cpsdirector/debug.py
conpaas-director/cpsdirector/debug.py
Python
0
@@ -0,0 +1,1549 @@ +import sys%0Afrom common import log%0A%0Aclass Debug:%0A%0A def __init__(self):%0A self.level = 5;%0A%0A def set_level(self, l):%0A self.level = l%0A%0A def get_level(self):%0A return(self.level)%0A%0A def debug(self, level, tx...
5a8c8afee5e50a04f38d91745563842fc548cef8
add favorites to the admin
crate_project/apps/favorites/admin.py
crate_project/apps/favorites/admin.py
Python
0
@@ -0,0 +1,359 @@ +from django.contrib import admin%0A%0Afrom favorites.models import Favorite%0A%0A%0Aclass FavoriteAdmin(admin.ModelAdmin):%0A list_display = %5B%22user%22, %22package%22, %22created%22, %22modified%22%5D%0A list_filter = %5B%22created%22, %22modified%22%5D%0A search_fields = %5B%22user__user...
6a0a99c856c1f52993db2d0471a5aead948dc403
Use correct attribute.
flocker/volume/script.py
flocker/volume/script.py
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """The command-line ``flocker-volume`` tool.""" import sys from twisted.python.usage import Options from twisted.python.filepath import FilePath from twisted.internet.defer import succeed from zope.interface import implementer from .service import ( ...
Python
0.000001
@@ -3775,23 +3775,23 @@ ions.sub -Command +Options .run(ser
cae06ce3f07cd241431baf792e5e3b9dbec04e6b
Create __init__.py
genes/docker/__init__.py
genes/docker/__init__.py
Python
0.000429
@@ -0,0 +1,5 @@ +#Add%0A
e5238b616f1a9be3fe5863e0aa9e9c118343df0f
add error wrapper to echo to stderr
DTError.py
DTError.py
Python
0.000001
@@ -0,0 +1,363 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# This software is under a BSD license. See LICENSE.txt for details.%0A%0Aimport sys%0A%0A_errors = %5B%5D%0A%0Adef DTErrorMessage(fcn, msg):%0A err_msg = %22%25s: %25s%22 %25 (fcn, msg)%0A _errors.append(err_msg)%0A sys.stderr.write(err_...
f120ce1555e2b14797d4e1f675f8cb6101f1b28f
Allow unicode in data.ConvertToBaseTypes
openhtf/util/data.py
openhtf/util/data.py
# Copyright 2016 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 agre...
Python
0.000012
@@ -4167,16 +4167,89 @@ umber).%0A + - Byte and unicode strings are left alone (instances of basestring).%0A - Ot @@ -5349,16 +5349,24 @@ one and +(%0A not isin @@ -5392,16 +5392,53 @@ .Number) + and not isinstance(obj, basestring)) :%0A # @@ -5492,16 +5492,17 @@ %22, a -nd leave +s well as n...
bd761bda5c01384870083ad750e59859c4a5b04a
add collector for http://hosts-file.net/
collectors/hosts-file.py
collectors/hosts-file.py
Python
0
@@ -0,0 +1,2416 @@ +#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0Aimport socket%0Afrom time import gmtime, strftime%0Aimport requests%0Aimport ipwhois%0Afrom pprint import pprint%0A%0A%0Adef get_url(url):%0A try:%0A res = requests.get(url)%0A except requests.exceptions.ConnectionError:%0A raise r...
233090aac7d71a1a8e0caf348b3d785bca15f69c
Create initial image.py file
derpibooru/image.py
derpibooru/image.py
Python
0.000001
@@ -0,0 +1,2118 @@ +# this list of conditions and the following disclaimer in the documentation%0A# and/or other materials provided with the distribution.%0A#%0A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0A# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, T...
1eb9d5aff303ff920b4bacbeea0d1de6bab419d9
add bonuses solution SRM 145 DIV 1
Bonuses.py
Bonuses.py
Python
0.000001
@@ -0,0 +1,619 @@ +from __future__ import division%0A%0Aclass Bonuses:%0A%09def getDivision(self, points):%0A%09%09bonuses = %5B%5D%0A%09%09# calculate bonuses%0A%09%09total = sum(points)%0A%09%09extra = 0%0A%09%09for p in points:%0A%09%09%09percent = p / total * 100%0A%09%09%09extra += percent %25 1%0A%09%09%09bonuses...
83ba0ea1ea11316c0fe6f7d6d82b1791c7757e2d
Put kind string in message instead of Directive object.
src/ggrc/converters/sections.py
src/ggrc/converters/sections.py
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com from .base import * from ggrc.models import Directive, Section from .base_row imp...
Python
0
@@ -2309,23 +2309,23 @@ irective -().type +_kind() ))%0A e @@ -2448,16 +2448,21 @@ irective +_kind (),%0A
34f2e6066bb44697636f72bb416e200145878a42
Add script for generating TestRun index (#74)
util/generate_testrun_index.py
util/generate_testrun_index.py
Python
0
@@ -0,0 +1,2471 @@ +#!/usr/bin/python3%0A%0A# Copyright 2017 Google Inc.%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#...
c15bf8a018265417400b9948e4b36eb48d40582b
Introduce a very simple vim modeline parser.
pygments/modeline.py
pygments/modeline.py
Python
0
@@ -0,0 +1,959 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0A pygments.modeline%0A ~~~~~~~~~~~~~~~~~%0A%0A A simple modeline parser (based on pymodeline).%0A%0A :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.%0A :license: BSD, see LICENSE for details.%0A%22%22%22%0Aimport re%0A%0A__all__ =...
9e5fa749cbf797e8646e72a6b54047a9644c8711
add controller file
qaamus/controller.py
qaamus/controller.py
Python
0.000001
@@ -0,0 +1,2074 @@ +import view%0Aimport parsers%0A%0Adef idar_controller(soup_object, make_soup):%0A data = parsers.IndAraParser(soup_object).get_idar(make_soup)%0A rendered = view.View().render(data)%0A return rendered%0A%0Adef angka_controller(soup_object):%0A data = parsers.AngkaParser(soup_object).get_...
2e60e02e9fd7cb788e15e61329f36e675f14160f
Create PedidoEditar.py
backend/Models/Sala/PedidoEditar.py
backend/Models/Sala/PedidoEditar.py
Python
0
@@ -0,0 +1,454 @@ +from Framework.Pedido import Pedido%0Afrom Framework.ErroNoHTTP import ErroNoHTTP%0A%0Aclass PedidoEditar(Pedido):%0A%0A%09def __init__(self,variaveis_do_ambiente):%0A%09%09super(PedidoEditar, self).__init__(variaveis_do_ambiente)%0A%09%09try:%0A%09%09%09self.id = self.corpo%5B'id'%5D%0A%09%09%09self...
23c9fe71f5f35afa54990a8383b5b6a0e75fb847
Add tests for app.main.forms.AdminEmailAddressValidator
tests/app/main/test_form_validators.py
tests/app/main/test_form_validators.py
Python
0.000001
@@ -0,0 +1,1329 @@ +import mock%0Aimport pytest%0A%0Afrom flask.ext.wtf import Form%0Afrom wtforms.fields.core import Field%0Afrom wtforms.validators import StopValidation%0A%0Afrom app.main.forms import AdminEmailAddressValidator%0A%0A%0A@mock.patch('app.main.forms.data_api_client')%0Aclass TestAdminEmailAddressValida...
27bf7a038257e96b1ceb6b53b0771a38734a8967
sorted(key=') and __call__ method
NEW/one.py
NEW/one.py
Python
0.999417
@@ -0,0 +1,1237 @@ +%22%22%22 1) implementing __call__ method in BingoCage class%0A which gives it a function like properties%22%22%22%0A%0A%0Aimport random%0A%0A%0Awords = %5B'pandas', 'numpy', 'matplotlib', 'seaborn', 'Tenserflow', 'Theano'%5D%0A%0A%0Adef reverse(x):%0A %22%22%22Reverse a letter%22%22%22%0A ...
aa5c4fde763467cae63c205df8e4aaf7328ab713
Add 'git cl format' presubmit check to src/device
device/PRESUBMIT.py
device/PRESUBMIT.py
Python
0
@@ -0,0 +1,491 @@ +# Copyright 2015 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%22Presubmit script.%0A%0ASee http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts%0Afor more details abo...
c654034a0da8b898dd55b03a895bf0dfdc6257bf
make vector2d hashable
fluent_python/object/vector2d_v2.py
fluent_python/object/vector2d_v2.py
Python
0.000007
@@ -0,0 +1,335 @@ +#!/usr/bin/env python%0A# encoding=utf-8%0A%0Aclass vector2d(object):%0A def __init__(self, x, y):%0A self.__x = float(x)%0A self.__y = float(y)%0A %0A @property%0A def x(self):%0A return self.__x%0A @property%0A def y(self):%0A return self.__y%0A%0A d...
fb3b3d2f9798872742541f7eae2d7b3e2a8a95ab
Add new abstraction with recursion
pygraphc/abstraction/AutoAbstractionRecursion.py
pygraphc/abstraction/AutoAbstractionRecursion.py
Python
0.000052
@@ -0,0 +1,1937 @@ +import networkx as nx%0Aimport os%0Afrom pygraphc.preprocess.CreateGraphModel import CreateGraphModel%0Afrom pygraphc.clustering.Louvain import Louvain%0A%0A%0Aclass AutoAbstraction(object):%0A def __init__(self, log_file):%0A self.log_file = log_file%0A self.clusters = %5B%5D%0A%0A...
80fd2d73f7a206b5b517cb455da457fed9dc6403
Add Rother District Council logo for letters
migrations/versions/0180_another_letter_org.py
migrations/versions/0180_another_letter_org.py
Python
0
@@ -0,0 +1,777 @@ +%22%22%22empty message%0A%0ARevision ID: 0180_another_letter_org%0ARevises: 0179_billing_primary_const%0ACreate Date: 2017-06-29 12:44:16.815039%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '0180_another_letter_org'%0Adown_revision = '0179_billing_primary_const'%0A%0Afrom...
1f8dd52b6a40b834d459ea356457429969393339
add migration
meinberlin/apps/cms/migrations/0035_remove_project_block_from_homepage.py
meinberlin/apps/cms/migrations/0035_remove_project_block_from_homepage.py
Python
0.000002
@@ -0,0 +1,2155 @@ +# Generated by Django 2.2.18 on 2021-02-18 10:01%0A%0Afrom django.db import migrations%0Aimport wagtail.core.blocks%0Aimport wagtail.core.fields%0Aimport wagtail.images.blocks%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('meinberlin_cms', '0034_emailformfield...
16e52502bf55075c58022fa35e1673a8a0d5f4bc
Add a test for UnionFind fix.
networkx/utils/tests/test_unionfind.py
networkx/utils/tests/test_unionfind.py
Python
0
@@ -0,0 +1,423 @@ +from nose.tools import *%0A%0Aimport networkx as nx%0A%0Adef test_unionfind():%0A # Fixed by: 2cddd5958689bdecdcd89b91ac9aaf6ce0e4f6b8%0A # Previously (in 2.x), the UnionFind class could handle mixed types.%0A # But in Python 3.x, this causes a TypeError such as:%0A # TypeError: unorder...
f11957f7b9f60ae1afbaf41fc558b2e600d2822c
Add basic smoketest
openprescribing/frontend/tests/commands/test_infer_practice_boundaries.py
openprescribing/frontend/tests/commands/test_infer_practice_boundaries.py
Python
0.000002
@@ -0,0 +1,665 @@ +from django.core.management import call_command%0Afrom django.test import TestCase%0A%0Afrom frontend.models import Practice%0A%0A%0Aclass InferPracticeBoundariesTestCase(TestCase):%0A%0A fixtures = %5B'orgs', 'practices'%5D%0A%0A def test_basic_smoketest(self):%0A should_have_boundary =...
81f3466990e4161d500a21a1429b14b8de836f0d
Create main.py
main.py
main.py
Python
0.000001
@@ -0,0 +1,1689 @@ +#!/usr/bin/python%0Aimport os%0A%0A%0Amax_length = 8 # maximum length of a word (words can be %3C or == )%0Awords = %5B%5D # store all words%0Aproductions = %7B%09# production rules%0A%09%22E%22: (%22E+E%22, %22E*E%22, %22(E)%22, %22xI%22), %0A%09%22I%22: (%220I%22, %221I%22, %220%22, %221%22)%0A%7D...
8ebe878fa4898939f210cf6a6918410781f964a9
Add skeleton NoteBag.py
NoteBag.py
NoteBag.py
Python
0
@@ -0,0 +1,2539 @@ +#!/usr/bin/python -B%0A%0A# For getting the config file%0Aimport configparser%0Aimport os.path%0Afrom os.path import abspath, dirname, realpath, join as join_path%0Afrom sys import argv%0A%0A# Widgets%0Afrom tkinter import Button, Entry, Frame, Label, Listbox, Scrollbar, Tk%0A# Constants%0Afrom tkin...
b27b6b79871cbf814a2dd255cf47e6b3281f6dfb
add assert_equal() util function
test/utils.py
test/utils.py
Python
0.000098
@@ -0,0 +1,432 @@ +#!/usr/bin/env python3%0A# Copyright (c) 2017 The lit developers%0A# Distributed under the MIT software license, see the accompanying%0A# file LICENSE or http://www.opensource.org/licenses/mit-license.php.%0A%22%22%22Utils for lit testing%22%22%22%0A%0Adef assert_equal(thing1, thing2, *args):%0A i...
ff3c5daf69d9ceb8d50bf4243830f816849c9b27
added parser for player connect messsage. non tested
core/parsers/playerenter.py
core/parsers/playerenter.py
Python
0.993817
@@ -0,0 +1,319 @@ +from core.workers import Parser%0A%0A%0Aclass HeartBeatParser(Parser):%0A %22%22%22parser for message when player enters. typical string = 'Player 76561198056103537/'Shpiler' logged in'%22%22%22%0A regexp = '*Player ?P%3CId%3E/%5C'?P%3CId%3E%5C' logged in'%0A%0A def on_match(self, line, matc...
d168599b9167ede2098aa2fe82375aa95e5ab8b3
Check if hook parameter is passed to the url
dockerpuller/app.py
dockerpuller/app.py
from flask import Flask from flask import request from flask import jsonify import json import subprocess app = Flask(__name__) config = None @app.route('/', methods=['POST']) def hook_listen(): if request.method == 'POST': token = request.args.get('token') if token == config['token']: ...
Python
0.000001
@@ -346,16 +346,42 @@ 'hook')%0A +%0A if hook:%0A @@ -432,24 +432,28 @@ + if hook_valu @@ -471,16 +471,20 @@ + + #payload @@ -505,16 +505,20 @@ _json()%0A + @@ -550,16 +550,20 @@ + subproce @@ -594,32 +594,36 @@ ...
f5b1038062aae983aea6500ae376ad87d4555c30
allow one-off test runs
tests_once.py
tests_once.py
Python
0
@@ -0,0 +1,612 @@ +#!/usr/bin/env python%0A%0A# IATI Data Quality, tools for Data QA on IATI-formatted publications%0A# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith%0A#%0A# Copyright (C) 2014 Publish What You Fund%0A#%0A# This programme is free software; you may redistribute and/or modify%0A# it un...
e345aa8deb3f79c100996d445a23d2166fbb2aca
add evolutions
migrations/versions/2f5abd277f57_.py
migrations/versions/2f5abd277f57_.py
Python
0.999703
@@ -0,0 +1,2207 @@ +%22%22%22empty message%0A%0ARevision ID: 2f5abd277f57%0ARevises: 21d6a9f40991%0ACreate Date: 2017-07-16 22:47:47.460172%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = '2f5abd277f57'%0Adown_revision = '21d6a9f40991'%0Abr...
0bc0691c7714b7b5885ce2a9c05eb7eb35738c74
Add test for sender_callable check
tests/test_decorators.py
tests/test_decorators.py
Python
0
@@ -0,0 +1,436 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport pytest%0A%0Afrom webhooks.exceptions import SenderNotCallable%0Afrom webhooks import webhook, unhashed_hook%0A%0A%0Adef test_callable_sender():%0A%0A @webhook(event=%22example200%22, sender_callable=123)%0A def basic(creator=%22pydanny...
749c24ee930d44914970b757cfcadb30bb7a1d1c
Prepare for testcase
tests/unit/page_tests.py
tests/unit/page_tests.py
Python
0
@@ -0,0 +1,151 @@ +import unittest, os, sys%0A%0Acurrent_dir = os.path.dirname(__file__)%0Abase_dir = os.path.join(current_dir, os.pardir, os.pardir)%0Asys.path.append(base_dir)%0A
d39ec1142544e0ef85259bdd31d2142d2c8f9fad
Improve test speed
utest/namespace/test_ns_performance.py
utest/namespace/test_ns_performance.py
import time import unittest from robot.utils.asserts import assert_true from robotide.namespace import Namespace from robotide.controller.chiefcontroller import ChiefController from resources import MessageRecordingLoadObserver from datafilereader import TESTCASEFILE_WITH_EVERYTHING, KW1000_TESTCASEFILE,\ KW2000_...
Python
0.000035
@@ -1785,16 +1785,92 @@ esult))%0A + if c %3E 0 and (b %3C= 0 or c / b %3E self.RELEVANT_B_RELATIVE_TO_C):%0A @@ -1968,32 +1968,36 @@ 0_TESTCASEFILE)%0A + self._ve @@ -2349,84 +2349,8 @@ **2%0A - if c %3E 0 and (b %3C= 0 or c / b %3E self.RELEVANT_B_RELATIVE_TO_C):%0A ...
f7273b6e97e6120fe0f3b0a2c9ea5865685608bd
Create client.py
client.py
client.py
Python
0.000001
@@ -0,0 +1,1054 @@ +%22%22%22A slightly smarter telnet client that, if available, supports readline.%22%22%22%0A%0Aimport telnetlib%0Afrom telnetlib import IAC, WILL, DO, WONT, DONT%0Atry:%0A import readline%0A old_readline_callback=readline.get_completer()%0Aexcept ImportError:%0A readline=None%0A%0Adef telne...
98a2706909a7f880273080fdc7b4e696b6a600aa
Create 04.py
Euler/04.py
Euler/04.py
Python
0
@@ -0,0 +1,102 @@ +print(max(a*b for a in range(999, 100, -1) for b in range(999, 100, -1) if str(a*b)==str(a*b)%5B::-1%5D))%0A
e2a9f8ae9378c52bcde06863de3445ae89cca0d0
Create details.py
details.py
details.py
Python
0
@@ -0,0 +1,197 @@ +import csv%0Af = open(%22data.csv%22)%0Aout = open(%22detail.csv%22,%22w%22)%0A%0Areader = csv.reader(f)%0Afor line in reader:%0A if line%5B0%5D%5B-1%5D == %22:%22:%0A out.write(%22 %22.join(line))%0A %0Af.close()%0Aout.close()%0A
389aa32dae9635bfc0eff192c9f01ab99e04b0f2
Create main.py
main.py
main.py
Python
0.000001
@@ -0,0 +1,1973 @@ +#controlling a robot with two motors that can avoid obstacles by using a sonar mounted on pan/tilt servos%0A%0Aimport motorcontrol, servocontrol, sonarcontrol, auxiliary%0Aimport time%0A%0A#instantiate objects%0Amotor = motorcontrol.MotorControl()%0Aservo = servocontrol.ServoControl()%0Asonar = sona...
cdbc14e6f78ca7b05e291a007c4267dd55d9b96a
add `enums.py`
todo/enums.py
todo/enums.py
Python
0.000007
@@ -0,0 +1,172 @@ +%22%22%22Enums are defined here%22%22%22%0Afrom enum import Enum, auto%0A%0A%0Aclass Status(Enum):%0A %22%22%22Enum for Task status%22%22%22%0A TO_DO = auto()%0A IN_PROGRESS = auto()%0A DONE = auto()%0A
34d7758b4a04b6cdc44a763cb1da194d4168b833
Correct expose_by_default interaction with expose_domains (#17745)
homeassistant/components/google_assistant/http.py
homeassistant/components/google_assistant/http.py
""" Support for Google Actions Smart Home Control. For more details about this component, please refer to the documentation at https://home-assistant.io/components/google_assistant/ """ import logging from aiohttp.web import Request, Response # Typing imports from homeassistant.components.http import HomeAssistantVi...
Python
0
@@ -1440,19 +1440,18 @@ default -and +or entity.
f03079f2fd200d9b726c70acec9cdfd8772adb26
Add support for arm64 as a CR architecture.
tools/cr/cr/base/arch.py
tools/cr/cr/base/arch.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A module for the basic architectures supported by cr.""" import cr DEFAULT = cr.Config.From( CR_ENVSETUP_ARCH='{CR_ARCH}', ) class Arch(cr.Plugin,...
Python
0.000005
@@ -1340,28 +1340,205 @@ orm.GetInstance().is_active%0A +%0A%0Aclass Arm64Arch(Arch):%0A%0A ACTIVE = cr.Config.From(%0A CR_ENVSETUP_ARCH='arm64',%0A )%0A%0A @property%0A def enabled(self):%0A return cr.AndroidPlatform.GetInstance().is_active%0A
64140f651b22b4b962368a53723cb4bda86651ba
test branch
test.py
test.py
Python
0.000002
@@ -0,0 +1,21 @@ +#this is a test file%0A
df9122528172c5142160f9804b695d65bd211892
Create QAStats.py
QAStats.py
QAStats.py
Python
0
@@ -0,0 +1,190 @@ +# Calculating statistics on Q&A communities. Includes temporal statistics ( for example, how many questions were asked in a period), spatial statistics, number of users, questions, answers.%0A
9add66f49ae0daa28db84e36bf2ac8675125d21c
Remove instructional comments
urls.py
urls.py
from django.conf.urls.defaults import * from django.contrib import admin from django.views.generic.simple import direct_to_template admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^authentic/', include('authentic.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.adm...
Python
0
@@ -178,278 +178,8 @@ '',%0A - # Example:%0A # (r'%5Eauthentic/', include('authentic.foo.urls')),%0A%0A # Uncomment the admin/doc line below and add 'django.contrib.admindocs' %0A # to INSTALLED_APPS to enable admin documentation:%0A # (r'%5Eadmin/doc/', include('django.contrib.admindocs.urls')),%0A%0A ...