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 |
|---|---|---|---|---|---|---|---|
408be8a0d49b7542c74e016a572499a8c4d85351 | Add tests to verify team index and add pages render without errors | app/teams/tests.py | app/teams/tests.py | Python | 0 | @@ -0,0 +1,349 @@
+from app.test_base import BaseTestCase%0A%0Aclass TestTeamBehavior(BaseTestCase):%0A def test_index_page_200(self):%0A self.login()%0A response = self.client.get('/teams/')%0A self.assert200(response)%0A%0A def test_add_page_200(self):%0A self.login()%0A respo... | |
5ce6283cff4a3a97911a663d777869a7c7377341 | add http_codes | catalogService/http_codes.py | catalogService/http_codes.py | Python | 0.000004 | @@ -0,0 +1,1345 @@
+#%0A# Copyright (c) 2008 rPath, Inc.%0A#%0A%0AHTTP_CONTINUE = 100%0AHTTP_SWITCHING_PROTOCOLS = 101%0AHTTP_PROCESSING = 102%0AHTTP_OK = 200%0AHTTP_CREATED = 201%0AHTTP_ACCEPTED = 202%0AHTTP_NON_AUTHORITATIVE = 203%0AHTTP_NO_CONTENT = 204%0AHTTP_RESET_CONTENT = 205%0AHTTP_PARTIAL_CONTENT = 206%0AHTTP_... | |
5c602a98098bdedeffc2b7359a4b3d8407cb1449 | Add migration to ensure consistency on file keys. | scripts/migrate_inconsistent_file_keys.py | scripts/migrate_inconsistent_file_keys.py | Python | 0 | @@ -0,0 +1,2699 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%22%22%22Find all nodes with different sets of keys for %60files_current%60 and%0A%60files_versions%60, and ensure that all keys present in the former are also%0Apresent in the latter.%0A%22%22%22%0A%0Afrom website.models import Node%0Afrom website.app imp... | |
e5e6506ab6b5191e309aa75e56e25253c0ba7763 | Create drivers.py | chips/memory/file/drivers.py | chips/memory/file/drivers.py | Python | 0.000001 | @@ -0,0 +1,116 @@
+# This code has to be added to the corresponding __init__.py%0A%0ADRIVERS%5B%22filememory%22%5D = %5B%22PICKLEFILE%22, %22JSONFILE%22%5D%0A%0A
| |
386baa36355b0e9378fff59fe768d1baa7e73fec | Add Himax motion detection example. | scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/himax_motion_detection.py | scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/himax_motion_detection.py | Python | 0 | @@ -0,0 +1,914 @@
+# Himax motion detection example.%0A%0Aimport sensor, image, time, pyb%0Afrom pyb import Pin, ExtInt%0A%0Asensor.reset()%0Asensor.set_pixformat(sensor.GRAYSCALE)%0Asensor.set_framesize(sensor.QVGA)%0Asensor.set_framerate(15)%0A%0Asensor.ioctl(sensor.IOCTL_HIMAX_MD_THRESHOLD, 0x01)%0Asensor.ioctl(sens... | |
b1ab4ef6fbac0ce02d05464e03599d44721fb239 | Add an example using partial. | examples/partial.py | examples/partial.py | Python | 0.000001 | @@ -0,0 +1,905 @@
+#!/usr/bin/env python%0Afrom functools import partial%0A%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0A%0Afrom latexipy import latexipy as lp%0A%0A%0Aif __name__ == '__main__':%0A lp.latexify()%0A%0A figure = partial(lp.figure, folder='some_images', exts=%5B'png'%5D)%0A%0A x = np.... | |
e781a1e89b945dad1585f82dfdb77cbffbe8fdeb | add unit tests | lib/svtplay_dl/tests/prio_streams.py | lib/svtplay_dl/tests/prio_streams.py | Python | 0.000001 | @@ -0,0 +1,1712 @@
+#!/usr/bin/python%0A# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*-%0A# ex:ts=4:sw=4:sts=4:et:fenc=utf-8%0A%0Afrom __future__ import absolute_import%0Aimport unittest%0Afrom svtplay_dl.utils import prio_streams%0A%0Aclass Stream(object):%0A def __init__(self, proto... | |
4e4a8bbb459e6158a7c2d22c04849de9b4de2693 | Add directory.py to the directory package | classyfd/directory/directory.py | classyfd/directory/directory.py | Python | 0.000001 | @@ -0,0 +1,62 @@
+%22%22%22Contains a Directory class to represent real directories%22%22%22
| |
0c079b7160cf635c14a016d418d2bc8d3d521f26 | add docker start tool | tools/run.py | tools/run.py | Python | 0.000001 | @@ -0,0 +1,1880 @@
+# coding=utf-8%0Aimport os%0Aimport json%0A%0Aos.system(%22docker rm -f redis%22)%0Aos.system(%22docker rm -f mysql%22)%0Aos.system(%22docker rm -f oj_web_server%22)%0A%0Aif os.system(%22docker run --name mysql -v /root/data:/var/lib/mysql -v /root/data/my.cnf:/etc/my.cnf -e MYSQL_ROOT_PASSWORD=root... | |
4cf7f6c23bc9d01c6780afa4d27bf9e5e71fb72b | add hacky download | util/unidata_dl.py | util/unidata_dl.py | Python | 0 | @@ -0,0 +1,961 @@
+import glob%0Aimport os%0Aimport datetime%0A%0Asts = datetime.datetime(2016, 11, 21, 0, 0)%0Aets = datetime.datetime(2016, 11, 21, 3, 0)%0Ainterval = datetime.timedelta(minutes=1)%0A%0Aos.chdir('data/nexrad/NIDS')%0Afor nexrad in glob.glob('???'):%0A os.chdir(nexrad)%0A for nids in %5B'N0Q', 'N... | |
e8799d50dea038fe6e6bb94a4676d2f6eaf1ed1d | Update judgeapi.py | judge/judgeapi.py | judge/judgeapi.py | from django.conf import settings
import socket
import struct
import json
import logging
from judge.simple_comet_client import delete_channel, create_channel, send_message
logger = logging.getLogger('judge.judgeapi')
size_pack = struct.Struct('!I')
def judge_request(packet, reply=True):
sock = socket.socket(soc... | Python | 0.000001 | @@ -1949,10 +1949,16 @@
E'%0A%0A
-%09%09
+
id =
@@ -1999,17 +1999,17 @@
lse (2 i
-s
+f
submiss
|
3dbf91d4d447f6dbddece040b3a9dcbeb8ebcd22 | Add missing migrations | getyourdata/data_request/migrations/0023_auto_20160716_0946.py | getyourdata/data_request/migrations/0023_auto_20160716_0946.py | Python | 0.000029 | @@ -0,0 +1,3078 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.6 on 2016-07-16 09:46%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django_extensions.db.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('data_request',... | |
ddb9e1c0160f40fe60330c247906b9b41f18be1b | Create hearthstone_way_to_legend.py | hearthstone_way_to_legend.py | hearthstone_way_to_legend.py | Python | 0.00009 | @@ -0,0 +1,793 @@
+import random,statistics%0A%0Awinrate = 0.51%0Aiterations = 100%0A%0Agames = %5B0%5D*iterations%0Apasswinstreak = 5*5 # below Rank 5%0Afor x in range(iterations):%0A %0A # 1-10 11-15 =%3E 15 rank%0A ladderPosition = 5*10 + 4*5%0A winstrek = 0%0A %0A while True:... | |
a801deeaa00e443b3c68c1fbcea1e6ff62d90082 | Add Python script to generate users | python/addusers.py | python/addusers.py | Python | 0.000003 | @@ -0,0 +1,2019 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22 %0AAdds a sequential number of users into a test database%0Awith username: newusern and password newusern%0A%0ANot for production usage%0A%22%22%22%0A%0Aimport MySQLdb%0A%0A%0Ahostname = # FILL IN %0Ausername = # FILL IN %0Apassword = # FILL... | |
6602bbfa47c2523bc4d058bfa1d5a28d5fc33836 | Add tag reading | bw_read_xml.py | bw_read_xml.py | from lxml import etree
from copy import copy
class BattWarsObject(object):
def __init__(self, obj):
self._attributes = {}
self.type = obj.get("type")
self.id = obj.get("id")
self._xml_node = obj
# We will create a name for this object by putting the type and ID together.
... | Python | 0 | @@ -901,16 +901,93 @@
name%5D%5D%0A%0A
+ def get_attr_tag(self, name):%0A return self._attributes%5Bname%5D.tag%0A%0A
# Us
@@ -2095,24 +2095,25 @@
+#
assert point
@@ -2125,16 +2125,16 @@
id_map%0A
-
%0A
@@ -2356,17 +2356,32 @@
eference
-%22
+: %25s%22 %25 obj.name
)%0A%0A r... |
7078197ff7f7d8acd5a16de0c1debda8515efdf7 | remove existed catalog directory | myriadeploy/setup_cluster.py | myriadeploy/setup_cluster.py | #!/usr/bin/env python
import socket
import subprocess
import sys
def host_port_list(workers):
return map(lambda (x,y) : str(x)+':'+str(y), workers)
def read_workers(filename):
ret = []
for line in open(filename,'r'):
line = line.strip()
# Skip blank lines or comments
if len(line) ... | Python | 0.000001 | @@ -952,24 +952,88 @@
, workers):%0A
+ args = %5B%22rm%22, %22-r%22, description%5D%0A subprocess.call(args);%0A
args = %5B
|
821f1b83c441122b28ad2dc869576ca22a4ee642 | Create ngram_service.py | ngram_utils/ngram_service.py | ngram_utils/ngram_service.py | Python | 0.000003 | @@ -0,0 +1,1115 @@
+from thrift.transport import TSocket%0Afrom thrift.protocol import TBinaryProtocol%0Afrom thrift.transport import TTransport%0Afrom libs.hbase import Hbase%0A%0Aclass NgramService(object):%0A%0A def __init__(self, mongo_host, hbase_host):%0A mclient = settings.MONGO_CLIENT%0A unigram_db = m... | |
897b56183c3b30a0bc4f439e20d42ce8da2b444c | add empty unit test for viewhandler module | supvisors/tests/test_viewhandler.py | supvisors/tests/test_viewhandler.py | Python | 0 | @@ -0,0 +1,1294 @@
+#!/usr/bin/python%0A#-*- coding: utf-8 -*-%0A%0A# ======================================================================%0A# Copyright 2016 Julien LE CLEACH%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 Licens... | |
6050610a5cf34bc55a05fa3a8d8a38f6e8e743af | Add test_ko.py for "ko" locale (#9) | tests/localization_tests/test_ko.py | tests/localization_tests/test_ko.py | Python | 0 | @@ -0,0 +1,2189 @@
+# -*- coding: utf-8 -*-%0A%0Afrom pendulum import Pendulum%0A%0Afrom .. import AbstractTestCase%0Afrom . import AbstractLocalizationTestCase%0A%0A%0A%0Aclass KoTest(AbstractLocalizationTestCase, AbstractTestCase):%0A%0A locale = 'ko'%0A%0A def diff_for_humans(self):%0A with self.wrap_wi... | |
013c6c57959fd8317ba8b27a2a467a37f0a1d8be | Create __init__.py | stock/__init__.py | stock/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
1eb1851e4dec9c6425c3cf127e6c4ec5b0d3c987 | Add LineNumberTable tests | tests/test_line_number_attribute.py | tests/test_line_number_attribute.py | Python | 0 | @@ -0,0 +1,750 @@
+# -*- coding: utf-8 -*-%0Aimport os.path%0A%0Aimport pytest%0A%0Afrom jawa import ClassFile%0A%0A%0A@pytest.fixture%0Adef cf():%0A sample_path = os.path.join(%0A os.path.dirname(__file__),%0A 'data',%0A 'HelloWorldDebug.class'%0A )%0A%0A with open(sample_path, 'rb') as f... | |
beb98425423e0278d9d4d5e39e6b5196146425a0 | add manual tests | manual_tests.py | manual_tests.py | Python | 0 | @@ -0,0 +1,2266 @@
+import os%0Aimport sys%0Aimport copy%0A%0Afrom estnin import estnin%0Afrom estnin import _estnin%0Afrom datetime import date%0Afrom timeit import default_timer as timer%0A%0A%0Adef target(count):%0A # return %5Bp for p in estnin.create(estnin.FEMALE, date(2199, 12, 1), 0)%5D%0A for _ in range(... | |
e785008aa948e929f7e3ecab3445c1347cb128f3 | Add setup.py file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,878 @@
+#!/usr/bin/env python%0A%0Afrom setuptools import find_packages%0Afrom setuptools import setup%0A%0A%0Asetup(%0A name='django-signage',%0A version='0.0.1',%0A description='A lightweight web-based digital signage application',%0A license='BSD',%0A author='Jason Bittel',%0A author_ema... | |
7a21009efda275372be7b801e07635bd2a9e47af | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,716 @@
+import os%0Afrom setuptools import setup, find_packages%0A%0Aimport coupons%0A%0A%0Adef read(fname):%0A return open(os.path.join(os.path.dirname(__file__), fname)).read()%0A%0Asetup(%0A name='django-coupons',%0A version=coupons.__version__,%0A description='A reuseable Django application f... | |
d0430066830350b3ef1621bb7c9d7ae7ae7045f4 | Add setup.py. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,852 @@
+%22%22%22%0A * Copyright (c) 2016. Mingyu Gao%0A * All rights reserved.%0A *%0A%22%22%22%0Aimport os%0Aimport re%0A# To use a consistent encoding%0Afrom codecs import open%0A# Always prefer setuptools over distutils%0Aimport setuptools%0A%0Ahere = os.path.abspath(os.path.dirname(__file__))%0A%0Apacka... | |
3f1b78f5156a6ee18020340290dde24d02d01105 | Add basic setup.py | setup.py | setup.py | Python | 0.000002 | @@ -0,0 +1,1034 @@
+%22%22%22%0AFlask-AtlassianConnect%0A-------------%0A%0AThis is the description for that library%0A%22%22%22%0Afrom setuptools import setup%0A%0A%0Asetup(%0A name='AC-Flask-HipChat',%0A version='0.1-dev',%0A url='https://bitbucket.org/mrdon/ac-flask-hipchat',%0A license='APLv2',%0A au... | |
ec25f1901d60814a62790cae2becfb6cac0f5e3e | add argparse dep | setup.py | setup.py | #!/usr/bin/python
from setuptools import setup, find_packages
setup(
name='configdb',
version='0.1',
description='database framework for configuration info',
author='ale',
author_email='ale@incal.net',
url='http://git.autistici.org/p/configdb',
install_requires=['Flask', 'formencode', 'inflect', 'SQLAlc... | Python | 0.000019 | @@ -272,16 +272,28 @@
quires=%5B
+'argparse',
'Flask',
@@ -317,16 +317,36 @@
nflect',
+%0A
'SQLAlc
|
089b020b07fda88ba4679d161badb4423a75444e | add Python setup script | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1196 @@
+# Based on PyPA sample project's setup script.%0A%0A%22%22%22Pymultihash installation script.%22%22%22%0A%0Aimport os.path%0Afrom setuptools import setup%0A%0A# Load readme file into long description.%0Athisdir = os.path.abspath(os.path.dirname(__file__))%0Awith open(os.path.join(thisdir, 'README.rs... | |
67b5eb144dbe14c134657ccc807343f361c5e249 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,223 @@
+from distutils.core import setup%0A%0Aversion = '0.1.0.dev0'%0A%0Asetup(name='sworkflow',%0A version=version,%0A description='Simple Workflow',%0A url='https://github.com/mydeco-dev-team/sworkflow',%0A packages=%5B'sworkflow'%5D,%0A)
| |
4161de9755b531825e83f684c964441bff9ffa7d | bump version to 1.0.0 | setup.py | setup.py | """
setup.py
"""
from setuptools import setup
version = "0.0.4"
setup(
name="nco",
version=version,
author="Joe Hamman",
author_email="jhamman@ucar.edu",
license="MIT",
description="""python bindings to NCO""",
packages=["nco"],
py_modules=["nco.nco", "nco.custom"],
url="https://g... | Python | 0 | @@ -56,13 +56,13 @@
= %22
+1.
0.0
-.4
%22%0A%0As
|
d0b1762a098e78ee9d012628ad96d6a18e8d2565 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,117 @@
+from distutils.core import setup%0Aimport py2exe%0A%0Asetup(console=%5B%22./server.py%22%5D, data_files=%5B('.', %5B'./config.ini'%5D)%5D)%0A
| |
7b6610e03d4485575b18881c375f83e999d20459 | Add setup.py #1 | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1446 @@
+from setuptools import setup%0Aimport io%0Aimport os%0A%0Ahere = os.path.abspath(os.path.dirname(__file__))%0A%0Adef read(*filenames, **kwargs):%0A encoding = kwargs.get('encoding', 'utf-8')%0A sep = kwargs.get('sep', '%5Cn')%0A buf = %5B%5D%0A for filename in filenames:%0A with i... | |
c43802f4cc071c6baf31f8d1461ce8c96e38fa9e | Bump greenlet==0.4.0 to support ARM architectures. | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
import os
import sys
# Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml)
if sys.platform == 'darwin':
os.environ['C_INCLU... | Python | 0 | @@ -1903,55 +1903,8 @@
= %5B%0A
- # Patched greenlet to work on ARMS%0A
@@ -1928,14 +1928,11 @@
==0.
-3.1-p1
+4.0
',%0A
|
3a6dd52e3cdfc5eca51d6dac4eb0701a1a04d550 | make version 0.3.5 | setup.py | setup.py | from setuptools import setup
setup(name='DukeDSClient',
version='0.3.4',
description='Command line tool(ddsclient) to upload/manage projects on the duke-data-service.',
url='https://github.com/Duke-GCB/DukeDSClient',
keywords='duke dds dukedataservice',
author='John Bradley',
... | Python | 0.000016 | @@ -72,17 +72,17 @@
on='0.3.
-4
+5
',%0A
|
995c75162a00b89fe23f43ec12f5e9495deb7799 | add optionnal dependancies | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:set expandtab tabstop=4 shiftwidth=4:
import os
import re
import sys
from distutils.core import setup
#some install path variables
sysconfdir = os.getenv("SYSCONFDIR", "/etc")
datarootdir = os.getenv("DATAROOTDIR", sys.prefix)
data_dir = os.path.join(sys.prefix, 's... | Python | 0 | @@ -2410,16 +2410,34 @@
scherry'
+, 'dnscherry.auth'
%5D,%0A d
@@ -2706,17 +2706,19 @@
_require
-=
+ =
%5B'pytest
@@ -2722,22 +2722,162 @@
est'
-, 'mechanize'%5D
+%5D,%0A extras_require = %7B%0A 'auth_htpasswd' : %5B'passlib'%5D,%0A 'auth_ldap' : %5B'python-ldap'%5D,%0A 'fas... |
b25e21745ecdc5c03b3229ba77ee51b5fdd1561d | Move scapy to scapyproto to avoid breaking import of scapy from inside of protocols | ooni/protocols/scapyproto.py | ooni/protocols/scapyproto.py | Python | 0 | @@ -0,0 +1,1417 @@
+import random%0Afrom zope.interface import implements%0Afrom twisted.python import usage%0Afrom twisted.plugin import IPlugin%0Afrom twisted.internet import protocol, defer%0Afrom ooni.plugoo.tests import ITest, OONITest%0Afrom ooni.plugoo.assets import Asset%0Afrom ooni.utils import log%0A%0Afrom o... | |
992191d290df8d7764a272c3b45e2f7b937456ec | add fib | misc/py3/fib.py | misc/py3/fib.py | Python | 0.999999 | @@ -0,0 +1,179 @@
+#!/usr/bin/env python%0A%0A# Python 3: Fibonacci series up to n%0A%0Adef fib(n):%0A a, b = 0, 1%0A while a %3C n:%0A print(a, end=' ')%0A a, b = b, a + b%0A print()%0A%0Afib(1000)%0A
| |
abf7b0ffd86656f8311da7bfde65663d35ffd543 | fix for using stencilview | kivy/uix/scrollview.py | kivy/uix/scrollview.py | '''
ScrollView widget
'''
__all__ = ('ScrollView', )
from kivy.uix.stencil import StencilView
from kivy.uix.scatter import ScatterPlane
class ScrollView(StencilView):
'''
ScrollView:
A ScrollView provides a scrollable/pannable viewport
which is clipped to the ScrollView's bounding box.
'... | Python | 0.000001 | @@ -7,19 +7,130 @@
roll
+
View
- widget
+%0A===========%0A%0AA ScrollView provides a scrollable/pannable viewport which is clipped to the%0AScrollView's bounding box.
%0A'''
@@ -180,16 +180,20 @@
.stencil
+view
import
@@ -286,21 +286,16 @@
%0A '''
-%0A
ScrollVi
@@ -300,128 +300,62 @@
View
-:%0A ... |
befa79ec76752f0811b49ec323813e6e1931638d | Create solution.py | hackerrank/algorithms/implementation/medium/bigger_is_greater/py/solution.py | hackerrank/algorithms/implementation/medium/bigger_is_greater/py/solution.py | Python | 0.000018 | @@ -0,0 +1,832 @@
+def solution(s):%0A #%0A # The next permutation algorithm. For more information, please look up:%0A # %5Bhref.%5D https://www.nayuki.io/page/next-lexicographical-permutation-algorithm%0A # %5Bhref.%5D https://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order%0A #%0A ... | |
df8ddd56ad51f0a644696cb0ff12c2e7a17c5913 | Create lonely-pixel-i.py | Python/lonely-pixel-i.py | Python/lonely-pixel-i.py | Python | 0.00022 | @@ -0,0 +1,960 @@
+# Time: O(m * n)%0A# Space: O(m + n)%0A%0Aclass Solution(object):%0A def findLonelyPixel(self, picture):%0A %22%22%22%0A :type picture: List%5BList%5Bstr%5D%5D%0A :rtype: int%0A %22%22%22%0A rows, cols = %5B0%5D * len(picture), %5B0%5D * len(picture%5B0%5D)%0A ... | |
c1dcb46e95d5b96ecf45db2e1f466b6f99330e1c | Add VimwikiTask cache-ing | taskwiki/cache.py | taskwiki/cache.py | import copy
import vim
class TaskCache(object):
"""
A cache that holds all the tasks in the given file and prevents
multiple redundant taskwarrior calls.
"""
def __init__(self, tw):
self.cache = dict()
self.tw = tw
def __getitem__(self, key):
task = self.cache.get(key... | Python | 0 | @@ -203,32 +203,77 @@
):%0A self.
+task_cache = dict()%0A self.vimwikitask_
cache = dict()%0A
@@ -325,16 +325,108 @@
, key):%0A
+ # String keys refer to the Task objects%0A if type(key) in (str, unicode):%0A
@@ -433,24 +433,29 @@
task = self.
+task_
cache.get(ke
@@ -458,1... |
67c3c0e3c165dc73f548cff57d6cb390614d5aad | Bring back old watcher module | virtool/watcher.py | virtool/watcher.py | Python | 0 | @@ -0,0 +1,2525 @@
+import os%0Aimport time%0Aimport logging%0A%0Afrom virtool.utils import file_stats%0Afrom setproctitle import setproctitle%0Afrom multiprocessing import Process%0Afrom inotify.adapters import Inotify%0A%0Alogger = logging.getLogger(__name__)%0A%0ATYPE_NAME_DICT = %7B%0A %22IN_CREATE%22: %22create... | |
4d08ff430eba96ebef3f0824fe83f5bc2a236675 | add share_mem | multiprocessing/share_mem.py | multiprocessing/share_mem.py | Python | 0 | @@ -0,0 +1,357 @@
+#!/usr/bin/env python%0A%0Afrom multiprocessing import Process, Value, Array%0A%0Adef f(n, a):%0A n.value = 3.1415927%0A for i in range(len(a)):%0A a%5Bi%5D = -a%5Bi%5D%0A%0Aif __name__ == '__main__':%0A num = Value('d', 0.0)%0A arr = Array('i', range(10))%0A%0A p = Process(targ... | |
119aabe89912c324d1588601c9cbc4b4a48e16ae | Add restarting_flup.py | restarting_flup.py | restarting_flup.py | Python | 0.000007 | @@ -0,0 +1,870 @@
+#!/usr/bin/env python%0A%22%22%22%0A%0AThis is the same as the usual .fcgi file%5B1%5D for using FastCGI with flup,%0Aexcept that this one terminates itself when the .fcgi file%E2%80%99s modification%0Adate changes. Assuming you have something%5B2%5D that restarts FastCGI processes%0Aas needed (which... | |
7496159322a173bb6265aed2dac4e50ad64de858 | Add base fullfill service | service.py | service.py | Python | 0 | @@ -0,0 +1,458 @@
+from flask import Flask%0Afrom flask import jsonify%0Afrom flask import request%0A%0Aapp = Flask(__name__)%0A%0A@app.route(%22/chainBot%22, methods=%5B'POST'%5D)%0Adef chainBot():%0A print(request.data)%0A return jsonify(%7B%0A %22speech%22: %22My Test Speech%22,%0A %22displayText... | |
837fd89008a430282f663e64fc03ce3df84018c6 | Use build/repack_action.gypi instead of doing it manually. | chromecast/chromecast.gyp | chromecast/chromecast.gyp | # Copyright 2014 The Chromium Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
'chromecast_branding%': 'Chromium',
},
'target_defaults': {
'include_dirs': [
'..', # Root of C... | Python | 0.000002 | @@ -2174,100 +2174,8 @@
%5D,%0A
- 'variables': %7B%0A 'repack_path': '../tools/grit/grit/format/repack.py',%0A %7D,%0A
@@ -3113,90 +3113,54 @@
-%7D,%0A 'in
+ 'pak_out
put
-s
':
-%5B%0A '%3C(repack_path)',%0A '%3C@(pak_inputs)
+'%3C(PRODUCT_DIR)/cast_shel... |
5b01f26d92a32964bcc97cbf9429177bce7c89be | add tests for progress indicator | tests/test_util.py | tests/test_util.py | Python | 0 | @@ -0,0 +1,624 @@
+# -*- coding: utf-8 -*-%0Afrom StringIO import StringIO%0Afrom biseqt.util import ProgressIndicator%0A%0A%0Adef test_progress_indicator():%0A logs = StringIO()%0A ProgressIndicator.write = lambda self, message: logs.write(message)%0A%0A indic = ProgressIndicator(num_total=1)%0A indic.star... | |
de7aee058348c00d2cdf244df102010b422e941b | Add a place holder for the PSNR metric | toolbox/metrics.py | toolbox/metrics.py | Python | 0.000009 | @@ -0,0 +1,56 @@
+def psnr(y_true, y_pred):%0A raise NotImplementedError%0A
| |
0da51215709f338e77acfa6e7933595d0c1df95d | Create SIP OPTIONS sender/receiver. | networks/sip.py | networks/sip.py | Python | 0 | @@ -0,0 +1,2246 @@
+# -*- coding: utf-8 -*-%0A%0Aimport argparse%0Aimport socket%0A%0ACRLF = '%5Cr%5Cn'%0A%0A%0Adef send_sip_options(server_host, server_port, client_host, client_port, verbose=True):%0A %22%22%22Sends SIP OPTIONS.%0A%0A :param str server_host: SIP server host (IP address).%0A :param int server... | |
3b9a0c0b83dda484586ea9c19091b7da1cae55d1 | prepare a test file for python | test_riak3k.py | test_riak3k.py | Python | 0.000002 | @@ -0,0 +1,99 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0Aimport nose%0Afrom nose.tools import *%0A%0Aimport riak3k%0A
| |
17c9e1a16c5c16c1b49836cc376ddd6408b73de0 | make the dispatcher a global variable and the deprecation warning more developer friendly | coherence/extern/louie.py | coherence/extern/louie.py | """
Wrapper module for the louie implementation
"""
import warnings
from coherence.dispatcher import Dispatcher
class Any(object): pass
class All(object): pass
class Anonymous(object): pass
# fake the API
class Dummy(object): pass
signal = Dummy()
sender = Dummy()
#senders
sender.Anonymous = Anonymous
sender.A... | Python | 0 | @@ -835,16 +835,42 @@
urn %5B%5D%0A%0A
+global _global_dispatcher%0A
_global_
@@ -930,16 +930,145 @@
l = %7B%7D%0A%0A
+def _display_deprecation_warning():%0A warnings.warn(%22extern.louie will soon be deprecated in favor of coherence.dispatcher.%22)%0A%0A
def conn
@@ -1295,83 +1295,37 @@
-warnings.warn(%22... |
7cf653b7f132b35a69230fcf32dc88bd1b7e29d1 | OrderWidget.is_hidden should evaluate False | mezzanine/core/forms.py | mezzanine/core/forms.py | from __future__ import unicode_literals
from future.builtins import str
from uuid import uuid4
from django import forms
from django.forms.extras.widgets import SelectDateWidget
from django.utils.safestring import mark_safe
from mezzanine.conf import settings
class Html5Mixin(object):
"""
Mixin for form cla... | Python | 0.999999 | @@ -1839,32 +1839,94 @@
field.%0A %22%22%22%0A
+%0A @property%0A def is_hidden(self):%0A return False%0A%0A
def render(s
|
0475e35bb6e0bab1d61c038ddd902e32478211d7 | Create whois.py | whois.py | whois.py | Python | 0.000003 | @@ -0,0 +1,277 @@
+# %E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%9A%E0%B8%97%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B9%84%E0%B8%94%E0%B9%89%E0%B8%97%E0%B8%B5%E0%B9%88 https://python3.wannaphong.com/2016/12/%E0%B8%94%E0%B8%B6%E0%B8%87%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5-whois-%E0%B9%82%E0%B8%94%E0%B9%8... | |
47f0edcbe4dd4902e679d4f1e384be1795c3d465 | Add str() calls around messages in tty | lib/spack/spack/tty.py | lib/spack/spack/tty.py | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Python | 0.000001 | @@ -1515,32 +1515,36 @@
format, cescape(
+str(
message)))%0A f
@@ -1537,16 +1537,17 @@
ssage)))
+)
%0A for
@@ -1654,31 +1654,36 @@
info(
+str(
message
+)
, *args, for
@@ -1752,31 +1752,36 @@
%22Debug: %22 +
+str(
message
+)
, *args, for
@@ -1836,31 +1836,36 @@
%22Error: %22 +
+str(
message
+)... |
416872a1e7191f62dd2353f3e221a9e9c93c161f | Add tests for utils. | test_utils.py | test_utils.py | Python | 0 | @@ -0,0 +1,1165 @@
+%22%22%22%0ATests for the utils.py file%0A%22%22%22%0Aimport axelrod as axl%0Aimport unittest%0Aimport utils%0Aimport tempfile%0Aimport csv%0A%0Aclass TestUtils(unittest.TestCase):%0A %22%22%22%0A Simple tests for the utils%0A %22%22%22%0A%0A axl.seed(0)%0A players = %5Bs() for s in a... | |
b28ace414c7087936ec14665026b78413b1f3791 | Create __init__.py | neutron_dynamic_routing/neutron/cmd/eventlet/agents/__init__.py | neutron_dynamic_routing/neutron/cmd/eventlet/agents/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
bf7ad11cc32af83aab6496ac7d7b911bea3d7876 | Use new API. | l10n_it_pec/model/partner.py | l10n_it_pec/model/partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Associazione Odoo Italia
# (<http://www.openerp-italia.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... | Python | 0 | @@ -972,31 +972,30 @@
nerp
-.osv
import
+ models,
fields
-, orm
%0A%0A%0Ac
@@ -1014,11 +1014,14 @@
ner(
-orm
+models
.Mod
@@ -1058,42 +1058,21 @@
er%22%0A
+%0A
-_columns = %7B%0A '
pec_mail
': f
@@ -1071,18 +1071,18 @@
mail
-':
+ =
fields.
char
@@ -1081,50 +1081,28 @@
lds.
-c
+C
har(
-%0A ... |
489d883af246e7de727ea14e01ae4a0cd17f88eb | fix emoji on python3.4 | limbo/plugins/emoji.py | limbo/plugins/emoji.py | """!emoji <n> will return n random emoji"""
import re
import random
from emojicodedict import emojiCodeDict
def randomelt(dic):
keys = dic.keys()
i = random.randint(0, len(keys) - 1)
return dic[keys[i]]
def emoji(n=1):
emoji = []
for i in range(n):
emoji.append(randomelt(emojiCodeDict))
... | Python | 0 | @@ -133,16 +133,21 @@
keys =
+list(
dic.keys
@@ -148,16 +148,17 @@
c.keys()
+)
%0A i =
|
b35908d8ed8257bfde75953c360112f87c0eccd3 | add api/urls.py | django_comments_xtd/api/urls.py | django_comments_xtd/api/urls.py | Python | 0 | @@ -0,0 +1,838 @@
+from django.urls import path, re_path%0A%0Afrom .views import (%0A CommentCount, CommentCreate, CommentList,%0A CreateReportFlag, ToggleFeedbackFlag,%0A preview_user_avatar,%0A)%0A%0Aurlpatterns = %5B%0A path('comment/', CommentCreate.as_view(),%0A name='comments-xtd-api-create'),... | |
4a9a844353a565a596148e31c17dad6b57cda081 | Add text encoding functionality. | txtencoding.py | txtencoding.py | Python | 0.000001 | @@ -0,0 +1,701 @@
+#!/usr/bin/env python3%0A%0Afrom chardet.universaldetector import UniversalDetector%0A%0A%0Aclass TxtEncoding:%0A def __init__(self):%0A # inspired by https://chardet.readthedocs.org/en/latest/usage.html#example-detecting-encodings-of-multiple-files%0A self.detector = UniversalDetect... | |
ff7d96204d528e65faec8312e98fd727bd163d08 | Save and load files. | scr/model/model.py | scr/model/model.py | Python | 0 | @@ -0,0 +1,2360 @@
+# 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%22%22%22%0AModel implementation%0A%22%22%22%0A%0Aimport json%0Afrom pathlib import Path%0A%... | |
24210f31a5b54adf1b3b038fdad73b679656217c | fix mr_unit.py so that it records test failures properly | scripts/mr_unit.py | scripts/mr_unit.py | import sys, os
import csv
import MySQLdb
import traceback
def add_perf_results_to_mr_unit(args):
mr_unit = MySQLdb.connect(host='mr-0x8', user='root', passwd=args[1], db='mr_unit')
mr_unit.autocommit(False)
cursor = mr_unit.cursor()
try:
for row in csv.reader(file(os.path.join(args[2], "perf.cs... | Python | 0.000001 | @@ -410,66 +410,8 @@
-1%5D%0A
- row%5B8%5D = %22TRUE%22 if row%5B8%5D == %221%22 else %22FALSE%22%0A
@@ -687,11 +687,13 @@
%7D%22,
+%22
%7B8%7D
+%22
, %22%7B
|
f424001f409fd35b0e62be9a82d62b21b438e082 | Add missing comma | onetime/urls.py | onetime/urls.py | from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
from onetime.views import cleanup, login
urlpatterns = patterns(''
(r'^cleanup/$', cleanup),
(r'^(?P<key>[a-z0-9+])$', login),
(r'^$', redirect_to, {'url': None}),
)
| Python | 0.999998 | @@ -153,16 +153,17 @@
terns(''
+,
%0A (r'
|
8d88bf0808c5249d2c1feace5b8a1db1679e44b6 | Create tests_unit.py | tests_unit.py | tests_unit.py | Python | 0.000003 | @@ -0,0 +1,2416 @@
+%22%22%22%0ANmeta2 Unit Tests%0A%0AUses pytest, install with:%0A sudo apt-get install python-pytest%0A%0ATo run test, type in:%0A py.test tests_unit.py%0A%0A%22%22%22%0A%0A#*** Testing imports:%0Aimport mock%0Aimport unittest%0A%0A#*** Ryu imports:%0Afrom ryu.base import app_manager # To supp... | |
cba429780061bcdafde6f2bc799e74106e2cc336 | Create textevolve.py | textevolve.py | textevolve.py | Python | 0.000001 | @@ -0,0 +1,750 @@
+'''%0AEvolve a piece of text with a simple evolutionary algorithm%0AAuthor: Saquib%0A7/27/13%0A'''%0Aimport random%0A%0Adef fitness(source, target):%0A fitval = 0%0A for i in range(0, len(source)):%0A fitval += (ord(target%5Bi%5D) - ord(source%5Bi%5D)) ** 2%0A return(fitval)%0A%0Adef mutat... | |
ff98bdf9ce263648de784183ad5984864f9d387a | Add ref create api test | tests/api/test_refs.py | tests/api/test_refs.py | Python | 0.000001 | @@ -0,0 +1,883 @@
+async def test_create(spawn_client, test_random_alphanumeric, static_time):%0A client = await spawn_client(authorize=True, permissions=%5B%22create_ref%22%5D)%0A%0A data = %7B%0A %22name%22: %22Test Viruses%22,%0A %22description%22: %22A bunch of viruses used for testing%22,%0A ... | |
7d21b55f2de7cd2c34cd3cd985824178d382398d | add 'stages' code | util/stages.py | util/stages.py | Python | 0.000123 | @@ -0,0 +1,989 @@
+from astrometry.util.file import *%0A%0Aclass CallGlobal(object):%0A%09def __init__(self, pattern, *args, **kwargs):%0A%09%09self.pat = pattern%0A%09%09self.args = args%0A%09%09self.kwargs = kwargs%0A%09def __call__(self, stage, kwargs):%0A%09%09func = self.pat %25 stage%0A%09%09kwa = self.kwargs.cop... | |
6a9447b6fb92369496178b1a379c724dfa9eb7aa | add management command to bootstrap Twilio gateway fees for incoming messages | corehq/apps/smsbillables/management/commands/bootstrap_twilio_gateway_incoming.py | corehq/apps/smsbillables/management/commands/bootstrap_twilio_gateway_incoming.py | Python | 0 | @@ -0,0 +1,1246 @@
+import logging%0A%0Afrom django.core.management.base import LabelCommand%0A%0Afrom corehq.apps.accounting.models import Currency%0Afrom corehq.apps.twilio.models import TwilioBackend%0Afrom corehq.apps.sms.models import INCOMING%0Afrom corehq.apps.smsbillables.models import SmsGatewayFee, SmsGateway... | |
adee3f0763a1119cfac212ce0eca88a08f7c65fa | Create masterStock.py | masterStock.py | masterStock.py | Python | 0 | @@ -0,0 +1,711 @@
+import requests%0Afrom bs4 import BeautifulSoup%0Aimport json%0A%0Adef loadMasterStock():%0A%09url = %22http://www.supremenewyork.com/mobile_stock.json%22%0A%09user = %7B%22User-Agent%22: %22Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 ... | |
d06b3b41f786fc7cd2c05a6215fed026eef1cb8f | Add misc plugin. | curiosity/plugins/misc.py | curiosity/plugins/misc.py | Python | 0 | @@ -0,0 +1,1045 @@
+import curio%0Aimport sys%0A%0Aimport curious%0Afrom curious.commands import command%0Afrom curious.commands.context import Context%0Afrom curious.commands.plugin import Plugin%0Afrom curious.dataclasses.embed import Embed%0A%0A%0Aclass Misc(Plugin):%0A %22%22%22%0A Miscellaneous commands.%0A ... | |
3d7a1ad963a11c8fc425c7d82f5e0f8f877dc861 | Add Python benchmark | lib/node_modules/@stdlib/math/base/special/atan2/benchmark/python/benchmark.py | lib/node_modules/@stdlib/math/base/special/atan2/benchmark/python/benchmark.py | Python | 0.000138 | @@ -0,0 +1,1536 @@
+#!/usr/bin/env python%0A%22%22%22Benchmark atan2.%22%22%22%0A%0Aimport timeit%0A%0Aname = %22atan2%22%0Arepeats = 3%0Aiterations = 1000000%0A%0A%0Adef print_version():%0A %22%22%22Print the TAP version.%22%22%22%0A%0A print(%22TAP version 13%22)%0A%0A%0Adef print_summary(total, passing):%0A ... | |
14160c8ee729a094b6a980ed7c94b37d11f6dfba | Create xor_recursive.py | tests/xor_recursive.py | tests/xor_recursive.py | Python | 0 | @@ -0,0 +1,1419 @@
+import sys%0A%0Adef xor(*store):%0A print(%22---------------recursive call----------------%22)%0A print(len(store))%0A if(len(store) == 2):%0A print(%22lowest level%22)%0A b = store%5B0%5D%0A a = store%5B1%5D%0A print(b)%0A print(a)%0A return bool((a or b) and not(a and b))%0A ... | |
d003babe55d8b7a202a50bc6eeb2e1113ef8247f | Add oeis plugin | plugins/oeis.py | plugins/oeis.py | Python | 0 | @@ -0,0 +1,1506 @@
+import requests%0Aimport re%0A%0A%0Aclass Plugin:%0A limit = 5%0A%0A def on_command(self, bot, msg, stdin, stdout, reply):%0A session = smartbot.utils.web.requests_session()%0A url = %22http://oeis.org/search%22%0A payload = %7B%0A %22fmt%22: %22text%22,%0A ... | |
c122db5ceda59d786bd550f586ea87d808595ab6 | Add a script to reimport the LGA boundaries from the GADM.org data | pombola/nigeria/management/commands/nigeria_update_lga_boundaries_from_gadm.py | pombola/nigeria/management/commands/nigeria_update_lga_boundaries_from_gadm.py | Python | 0.000022 | @@ -0,0 +1,2077 @@
+from django.contrib.gis.gdal import DataSource%0Afrom django.core.management import BaseCommand%0Afrom django.db import transaction%0A%0Afrom mapit.management.command_utils import save_polygons, fix_invalid_geos_geometry%0Afrom mapit.models import Area, Type%0A%0Aclass Command(BaseCommand):%0A he... | |
271be0bf16692aae2736d40e96447262e75c4a0f | add missing web.py | zmq/web.py | zmq/web.py | Python | 0 | @@ -0,0 +1,542 @@
+#-----------------------------------------------------------------------------%0A# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley%0A#%0A# This file is part of pyzmq%0A#%0A# Distributed under the terms of the New BSD License. The full license is in%0A# the file COPYING.BSD, distributed as par... | |
0a7f1695f9155bbe10b933e47637e4df0e2e31d4 | Create HttpAndWeb.py | day3/HttpAndWeb.py | day3/HttpAndWeb.py | Python | 0.000002 | @@ -0,0 +1,1183 @@
+import requests%0A%0A%0Adef Get(url, PostId):%0A%09try:%0A%09%09isinstance(int(PostId), int)%0A%09%09if int(PostId) %3C= 100 and int(PostId) %3E 0:%0A%09%09%09r = requests.get(url + PostId)%0A%09%09%09return r%0A%09%09else:%0A%09%09%09print(%22Number must be between 1 and 100%22)%0A%09except ValueEr... | |
9fa6ec498d70afdb4f28410d4ac7c29780c60861 | Add first stab at origen submodule | transmutagen/origen.py | transmutagen/origen.py | Python | 0.000001 | @@ -0,0 +1,1120 @@
+from subprocess import run%0A%0Afrom pyne.origen22 import (nlibs, write_tape5_irradiation, write_tape4,%0A parse_tape9, merge_tape9, write_tape9)%0Afrom pyne.material import from_atom_frac%0A%0Aif __name__ == '__main__':%0A ORIGEN = '/home/origen22/code/o2_therm_linux.exe'%0A%0A xs_TAPE9 = ... | |
72f9d74fe6503de45e7251460d5419eebcabfb7e | Add files via upload | old/hefesto_temp_fix.py | old/hefesto_temp_fix.py | Python | 0 | @@ -0,0 +1,1250 @@
+import os%0A%0A%0A%0A%0A%0A%0Adef replace_temp(inputfile_folder):%0A os.chdir(inputfile_folder)%0A home_dir = os.getcwd()%0A for i in os.listdir(os.getcwd()):%0A if os.path.isdir(i):%0A os.chdir(i)%0A print(%22In folder: %7B%7D%22.format(os.getcwd()))%0A ... | |
816872186966186eb463d1fd45bea3a4c6f68e00 | Add new sanity test for demoproject views | demoproject/tests_demo.py | demoproject/tests_demo.py | Python | 0 | @@ -0,0 +1,673 @@
+from demoproject.urls import urlpatterns%0Afrom django.test import Client, TestCase%0A%0A%0Aclass DemoProject_TestCase(TestCase):%0A def setUp(self):%0A self.client = Client()%0A%0A def test_all_views_load(self):%0A %22%22%22%0A A simple sanity test to make sure all vie... | |
2cdf9728bd185fa7a32e4a7f758311594245fae0 | Add proc_suffixes_file.py | file_path/proc_suffixes_file.py | file_path/proc_suffixes_file.py | Python | 0.000001 | @@ -0,0 +1,1561 @@
+#!/usr/bin/env python%0Aimport os%0Aimport re%0Aimport sys%0A%0ASUFFIX_PAT = re.compile(r'(?P%3CFILE%3E%5Ba-zA-z0-9%5D+)_%5Cd+%5Cb')%0ASUFFIXED_LIST = %5B%5D%0A%0A%0Adef is_suffixed_file(dir_path, file_name):%0A base_name, ext_name = os.path.splitext(file_name)%0A match_obj = SUFFIX_PAT.match(... | |
286c9c8a6618fc0a87dbe1b50787331986155940 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
959aecd612f66eee22e179f985227dbb6e63202a | Move buckling calcs to continuum_analysis | __init__.py | __init__.py | Python | 0 | @@ -0,0 +1,165 @@
+from abaqus_model import *%0D%0Afrom abaqus_postproc import *%0D%0Afrom continuum_analysis import *%0D%0Afrom rayleighritz import RayleighRitzDiscrete%0D%0Afrom stiffcalc import *%0D%0A
| |
6d2735035d7230e6a709f66be93b760531a42868 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
662b0754ea73ef9dc19c50ac8d9b3e2aaa7fbb02 | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
6c42f104c8248b8e64aa72c1783ece510c6f9fac | fix repr formatting | djangae/core/paginator.py | djangae/core/paginator.py | import collections
from django.utils import six
from django.core.paginator import PageNotAnInteger, EmptyPage
class DatastorePaginator(object):
"""
A paginator which only supports previous/next page controls and avoids doing
expensive count() calls on datastore-backed queries.
Does not implement the... | Python | 0.000003 | @@ -2688,16 +2688,18 @@
cts
-%25s
+%7B0%7D
to
-%25s
+%7B1%7D
%3E'.f
|
05a6080eed951f80da3b6f7ee4962101884f328e | add testing utility for checking term lookback windows | zipline/pipeline/factors/testing.py | zipline/pipeline/factors/testing.py | Python | 0 | @@ -0,0 +1,2413 @@
+import numpy as np%0A%0Afrom zipline.testing.predicates import assert_equal%0Afrom .factor import CustomFactor%0A%0A%0Aclass IDBox(object):%0A %22%22%22A wrapper that hashs to the id of the underlying object and compares%0A equality on the id of the underlying.%0A%0A Parameters%0A ------... | |
d3a684b06d2d61f2a498346f78a5cbbabd7828e7 | Create elastic_search.py | misc/elastic_search.py | misc/elastic_search.py | Python | 0.000057 | @@ -0,0 +1,1025 @@
+import requests%0Aimport json%0Aimport pprint%0A%0Aes = 'http://hostt:9200/'%0Aquery = '''%0A%7B'fields': %5B'field1', 'field2',%5D,%0A 'filter': %7B'bool': %7B'must': %5B%7B'terms': %7B'field1': %5B1,%0A 2%5D%7D%7D,%0A %... | |
9db1db1d78be7a6199c145fa6bf7b29eb4f2c857 | fix iarc cron | mkt/developers/cron.py | mkt/developers/cron.py | import datetime
import logging
import cronjobs
from celery.task.sets import TaskSet
from tower import ugettext as _
import amo
import lib.iarc
from amo.utils import chunked
from mkt.constants.iarc_mappings import RATINGS
from mkt.developers.tasks import (refresh_iarc_ratings, region_email,
... | Python | 0.000329 | @@ -3265,16 +3265,19 @@
ngs_body
+.id
%5D.get(ro
|
7bf376c57cc989f382f6a1cdc6a5f956b2c73fd6 | Add pixels_with_value() | ml/img/segmentation.py | ml/img/segmentation.py | Python | 0 | @@ -0,0 +1,102 @@
+import numpy as np%0A%0A%0Adef pixels_with_value(img, val):%0A return np.all(img==np.array(val), axis=2)%0A%0A%0A
| |
13c40d631c5d0e6035ea143a68e45201691b46a5 | Create 0303_restaurant_plural_foods.py | 2019/0303_restaurant_plural_foods.py | 2019/0303_restaurant_plural_foods.py | Python | 0.999927 | @@ -0,0 +1,1439 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ANPR 2019-03-03%0Ahttps://www.npr.org/2019/03/03/699735287/sunday-puzzle-in-this-game-a-chance-to-claim-vic-tor-y%0A%0AName a popular restaurant chain in two words. %0AIts letters can be rearranged to spell some things to eat and some things to drink. %0ABoth are... | |
ed46c3887c7b51cd75d46523af7b901b79eb92fc | add import script for Milton Keynes (closes #863) | polling_stations/apps/data_collection/management/commands/import_milton_keynes.py | polling_stations/apps/data_collection/management/commands/import_milton_keynes.py | Python | 0 | @@ -0,0 +1,392 @@
+from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter%0A%0Aclass Command(BaseXpressDemocracyClubCsvImporter):%0A council_id = 'E06000042'%0A addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (1).tsv'%0A stations_name = 'parl.2017-06-08/Versio... | |
4f042e64e3155abfc4b86f61623a4d999dad0f89 | Move tinyHttpServer.py | tinyHttpServer.py | tinyHttpServer.py | Python | 0.000004 | @@ -0,0 +1,340 @@
+import SimpleHTTPServer%0Aimport SocketServer%0A%0APORT = 8080%0A%0Atry:%0A Handler = SimpleHTTPServer.SimpleHTTPRequestHandler%0A httpd = SocketServer.TCPServer((%22%22, PORT), Handler)%0A print(%22serving at port %25d%22 %25 (PORT))%0A print(%22Type Ctrl+C to quit%22)%0A httpd.serve_forev... | |
5fb6b31ea928162c5185d66381ae99c7454d33c0 | Add comb sort algorithm | sorts/comb_sort.py | sorts/comb_sort.py | Python | 0.000008 | @@ -0,0 +1,1595 @@
+%22%22%22%0AComb sort is a relatively simple sorting algorithm originally designed by Wlodzimierz Dobosiewicz in 1980.%0ALater it was rediscovered by Stephen Lacey and Richard Box in 1991. Comb sort improves on bubble sort.%0A%0AThis is pure python implementation of counting sort algorithm%0AFor doc... | |
2ed853301e8cedb72c7c07367d58e55cac23aa7c | add PI to arduino | raspi-pl2303.py | raspi-pl2303.py | Python | 0.999473 | @@ -0,0 +1,369 @@
+#!/usr/bin/env python%0A%0Aimport serial%0A%0Aprint 'RaspberryPi PL2303(USB2SerialTTL) communicate.'%0Aprint %22Copyright (c) 2015 winlin(winlin@vip.126.com)%22%0A%0Af = serial.Serial('/dev/ttyUSB0', 115200)%0A%0Awhile True:%0A v = %22Hello, Arduino, this is RaspberryPi 2.0~%22%0A f.write(v)%0A... | |
30412406b354f510a7321c3b3a159df6d7743668 | Add a database file for Loren to complete | utils/database.py | utils/database.py | Python | 0 | @@ -0,0 +1,128 @@
+import database_setup%0A%0Aassert(database_setup.is_table_set_up())%0A%0A# TODO: Create the stubs for database files%0A# Assignee: Loren%0A%0A
| |
929abedc5f971a58dfb54b706c66548609351835 | Create fair_warning.py | google-code-jam/fair_warning.py | google-code-jam/fair_warning.py | Python | 0.002125 | @@ -0,0 +1,669 @@
+%22%22%22%0Ahttps://code.google.com/codejam/contest/433101/dashboard#s=p1%0A%22%22%22%0A%0Adef gcd(a, b):%0A if b %3E a:%0A return gcd(b, a)%0A elif b == 0:%0A return a%0A else:%0A return gcd(b, a %25 b)%0A%0A%0Adef big_gcd(a):%0A return reduce(lambda x,y: gcd(x, y), ... | |
0c98d2e439a13f6979271f0386e93aca1cf255e2 | Update model_config.py | tensorflow/python/keras/saving/model_config.py | tensorflow/python/keras/saving/model_config.py | # Copyright 2018 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.000001 | @@ -1261,17 +1261,16 @@
sage:%0A
-%5C
%60%60%60%0A #
@@ -1437,9 +1437,8 @@
)%0A
-%5C
%60%60%60%0A
|
b7a019b41cbfac78ff48fe604d401921786d7459 | Add size_continuous_layer helper tests | test/viz/helpers/test_size_continuous_layer.py | test/viz/helpers/test_size_continuous_layer.py | Python | 0.000001 | @@ -0,0 +1,2520 @@
+import unittest%0Afrom unittest.mock import Mock%0Afrom cartoframes.viz import helpers, Source%0A%0A%0Aclass TestSizeContinuousLayerHelper(unittest.TestCase):%0A def test_helpers(self):%0A %22should be defined%22%0A self.assertNotEqual(helpers.size_continuous_layer, None)%0A%0A d... | |
e79445de75721b0d0b8ab1b6c8e24f036bf35a11 | make qsub | nexus_obj/ascii_txt.py | nexus_obj/ascii_txt.py | Python | 0.999677 | @@ -0,0 +1,700 @@
+import os%0A%0Adef qsub_file(fnames,nmpi=64,title='title',hours=2):%0A header = %22%22%22#!/bin/bash%0A#PBS -N %25s%0A#PBS -l walltime=0%25d:00:00%0A#PBS -l nodes=%25d%0A%0A#PBS -A mat158%0A#PBS -j oe%0A#PBS -k n%0Acd $%7BPBS_O_WORKDIR%7D%0Aexport OMP_NUM_THREADS=8%0A%0ABIN=~/soft/kylin_qmcpack/qmcp... | |
430c5301d7db50b153b0ae33f5c281506948099c | Add new package | plasTeX/Packages/afterpage.py | plasTeX/Packages/afterpage.py | Python | 0.000001 | @@ -0,0 +1,202 @@
+#!/usr/bin/env python%0A%0Afrom plasTeX import Command, Environment%0A%0Aclass afterpage(Command):%0A args = 'self:nox'%0A%0A def invoke(self, tex):%0A super(afterpage, self).invoke(tex)%0A return %5B%5D%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.