commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
1058a9cb6e667c850f56b6003038496b77c359c5 | Add tool to fix links. | rangadi/beam,robertwb/incubator-beam,lukecwik/incubator-beam,lukecwik/incubator-beam,markflyhigh/incubator-beam,chamikaramj/beam,chamikaramj/beam,RyanSkraba/beam,rangadi/incubator-beam,lukecwik/incubator-beam,robertwb/incubator-beam,charlesccychen/incubator-beam,chamikaramj/beam,rangadi/beam,charlesccychen/beam,markfly... | website/tools/append_index_html_to_internal_links.py | website/tools/append_index_html_to_internal_links.py | """Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving anchors, etc).
Usage:
From root directory, after running the jekyll build, execute
'python tools/append_index_html_to_internal_links.py'.
D... | apache-2.0 | Python | |
8bf248f304e7188e279a37ff06c8fc41f54e1df8 | Add console log | anthonykoch/sublimegulpserver,anthonykoch/sublimegulpserver | Logging.py | Logging.py |
from GulpServer.Settings import Settings
user_settings = None
def plugin_loaded():
global user_settings
user_settings = Settings()
class Console(object):
def log(self, *args):
if user_settings.get('dev'):
print(*args)
| mit | Python | |
9451bfccaf9e2782dc0b1e7670f61ce765b8e7c2 | Update for Issue #163 | dtrip/.ubuntu,RexGene/monsu-server,dtrip/.ubuntu,RexGene/monsu-server | tamper/nonrecursivereplacement.py | tamper/nonrecursivereplacement.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import random
import re
from lib.core.common import singleTimeWarnMessage
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def tamper(payload, headers):
... | mit | Python | |
ec07c74852eaf9bc6ec7d4abb0e5bb3a740501a4 | Add BoundingBox tests | larrybradley/photutils,astropy/photutils | photutils/aperture/tests/test_bounding_box.py | photutils/aperture/tests/test_bounding_box.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from numpy.testing import assert_allclose
from astropy.tests.helper import pytest
from ..bounding_box import BoundingBox
try:
import matplot... | bsd-3-clause | Python | |
eef0cb0ff41ec35d92e3d76e1e15c1d6edd5b786 | Add ICC(2,1) and ICC(3,1) calculation | tassolom/twq-app,tassolom/twq-app,teamworkquality/twq-app,tassolom/twq-app,tassolom/twq-app,teamworkquality/twq-app,teamworkquality/twq-app,teamworkquality/twq-app | analise/icc.py | analise/icc.py | def icc(data, icc_type):
''' Calculate intraclass correlation coefficient for data within
Brain_Data class
ICC Formulas are based on:
Shrout, P. E., & Fleiss, J. L. (1979). Intraclass correlations: uses in
assessing rater reliability. Psychological bulletin, 86(2), 420.
icc1: x_ij = mu + ... | mit | Python | |
43ccd46f3319f6afe154c5ed663143742c229074 | add voronoi_follower | irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms | tms_rc/tms_rc_double/scripts/voronoi_follower.py | tms_rc/tms_rc_double/scripts/voronoi_follower.py | # -*- coding:utf-8 -*-
import rospy
from geometry_msgs.msg import Pose2D, Twist
from tms_msg_rc_srv import rc_robot_control, rc_robot_controlResponse
from tms_msg_db.srv import TmsdbGetData, TmsdbGetDataRequest
import datetime
import pymongo
from math import sin, cos, atan2, pi, radians, degrees, sqrt
pub = rospy.Pub... | bsd-3-clause | Python | |
9e090675765a2c0c6412ee51d1e0e007404a30fd | Create k-diff-pairs-in-an-array.py | tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,jaredkoontz/leetcode,yiwen-luo/LeetCode,jaredkoontz/leetcode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,yiwen-luo/LeetCode,jaredkoontz/leetcode,kamyu104/LeetCode,yiwen-luo/LeetCode,kamyu10... | Python/k-diff-pairs-in-an-array.py | Python/k-diff-pairs-in-an-array.py | # Time: O(n)
# Space: O(n)
# Total Accepted: 5671
# Total Submissions: 20941
# Difficulty: Easy
# Contributors: murali.kf370
# Given an array of integers and an integer k,
# you need to find the number of unique k-diff pairs in the array.
# Here a k-diff pair is defined as an integer pair (i, j),
# where i and j are... | mit | Python | |
586e7745f8ed76985f28a391dcf451c06af61903 | add sphinx helper functions | myint/rstcheck,myint/rstcheck | src/rstcheck/_sphinx.py | src/rstcheck/_sphinx.py | """Sphinx helper functions."""
import contextlib
import pathlib
import tempfile
import typing
from . import _docutils, _extras
if _extras.SPHINX_INSTALLED:
import sphinx.application
import sphinx.domains.c
import sphinx.domains.cpp
import sphinx.domains.javascript
import sphinx.domains.python
... | mit | Python | |
9f66f31d42a16d8b9536a9cb160e454118ff4369 | Add tests for UninstallPathSet | James-Firth/pip,techtonik/pip,zenlambda/pip,dstufft/pip,luzfcb/pip,erikrose/pip,chaoallsome/pip,fiber-space/pip,h4ck3rm1k3/pip,sigmavirus24/pip,yati-sagade/pip,squidsoup/pip,willingc/pip,mindw/pip,haridsv/pip,zorosteven/pip,rbtcollins/pip,zorosteven/pip,sbidoul/pip,sigmavirus24/pip,wkeyword/pip,jasonkying/pip,benesch/p... | tests/unit/test_req_uninstall.py | tests/unit/test_req_uninstall.py | import os
import shutil
import sys
import tempfile
import pytest
from mock import Mock
from pip.locations import running_under_virtualenv
from pip.req.req_uninstall import UninstallPathSet
class TestUninstallPathSet(object):
def setup(self):
if running_under_virtualenv():
# Construct tempdir ... | mit | Python | |
8d8f89c82511b86fb87cef5db3bad633283283cc | Add missing migrations in develop branch | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | modelview/migrations/0044_auto_20191007_1227.py | modelview/migrations/0044_auto_20191007_1227.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0043_merge_20190425_1036'),
]
operations = [
migrations.Remov... | agpl-3.0 | Python | |
4a25572283448a820cf55008e81405f3eb84a072 | Add test for unicode in env (#345) | catkin/catkin_tools,catkin/catkin_tools,rhaschke/catkin_tools,rhaschke/catkin_tools,catkin/catkin_tools,catkin/catkin_tools,rhaschke/catkin_tools | tests/system/verbs/catkin_build/test_unicode_in_env.py | tests/system/verbs/catkin_build/test_unicode_in_env.py | import os
from ....utils import catkin_success
from ...workspace_factory import workspace_factory
def test_catkin_build_with_unicode_in_env():
with workspace_factory() as wf:
wf.create_package('foo', depends=['bar'])
wf.create_package('bar')
wf.build()
print('Workspace: {0}'.for... | apache-2.0 | Python | |
53f91164ce93a01c2ad628fd49109a5fa8917ecb | Extend datasource model schema (#2342) | google/timesketch,google/timesketch,google/timesketch,google/timesketch | timesketch/migrations/versions/180a387da650_extend_datasource_model_with_total_file_.py | timesketch/migrations/versions/180a387da650_extend_datasource_model_with_total_file_.py | """Extend datasource model with total file events field
Revision ID: 180a387da650
Revises: 75af34d75b1e
Create Date: 2022-09-26 13:04:10.336534
"""
# This code is auto generated. Ignore linter errors.
# pylint: skip-file
# revision identifiers, used by Alembic.
revision = '180a387da650'
down_revision = '75af34d75b1... | apache-2.0 | Python | |
63dc7fb2586824b6a6de52b1ba80e6196d80ff42 | Create credentials.py | fogonwater/pystatsnz | credentials.py | credentials.py | # add your primary statsnz key here
# available from https://statisticsnz.portal.azure-api.net/
statsnz_key = "MY_SECRET_KEY"
| mit | Python | |
2aadd55510684c4065c1bed1c1387ee57b18fd77 | Add a prototype of Simulated Annealing Algorithm, and a TSP example. | PyOCL/TSP,PyOCL/oclGA,PyOCL/OpenCLGA,PyOCL/oclGA,PyOCL/oclGA,PyOCL/oclGA,PyOCL/TSP,PyOCL/OpenCLGA,PyOCL/OpenCLGA | OpenCLGA/sa.py | OpenCLGA/sa.py | #!/usr/bin/python3
from abc import ABCMeta
from utils import calc_linear_distance, plot_tsp_result
import math
import random
class SAImpl(metaclass = ABCMeta):
def __init__(self):
pass
## Calculate the cost of the solution
def cost(self, solution):
pass
## Return a new neighbor solution... | mit | Python | |
41e21884418cdd2b525b4f02d1cfa4ed9ea2c000 | Add bug test for 9268 (#65) | iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples | bugs/issue_9268.py | bugs/issue_9268.py | # RUN: %PYTHON %s
# XFAIL: *
import iree.compiler.tools.tflite as iree_tflite
# https://github.com/iree-org/iree/issues/9268
ir = '''
func.func @main(%a : tensor<f32>, %b : tensor<f32>) -> tensor<*xf32> {
%val = "tfl.add"(%a, %b) {fused_activation_function = "NONE"} : (tensor<f32>, tensor<f32>) -> tensor<*xf32>
r... | apache-2.0 | Python | |
8c401af5bb7c3678de4091b88d81e04ddf248705 | Remove unused 'fahrenheit' config option | szibis/Diamond,gg7/diamond,codepython/Diamond,bmhatfield/Diamond,TAKEALOT/Diamond,hamelg/Diamond,signalfx/Diamond,works-mobile/Diamond,h00dy/Diamond,Basis/Diamond,tusharmakkar08/Diamond,EzyInsights/Diamond,TAKEALOT/Diamond,Precis/Diamond,joel-airspring/Diamond,Precis/Diamond,actmd/Diamond,rtoma/Diamond,joel-airspring/D... | src/collectors/lmsensors/lmsensors.py | src/collectors/lmsensors/lmsensors.py | # coding=utf-8
"""
This class collects data from libsensors. It should work against libsensors 2.x
and 3.x, pending support within the PySensors Ctypes binding:
[http://pypi.python.org/pypi/PySensors/](http://pypi.python.org/pypi/PySensors/)
Requires: 'sensors' to be installed, configured, and the relevant kernel
mod... | # coding=utf-8
"""
This class collects data from libsensors. It should work against libsensors 2.x
and 3.x, pending support within the PySensors Ctypes binding:
[http://pypi.python.org/pypi/PySensors/](http://pypi.python.org/pypi/PySensors/)
Requires: 'sensors' to be installed, configured, and the relevant kernel
mod... | mit | Python |
f3e1b1404f32cd0195aa8148d1ab4285cf9ad352 | Add class BaseSpider | SaltusVita/ReoGrab | Spiders.py | Spiders.py | '''
Created on 2 сент. 2016 г.
@author: garet
'''
class BaseSpider():
def __init__(self):
pass
def AddUrls(self, urls):
pass
def Routing(self, url):
pass
def SaveCache(self, url, data=None):
pass
def GetCache(self, url):
pass
... | bsd-3-clause | Python | |
e5be29bc3c5a77493fe64bb3fc8b52611cc13469 | Add tests for Generic Interface. | rht/zulip,mahim97/zulip,rht/zulip,mahim97/zulip,brainwane/zulip,hackerkid/zulip,zulip/zulip,eeshangarg/zulip,Galexrt/zulip,vabs22/zulip,kou/zulip,rishig/zulip,amanharitsh123/zulip,punchagan/zulip,eeshangarg/zulip,andersk/zulip,shubhamdhama/zulip,showell/zulip,jackrzhang/zulip,eeshangarg/zulip,hackerkid/zulip,vabs22/zul... | zerver/tests/test_outgoing_webhook_interfaces.py | zerver/tests/test_outgoing_webhook_interfaces.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerver.outgoing_webhooks.generic import GenericOutgoingWebhookService
class T... | apache-2.0 | Python | |
48d38c28212c0b3ac8bb8ee324221d94b07e84ee | Add initial Domain Tools module | MISP/misp-modules,MISP/misp-modules,VirusTotal/misp-modules,MISP/misp-modules,Rafiot/misp-modules,amuehlem/misp-modules,amuehlem/misp-modules,Rafiot/misp-modules,VirusTotal/misp-modules,VirusTotal/misp-modules,amuehlem/misp-modules,Rafiot/misp-modules | misp_modules/modules/expansion/domaintools.py | misp_modules/modules/expansion/domaintools.py | import json
import logging
import sys
from domaintools import API
log = logging.getLogger('domaintools')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
log.a... | agpl-3.0 | Python | |
1f80f3cc606d9c42e41e30108e97f776b02803c5 | Create abcprob.py | beepingmoon/code,beepingmoon/code | abcprob.py | abcprob.py | # by beepingmoon, 2014-07-22
# abc problem, http://rosettacode.org/wiki/ABC_Problem
import time
class Blok:
def __init__(self, znaki, czyDostepny = True):
self.znaki = znaki
self.czyDostepny = czyDostepny
def sprawdzZnaki(self, znak):
for z in self.znaki:
if z == znak:
return True
return False
blok... | mit | Python | |
b7b29a00b1a2e448d78c8f3c4333753668589e16 | Create __init__.py | 0nse/WikiWho,wikiwho/WikiWho,0nse/WikiWho,maribelacosta/wikiwho | etc/__init__.py | etc/__init__.py | mit | Python | ||
e1ea3859b08a14c80ccd65fc5551336bdc760f96 | add biggan projukti blog | banglakit/corpus-builder | corpus_builder/spiders/public_blog/biggan_projukti.py | corpus_builder/spiders/public_blog/biggan_projukti.py | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import Rule
from corpus_builder.templates.spider import CommonSpider
class BigganProjuktiSpider(CommonSpider):
name = 'biggan_projukti'
allowed_domains = ['www.bigganprojukti.com', 'bigganprojukti.com']
... | mit | Python | |
204e6fc49bcc739f1e5c53bfbfc3eb7e86a7640c | Add windows autostart. | franekp/millandict,franekp/ankidict,franekp/ankidict,franekp/ankidict,franekp/ankidict,franekp/millandict | StartAtBoot.py | StartAtBoot.py | import sys
if sys.platform.startswith('win'):
from PyQt4.QtCore import QSettings
RUN_PATH = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"
settings = QSettings(RUN_PATH, QSettings.NativeFormat)
settings.setValue("Anki", sys.argv[0])
# to remove that:
# self.settings.re... | unknown | Python | |
7919fa239e597c0358b518740aa2657b49caddbf | add oop_advance | hewentian/python-learning | src/python27/oop_advance/slots.py | src/python27/oop_advance/slots.py | # -*- coding: utf-8 -*-
class Student(object):
pass
s = Student()
s.name = 'Tim Ho'
print s.name
def set_age(self, age):
self.age = age
from types import MethodType
s.set_age = MethodType(set_age, s, Student)
s.set_age(25)
print s.age
s2 = Student()
# s2.set_age(25)
def set_score(self, score):
self.s... | apache-2.0 | Python | |
f576b7b151c6c74eea668e66fff54ab2c33f39d6 | add 100 | zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler | Volume2/100.py | Volume2/100.py | if __name__ == "__main__":
b, n, L = 85, 120, 10 ** 12
while n <= L:
b, n = 3 * b + 2 * n - 2, 4 * b + 3 * n - 3
print b, n
| mit | Python | |
68efa8a0fb206da8cd1410d74572520f558ebded | Create apriori.py | Jan-Ko/basketanalysis | apriori.py | apriori.py | def preprocessing(data):
""" preprocesses data to be applicable to apriori
Parameters
----------
data : tbd
Returns
---------
list of sets
"""
pass
class apriori():
""" Frequent Itemsets using the apriori algorithm
Parameters
----------
baskets : list... | mit | Python | |
8adf39f011d8290c07f01e807b65373e40b4c314 | Create score.py | lettersonsounds/sing | score.py | score.py | """ Requires sox and text2wave (via festival)
"""
from pippi import dsp
from pippi import tune
import subprocess
import os
def sox(cmd, sound):
path = os.getcwd()
filename_in = '/proc-in'
filename_out = '/proc-out.wav'
dsp.write(sound, filename_in)
cmd = cmd % (path + filename_in + '.wav', path ... | unlicense | Python | |
0ac53ef31a47c61382557b9fb3ba588fd4e1ae67 | Add first working setup.py script | rlc2/pygame_maker,rlc2/pygame_maker | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='pygame_maker',
version='0.1',
description='ENIGMA-like pygame-based game engine',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPGv2)',
'Progamming Lang... | lgpl-2.1 | Python | |
1c608e69ecf61484ea1210fe0d6dc8d116c583d3 | Update homepage in setup.py | Polyconseil/django-pagination,atugushev/django-pagination,zyga/django-pagination,alternativshik/django-pagination,Polyconseil/django-pagination,alternativshik/django-pagination,zyga/django-pagination,atugushev/django-pagination | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='linaro-django-pagination',
version=version,
description="linaro-django-pagination",
long_description=open("README").read(),
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='linaro-django-pagination',
version=version,
description="linaro-django-pagination",
long_description=open("README").read(),
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :... | bsd-3-clause | Python |
3693c5696da5bb96fc242d276f0d1a0a983a9c5d | Add setup.py script | zillolo/vsut-python | setup.py | setup.py | import os
from setuptools import setup
def read(file):
return open(os.path.join(os.path.dirname(__file__), file)).read()
setup(
name="vsut",
version="1.5.2",
author="Alex Egger",
author_email="alex.egger96@gmail.com",
description="A simple unit testing framework for Python 3.",
license="MI... | mit | Python | |
565ff051cabe9eaec6f24df6e8c31115e0a4eed8 | Add setup.py | eternnoir/VSTools | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='VSTools',
version='0.1',
description='Easy use Visual Studio msbuild with python. ',
author='eternnoir',
author_email='eternnoir@gmail.com',
url='https://github.com/eternnoir/VSTools',
packages=['VSTools'],
) | apache-2.0 | Python | |
b164ec6fae6ea9a6734ac58ddd8c3b89f73713fe | Add setup.py | tysonclugg/django-classy-settings,RonnyPfannschmidt/django-classy-settings,MarkusH/django-classy-settings,rapilabs/django-classy-settings,ar45/django-classy-settings,funkybob/django-classy-settings,pombredanne/django-classy-settings | setup.py | setup.py |
from distutils.core import setup
setup(
name='django-classy-settings',
version='0.1',
description='Simple class-based settings for Django',
author='Curtis Maloney',
author_email='curtis@tinbrain.net',
packages=['cbs',],
)
| bsd-2-clause | Python | |
69f9f090cfa5c9ca5d7dde70cfcdd3327147bdb7 | Create setup.py | nurnbeck/project-1-CMPUT-291 | setup.py | setup.py | import cx_Oracle
'''
- This is to drop all pervious tables and create new tables
- Call setup(curs, connection) in main function
- setup(curs, connection) returns nothing
- Do not call dropTable() and createTable() in main
unless you really want to do so
'''
def dropTable(curs):
droplst = []
droplst.appen... | mit | Python | |
fa4ce6dc15e8b47c5978c476db7801473820af0d | add setup.py | yasserglez/pymdptoolbox,silgon/pymdptoolbox,yasserglez/pymdptoolbox,silgon/pymdptoolbox,McCabeJM/pymdptoolbox,McCabeJM/pymdptoolbox,sawcordwell/pymdptoolbox,sawcordwell/pymdptoolbox | setup.py | setup.py | # -*- coding: utf-8 -*-
| bsd-3-clause | Python | |
8e8fbf8b63239915736b788b7f1c8ac21a48c190 | Add a basic setup.py script | marineam/coil,kovacsbalu/coil,tectronics/coil,tectronics/coil,marineam/coil,kovacsbalu/coil | setup.py | setup.py | from distutils.core import setup
from coil import __version__ as VERSION
setup(
name = 'coil',
version = VERSION,
author = 'Michael Marineau',
author_email = 'mike@marineau.org',
description = 'A powerful configuration language',
license = 'MIT',
packages = ['coil', 'coil.test'],
script... | mit | Python | |
d074995f8ce5a62104525b1f3cfed10ace12c3bc | add setup.py | slyrz/feature | setup.py | setup.py | from setuptools import setup
setup(name="feature",
version="0.1",
url="https://github.com/slyrz/feature",
description="Easy feature engineering.",
long_description=open('README.md').read(),
packages=['feature', 'feature.plugin'],
license='MIT')
| mit | Python | |
699ac33eec57fa49e2c1917d2bf17950bd6e6474 | Create setup script | Fantomas42/mots-vides,Fantomas42/mots-vides | setup.py | setup.py | """Setup script of mots-vides"""
from setuptools import setup
from setuptools import find_packages
import mots_vides
setup(
name='mots-vides',
version=mots_vides.__version__,
description='Python library for managing stop words in many languages.',
long_description=open('README.rst').read(),
keywo... | bsd-3-clause | Python | |
959580ea313e4445374e8ee9f32e1a8822dd5beb | add setup script for install | ljwolf/spvcm,ljwolf/spvcm | setup.py | setup.py | from setuptools import setup
setup(name='hlm_gibbs',
version='0.0.1',
description='Fit spatial multilevel models and diagnose convergence',
url='https://github.com/ljwolf/hlm_gibbs',
author='Levi John Wolf',
author_email='levi.john.wolf@gmail.com',
license='3-Clause BSD',
pack... | mit | Python | |
dca7a5f766b7e2fd5cfc346cbc358faafa1ec9f1 | add setup.py file | schaul/py-vgdl | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
libname="vgdl"
setup(
name = libname,
version="1.0",
description='A video game description language (VGDL) built on top pf pygame',
author='Tom Schaul',
url='https://github.com/scha... | bsd-3-clause | Python | |
1618d8afeca1b667b4439d62b3727528dcba9159 | Add setup.py | lamby/django-filebased-email-backend-ng | setup.py | setup.py | from setuptools import setup
setup(
name='django-filebased-email-backend-ng',
packages=(
'django_filebased_email_backend_ng',
)
)
| bsd-3-clause | Python | |
95d1f63ce4d9698f8ab4b64757e3669c75accbbd | throw on some more setup.py pypi classifiers | goldblatt/django-object-actions,goldblatt/django-object-actions,crccheck/django-object-actions,Cuuuurzel/django-object-actions,dukebody/django-object-actions,dukebody/django-object-actions,Cuuuurzel/django-object-actions,crccheck/django-object-actions | setup.py | setup.py | from distutils.core import setup
setup(
name='django-object-actions',
version='0.0.1',
author="The Texas Tribune",
author_email="cchang@texastribune.org",
maintainer="Chris Chang",
# url
packages=['django_object_actions'],
include_package_data=True, # automatically include things from... | from distutils.core import setup
setup(
name='django-object-actions',
version='0.0.1',
author="The Texas Tribune",
author_email="cchang@texastribune.org",
maintainer="Chris Chang",
# url
packages=['django_object_actions'],
include_package_data=True, # automatically include things from... | apache-2.0 | Python |
591b9be8d03cf2ecd12eed1bd36f9d762e91195c | Add setup.py for package installation | josephl/simplio | setup.py | setup.py | from setuptools import setup
setup(
name='simplio',
version='0.1',
description='Simplest-case command-line input/output',
long_description=(
'Simplio is a Python function decorator that applies an input file '
'object and an output file object as arguments to the decorated '
'f... | mit | Python | |
0abe1e173b73770b5f2ee81f57f21c41466e5c61 | Add setup script | cadyyan/technic-solder-client,durandj/technic-solder-client | setup.py | setup.py | #!/usr/bin/env python
import os.path
from setuptools import find_packages, setup
setup(
name = 'technic-solder-client',
version = '1.0',
description = 'Python implementation of a Technic Solder client',
author = 'Cadyyan',
url = 'https://github.com/cadyyan/technic... | mit | Python | |
af49ecf6ce12b2fa909733c17569c7231c343190 | add simple sql shell | denisenkom/pytds,m32/pytds,tpow/pytds,denisenkom/pytds,m32/pytds,tpow/pytds | shell.py | shell.py | # simple interactive shell for MSSQL server
import pytds
import os
def main():
conn = pytds.connect(dsn=os.getenv("HOST", "localhost"), user=os.getenv("SQLUSER", "sa"), password=os.getenv("SQLPASSWORD"))
while True:
try:
sql = input("sql> ")
except KeyboardInterrupt:
re... | mit | Python | |
93e2d3d72099b854f854abc44a79b2c4edb74af8 | add basic file splitter | amccreight/mochitest-logs | split.py | split.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Echo all output starting with the line after the line that starts with splitStart.
import sys
... | mpl-2.0 | Python | |
3d44701308fe1c32d8ae2efab609d5e7bcd563c0 | Create ajastin.py | taloprojekti/SP2017,taloprojekti/SP2017 | ajastin.py | ajastin.py | def downloader():
#import downloader
#downloader.main()
return 0
def lampotila():
Tnow = 15
#import lampotila
#lampotila.main()
return Tnow
def main():
import time
from datetime import datetime
n = 0
ret1 = 0
t0 = time.time()
try:
while ret1 == 0:
time.sleep... | mit | Python | |
c45da8544bd3e4f85073e61cfba417862ce66fc2 | add 'Appeaser' strategy | uglyfruitcake/Axelrod,risicle/Axelrod,bootandy/Axelrod,mojones/Axelrod,risicle/Axelrod,kathryncrouch/Axelrod,emmagordon/Axelrod,uglyfruitcake/Axelrod,emmagordon/Axelrod,bootandy/Axelrod,drvinceknight/Axelrod,kathryncrouch/Axelrod,mojones/Axelrod | axelrod/strategies/appeaser.py | axelrod/strategies/appeaser.py | from axelrod import Player
class Appeaser(Player):
"""
A player who tries to guess what the opponent wants, switching his
behaviour every time the opponent plays 'D'.
"""
def strategy(self, opponent):
"""
Start with 'C', switch between 'C' and 'D' when opponent plays 'D'.
"... | mit | Python | |
d29a94809f6f58e053a646d796fe9e55a51b334e | Initialize Ch. 1 caesarHacker | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/CrackingCodesWithPython/Chapter01/caesarHacker.py | books/CrackingCodesWithPython/Chapter01/caesarHacker.py | # Caesar Hacker improved
# Rewritten as function for importing
# SPOILERS: Chapter 6 (caesarHacker), Chapter 7 (functions)
import books.CrackingCodesWithPython.Chapter01.config
def hackCaesar(message):
# Loop through every possible key:
for key in range(len(books.CrackingCodesWithPython.Chapter01.config.SYM... | mit | Python | |
cfdbfd30f41ea4a0dc5fb693e896c6e24ae78e05 | Create pipeline.py | googleforgames/clean-chat,googleforgames/clean-chat | toxicity_ml/toxicBERT/pipeline.py | toxicity_ml/toxicBERT/pipeline.py | # coding=utf-8
# Copyright 2020 Google LLC
import tensorflow_model_analysis as tfma
from tfx.components import (Evaluator, ExampleValidator, ImportExampleGen,
ModelValidator, Pusher, ResolverNode, SchemaGen,
StatisticsGen, Trainer, Transform)
from tfx.proto impor... | apache-2.0 | Python | |
03fce72b60eb8cad2368447cf23f72f8084f4a4b | Add py solution for 575. Distribute Candies | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/distribute-candies.py | py/distribute-candies.py | class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return min(len(candies) / 2, len(set(candies)))
| apache-2.0 | Python | |
d34dcf1179e6e5c2b864627266ae1788d10142aa | Add Chuanping Yu's solutions to Problem02 | GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017 | Week01/Problem02/cyu_02.py | Week01/Problem02/cyu_02.py | #!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
FIB.append(F)
if F%2 == 0 and F <= 4000000:
S = S + F
print(S)
| bsd-3-clause | Python | |
5eb9a910096f3e0000499390541a83bc50fb73ce | add binheap | ndraper2/data-structures,SakiFu/data-structures | binheap.py | binheap.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
class BinHeap(object):
def __init__(self, iterable=None):
self.list = []
if iterable:
for item in iterable:
self.push(item)
def push(self, value):
self.list.append(value)
self._bubble_... | mit | Python | |
4f0e9a14286f21d835e36e549ebee80419e46cec | test game | cameronbriar/curses | blocker.py | blocker.py | #!/usr/bin/env python
class Blocker:
def __init__(self):
print 'Blocker v1.0'
return
def run(self):
return
game = Blocker()
game.run()
| bsd-2-clause | Python | |
769019be1331fa58e363fba37957ec90ab6f8163 | add code for more precise arbtirage math (WiP) | victorshch/pytrader | arbmath.py | arbmath.py | import decimal
from decimal import Decimal
class ExchangeModel(object);
def __init__(self, depths, tradeApi):
self.depths = depths;
self.tradeApi = tradeApi
self.symbols = [key[:3] for key, value in depths] + [key[3:] for key, value in depths]
self.symbols = list(set(self.symbols))
# returns (ba... | mit | Python | |
22ee1754a1409fb40bf2bb31cb565bfe914c9c38 | Create comparison charts from two summary.csv files | chrishantha/performance-apim,chrishantha/performance-apim,chrishantha/performance-apim | distribution/scripts/jmeter/create-comparison-charts.py | distribution/scripts/jmeter/create-comparison-charts.py | #!/usr/bin/env python3.6
# Copyright 2017 WSO2 Inc. (http://wso2.org)
#
# 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... | apache-2.0 | Python | |
cd5e6a14bb0a67d6558b691f6b55f7918c4d4970 | Create new package (#6384) | matthiasdiener/spack,mfherbst/spack,EmreAtes/spack,mfherbst/spack,tmerrick1/spack,LLNL/spack,EmreAtes/spack,mfherbst/spack,mfherbst/spack,krafczyk/spack,krafczyk/spack,iulian787/spack,mfherbst/spack,matthiasdiener/spack,tmerrick1/spack,EmreAtes/spack,iulian787/spack,matthiasdiener/spack,iulian787/spack,tmerrick1/spack,... | var/spack/repos/builtin/packages/r-fnn/package.py | var/spack/repos/builtin/packages/r-fnn/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python | |
f68175870692d128fb2a01795d20605bb2e17aa9 | Add initial functional tests | randomic/aniauth-tdd,randomic/aniauth-tdd | functional_tests/test_evexml.py | functional_tests/test_evexml.py | """Functional tests for the xml api part of aniauth project.
This is a temporary app as EVE Online's xml api is deprecated and will be
disabled March 2018.
"""
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import tag
from django.shortcuts import reverse
from selenium import ... | mit | Python | |
6a7b32e271a264aad763fbd28749ac1258cf041f | Add dialplan filestring module | IndiciumSRL/wirecurly | wirecurly/dialplan/filestring.py | wirecurly/dialplan/filestring.py | import logging
from wirecurly.exc import *
from wirecurly.dialplan.expression import *
import os
log = logging.getLogger(__name__)
__all__ = ['FileString']
class FileString(object):
'''
Filestring oject to use with playback app in dialplan.
'''
def __init__(self,*argv):
super(FileString, self).__init__()
s... | mpl-2.0 | Python | |
6ce84d454ef18f7b7dfc988195bfacb4e69e8c3f | add CRUD test cases for Snippet | castaway2000/OpenStay,castaway2000/OpenStay,castaway2000/OpenStay | hackathon_starter/hackathon/unittests/testsnippets.py | hackathon_starter/hackathon/unittests/testsnippets.py | from hackathon.models import Snippet
from rest_framework import status
from rest_framework.test import APITestCase
class SnippetViewTestCase(APITestCase):
def setUp(self):
self.s1 = Snippet.objects.create(title='t1', code="""print("Hello, World.")""")
self.s2 = Snippet.objects.create(title='t2', c... | mpl-2.0 | Python | |
f59749db263291f481c4bdc9f6ede2f6de6cb6d4 | Create foundation for input file generation (csv for connectivity table, etc.) | ndebuhr/openfea,ndebuhr/openfea | create_input_files.py | create_input_files.py | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output',required=True)
parser.add_argument('-d','--dof',required=True)
# parser.add_argument('-v','--version',required=False)
... | mit | Python | |
9f6df0b93a7a6911d9e7eee0e4fe87e34ea52832 | Create main entrypoint of cli | victormartinez/shub_cli | shub_cli/cli.py | shub_cli/cli.py | """
Scrapinghub CLI
Usage:
shub-cli jobs
shub-cli jobs [-t TAG1,TAG2] [-l LACK1,LACK2] [-s SPIDER] [-e STATE] [-c COUNT]
shub-cli job -id <id>
Options:
-t TAG1,TAG2 Description.
-l LACK1,LACK2 Description.
-s SPIDER Description.
-e STATE Description.
-c COUNT Description.
Exam... | mit | Python | |
53c7233d0ecf7e3f807da9112d1c5eecb75c9ae2 | Add a new moderation-style cog | Thessia/Liara | cogs/moderation.py | cogs/moderation.py | from discord.ext import commands
import discord
import datetime
class Moderation:
def __init__(self, liara):
self.liara = liara
@commands.command(pass_context=True, no_pm=True)
async def userinfo(self, ctx, user: discord.Member=None):
if user is None:
user = ctx.message.author... | mit | Python | |
087829b024ea9c5b2028c3f13786578be6dfd702 | fix the bug of loading all cifar data | ouwenjie03/GAN | load_data.py | load_data.py | # encoding: utf-8
"""
@author: ouwj
@position: ouwj-win10
@file: load_data.py
@time: 2017/4/26 14:33
"""
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='bytes')
return dic... | # encoding: utf-8
"""
@author: ouwj
@position: ouwj-win10
@file: load_data.py
@time: 2017/4/26 14:33
"""
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='bytes')
return dic... | mit | Python |
54404541913185a54fea75353d9fffc72ddc2ff6 | Create discovery_diag.py | infobloxopen/netmri-toolkit,infobloxopen/netmri-toolkit,infobloxopen/netmri-toolkit | python/discovery_diag.py | python/discovery_diag.py | import requests
import json
requests.packages.urllib3.disable_warnings()
s = requests.Session()
def netmriLogin( temp, querystring ):
username = "admin"
password = "infioblox"
url = "https://demo-netmri.infoblox.com/api/3.3" + temp
response = s.request("GET", url, params=querystring, verify=False,
... | mit | Python | |
35f4f5bbea5b291b8204a2ca30acddebfad86d3e | Create 2004-4.py | Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom | 2004-4.py | 2004-4.py | times = input()
i = 0
while i < times:
length = input()
ascents = 0
descents = 0
plateaus = 0
maxA = 0
maxD = 0
maxP = 0
sequence = []
j = 0
while j < length:
currentNum = input()
sequence.append(currentNum)
if j != 0:
if currentNum < sequence[j-1]:
... | mit | Python | |
f228b0d76a5c619e45d40d4d0da12059cb2668e9 | Create warlock.py | anuragpapineni/Hearthbreaker-evolved-agent,noa/hearthbreaker,pieiscool/edited-hearthbreaker,slaymaker1907/hearthbreaker,danielyule/hearthbreaker,Ragowit/hearthbreaker,kingoflolz/hearthbreaker,jirenz/CS229_Project,slaymaker1907/hearthbreaker,anuragpapineni/Hearthbreaker-evolved-agent,anuragpapineni/Hearthbreaker-evolved... | hsgame/cards/minions/warlock.py | hsgame/cards/minions/warlock.py | import hsgame.targeting
from hsgame.constants import CHARACTER_CLASS, CARD_RARITY, MINION_TYPE
from hsgame.game_objects import MinionCard, Minion, Card
#from hsgame.cards.battlecries import
__author__ = 'randomflyingtaco'
#let the train wreck begin
| mit | Python | |
97fcef753647bfbdab0381b30d1533bdce36aeb9 | fix admin | chuck211991/django-pyodbc,schmidsi/django-pyodbc,chuck211991/django-pyodbc | django-pyodbc/contrib/admin/models/models.py | django-pyodbc/contrib/admin/models/models.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.utils.safestring import mark_safe
ADDITION = 1
CHANGE = 2
DELETION = 3
... | bsd-3-clause | Python | |
0ace48790374ea75ba2c6cbc51678e3240c22a88 | Create Differ.py | thezakman/CTF-Scripts,thezakman/CTF-Scripts | Differ.py | Differ.py |
file1 = raw_input('[file1:] ')
modified = open(file1,"r").readlines()[0]
file2 = raw_input('[file2:] ')
pi = open(file2, "r").readlines()[0] # [:len(modified)]
resultado = "".join( x for x,y in zip(modified, pi) if x != y)
resultado2 = "".join( x for x,y in zip(pi, modified) if x != y)
print "[Differ:]
print '\n---... | artistic-2.0 | Python | |
60de63d2fc53c020649bc21576765366f310cf56 | fix by adding migration | lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django | src/polls/migrations/0006_auto_20171114_1128.py | src/polls/migrations/0006_auto_20171114_1128.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-14 10:28
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0005_poll_t... | agpl-3.0 | Python | |
a5d5dde8c523aa28452d790e7f0291c1cf52aacb | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest. | breznak/nupic,breznak/nupic,breznak/nupic | tests/external/py2/testfixture_test.py | tests/external/py2/testfixture_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (C) 2013 Numenta Inc. All rights reserved.
#
# The information and source code contained herein is the
# exclusive property of Numenta Inc. No part of this software
# may be used, reproduced, stored or distributed... | agpl-3.0 | Python | |
b0c74bcf7dd4120684a944a7cd8cc005bee039f5 | Create BogoBogo.py | MaximeKjaer/dailyprogrammer-challenges | Challenge-175/01-Easy/BogoBogo.py | Challenge-175/01-Easy/BogoBogo.py | import random
def bogosort(n, m):
i = 0
while n != m:
n = ''.join(random.sample(n,len(n)))
i += 1
print(i, 'iterations')
return i
def bogobogosort(n, m):
i = 0 #number of iterations
j = 2 #number of elements
while n[:j] != m:
n = ''.join(random.sample(n,len(n)))
while n[:j] != m[:j]:
n = ''.join(ran... | mit | Python | |
84b932df5520901645c6d999abddea1191654a34 | create skeleton of a proper in place quicksort | BradleyMoore/Algorithms | algorithms/sorting/quicksort_ip.py | algorithms/sorting/quicksort_ip.py | from random import randint
def partition(unsorted, start, end, pivot):
pass
def choose_pivot(start, end):
pass
def quicksort(unsorted, start=0, end=None):
pass
if __name__ == '__main__':
unsorted = [3,345,456,7,879,970,7,4,23,123,45,467,578,78,6,4,324,145,345,3456,567,5768,6589,69,69]
sorted... | mit | Python | |
60002062970a2f83725355911dde73673c5875a5 | Add a snippet. | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/pyqt/pyqt5/button_clic_event_as_class.py | python/pyqt/pyqt5/button_clic_event_as_class.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | mit | Python | |
6f5843fb04cfa2ed2082b340f282223ec374f9f6 | copy group descriptions to text table | mgax/mptracker,mgax/mptracker,mgax/mptracker,mgax/mptracker | alembic/versions/49ed2a435cf_group_description.py | alembic/versions/49ed2a435cf_group_description.py | revision = '49ed2a435cf'
down_revision = '5927719682b'
import uuid
from datetime import datetime
from alembic import op
import sqlalchemy as sa
from sqlalchemy import sql
import jinja2
def random_uuid():
return str(uuid.uuid4())
def upgrade():
text = sql.table('text',
sql.column('id'),
sql.... | mit | Python | |
f18fd5c4ad61adb56ac7524a006ce9977aa06a31 | Add worker to send queue mails | Aladom/django-mailing,Aladom/django-mailing | mailing/management/commands/send_queued_mails_worker.py | mailing/management/commands/send_queued_mails_worker.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Mail.STATUS_PENDING and having
`scheduled_on` set on a past date. In ... | mit | Python | |
5a7081c5c46a050566477adda19d30844192ceb2 | Add migration to add authtokens for existing users | WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed | src/mmw/apps/user/migrations/0002_auth_tokens.py | src/mmw/apps/user/migrations/0002_auth_tokens.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
def add_auth_tokens_to_users(apps, schema_editor):
for user in User.objects.all()... | apache-2.0 | Python | |
31b309c1f5981a10207e85950ef8139018afd37c | add roles urls | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/roles/urls.py | src/python/expedient/clearinghouse/roles/urls.py | '''
Created on Jul 29, 2010
@author: jnaous
'''
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns("expedient.clearinghouse.roles.views",
url(r"^confirm/(?P<proj_id>\d+)/(?P<req_id>\d+)/(?P<allow>\d)/(?P<delegate>\d)/$", "confirm_request", name="roles_confirm_request"),
)
| bsd-3-clause | Python | |
abb72a3a248efd1b244798f91cbca09af01ebb3e | Fix CloneManga modules. | webcomics/dosage,peterjanes/dosage,peterjanes/dosage,webcomics/dosage | dosagelib/plugins/clonemanga.py | dosagelib/plugins/clonemanga.py | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2017 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from ..helpers import indirectStarter, xpath_class
from ..scraper import _... | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from re import compile
from ..scraper import _BasicScraper
from ..util im... | mit | Python |
14e55d45428c617507c5c161f4d33154849f63a5 | Create Endings.py | JLJTECH/TutorialTesting | Edabit/Endings.py | Edabit/Endings.py | #!/usr/bin/env python3
'''
Create a function that adds a string ending to each member in a list.
'''
def add_ending(lst, ending):
return [i + ending for i in lst]
| mit | Python | |
ab53993b708b3f9cf3b5762664fef58bae99ea20 | Add some code to auto-remove Ltac | JasonGross/coq-tools,JasonGross/coq-tools | recursive_remove_ltac.py | recursive_remove_ltac.py | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | mit | Python | |
cd6eebfecab9b93863e7e20acec1ba0481f6b95f | Fix benchmark naming in reporting | freedomtan/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,frreiss/tensorflow-fred,karllessard/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-exper... | tensorflow/python/eager/benchmarks_test_base.py | tensorflow/python/eager/benchmarks_test_base.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python |
dccb0f292c86da942c5e4493a5e117e5f3047a05 | add aiohttp exercise | ianzhengnan/learnpy,ianzhengnan/learnpy | aiohttp_ext.py | aiohttp_ext.py | import asyncio
from aiohttp import web
async def index(request):
await asyncio.sleep(0.5)
return web.Response(body=b'<h1>Index</h1>',content_type='text/html')
async def hello(request):
await asyncio.sleep(0.5)
text = '<h1>hello, %s</h1>' % request.match_info['name']
return web.Response(body=text.... | apache-2.0 | Python | |
5788864141c2b635a3c0b8358d868fa7e2b5e789 | Create Pedido_Cadastrar.py | AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb | backend/Models/Turma/Pedido_Cadastrar.py | backend/Models/Turma/Pedido_Cadastrar.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoCadastrar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoCadastrar, self).__init__(variaveis_do_ambiente)
try:
self.letra = self.corpo['letra']
self.id_disciplina = self.corpo['id_dsciplin... | mit | Python | |
44e3876d76c7d7b3571c82030ff78260e4ec7e65 | Add PCA.py template | christopherjenness/ML-lib | ML/PCA.py | ML/PCA.py | """
Exact principal component analysis (PCA)
"""
class PCA(object):
"""
Exact principal component analysis (PCA)
"""
def __init__(self):
return
def fit(self, X):
return | mit | Python | |
cd2c959674043fcc3b6261129f57f266539a8658 | Add a Python snippet. | niucheng/Snippets,niucheng/Snippets,niucheng/Snippets | Python.py | Python.py | #!/usr/bin/env python
# coding: utf-8
"""Python snippet
"""
import os
import sys
if __name__ == '__main__':
if len (sys.argv) == 1:
print ("Hi there!")
else:
print ("Hello, %s!" % sys.argv[1])
| mit | Python | |
65449c60f357eeab5ddc9eb91a468ab1e3719de7 | Add dismiss_recommendation example (#35) | googleads/google-ads-python | examples/v0/recommendations/dismiss_recommendation.py | examples/v0/recommendations/dismiss_recommendation.py | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python | |
8d6ca433d33551cc1fe5c08edcf68ec65e5447b0 | Add solution to exercise 3.3. | HenrikSamuelsson/python-crash-course | exercises/chapter_03/exercise_03_03/exercies_03_03.py | exercises/chapter_03/exercise_03_03/exercies_03_03.py | # 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
print("Should I buy a " + transportation[2] + "?\n")
| mit | Python | |
d82ecab372ed22da0b00512294ee6cd3f5fcb012 | Add script to reindex datasets. | etalab/ckan-of-worms,etalab/ckan-of-worms | ckanofworms/scripts/reindex.py | ckanofworms/scripts/reindex.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# CKAN-of-Worms -- A logger for errors found in CKAN datasets
# By: Emmanuel Raviart <emmanuel@raviart.com>
#
# Copyright (C) 2013 Etalab
# http://github.com/etalab/ckan-of-worms
#
# This file is part of CKAN-of-Worms.
#
# CKAN-of-Worms is free software; you can redistri... | agpl-3.0 | Python | |
3a5df951bb9d12843d46107d0fbca9bd3d9105b3 | Change the name of GUI.py to main_window.py, and change the __init__ function, so that board object and the size of the window can be passed when a frame object is created. | serenafr/My2048 | src/main_window.py | src/main_window.py | import wx
import wx.lib.stattext as ST
import board
class My2048_wx(wx.Frame):
def __init__(self, parent, id, title, size, board_object):
super(My2048_wx, self).__init__(parent, title = title,
size = size)
board_object = board.Board
self.Construct()
def Construct(self):
SIZE = 4;
'''panel_box is the ... | mit | Python | |
ab99892d974503f2e0573a8937dc8f1b085b0014 | Add stringbuilder module | nerevu/riko,nerevu/riko | modules/pipestrconcat.py | modules/pipestrconcat.py | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | mit | Python | |
e7053da76c14f12bfc02992ab745aac193e7c869 | Create compareLists.py | Programing4Mathematics/Beginning | compareLists.py | compareLists.py | def unique(a):
""" return the list with duplicate elements removed """
return list(set(a))
def intersect(a, b):
""" return the intersection of two lists """
return list(set(a) & set(b))
def union(a, b):
""" return the union of two lists """
return list(set(a) | set(b))
if __name__ == "__main_... | apache-2.0 | Python | |
f347e84d4488d635d6b4a1eaf93855631f42c410 | Add simple ant system based solver | Cosiek/KombiVojager | solvers/AntSystem.py | solvers/AntSystem.py | #!/usr/bin/env python
# encoding: utf-8
from random import shuffle, random
from itertools import permutations
from base_solver import BaseSolver
INF = float('inf')
class Ant(object):
route = []
score = INF
def __init__(self, route):
self.route = route
def evaluate(self, task):
st... | mit | Python | |
0ca69bd8c29d123702e1934863d5d8a8c0d1703b | Create parse.py | V1Soft/Essential | parse.py | parse.py | # Parse the Essential Script
def parse(source):
parsedScript = [[]]
word = ''
prevChar = ''
inArgs = False
inList = False
inString = False
inQuote = False
for char in source:
if char == '(' and not inString and not inQuote:
parsedScript.append([])
parsedSc... | bsd-3-clause | Python | |
c4b7bd5b74aaba210a05f946d59c98894b60b21f | Add test for pixel CLI | ceholden/yatsm,c11/yatsm,ceholden/yatsm,valpasq/yatsm,c11/yatsm,valpasq/yatsm | tests/cli/test_pixel.py | tests/cli/test_pixel.py | """ Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Correctly run for one pixel
"""
runner = CliRunner()
r... | mit | Python | |
26dd65a282ada1e79309c4ff35cee4e49b086b66 | Create part3.py | PythonProgramming/pygame-tutorial-series | part3.py | part3.py | import pygame
pygame.init()
display_width = 800
display_height = 600
black = (0,0,0)
white = (255,255,255)
red = (255,0,0)
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption('A bit Racey')
clock = pygame.time.Clock()
carImg = pygame.image.load('racecar.png')
def car(x... | mit | Python | |
98663d644b90e0e4c6188555501bcbc2b42d391a | Create part4.py | PythonProgramming/pygame-tutorial-series | part4.py | part4.py | import pygame
pygame.init()
display_width = 800
display_height = 600
black = (0,0,0)
white = (255,255,255)
red = (255,0,0)
car_width = 73
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption('A bit Racey')
clock = pygame.time.Clock()
carImg = pygame.image.load('racecar.... | mit | Python | |
4727d86e5207dac3f53018b4ff2d1d0ade97d4e6 | Add http_json external pillar (#32741) | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/pillar/http_json.py | salt/pillar/http_json.py | # -*- coding: utf-8 -*-
"""
A module that adds data to the Pillar structure retrieved by an http request
Configuring the HTTP_JSON ext_pillar
====================================
Set the following Salt config to setup Foreman as external pillar source:
.. code-block:: json
ext_pillar:
- http_json:
ur... | apache-2.0 | Python | |
d2e5c2d20cf7e07f2dc8288d303e8f4088d5877a | Update module! | HubbeKing/Hubbot_Twisted | Modules/Update.py | Modules/Update.py | from ModuleInterface import ModuleInterface
from IRCResponse import IRCResponse, ResponseType
import GlobalVars
import re
import subprocess
class Module(ModuleInterface):
triggers = ["update"]
help = "update - pulls the latest code from GitHub"
def onTrigger(self, Hubbot, message):
if message.Use... | mit | Python | |
555cfbb827532c54598cecde01ef4e6e5e07714d | Create a test for re-evaluating external tasks while a workflow is running. | dlstadther/luigi,ViaSat/luigi,adaitche/luigi,humanlongevity/luigi,PeteW/luigi,Houzz/luigi,ZhenxingWu/luigi,springcoil/luigi,ContextLogic/luigi,ivannotes/luigi,percyfal/luigi,belevtsoff/luigi,Yoone/luigi,meyerson/luigi,tuulos/luigi,dkroy/luigi,Houzz/luigi,Dawny33/luigi,theoryno3/luigi,JackDanger/luigi,Magnetic/luigi,bow... | test/worker_external_task_test.py | test/worker_external_task_test.py | # Copyright (c) 2015
#
# 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
# d... | apache-2.0 | Python | |
6232295511ee780a6438c9cdfdcf576cb4f3d8e8 | Add python script to convert .OBJ data for import | huttarl/slitherlink3D,huttarl/slitherlink3D,huttarl/slitherlink3D | obj2json.py | obj2json.py | # obj2json: Convert OBJ export from polyHedronisme to Slitherlink3D JSON data
import sys, json
faces = []
vertices = []
name = "unknown"
num_edges = 0
class ParseError(SyntaxError):
"""Raised when there's trouble parsing the input."""
pass
def process(line):
# print("Processing", line)
if line.start... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.