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 |
|---|---|---|---|---|---|---|---|
2b9df0394285f601c80de2b6e7c5c39006caa3ed | add deployment script for OMS PDS, see ./doc/INSTALL.rst for more details on the deployment | fabfile.py | fabfile.py | Python | 0 | @@ -0,0 +1,721 @@
+'''%0AInstall PDS%0A-----------%0A%0Adetails at oms-deploy! https://github.com/IDCubed/oms-deploy%0A'''%0A%0Afrom oms_fabric.webapp import Webapp%0A%0APDS = Webapp()%0APDS.repo_url = 'https://github.com/IDCubed/OMS-PDS'%0APDS.repo_name = 'OMS-PDS'%0A%0Adef deploy_project(instance='pds',%0A ... | |
1214755d5023331a432a2cea3224a6d117622393 | Create odrive.py | odrive.py | odrive.py | Python | 0.000002 | @@ -0,0 +1,1654 @@
+#!/usr/bin/env python%0A%0Aimport glob%0Aimport os%0Aimport re%0A%0A%0A'''%0A# tool for MoMA O drive migration%0A# will create %22artist level%22 folders and move object level folders inside%0A%0APseudo code%0A1. crawl folders 2 levels deep%0A2. for folder:%0A%09if folder matches *---*---*---* patte... | |
10bd939290f4a9195ff582addb17beed5ba08f67 | Add some examples of situations the leak detector detects. | examples.py | examples.py | Python | 0 | @@ -0,0 +1,405 @@
+%22%22%22 Some examples of what nose leak detector can detect. %22%22%22%0A%0Atry:%0A from unittest import mock%0Aexcept ImportError:%0A from mock import mock%0A%0Anew_global_mock = None%0A%0A%0Adef test_with_leaked_new_global_mock():%0A global new_global_mock%0A new_global_mock = mock.Mo... | |
cc6322683b0f98f666f0bef130fab4e7c45e07a6 | Add auxiliary python file | la/oblas/data/auxiliary.py | la/oblas/data/auxiliary.py | Python | 0.000001 | @@ -0,0 +1,581 @@
+# Copyright 2016 The Gosl Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style%0A# license that can be found in the LICENSE file.%0A%0Adef vprint(name, v):%0A l = '%25s := %5B%5Dfloat64%7B' %25 name%0A for i in range(len(v)):%0A if i %3E 0: l += ','%0A ... | |
e39ffc74a2386d58d62e1302ea0b0f2e8550cf84 | Create genetic algorithm engine: genetic.py | genetic.py | genetic.py | Python | 0.999995 | @@ -0,0 +1,1947 @@
+%0Aimport random%0Aimport statistics%0Aimport sys%0Aimport time%0A%0A%0Adef _generate_parent(length, geneSet, get_fitness):%0A genes = %5B%5D%0A while len(genes) %3C length:%0A sampleSize = min(length - len(genes), len(geneSet))%0A genes.extend(random.sample(geneSet, sampleSize))... | |
8588624502c88b89426619640acee0077332906d | Create getImgs.py | getImgs.py | getImgs.py | Python | 0 | @@ -0,0 +1,830 @@
+#%E5%9C%A8%E7%8C%AB%E6%89%91%E7%BD%91%E4%B8%8A%E7%88%AC%E5%8F%96%E4%B8%80%E4%BA%9B%E5%A5%BD%E7%9C%8B%E7%9A%84%EF%BD%9E%E5%9B%BE%E7%89%87%0A#-*-coding:utf-8-*-%0Aimport urllib2, re, urllib%0Afrom bs4 import BeautifulSoup%0A%0Adef getHtml(url):%0A header = %7B'User-Agent':'Mozilla/5.0 (X11; Ubuntu; ... | |
a6eab0de0a7b681d13462528edd0fec212452341 | Create pset1.py | pset1.py | pset1.py | Python | 0.000001 | @@ -0,0 +1,579 @@
+# PROBLEM 1 : Counting Vowels%0Acount=0%0Afor char in s:%0A if char=='a' or char=='e' or char=='i' or char=='o' or char=='u':%0A count+=1%0Aprint count%0A%0A%0A%0A# PROBLEM 2 : Counting Bobs%0Acount=0%0Afor i in range(0,len(s)-2):%0A if s%5Bi%5D=='b' and s%5Bi+1%5D=='o' and s%5Bi+2%5D=='... | |
7107149104424959f989b9bfaef48dd09391d7cc | Add lc0819_most_common_word.py | lc0819_most_common_word.py | lc0819_most_common_word.py | Python | 0.013247 | @@ -0,0 +1,1681 @@
+%22%22%22Leetcode 819. Most Common Word%0AEasy%0A%0AURL: https://leetcode.com/problems/most-common-word/%0A%0AGiven a paragraph and a list of banned words, return the most frequent word that%0Ais not in the list of banned words.%0AIt is guaranteed there is at least one word that isn't banned,%0Aand ... | |
034aaea2e8e56d24d709669f9992b0806b638621 | create a new python file test_cut_milestone.py | test/unit_test/test_cut_milestone2.py | test/unit_test/test_cut_milestone2.py | Python | 0.000011 | @@ -0,0 +1,1562 @@
+from lexos.processors.prepare.cutter import cut_by_milestone%0A%0Aclass TestMileStone:%0A def test_milestone_regular(self):%0A text_content = %22The bobcat slept all day..%22%0A milestone = %22bobcat%22%0A assert cut_by_milestone(text_content, milestone) == %5B%22The %22,%0A ... | |
6b9a0fe7181a3d80a4a88d32e895dda51923a96b | fix bug 984562 - track b2g 1.3 builds | alembic/versions/224f0fda6ecb_bug_984562-track-b2g-1_3.py | alembic/versions/224f0fda6ecb_bug_984562-track-b2g-1_3.py | Python | 0 | @@ -0,0 +1,2177 @@
+%22%22%22bug 984562 - track b2g 1.3%0A%0ARevision ID: 224f0fda6ecb%0ARevises: 4c279bec76d8%0ACreate Date: 2014-03-28 10:54:59.521434%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '224f0fda6ecb'%0Adown_revision = '4c279bec76d8'%0A%0Afrom alembic import op%0Afrom socorro.li... | |
e0786c5798b35b911193de1b4e3694b7ad8cad76 | Add unit test for generate_admin_metadata helper function | tests/test_generate_admin_metadata.py | tests/test_generate_admin_metadata.py | Python | 0.000001 | @@ -0,0 +1,516 @@
+%22%22%22Test the generate_admin_metadata helper function.%22%22%22%0A%0Adef test_generate_admin_metadata():%0A import dtoolcore%0A from dtoolcore import generate_admin_metadata%0A admin_metadata = generate_admin_metadata(%22ds-name%22, %22creator-name%22)%0A assert len(admin_metadata%5B%... | |
1db200b51d05e799b1016cdf1ed04726a3377635 | Add basic structure of rules. | rules.py | rules.py | Python | 0.000002 | @@ -0,0 +1,838 @@
+# -*- coding: utf-8 -*-%0A%0Aclass RuleDoesNotExistError(Exception):%0A %0A def __init__(self, rulename):%0A self.value = rulename%0A%0A def __str__(self):%0A return 'rule %22%7B0%7D%22 is not implemented'.format(self.value)%0A%0A def __unicode__(self):%0A return str(... | |
724dc6ff77e9494e9519cb507cf43644034d5ca6 | Integrate switch 10 and introduce couplings. | run_2.py | run_2.py | Python | 0 | @@ -0,0 +1,241 @@
+#!/usr/bin/python3%0A#%0A# start pytrain%0A#%0Aimport os%0Aimport sys%0A%0AMYDIR = os.path.dirname(sys.argv%5B0%5D)%0A%0Aos.system(MYDIR+%22/run.sh%22)%0Aif len(sys.argv)==1:%0A sys.argv.append(%2210.0.0.6%22)%0Aos.system(%22chromium http://%25s:8000/index.html%22%25(sys.argv%5B1%5D))%0A
| |
73cb99538aa48e43cfc3b2833ecf0ececee1dc42 | Add timers example | timers.py | timers.py | Python | 0.000001 | @@ -0,0 +1,383 @@
+import asyncio%0A%0A%0A@asyncio.coroutine%0Adef coro(loop):%0A yield from asyncio.sleep(0.5, loop=loop)%0A print(%22Called coro%22)%0A%0A%0A%0Aloop = asyncio.get_event_loop()%0A%0Adef cb(arg):%0A print(%22Called%22, arg)%0A%0A%0Aloop.create_task(coro(loop))%0Aloop.call_soon(cb, 1)%0Aloop.cal... | |
17af81742f5bf6473155837c655506f4509a4273 | Add buildlet/__init__.py | buildlet/__init__.py | buildlet/__init__.py | Python | 0.000021 | @@ -0,0 +1,309 @@
+# %5B%5B%5Bcog import cog; cog.outl('%22%22%22%5Cn%25s%5Cn%22%22%22' %25 file('../README.rst').read())%5D%5D%5D%0A%22%22%22%0ABuildlet - build tool like functionality as a Python module%0A===========================================================%0A%0A%22%22%22%0A# %5B%5B%5Bend%5D%5D%5D%0A%0A__autho... | |
1ed0bc1eb37b42845f42659ae00ccfbe444b0bfe | add first game | game-timeout.py | game-timeout.py | Python | 0 | @@ -0,0 +1,1510 @@
+# -*- coding: utf-8 -*-%0Afrom mcpi import minecraft, block%0Aimport time%0A%0A%0Adef buildGame(mc, y):%0A mc.postToChat(%22Begin%22)%0A mc.setting(%22world_immutable%22, True)%0A putDestination(mc, -5,y-1,5)%0A putPoint(mc, -5, y, 5)%0A putPoint(mc, -5, y, -5)%0A putPoint(mc, 5, y... | |
9c939cca65e3fbf0318e34f94021f3fa7ddb4f2d | add setup script for downloading dependencies | setup.py | setup.py | Python | 0 | @@ -0,0 +1,826 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Wed Aug 30 16:09:27 2017%0A%0ASetup script for downloading all dependencies%0A%0A@author: duc%0A%22%22%22%0A%0Aimport pip%0Aimport nltk%0A%0A%0Adependencies = %5B%0A 'certifi==2017.7.27.1',%0A 'chardet==3.0.4',%0A 'cyc... | |
4f024a5da95d7a55e055fcde89981cefcc48a9b4 | Add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1042 @@
+%22%22%22Setup script of zinnia-spam-checker-mollom%22%22%22%0Afrom setuptools import setup%0Afrom setuptools import find_packages%0A%0Asetup(%0A name='zinnia-spam-checker-akismet',%0A version='1.0.dev',%0A%0A description='Anti-spam protections for django-blog-zinnia with Mollom',%0A lon... | |
cbac3a73c628aed66800e993e3931fcb43f76dd0 | This is 0.18 | setup.py | setup.py | import os
import sys
from setuptools import setup, Extension, Feature
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
# fail safe compilation shamelessly stolen from the simplejson
# setup.py file. Original author: Bob Ip... | Python | 0.999997 | @@ -1794,17 +1794,17 @@
ion='0.1
-7
+8
',%0A
|
6c4bbb599900644055c200cfdd3a6fd2cd02a295 | add setup | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,752 @@
+from setuptools import setup, Command%0A%0A%0Aclass PyTest(Command):%0A user_options = %5B%5D%0A def initialize_options(self):%0A pass%0A%0A def finalize_options(self):%0A pass%0A%0A def run(self):%0A import sys,subprocess%0A errno = subprocess.call(%5Bsys.exec... | |
cc7ce1fb7695cb1214b0289e64cd5a0f9d3040c2 | add a TODO | magentoerpconnect/tests/test_synchronization.py | magentoerpconnect/tests/test_synchronization.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | Python | 0.000014 | @@ -1266,16 +1266,45 @@
args):%0A
+ # TODO: a dict is better%0A
if m
|
9d406dc943a3a135ad8386255bd312b0412e9fe6 | Add files via upload | Definitief/timer.py | Definitief/timer.py | Python | 0 | @@ -0,0 +1,685 @@
+import pygame%0D%0Ascreen = pygame.display.set_mode((800, 600))%0D%0Aclock = pygame.time.Clock()%0D%0A%0D%0Acounter, text = 10, '10'.rjust(3)%0D%0Apygame.time.set_timer(pygame.USEREVENT, 1000)%0D%0Afont = pygame.font.SysFont('timer', 30)%0D%0Aevent = pygame.USEREVENT%0D%0Awhile True:%0D%0A for e i... | |
61b007c4e79edd98f076ed2873d4cdca601b6202 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1051 @@
+# Copyright (c) 2017 Luiz Menezes%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without restriction, including without limitation the rights%0A# to use, co... | |
83fd46732d473132cf51f551608689e2ac4fc4c9 | Add poodle main file | poodle.py | poodle.py | Python | 0.000001 | @@ -0,0 +1,2358 @@
+import http.server%0Aimport http.client%0Aimport socketserver%0Aimport ssl%0Aimport argparse%0Aimport socket%0Aimport sys%0Aimport threading%0Asys.path.append('tests/')%0Afrom testClient import open_ssl%0Afrom pprint import pprint%0A%0ACRLF = %22%5Cr%5Cn%5Cr%5Cn%22%0A%0Aclass MyTCPHandler(socketserv... | |
063bf860b8a6b043e982d9db0f6c5cb524590752 | Create gate-puzzles.py | CiO/gate-puzzles.py | CiO/gate-puzzles.py | Python | 0.000729 | @@ -0,0 +1,722 @@
+from string import punctuation%0A%0Adef find_word(message):%0A msg = ''.join(l for l in message.lower() if not l in punctuation).split()%0A lMessage = len(msg)%0A scores = msg%5B:%5D%0A%0A for i, word in enumerate(msg):%0A lWord = len(word)%0A likeness = 0%0A for each... | |
7e5e310f0a4bd4aa3fa4313624136f52146c9bbd | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,707 @@
+import os%0Afrom setuptools import setup, find_packages%0A%0Aimport tickets%0A%0A%0Adef read(fname):%0A return open(os.path.join(os.path.dirname(__file__), fname)).read()%0A%0Asetup(%0A name='django-tickets',%0A version=tickets.__version__,%0A description='Reusable django application prov... | |
6953c04104eb4cc3eb908026f2420e3978371616 | Move working view.cwl script to doc folder | doc/viewcwl-json.py | doc/viewcwl-json.py | Python | 0 | @@ -0,0 +1,1451 @@
+#!/usr/bin/env python%0A%0Aimport fnmatch%0Aimport requests%0Aimport time%0Aimport os%0Aimport glob%0A%0A# You can alternatively define these in travis.yml as env vars or arguments%0ABASE_URL = 'https://view.commonwl.org/workflows'%0A%0A#get the cwl in l7g/cwl-version%0Amatches = %5B%5D%0Afor root, ... | |
c43a2af36172faca15d24c858fdb27c88ba6e76a | Add the main setup config file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,530 @@
+from setuptools import setup%0A%0A%0Asetup(%0A name='scrapy-corenlp',%0A version='0.1',%0A description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition',%0A url='https://github.com/vu3jej/scrapy-corenlp',%0A author='Jithesh E J',%0A author_email='mail@jithesh.n... | |
d177935aab000e0c909f85a6162d64438f009301 | add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,860 @@
+#!/usr/bin/env python%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0Asetup(%0A name=%22file2py%22,%0A packages=%5B'file2py'%5D,%0A version=%220.2.0%22,%0A author=%22Krzysztof Warunek%22,%0A author_email=%22kalmaceta@gmail.... | |
df00bcd0fbf94b35162e02a2776ee7d089a4193c | update version string | setup.py | setup.py | import sys
from distutils.core import setup, Extension
version = '0.6.0'
ext_kwds = dict(
name = "pycosat",
sources = ["pycosat.c"],
define_macros = []
)
if sys.platform != 'win32':
ext_kwds['define_macros'].append(('PYCOSAT_VERSION', '"%s"' % version))
if '--inplace' in sys.argv:
ext_kwds['defi... | Python | 0.000001 | @@ -66,16 +66,20 @@
= '0.6.0
+.dev
'%0A%0A%0Aext_
|
39fd3d75dd6dc60fb2f4fdc1cf5cf4096eade93d | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,446 @@
+%22%22%22.%22%22%22%0Afrom setuptools import setup%0A%0Asetup(%0A name=%22data-structures%22,%0A description=%22Implementations of various data structures in Python%22,%0A version=0.1,%0A author=%22Matt Favoino, Allan Liebold%22,%0A licence=%22MIT%22,%0A py_modules=%5B'linked-list'%... | |
91a851dd6516bcdd451ba187c72fe2d3eef6a3ce | make fileoperate module | utilfunc/fileoperate.py | utilfunc/fileoperate.py | Python | 0.000001 | @@ -0,0 +1,2418 @@
+# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode:nil -*-%0A# vi: set ft=python sts=4 sw=4 et:%0A%0Aimport os%0Aimport shutil%0A%0Averbose = True%0A%0Aclass DeleteFile(object):%0A %22%22%22%0A Delete file/directory%0A --------------------------------%0A Parameters:%0A ... | |
5a6af2cb6925adfe392c870c23c9e8dfcedccd06 | extract text from image | reader.py | reader.py | Python | 0.999999 | @@ -0,0 +1,1439 @@
+import http.client, urllib.request, urllib.parse, urllib.error, base64, json%0A%0A%0Adef transcribe(url):%0A subscription_key = 'a48ce7ca33e746349ab4b33a2fe054c7'%0A%0A uri_base = 'westeurope.api.cognitive.microsoft.com'%0A%0A headers = %7B%0A # Request headers.%0A 'Content-Ty... | |
4f6900033dc8bbba5f85369565ce17aa850c230c | Add an egg-ified setup | setup.py | setup.py | Python | 0.000071 | @@ -0,0 +1,312 @@
+try:%0A from setuptools import setup%0Aexcept:%0A from distutils.core import setup%0A%0Aimport forms%0A%0Asetup(%0A name='forms',%0A version=forms.version,%0A description='HTML forms framework for Nevow',%0A author='Matt Goodall',%0A author_email='matt@pollenation.net',%0A pac... | |
aee2363f6c6995a124b3c0ad358e83dc815ea808 | Remove redundant subscription fields from user model. | alembic/versions/3fc4c97dc6bd_remove_redundant_user_subscription_.py | alembic/versions/3fc4c97dc6bd_remove_redundant_user_subscription_.py | Python | 0 | @@ -0,0 +1,883 @@
+%22%22%22remove redundant user subscription fields%0A%0ARevision ID: 3fc4c97dc6bd%0ARevises: 3d723944025f%0ACreate Date: 2015-01-27 18:11:15.822193%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '3fc4c97dc6bd'%0Adown_revision = '3d723944025f'%0Abranch_labels = None%0Adepend... | |
a3e70bdd8146d4e70dc8f34396f7c537dbd4784c | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,309 @@
+from distutils.core import setup%0A%0Asetup(name='m',%0A version='0.1.0',%0A packages=%5B'm', 'm.security'%5D,%0A install_requires=%5B'WebOb%3E=1.6.1'%5D,%0A author = %22comyn%22,%0A author_email = %22me@xueming.li%22,%0A description = %22This is a very light web framewo... | |
76d2386bfa9e61ac17bca396384772ae70fb4563 | Add one liner to add ability to print a normal distribution with mean zero and varience one | gauss.py | gauss.py | Python | 0 | @@ -0,0 +1,201 @@
+#!/usr/bin/env python3 %0A%0A#Copyright 2015 BRendan Perrine%0A%0Aimport random %0A%0Arandom.seed()%0A%0Aprint (random.gauss(0,1), %22Is a normal distribution with mean zero and standard deviation and varience of one%22)%0A
| |
5653330769630c8f4f8ed88753b3886d063f9e3d | Add web example | web.py | web.py | Python | 0.000002 | @@ -0,0 +1,538 @@
+# -*- coding: utf-8 -*-%0Aimport asyncio%0Aimport os%0A%0Afrom flask import Flask%0A%0Aflask_app = Flask(__name__)%0A%0A%0A@flask_app.route('/')%0Adef hello():%0A return 'Hello World!'%0A%0A%0Aasync def main():%0A port = int(os.environ.get('PORT', 5000))%0A future_tasks = %5B%0A async... | |
4a89b6e085f363a6e848a13e857872165a781d61 | add a base setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1445 @@
+from distutils.core import setup%0Aimport os%0A%0A# Borrowed and modified from django-registration%0A# Compile the list of packages available, because distutils doesn't have%0A# an easy way to do this.%0Apackages, data_files = %5B%5D, %5B%5D%0Aroot_dir = os.path.dirname(__file__)%0Aif root_dir:%0A ... | |
9fb6d0ea74aacc77f06d36805760270854e53eba | Add missing django_libs test requirement | setup.py | setup.py | import os
from setuptools import setup, find_packages
import calendarium
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setup(
name="django-calendarium",
version=calendarium.__version__,
description=read('DESCRIP... | Python | 0.000003 | @@ -754,16 +754,39 @@
2.0.0',%0A
+ 'django_libs',%0A
|
ff000972d386b001d75cb36b161acd59a1626917 | Correct Path to PyPi Readme | setup.py | setup.py | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | Python | 0.000002 | @@ -1106,13 +1106,8 @@
en('
-PyPi-
READ
|
e611dda17f64b0d1355fbe85589b2c790db40158 | Create hello.py | hello.py | hello.py | Python | 0.999503 | @@ -0,0 +1,64 @@
+def main():%0A print(%22hello%22)%0A%0Aif __name__=='__main__':%0A main()%0A
| |
23ccab0a6d4107de250fb5e609538bb86a3aef24 | add main script runner | runner.py | runner.py | Python | 0.000001 | @@ -0,0 +1,988 @@
+import json%0Aimport urllib2%0A%0Afrom selenium import webdriver%0Afrom selenium.common.exceptions import TimeoutException%0Afrom selenium.webdriver.support.ui import WebDriverWait%0Afrom selenium.webdriver.support import expected_conditions as EC%0A%0Adrupal_site = %22http://url.toyourdrupalsite.com... | |
4e503a060023da75153438d73902d19a07e90be3 | Add the source file | PyBF.py | PyBF.py | Python | 0.000004 | @@ -0,0 +1,1336 @@
+# -*- coding: utf-8 -*-%0A%0Aimport sys%0A%0Aarray = %5B0%5D # array of bytes%0Aptr = 0 # data pointer%0A%0Adef readNoLoop(char):%0A global ptr%0A # Increment/Decrement the byte at the data pointer%0A if char=='+':%0A array%5Bptr%5D += 1%0A elif char=='-':%0A array%5Bptr%5D -= 1%0A if a... | |
7d3a1eb991e6678e8227ea7778688a0458ad5843 | Add package distribution files | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,279 @@
+#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='GCJCore',%0A version='1.0',%0A description='AppState reader for python scripts',%0A author='Yves Stadler',%0A author_email='yves.stadler@gmail.com',%0A url='',%0A packages=%5B'gcjcore'%5D,%0A ... | |
5d5806ed7b490ab79a882e8b3f966d5309db648b | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1659 @@
+%0Aimport sys%0A%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A if sys.version_info %3E (3,):%0A raise RuntimeError(%22python3 support requires setuptools%22)%0A from distutils.core import setup%0A%0A%0Ainfo = %7B%7D%0Asrc = open(%22lxmlmate.py%22)%0Alines = %5B%5... | |
addc7e79920afbef5a936b0df536bb8d5f71af99 | Add a setup script. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,228 @@
+#!/usr/bin/python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='discuss',%0A version='1.0',%0A description='Python client for Project Athena forum system',%0A author='Victor Vasiliev',%0A packages=%5B'discuss'%5D%0A )%0A
| |
3edc58673e21c7bbbfa5db07d7c6a92c76470dfc | add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1015 @@
+# -*- coding: utf-8 -*-%0A%0Afrom setuptools import setup%0A%0A%0Asetup(%0A name='sphinx-git-lowdown',%0A version='0.0.1',%0A url='https://github.com/yamahigashi/sphinx-git-lowdown',%0A # download_url='http://pypi.python.org/pypi/sphinx-git-lowdown',%0A license='Apache',%0A author=... | |
0741cd665592dc18a7880622fad83aec92093907 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,394 @@
+from setuptools import setup, find_packages%0A%0Aimport hedgehog_light%0A%0Asetup(%0A name=%22stm32flasher%22,%0A description=%22STM32 USART Flasher%22,%0A version=hedgehog_light.__version__,%0A license=%22AGPLv3%22,%0A url=%22https://github.com/PRIArobotics/STM32Flasher%22,%0A auth... | |
845660721ddcbefa4b52fe4a5f3fd3bba75c10bc | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1435 @@
+import os%0Afrom setuptools import setup%0A%0A# Utility function to read the README file.%0A# Used for the long_description. It's nice, because now 1) we have a top level%0A# README file and 2) it's easier to type in the README file than to put a raw%0A# string in below ...%0Adef read(fname):%0A ... | |
d98c66ee6a0e27485980fd336ef2ee7a2f08462c | Add setup.py for Read the Docs | setup.py | setup.py | Python | 0 | @@ -0,0 +1,322 @@
+#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='coffeestats',%0A version='0.2.1',%0A description='Coffeestats.org',%0A author='Jan Dittberner',%0A author_email='jan@dittberner.info',%0A url='https://github.com/coffeestats/coffeestats-django',%0A ... | |
2c11575e5414cca19698cc500844e7553dcc9aa8 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,566 @@
+from distutils.core import setup%0A%0A%0Asetup(name='s3viewport',%0A version='20120930',%0A description='A FUSE filesystem for viewing S3 buckets',%0A author='Brendan MacDonell',%0A author_email='brendan@macdonell.net',%0A url='https://github.com/bremac/s3viewport',%0A p... | |
02f984f7efe9481dbaa2517cfc11ec826421925f | update the version of jinja needed, 2.6 is out | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
requires = ['feedgenerator', 'jinja2 >= 2.4', 'pygments', 'docutils', 'pytz',
'blinker', 'unidecode']
try:
import argparse # NOQA
except ImportError:
requires.append('argparse')
entry_points = {
'console_scripts': [
'pelican = pelica... | Python | 0 | @@ -91,9 +91,9 @@
= 2.
-4
+6
', '
|
2e2ae8f42c46a09224fdd4d39ab317f23c96d465 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1174 @@
+import os%0Afrom setuptools import setup, find_packages%0A%0Athis_dir = os.path.abspath(os.path.dirname(__file__))%0Awith open(os.path.join(this_dir, 'README.md'), 'r') as f:%0A long_description = f.read()%0A%0Asetup(name='boa',%0A version='0.1',%0A author='Bounouar Colin',%0A main... | |
67c508d132f1ec40768a7488bc1e08e62d2208fe | Add DatabaselessTestRunner class | zc_common/databaseless_test_runner.py | zc_common/databaseless_test_runner.py | Python | 0 | @@ -0,0 +1,363 @@
+from django.test.runner import DiscoverRunner%0A%0A%0Aclass DatabaselessTestRunner(DiscoverRunner):%0A %22%22%22A test suite runner that does not set up and tear down a database.%22%22%22%0A%0A def setup_databases(self):%0A %22%22%22Overrides DjangoTestSuiteRunner%22%22%22%0A pass... | |
28fd3e9305872593a9d8167afa11ce3190b43903 | add uncollectible object sample code | profiling/snippet/uncollectible.py | profiling/snippet/uncollectible.py | Python | 0.000012 | @@ -0,0 +1,1470 @@
+from __future__ import print_function%0Aimport gc%0A%0A'''%0AThis snippet shows how to create a uncollectible object:%0AIt is an object in a cycle reference chain, in which there is an object%0Awith __del__ defined.%0AThe simpliest is an object that refers to itself and with a __del__ defined.%0A'''... | |
55637514e578421e749f90f1ae8bd782831abffb | Add ClientMesh Decoder | malwareconfig/decoders/clientmesh.py | malwareconfig/decoders/clientmesh.py | Python | 0 | @@ -0,0 +1,1267 @@
+from base64 import b64decode%0Afrom malwareconfig.common import Decoder%0Afrom malwareconfig.common import string_printable%0A%0A%0Aclass ClientMesh(Decoder):%0A decoder_name = %22ClientMesh%22%0A decoder__version = 1%0A decoder_author = %22@kevthehermit%22%0A decoder_description = %22Cl... | |
0018765068ed533bed6adaa33a7634c104850034 | Create RomanToInt_001.py | leetcode/013-Roman-to-Integer/RomanToInt_001.py | leetcode/013-Roman-to-Integer/RomanToInt_001.py | Python | 0.002185 | @@ -0,0 +1,421 @@
+class Solution(object):%0A def romanToInt(self, s):%0A %22%22%22%0A :type s: str%0A :rtype: int%0A %22%22%22%0A r2i = %7B'I':1, 'V':5, 'X':10, 'L':50, %0A 'C':100, 'D':500, 'M':1000%7D%0A%0A res = 0%0A for i in range(len(s)):%0A ... | |
180cae4ec364cf1b2bf9d1f733999a538c5f516f | Create test-events.py | test/python/test-events.py | test/python/test-events.py | Python | 0.000007 | @@ -0,0 +1,2021 @@
+import datetime%0Aimport time%0Afrom tibrv.tport import *%0Afrom tibrv.status import *%0Afrom tibrv.tport import *%0Afrom tibrv.events import *%0Afrom tibrv.disp import *%0Aimport unittest%0A%0Aclass EventTest(unittest.TestCase, TibrvMsgCallback):%0A%0A @classmethod%0A def setUpClass(cls):%0A ... | |
95fdd1f96ad4d54fb75ea134ea2195808d4c1116 | Add python script to check big-O notation | bigO.py | bigO.py | Python | 0.000001 | @@ -0,0 +1,374 @@
+import timeit%0Aimport random%0A%0Afor i in range (10000, 100000, 20000):%0A t = timeit.Timer(%22random.randrange(%25d) in x%22%25i, %22from __main__ import random, x%22)%0A%0A x = list(range(i))%0A list_time = t.timeit(number = 1000)%0A%0A x = %7Bj:None for j in range(i)%7D%0A dict_time = t.tim... | |
a0ae12ddf581eb77af5ce5c6498c26745bd2cfcb | Add script to extract code/data size after make examples. | stats.py | stats.py | Python | 0 | @@ -0,0 +1,1290 @@
+#!/usr/bin/python%0A# encoding: utf-8%0A%0Afrom __future__ import with_statement%0Aimport argparse, re, sys%0A%0Adef filter(args):%0A bytes_extractor = re.compile(r%22(%5B0-9%5D+) bytes%22)%0A with args.output:%0A with args.input:%0A for line in args.input:%0A ... | |
151a5a64aa5d0e3a2b4e63c7f07916efa087b8a2 | Create car-fleet.py | Python/car-fleet.py | Python/car-fleet.py | Python | 0.000038 | @@ -0,0 +1,1858 @@
+# Time: O(nlogn)%0A# Space: O(n)%0A%0A# N cars are going to the same destination along a one lane road.%0A# The destination is target miles away.%0A#%0A# Each car i has a constant speed speed%5Bi%5D (in miles per hour),%0A# and initial position position%5Bi%5D miles towards the target along the roa... | |
67d7f3fc03c6bc031f73b53348b140e7f24567c1 | Add opennurbs package (#6570) | var/spack/repos/builtin/packages/opennurbs/package.py | var/spack/repos/builtin/packages/opennurbs/package.py | Python | 0 | @@ -0,0 +1,2768 @@
+##############################################################################%0A# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
aa2ddd886cc344889b53eed2ca8102fe5dc0aed4 | Make tf_saved_model/debug_info.py a bit more strict. | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py | # Copyright 2019 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.001932 | @@ -1332,16 +1332,38 @@
info.py%22
+:%7B%7B%5B0-9%5D+%7D%7D:%7B%7B%5B0-9%5D+%7D%7D
%0A%0A%0Aif __
|
7b0005eb7d2b2e05a9fd833a2771573aec69c199 | Add script for comparing test vectors. | tests/compare_test_data.py | tests/compare_test_data.py | Python | 0 | @@ -0,0 +1,1941 @@
+import os%0Aimport sys%0Aimport glob%0Aimport h5py%0A%0Afrom QGL import *%0Aimport QGL%0A%0ABASE_AWG_DIR = QGL.config.AWGDir%0ABASE_TEST_DIR = './test_data/awg/'%0A%0Adef compare_sequences():%0A test_subdirs = %5B'TestAPS1', 'TestAPS2'%5D%0A for subdir in test_subdirs:%0A testdirs = glo... | |
bf9a5c6f14cfbafe544fcc27f146410afcc84fea | Add migrations for number_of_streams. | migrations/versions/19b7fe1331be_.py | migrations/versions/19b7fe1331be_.py | Python | 0 | @@ -0,0 +1,665 @@
+%22%22%22Add number_of_streams to movies.%0A%0ARevision ID: 19b7fe1331be%0ARevises: 2c76677d803f%0ACreate Date: 2013-11-16 22:11:44.560000%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '19b7fe1331be'%0Adown_revision = '2c76677d803f'%0A%0Afrom alembic import op%0Aimport sql... | |
3d10dd8b18096ba51ed4b837f8b297d015258a96 | Add conftest for UI testing | tests/dash_app/conftest.py | tests/dash_app/conftest.py | Python | 0 | @@ -0,0 +1,439 @@
+from pytest import fixture%0Afrom selenium.webdriver.chrome.options import Options%0A%0Afrom dash_app import app%0A%0A%0Adef pytest_setup_options():%0A options = Options()%0A options.add_argument('--disable-gpu')%0A options.add_argument('--headless')%0A options.add_argument(%22--no-sandbo... | |
98213db5448f73edb039912bbdf6dd2f69ce26a4 | Add the migration. Oops. | migrations/versions/c3500625bed8_.py | migrations/versions/c3500625bed8_.py | Python | 0 | @@ -0,0 +1,1059 @@
+%22%22%22empty message%0A%0ARevision ID: c3500625bed8%0ARevises: 3dcc171e7253%0ACreate Date: 2017-02-21 16:08:43.397517%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.dialects import mysql%0A%0A# revision identifiers, used by Alembic.%0Arevision = 'c3500625bed8'%... | |
514f744bc39129a241e704e4ea282befcd31b1b7 | Add about page functional test | tests/functional/test_about_page.py | tests/functional/test_about_page.py | Python | 0 | @@ -0,0 +1,515 @@
+from .base import FunctionalTest%0A%0A%0Aclass AboutPageTest(FunctionalTest):%0A%0A def test_about_page_navigation(self):%0A self.browser.get(self.live_server_url)%0A%0A self.browser.set_window_size(1024, 768)%0A%0A about_link = self.browser.find_element_by_link_text('ABOUT US... | |
0e877e6124d370a0d628d12e387d5614ab4c6a6a | Create hacktorial.py | hacktorial.py | hacktorial.py | Python | 0.000001 | @@ -0,0 +1,2216 @@
+#!/usr/bin/env python%0A%0A# I got really excited about the recursive functions that come with Python%0A%0A# Factorial%0Adef factorial(z):%0A return reduce((lambda a, b: a*b), xrange(1, z+1))%0A%0A# Some narrow functions as reference for broader functions:%0A%0A''' A. The sum of squares is limite... | |
fb5a0d0cf9e3e14e418b06c373f26a2e6e2a7c1e | Read data from csv | script.py | script.py | Python | 0 | @@ -0,0 +1,724 @@
+import numpy as np%0Aimport pandas%0A%0Adef main():%0A%09data = pandas.read_csv('sarcasm_v2.csv').as_matrix()%0A%09# print(data.shape)%0A%09data%5B:, 0%5D = np.array(%5Bfind_category(x) for x in data%5B:, 0%5D%5D)%0A%09data%5B:, 1%5D = np.array(%5Bsarcasm(x) for x in data%5B:, 1%5D%5D)%0A%09# print(d... | |
350ea09999002935178bf6569411e56455167ff8 | add script to clean cells | drop_ipynb_output.py | drop_ipynb_output.py | Python | 0 | @@ -0,0 +1,2931 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0ASuppress output and prompt numbers for IPython notebooks included in git%0Arepositories.%0A%0ABy default, this script will tell git to ignore prompt numbers and%0Acell output when adding ipynb files to git repositories. Note that the%0Anotebook files themselves... | |
0bd974c21f42f7c2e0162b92ea1cde5ee5ff8060 | add wrapper to get all bootstrapped preds | analysis/get_all_bootstrapped_model_predictions.py | analysis/get_all_bootstrapped_model_predictions.py | Python | 0 | @@ -0,0 +1,2019 @@
+from __future__ import division%0Aimport os%0Aimport numpy as np%0Aimport pandas as pd%0Aimport analysis_helpers as h%0A%0A'''%0AWrapper around bootstrap_model_predictions.py. %0AIt will spawn several threads to get bootstrap vectors from all splits and models.%0A%0AEstimate uncertainty in estimates... | |
89464b86d3c94c5aea5aac15e0dc5b581ed2ac3f | Save olass/models/crud_mixin.py needs refactoring in order to have access to the `session` | olass/models/crud_mixin.py | olass/models/crud_mixin.py | Python | 0 | @@ -0,0 +1,1067 @@
+%22%22%22%0AGoal: simplify the code when interacting with entities%0A%22%22%22%0Aimport sqlalchemy as db%0A%0A%0Aclass CRUDMixin():%0A %22%22%22 Helper class sqlalchemy entities %22%22%22%0A __table_args__ = %7B'extend_existing': True%7D%0A%0A id = db.Column(db.Integer, primary_key=True)%0A... | |
d445b65414325b9281ad6fcdc59ab4a2290d0bdc | Add missing migration | website/jdpages/migrations/0015_auto_20171209_1040.py | website/jdpages/migrations/0015_auto_20171209_1040.py | Python | 0.0002 | @@ -0,0 +1,1764 @@
+# -*- 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 ('jdpages', '0014_organisationmember_email'),%0A %5D%0A%0A operations = %5B%0A migrations.... | |
59e909afcb5dc5e44703c25d183b9edce60882b6 | add comment | controller/addComment.py | controller/addComment.py | Python | 0 | @@ -0,0 +1,681 @@
+#!/usr/local/bin/python3%0A%0A%22%22%22%0Acreated_by: Aninda Manocha%0Acreated_date: 3/5/2015%0Alast_modified_by: Aninda Manocha%0Alast_modified date: 3/5/2015%0A%22%22%22%0A%0A# imports%0Aimport constants%0Aimport utils%0Aimport json%0Afrom sql.session import Session%0Afrom sql.user ... | |
a46f3dd56b716cf2c9c918e4135d2248388ba030 | Change template debugging back to False | {{cookiecutter.project_slug}}/config/settings/test.py | {{cookiecutter.project_slug}}/config/settings/test.py | # -*- coding: utf-8 -*-
'''
Test settings
- Used to run tests fast on the continuous integration server and locally
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
# Turn debug off so tests run faster
DEBUG = False
# But template debugging m... | Python | 0 | @@ -291,76 +291,8 @@
lse%0A
-# But template debugging must be enabled for django_coverage_plugin%0A
TEMP
@@ -326,11 +326,12 @@
%5D =
-Tru
+Fals
e%0A%0A#
|
a45b62ab76324db2ae4a0842b901fec8e463e2f0 | Add tests for the constructor | tests/test_vector2_ctor.py | tests/test_vector2_ctor.py | Python | 0.000001 | @@ -0,0 +1,583 @@
+import pytest # type: ignore%0Afrom hypothesis import given%0Afrom utils import floats, vectors, vector_likes%0A%0Afrom ppb_vector import Vector2%0A%0A%0Aclass V(Vector2): pass%0A%0A%0A@pytest.mark.parametrize('cls', %5BVector2, V%5D)%0A@given(x=vectors())%0Adef test_ctor_vector_like(cls, x: Vector2... | |
b18732173a22aa431165fa321abac7924f66b1e1 | Require Python to build Julia | var/spack/packages/julia/package.py | var/spack/packages/julia/package.py | from spack import *
import os
class Julia(Package):
"""The Julia Language: A fresh approach to technical computing"""
homepage = "http://julialang.org"
url = "http://github.com/JuliaLang/julia/releases/download/v0.4.2/julia-0.4.2.tar.gz"
version('0.4.2', 'ccfeb4f4090c8b31083f5e1ccb03eb06')
#... | Python | 0.999042 | @@ -445,16 +445,50 @@
config%22)
+%0A depends_on(%22python @2.6:2.9%22)
%0A%0A #
|
221621e88496805fbee7849e376cce40e0d45f03 | Add test for #305 (thanks to @bfredl) | numba/tests/issues/test_issue_305.py | numba/tests/issues/test_issue_305.py | Python | 0 | @@ -0,0 +1,1471 @@
+from __future__ import print_function, division, absolute_import%0Aimport tempfile%0Aimport textwrap%0A%0Afrom numba import jit, autojit%0A%0A# Thanks to @bfredl%0A%0Adef test_fetch_latest_source():%0A %22%22%22%0A When reloading new versions of the same module into the same session (i.e.%0A ... | |
50bf65094d625eb80e39cebd82ea19713b30f3bb | Fix missing option in the test settings.py file | openstack_dashboard/test/settings.py | openstack_dashboard/test/settings.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Python | 0.000015 | @@ -4105,24 +4105,524 @@
e_vpn': True
+,%0A # If the profile_support config is turned on in local_settings%0A # the %22router%22 dashboard will be enabled which can be used to%0A # create and use profiles with networks and instances. In which case%0A # using run_tests will require the registration of the %... |
618340e7dfd21c54ac713140079c53b205aae73e | Create tuples.py | hacker_rank/python/basic_data_types/tuples.py | hacker_rank/python/basic_data_types/tuples.py | Python | 0.008361 | @@ -0,0 +1,155 @@
+if __name__ == '__main__':%0A n = int(input())%0A integer_list = map(int, input().split())%0A t = (tuple(integer_list))%0A %0A %0A print(hash(t))%0A
| |
d3b99620a4794376f4319516af65aa0f5c433354 | Create really terrible demo | demo.py | demo.py | Python | 0.000001 | @@ -0,0 +1,433 @@
+import document%0A%0Apre = document.getElementById('edoutput')%0Apre.innerHTML = '''%0A%3Cbutton onclick=%22var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/core.js', false);a.send();console.log(a.response);%22%3ERun%3C/button%3E%0A%3Cspan id=%... | |
12d075d7d93d6dd1aed72c18595b2931f5e14721 | use six instead of io | astropy_helpers/sphinx/ext/autodoc_enhancements.py | astropy_helpers/sphinx/ext/autodoc_enhancements.py | """
Miscellaneous enhancements to help autodoc along.
"""
import inspect
import sys
import types
from io import StringIO
from sphinx.ext.autodoc import AttributeDocumenter, ModuleDocumenter
from sphinx.util.inspect import isdescriptor
if sys.version_info[0] == 3:
class_types = (type,)
else:
class_types = (t... | Python | 0.000044 | @@ -96,33 +96,8 @@
es%0A%0A
-from io import StringIO%0A%0A
from
@@ -3888,33 +3888,442 @@
-app._warning = StringIO()
+try:%0A # *this* is in a try/finally because we don't want to force six as%0A # a real dependency. In sphinx 1.4, six is a prerequisite, so%0A # there's no issue... |
6af0081721acd4b6258b97c02424b2ccba80a303 | Create scale.py | docs/learning-by-doing/week06-mesos-and-marathon/scale.py | docs/learning-by-doing/week06-mesos-and-marathon/scale.py | Python | 0.000002 | @@ -0,0 +1,351 @@
+import http.client%0Aimport json%0A%0AURI = 'localhost:8080'%0Aheader = %7B'Content-type': 'application/json'%7D%0Adata = '%22instances%22: %223%22'%0Ajson_data = json.dumps(data)%0Amethod = 'PUT'%0Alink = '/v2/apps/basic-0?force=true'%0A%0Acon = http.client.HTTPConnection(URI)%0Acon.request(method,l... | |
93a2c523383fd1903e2912c783efdd1d27dc81ee | add tests for inserting rows with missing key columns | test/cql-pytest/test_null.py | test/cql-pytest/test_null.py | Python | 0.000087 | @@ -0,0 +1,3029 @@
+# Copyright 2020 ScyllaDB%0A#%0A# This file is part of Scylla.%0A#%0A# Scylla is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your opt... | |
2b095ad646f1e8d4280190c9a1c2ccbed512d43c | Create __init__.py | pythainlp/romanization/__init__.py | pythainlp/romanization/__init__.py | Python | 0.000429 | @@ -0,0 +1,43 @@
+from pythainlp.romanization.royin import *%0A
| |
2ce83fbdef3a139dfb5618e9dc7fde4f2c8249ec | add method params. | exadmin/views/website.py | exadmin/views/website.py | from django.utils.translation import ugettext as _
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.cache import never_cache
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from django.http import HttpResponse
from base import BaseAdminView
from ... | Python | 0 | @@ -868,35 +868,52 @@
et(self, request
+, *args, **kwargs
):%0A
-
context
@@ -1415,32 +1415,49 @@
st(self, request
+, *args, **kwargs
):%0A retur
@@ -1573,32 +1573,49 @@
et(self, request
+, *args, **kwargs
):%0A conte
@@ -1916,32 +1916,32 @@
@never_cache%0A
-
def post(sel
@@ -1942... |
807a87ef5bfe1f34a072e3de0e1d60c07cefb5fb | Add test_pypy | unnaturalcode/test_pypy.py | unnaturalcode/test_pypy.py | Python | 0.000132 | @@ -0,0 +1,1601 @@
+#!/usr/bin/python%0A# Copyright 2017 Dhvani Patel%0A#%0A# This file is part of UnnaturalCode.%0A# %0A# UnnaturalCode is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundat... | |
464d55d687a664a5ed7da4f7ddafce1f647d5efc | add templation url.templation_static to manage statics in dev stage | templation/urls.py | templation/urls.py | Python | 0 | @@ -0,0 +1,699 @@
+from django.conf.urls import patterns, url%0Afrom .settings import DAV_ROOT, DAV_STATIC_URL%0Afrom .views import static_view%0A%0A%0Adef templation_static(**kwargs):%0A %22%22%22%0A Helper function to return a URL pattern for serving files in debug mode.%0A Mostly cloned from django.conf.url... | |
89daaaf631258595577dfc1c24dfdde8425f9efc | add migration | migrations/versions/2d696cdd68df_.py | migrations/versions/2d696cdd68df_.py | Python | 0.000001 | @@ -0,0 +1,506 @@
+%22%22%22empty message%0A%0ARevision ID: 2d696cdd68df%0ARevises: 388d0cc48e7c%0ACreate Date: 2014-11-14 00:27:32.062569%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '2d696cdd68df'%0Adown_revision = '388d0cc48e7c'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A... | |
adc96ec2e3d37c8f838fa67cf39b8e9748670539 | Change init to reflect changes in version 1.3.0 of pinry | pinry/settings/__init__.py | pinry/settings/__init__.py | import os
from django.contrib.messages import constants as messages
SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../')
# Changes the naming on the front-end of the website.
SITE_NAME = 'Pinry'
# Set to False to disable people from creating new accounts.
ALLOW_NEW_REGISTRATIONS = True
... | Python | 0 | @@ -150,83 +150,8 @@
)%0A%0A%0A
-# Changes the naming on the front-end of the website.%0ASITE_NAME = 'Pinry'%0A%0A
# Se
@@ -233,19 +233,20 @@
TIONS =
-Tru
+Fals
e%0A%0A# Set
@@ -1965,16 +1965,30 @@
: 'alert
+ alert-warning
',%0A m
@@ -2019,12 +2019,13 @@
ert-
-erro
+dange
r',%0A
|
c779a68f1cf97693e09f116237c38efa1d791186 | add a module working with http connections | http.py | http.py | Python | 0.000006 | @@ -0,0 +1,564 @@
+'''%0Aworking with HTTP requests & responces%0A'''%0A%0Aimport config%0Aimport httplib%0Aimport urlparse%0A%0A'''%0Amake a connection to URL%0A'''%0Adef mkConn(url):%0A%09pars = urlparse.urlparse(url)%0A%09conCls = pars.scheme == 'https' and httplib.HTTPSConnection or httplib.HTTPConnection%0A%09retu... | |
bcd2cdae3176dddca06b0e09774b7c9cd641ce7b | Define custom exceptions | aggregator/exceptions.py | aggregator/exceptions.py | Python | 0.00025 | @@ -0,0 +1,220 @@
+%0Aclass WebCrawlException(Exception):%0A%09pass%0A%0Aclass AuthorNotFoundException(WebCrawlException):%0A%09pass%0A%0Aclass DatePublishedNotFoundException(WebCrawlException):%0A%09pass%0A%0Aclass TitleNotFoundException(WebCrawlException):%0A%09pass%0A
| |
1696d69b07f40a2a3d5c6b722a5990011af25842 | Add a comment in tf_upgrade_v2.py to indicate order of arguments in self.function_reorders should match old order as opposed to new order. | tensorflow/tools/compatibility/tf_upgrade_v2.py | tensorflow/tools/compatibility/tf_upgrade_v2.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.000006 | @@ -2455,24 +2455,163 @@
rong thing.%0A
+ # IMPORTANT: order here should correspond to OLD argument order.%0A # We just prepend %22arg_name=%22 to all arguments in function calls.%0A
self.fun
|
06dbbfd7a8876f7db14f80e13d45eacd369501ab | add SocketServer | aioworkers/net/server.py | aioworkers/net/server.py | Python | 0.000001 | @@ -0,0 +1,826 @@
+import socket%0A%0Afrom ..core.base import LoggingEntity%0A%0A%0Aclass SocketServer(LoggingEntity):%0A def __init__(self, *args, **kwargs):%0A self._sockets = %5B%5D%0A super().__init__(*args, **kwargs)%0A%0A def set_config(self, config):%0A super().set_config(config)%0A ... | |
de250e5e63e4b0a36d06f8187644f91157265218 | Remove Privacy stubs | modules/installed/privacy/privacy.py | modules/installed/privacy/privacy.py | import cherrypy
from gettext import gettext as _
from plugin_mount import PagePlugin
from modules.auth import require
import cfg
import util
class Privacy(PagePlugin):
order = 20 # order of running init in PagePlugins
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
... | Python | 0 | @@ -438,454 +438,43 @@
12)%0A
- self.menu.add_item(%22General Config%22, %22icon-asterisk%22, %22/privacy/config%22, 10)%0A self.menu.add_item(%22Ad Blocking%22, %22icon-ban-circle%22, %22/privacy/adblock%22, 20)%0A self.menu.add_item(%22HTTPS Everywhere%22, %22icon-lock%22, %22/privacy/https_ever... |
5b678c9a8b82ab050f44934578c6824d4d500382 | fix bug in print_tree() where indentation level would not display correctly, change behaviour to let user decide which string to output | libtree/tree.py | libtree/tree.py | import json
from libtree.node import Node
from libtree.positioning import (ensure_free_position,
find_highest_position, set_position,
shift_positions)
from libtree.query import (get_children, get_descendant_ids, get_node,
get_r... | Python | 0.000001 | @@ -369,17 +369,20 @@
indent=
-2
+' '
, _level
@@ -583,19 +583,19 @@
:param
-int
+str
indent:
@@ -599,29 +599,23 @@
nt:
-Amount of whitespaces
+String to print
per
@@ -635,9 +635,12 @@
lt:
-2
+' '
)%0A
@@ -741,18 +741,21 @@
mat(
-' '*
indent
+*_level
, st
@@ -873,22 +873,17 @@
=_level+
-indent
+1... |
d813f07e85b070e7ad60e8d9102ff148cc4734b8 | Create index.py | SourceCode/index.py | SourceCode/index.py | Python | 0.000016 | @@ -0,0 +1,2 @@
+#%0A
| |
e90ceebda79f710f83e92869d988057367ee6e9b | Remove unused import | tests/unit/py2/nupic/support/consoleprinter_test/consoleprinter_test.py | tests/unit/py2/nupic/support/consoleprinter_test/consoleprinter_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | Python | 0.000001 | @@ -999,46 +999,8 @@
--%0A%0A
-from __future__ import with_statement%0A
impo
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.