commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
9826ccce540a945a8cb8bb788a8f993aa5aae553
update stock reco permission
erpnext/patches/jan_mar_2012/update_stockreco_perm.py
erpnext/patches/jan_mar_2012/update_stockreco_perm.py
def execute(): import webnotes webnotes.conn.sql("update `tabDocPerm` set cancel = 1 where parent = 'Stock Reconciliation' and ifnull(submit, 0) = 1")
Python
0
4f9d2d5d9b44ec0232bb1fa7c35012e969b00a2a
Add integration test
plenum/test/bls/test_commit_signature_validation_integration.py
plenum/test/bls/test_commit_signature_validation_integration.py
from contextlib import contextmanager from plenum.common.constants import STEWARD_STRING from plenum.test.helper import sdk_send_random_request, get_key_from_req, sdk_get_and_check_replies, \ sdk_send_random_and_check from plenum.test.pool_transactions.helper import prepare_node_request, \ sdk_sign_and_send_pr...
Python
0
95ff3a585af98df894e5032da9e0e38622a3d9a9
Add template field
kansha/alembic/versions/2b0edcfa57b4_add_templates.py
kansha/alembic/versions/2b0edcfa57b4_add_templates.py
"""Add templates Revision ID: 2b0edcfa57b4 Revises: 24be36b8c67 Create Date: 2015-11-24 17:50:13.280722 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '2b0edcfa57b4' down_revision = '24be36b8c67' def upgrade(): op.add_column('board', sa.Column('is_templa...
Python
0.000001
e1adbced92453329f7285ec38c1dc7821ebb52c7
Add generic reproducer for bug #1879878
nova/tests/functional/regressions/test_bug_1879878.py
nova/tests/functional/regressions/test_bug_1879878.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
fa6fee77d36394145a396688c77096315de8e32a
Create ggrocket.py
ggrocket.py
ggrocket.py
from math import pi, degrees, radians, atan2 from ggmath import MathApp, Circle, ImagePoint class Rocket(ImagePoint): def __init__(self, planet, **kwargs): self._xy = (0,0) self.planet = planet self.bmurl = kwargs.get('bitmap', 'rocket.png') # default rocket png self.bitmapfram...
Python
0.000002
b07f482c0cdc827b0b8d73bd920d9d302d006a91
Test case for contact references (#15077)
erpnext/tests/test_search.py
erpnext/tests/test_search.py
from __future__ import unicode_literals import unittest import frappe from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes class TestSearch(unittest.TestCase): #Search for the word "clie", part of the word "client" (customer) in french. def test_contact_search_in_foreign_language(self): fra...
Python
0
2539e398eccf6134ccdb0c608513c3c5812654b5
Create File2Txt.py
File2Txt.py
File2Txt.py
from console import clear from console import hud_alert from os import remove def drop_extension(filename): dictionary = dict(enumerate(filename, start = 1)) try: assert '.' in dictionary.values() except AssertionError: return filename for (k, v) in dictionary.iteritems(): if v == '.': return filename[:k-...
Python
0
74c89b9fd6ac8f9d32192c0c0fbd5851230538e0
add a script to run sandman. sandman can be used to edit te sqlite database through a browser.
sandman_run.py
sandman_run.py
#!venv/bin/python from sandman import app from sandman.model import activate from losseblaadjes import app as lossebladjes_app app.config['SQLALCHEMY_DATABASE_URI'] = lossebladjes_app.config['SQLALCHEMY_DATABASE_URI'] activate() app.run()
Python
0
0df8ce131c5ed07b032060d9f460a328324c9974
add simplistic google docs exporter
google-export/exporter.py
google-export/exporter.py
import gdata.docs.service import gdata.spreadsheet.service app_name = 'at.zeha.google-export-v0-github' login_u = 'username@example.org' login_p = 'password' export_folder = '/home/username/google-export/data/' gd_client = gdata.docs.service.DocsService(source=app_name) gd_client.ClientLogin(login_u, login_p) gs_cl...
Python
0.000004
a12f74ec8d7413e0db2d3012bf94d92bde74cbaf
Create cvrmongo.py
cvrminer/cvrmongo.py
cvrminer/cvrmongo.py
"""cvrmongo - Interface to CVR information a Mongo database. Usage: cvrmongo [options] build-database cvrmongo [options] count-companies cvrmongo [options] get-all-company-purposes cvrmongo [options] get-company <cvr-nummer> cvrmongo [options] get-company-purposes <cvr-nummer> Options: --debug ...
Python
0.000007
7320e6fd38babe5b7c2d5fbb5121d5845c57bb05
Add problem75.py
euler_python/problem75.py
euler_python/problem75.py
""" problem75.py It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples. 12 cm: (3,4,5) 24 cm: (6,8,10) 30 cm: (5,12,13) 36 cm: (9,12,15) 40 cm: (8,15,17) 48 cm: (12,16,20) In c...
Python
0.000075
c7efac00035589f271b2c591489f3b32cabcc6e5
Add very basic example.
examples/example1.py
examples/example1.py
from datetime import datetime from flask import Flask from flask_json import FlaskJSON, JsonErrorResponse, json_response app = Flask(__name__) FlaskJSON(app) @app.route('/get_time') def get_time(): return json_response(time=datetime.utcnow()) @app.route('/raise_error') def raise_error(): raise JsonErrorRes...
Python
0.000001
9fc13403b4687ed90e73d48782fb28215cb63612
Add tests for hc.lib.curl
hc/lib/tests/test_curl.py
hc/lib/tests/test_curl.py
from unittest.mock import patch from django.test import TestCase from hc.lib.curl import request import pycurl class FakeCurl(object): def __init__(self, testclass): self.opts = {} self.testclass = testclass def setopt(self, k, v): self.opts[k] = v def perform(self): if ...
Python
0
ff9ebfb2698c40da5af383b0e620191f4a893e7b
add skitai_pingpong_handler
skitai/tools/benchmark/skitai_pingpong_handler.py
skitai/tools/benchmark/skitai_pingpong_handler.py
""" This module is copy of skitai.handler.pingpong_handler.py. It's not actually used by skitai, but for just your reference """ from . import ssgi_handler class Handler (ssgi_handler.Handler): def __init__(self, wasc): self.wasc = wasc def match (self, request): return request.split_uri() [0] == "/ping" ...
Python
0.000079
5cae22b665c250935d7a0c3fdd0e583beff08500
add nofollow to Link object
scrapy/link.py
scrapy/link.py
""" This module defines the Link object used in Link extractors. For actual link extractors implementation see scrapy.contrib.linkextractor, or its documentation in: docs/topics/link-extractors.rst """ class Link(object): """Link objects represent an extracted link by the LinkExtractor. At the moment, it cont...
""" This module defines the Link object used in Link extractors. For actual link extractors implementation see scrapy.contrib.linkextractor, or its documentation in: docs/topics/link-extractors.rst """ class Link(object): """Link objects represent an extracted link by the LinkExtractor. At the moment, it cont...
Python
0
2f180a089450da5241836a1c6dc77f5116a5418d
Add c4_check_move
examples/c4_check_move.py
examples/c4_check_move.py
from keras.models import load_model from capstone.game.games import Connect4 as C4 from capstone.game.players import AlphaBeta, GreedyQ, RandPlayer from capstone.rl.value_functions import QNetwork from capstone.game.utils import play_match board = [[' ', ' ', ' ', ' ', ' ', ' ', ' '], # 6 [' ', ' ', ' ', ' ',...
Python
0.000012
bfbec3452bb518f9bd674a3782a56e45ee2e18da
Add quotes example
examples/quotes/quotes.py
examples/quotes/quotes.py
import sys print(sys.version_info) import random import time import networkzero as nw0 quotes = [ "Humpty Dumpty sat on a wall", "Hickory Dickory Dock", "Baa Baa Black Sheep", "Old King Cole was a merry old sould", ] my_name = input("Name: ") nw0.advertise(my_name) while True: services = [(name,...
Python
0
9018954189a6556e6038d01e0766a336d62a91fd
Add __init__.py
choosealicense/__init__.py
choosealicense/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ choosealicense-cli ~~~~~ Bring http://choosealicense.com to your terminal. :copyright: (c) 2015 by lord63. :license: MIT, see LICENSE for more details. """ __title__ = "choosealicense-cli" __version__ = '0.1.0' __author__ = "lord63" __license__ ...
Python
0.006636
8d45b85a5726db2cc3038adae2fc2f609c35ed63
Create analyzer.py
analyzer.py
analyzer.py
#!/usr/bin/python import pprint import re import argparse from datetime import datetime from statsd import StatsClient from utils import failureReasons, JenkinsClient def is_build_failed(job): if job['lastBuild']: if job['lastBuild']['result'] == 'FAILURE': return True return Fals...
Python
0.000001
7df4b40a67978620f4a596191c5758276a6e4045
Create FireFlow.py
FireFlow.py
FireFlow.py
################################################################################################################################# # Name: Elizabeth Rentschlar # # Purpose: ...
Python
0
954301b5f3290a85d58d9d16a30c8c50c97e7283
Add fuzzy match
form_matching/fuzzy_match.py
form_matching/fuzzy_match.py
''' Tashlin Reddy August 2020 Fuzzy Match strings in Columns of CSV file ''' #read in dependencies import pandas as pd import numpy as np from fuzzywuzzy import fuzz #read in csv form form = pd.read_csv('form.csv') #form = pd.read_csv('https...') #iterate over each column and check if there is a list to fuz...
Python
0.000001
b7406691eed7308d7dd4336326c896e22d16d768
add coins model with save fig in the right spot
book/coins_model_sel_demo.py
book/coins_model_sel_demo.py
import numpy as np from pyprobml_utils import save_fig import matplotlib.pyplot as plt from scipy.special import betaln theta = 0.7 N = 5 alpha = 1 alphaH = alpha alphaT = alpha # instantiate a number of datastructures flips = np.zeros((2**N, N)) Nh = np.zeros(2**N) Nt = np.zeros(2**N) marginal_lik = np.zeros(2**N) l...
Python
0
8347613940104b77224c48e104f898ac29f0c34d
Add script to generate synthetic CPT documents
generateCPTCorpus.py
generateCPTCorpus.py
"""Script that generates a (synthetic) corpus to test the CPT model. The corpus consists of 5 documents containing fixed topics and opinions. The generation process is described in the CPT paper. A text document contains the topic words on the first line and the opion words on the second line. Usage: python generat...
Python
0.000003
32858d93d8fcb0adf3b0da54f607fddbc29926ad
refactor customerRegister
usermanage/views/customerRegister.py
usermanage/views/customerRegister.py
from django.shortcuts import render, redirect from django.http import HttpResponseRedirect from django.contrib.auth import login, authenticate, logout from django.contrib.auth.models import User, Group from django.contrib.auth.decorators import login_required, user_passes_test, permission_required from django.contrib.a...
Python
0.999986
4abd3e25bb28b497af38588ca4d495e9bbf927fd
Convert Windows to Unix style line endings
glance/common/ordereddict.py
glance/common/ordereddict.py
# Copyright (c) 2009 Raymond Hettinger # # 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 without limitation the rights to use, copy, modify, merge, # publish,...
# Copyright (c) 2009 Raymond Hettinger # # 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 without limitation the rights to use, copy, modify, merge, # pu...
Python
0.000194
8f6dd4e4825175b4be37bca85c466b51619c3b89
Create list-iod-web-index.py
list-iod-web-index.py
list-iod-web-index.py
#!/usr/bin/env python import os import unirest import time import json import pprint import logging import argparse unirest.timeout(120) IODAPIKEY = os.environ.get('IODAPIKEY') parser = argparse.ArgumentParser(description='List IOD connectors associated with the API key') parser.add_argument('--apikey', default=IOD...
Python
0.000003
deac3ae3b0f19adcbe612cce7fe9cfbbc2c08c5f
Update to current year
docs/conf.py
docs/conf.py
import os import sys sys.path.insert(0, "..") from praw import __version__ copyright = "2020, Bryce Boe" exclude_patterns = ["_build"] extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"] html_static_path = ["_static"] html_theme = "sphinx_rtd_theme" html_theme_options = {"collapse_navigation": True} htmlhe...
import os import sys sys.path.insert(0, "..") from praw import __version__ copyright = "2017, Bryce Boe" exclude_patterns = ["_build"] extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"] html_static_path = ["_static"] html_theme = "sphinx_rtd_theme" html_theme_options = {"collapse_navigation": True} htmlhe...
Python
0.000005
2ea14af13a80b98609108f8824ff1d995b0fecfb
Create img2html.py
img2html.py
img2html.py
#!/usr/bin/env python # img to html v0.2 # will convert a non-svg image to html # # Gauntlet O. Manatee # spukspital@openmailbox.org import os, sys import Image imgname = raw_input("Enter the path to the .png file you want to convert.\n(I recommend .png, though it is not mandatory.\n \ Other image files work, t...
Python
0.000126
819a74a5960a94bf8ac2a70af3af3fd17a69fccc
Create MPL115A2.py
MPL115A2.py
MPL115A2.py
#!/usr/bin/python #=========================================================================== # Code based off yaso.kuhl post in forum and adafruit_support_mike # modified and restructured by kkkkkbruce #=========================================================================== import time import RPi.GPIO as GPIO f...
Python
0.000001
cff78bad619c7fb1e8c9067dedbf6afc38de90d5
Create 'Python.py'.
P/Python.py
P/Python.py
for i in range (0, 10, 1): print ((" " * (10 - i)) + ("*" * (i * 2 + 1))) for i in range (10, -1, -1): print ((" " * (10 - i)) + ("*" * (i * 2 + 1))) raw_input ()
Python
0.003145
16525e1e249d8506f605569c5d6d87b1988e890d
Create PushOver.py
PushOver.py
PushOver.py
import sys #Making compatible for Python 3 and 2. if sys.version_info < (3, 0, 0): import urllib else: import urllib2.parse as urllib import urllib2 class Sounds(object): Short_Pushover = 'pushover' Short_Bike = 'bike' Short_Bugle = 'bugle' Short_Cash_Register = 'cashregister' Short_Class...
Python
0
d782809746cfb403358bdfb10215b70c96498264
Introduce a live camera viewer with Qt.
QtViewer.py
QtViewer.py
#! /usr/bin/env python # -*- coding:utf-8 -*- # # Qt interface to display AVT cameras # # # External dependencies # from PyQt4 import QtGui, QtCore # # Window to display a camera # class QtViewer( QtGui.QWidget ) : # # Initialisation # def __init__( self, camera ) : # Initialize parent class QtGui.QWid...
Python
0
70ed3c4044b425f2b679da3f0a3f33a9f7e6381a
introduce data gatherer for finding new versions of various libraries
data/gatherer.py
data/gatherer.py
"""Gatherer of software components for further identification by the Cuckoo Sandbox team. This file uploads as many relevant software components as possible so that the Cuckoo Sandbox team may be able to add support for more versions of certain software packages. E.g., currently we have special support for Office 2007...
Python
0
3bf112fcd3f42716bcf7dad0561280f52fc6a31f
add django-cron suppo
link_report/cron.py
link_report/cron.py
# This file works with our fork of django-cron. # It's use is optional # Use any means you like to run scheduled jobs. from django_cron import cronScheduler from django_cron import Job from django_cron import DAY from link_report.utils import update_sentry_404s class RunUpdateSentry404s(Job): run_every = D...
Python
0.000001
02d7e423416ab90bdc4db6428c51efaf6f33a4c6
Create templatetag for put a settings var into context
dbaas/dbaas/templatetags/settings_tags.py
dbaas/dbaas/templatetags/settings_tags.py
from django import template from django.conf import settings register = template.Library() @register.assignment_tag() def setting(var_name): """ Get a var from settings """ return getattr(settings, var_name)
Python
0
0c329e33d9b2c0a4101791f4a5597631c61b2255
Create __init__.py
__init__.py
__init__.py
Python
0.000429
7ff5cafea31631605883e22d022a5e4bcede336f
exit more gracefully if no repository id is given
__init__.py
__init__.py
# reviewboard extension for mercurial import os, errno, re from mercurial import cmdutil, hg, ui, patch, util from mercurial.i18n import _ from mercurial import demandimport demandimport.disable() from reviewboard import ReviewBoard, ReviewBoardError def postreview(ui, repo, rev='tip', **opts): '''post changeset...
# reviewboard extension for mercurial import os, errno, re from mercurial import cmdutil, hg, ui, patch, util from mercurial.i18n import _ from mercurial import demandimport demandimport.disable() from reviewboard import ReviewBoard, ReviewBoardError def postreview(ui, repo, rev='tip', **opts): '''post changeset...
Python
0.000001
220086dd3404ad00f113751a78c5abb219d68819
Introduce resource provider.
loldb/v2/resources.py
loldb/v2/resources.py
import collections import os import re import sqlite3 import raf def _get_highest_version(versions): versions = [(v, v.split('.')) for v in versions] def version_converter(version): try: parts = map(int, version[1]) except ValueError: return None else: ...
Python
0
7aabf3383b8386602ed77500ad3b4914028c97a4
add tuple
python/tuple/tuple/src/tuple/tuple.py
python/tuple/tuple/src/tuple/tuple.py
#!/usr/bin/python lst = [10, 20, 30] print "lst = %s" % lst lst[1] = 15 print "lst = %s" % lst tpl = (100, 200, 300) print tpl[0] print tpl[1] print tpl[2] #tpl[1] = 150
Python
0.998576
9ca2291f49188b5ecd6df09fd5230e321eb91b2d
Add FileHandler tests.
test_logbook.py
test_logbook.py
import logbook import os import shutil import unittest import tempfile class LogbookTestCase(unittest.TestCase): def setUp(self): self.log = logbook.Logger('testlogger') class BasicAPITestCase(LogbookTestCase): def test_basic_logging(self): handler = logbook.TestHandler() with hand...
import unittest import logbook class BasicAPITestCase(unittest.TestCase): def test_basic_logging(self): logger = logbook.Logger('Test Logger') handler = logbook.TestHandler() with handler.contextbound(bubble=False): logger.warn('This is a warning. Nice hah?') assert ...
Python
0
f3522fedb75b72476419779850e7bbc5fa277c70
Add generator
Planificador/gamesCreator.py
Planificador/gamesCreator.py
#!/usr/bin/python # -*- coding: utf-8 -*- import random; class Exercice: def __init__(self, num, level): self.preparator = [] self.precursor = [] self.num = num self.level = level def __cmp__(self, other): if not isinstance(other, Exercice): return NotImplemented return self.num == other.num def _...
Python
0.000002
0a501aca74224581228cf695d8d7d46d845ef8df
Create BPLY.py
BPLY.py
BPLY.py
import AXUV20 import surface import geometry
Python
0
d1e6f060edd7b09f84892df95611fc3f52a6fb5a
Rename results file
crowdastro/experiment/results.py
crowdastro/experiment/results.py
"""Object for storing experimental results. Matthew Alger The Australian National University 2016 """ import h5py import numpy class Results(object): """Stores experimental results.""" def __init__(self, path, methods, n_splits, n_examples): """ path: Path to the results file (h5). File wil...
Python
0.000001
52f5eb3e39d7cc01d2d149d87eb63086028ca265
add integration tests for settings
okupy/tests/integration/test_settings.py
okupy/tests/integration/test_settings.py
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python from django.conf import settings from django.test import TestCase from django.test.client import Client from mockldap import MockLdap from okupy.tests import vars class SettingsIntegrationTests(TestCase): @classmethod def setUpClass(cls): cls.mock...
Python
0
fd540540fa269279502b89ef83f1daaf38210162
move only module to __init__.py
__init__.py
__init__.py
import requests, re, json import lxml.etree import lxml.html.soupparser user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14' json_getter = re.compile(r'trulia\.propertyData\.set\((.*?)\);') def get(url): return requests.get(url, he...
Python
0.00002
b1b9d1c9e46bcc92c9046450d92ae8e89f2d2998
Create __init__.py
__init__.py
__init__.py
__version__ = '0.9.5' from VKapi2.exceptions import ApiException from VKapi2.api import Api from VKapi2.api import ApiHelper import sys import logging import requests logger = logging.getLogger('VK_api_2') formatter = logging.Formatter( '%(asctime)s (%(filename)s:%(lineno)d %(threadName)s) %(levelname)s - %(nam...
Python
0.000429
5f80b313c436bdac9eb8db4e9f835a210833c106
Add __init__.py.
__init__.py
__init__.py
import messages from connection import Connection from monitor import Monitor from publisher import Publisher
Python
0.000084
c5f16d5d8c85383a3735b871962f70509109ebd7
Create __init__.py
__init__.py
__init__.py
Python
0.000429
974ba258850d556b25372e2941c0742d5812a78f
Adding an OpenID authentcation process test.
test/internet_tests/test_openid_authentication.py
test/internet_tests/test_openid_authentication.py
# Generated by the windmill services transformer from windmill.authoring import WindmillTestClient def test_openid_authentication(): client = WindmillTestClient(__name__) client.open(url='https://www.hampr.com/') client.waits.forPageLoad(timeout=20000) client.waits.forElement(xpath="//div[@id='hamprTit...
Python
0.99984
a3e3b5f0964d700732d623a3dcafb0056f4eb1eb
Update __version__
djstripe/__init__.py
djstripe/__init__.py
from __future__ import unicode_literals import warnings from django import get_version as get_django_version __title__ = "dj-stripe" __summary__ = "Django + Stripe Made Easy" __uri__ = "https://github.com/pydanny/dj-stripe/" __version__ = "0.7.0-dev" __author__ = "Daniel Greenfeld" __email__ = "pydanny@gmail.com" ...
from __future__ import unicode_literals import warnings from django import get_version as get_django_version __title__ = "dj-stripe" __summary__ = "Django + Stripe Made Easy" __uri__ = "https://github.com/pydanny/dj-stripe/" __version__ = "0.5.0" __author__ = "Daniel Greenfeld" __email__ = "pydanny@gmail.com" __li...
Python
0.000006
57bd45f13a091dd6fe40ecd960dc7e6b00d60def
support for epics ioc to host XRF scan plans.
profile_xf05id1/startup/30-scanutils.py
profile_xf05id1/startup/30-scanutils.py
from ophyd import EpicsSignal,EpicsSignalRO,Device from ophyd import Component as Cpt class SRXScanRecord(Device): class OneScan(Device): p1s = Cpt(EpicsSignal, 'P1-S') p2s = Cpt(EpicsSignal, 'P2-S') p1i = Cpt(EpicsSignal, 'P1-I') p2i = Cpt(EpicsSignal, 'P2-I') p1stp = Cpt(...
Python
0
71c8e8e3d6395b51a453e591bee882cd3e024d26
Create solve-the-equation.py
Python/solve-the-equation.py
Python/solve-the-equation.py
# Time: O(n) # Space: O(n) # Solve a given equation and return the value of x in the form of string "x=#value". # The equation contains only '+', '-' operation, the variable x and its coefficient. # # If there is no solution for the equation, return "No solution". # # If there are infinite solutions for the equation,...
Python
0.000246
97bf042815dff04a87b3321d1c269036ab9e7794
Create __init__.py
__init__.py
__init__.py
Python
0.000429
73ce4aafc7eed616adb36a9b9f7268b696fbd489
Create __init__.py
__init__.py
__init__.py
from source import networkviz as networkviz
Python
0.000016
4dc7c6be7b3f6741e787731801b4d853c1f24f1f
Add mkerefuse.__main__ module
mkerefuse/__main__.py
mkerefuse/__main__.py
#!/usr/bin/env python3 """ Looks up addresses to discover future garbage and/or recycle pickup dates within the city of Milwaukee, WI Usage: mkerefuse --help mkerefuse [options] Options: -a, --address STRING House number -d, --direction STRING Address direction (N, S, E, W) -s, --stre...
Python
0.000162
bf05dd9c1b39c8752aae60997fe5aca6e5572584
Create gae_pylint_plugin.py
gae_pylint_plugin.py
gae_pylint_plugin.py
from astroid import MANAGER from astroid import scoped_nodes NDB_PROPERTIES = [ 'DateTimeProperty', 'StringProperty', 'KeyProperty', 'StructuredProperty' ] def register(linter): pass def transform(modu): if modu.name == 'google.appengine.ext.ndb': for f in NDB_PROPERTIES: ...
Python
0.000002
e0ae0c605fd30f4f303abf390aaa6cbfa18cee39
Bump version 1.22.3
geocoder/__init__.py
geocoder/__init__.py
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import """ Geocoder ~~~~~~~~ Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each...
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import """ Geocoder ~~~~~~~~ Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each...
Python
0
463de112add0178b6e3aa13b75bc7ae8dc26b612
Create __openerp__.py
__openerp__.py
__openerp__.py
# -*- encoding: utf-8 -*- { 'name': 'Message box dialog', 'application': False, 'version': '8.0.r1.0', 'category': 'General', 'description': ''' Allows to ask a question through a dialog. Via a wizard your question is asked. Buttons can be hidden or their labels can be set * Creates a record in m...
Python
0.005291
cf060a473bb2412f97301ab72f96a57d370bc79f
Add IncrementalModel
models/rasmachine/incremental_model.py
models/rasmachine/incremental_model.py
import pickle from indra.assemblers import PysbAssembler class IncrementalModel(object): def __init__(self, fname=None): if fname is None: self.stmts = {} else: try: self.stmts = pickle.load(open(fname, 'rb')) except: print 'Could ...
Python
0.000001
12e7e7b29a91e67755c5d9b9e29b4a8614def1bc
Add module disable framework
motobot/core_plugins/disable_module.py
motobot/core_plugins/disable_module.py
from motobot import command, request, IRCLevel, Priority, Notice, split_response @request('GET_PLUGINS') def disabled_request(bot, context, channel): disabled = context.database.get({}).get(channel.lower(), set()) return filter_plugins(bot.plugins, disabled) def filter_plugins(plugins, disabled): return...
Python
0.000001
09f2bfa4a30fd59af209045f74a84941e5e0b1c6
Create game.py
game.py
game.py
# CodeSkulptor runs Python programs in your browser. # Click the upper left button to run this simple demo. # CodeSkulptor runs in Chrome 18+, Firefox 11+, and Safari 6+. # Some features may work in other browsers, but do not expect # full functionality. It does NOT run in Internet Explorer. import simplegui DEBUG ...
Python
0.000001
7c4e265808440c8e670651660909e61498c496a0
add dijkstrashortreach
algorithms/graph-theory/dijkstrashortreach/dijkstrashortreach.py
algorithms/graph-theory/dijkstrashortreach/dijkstrashortreach.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Zeyuan Shang # @Date: 2015-12-26 16:28:23 # @Last Modified by: Zeyuan Shang # @Last Modified time: 2015-12-26 16:28:36 import sys import queue class Vertex: def __init__(self): self.edges = {} def get_edges(self): return self.edges ...
Python
0.999957
8ee4cef9689ee8a73e3952d46dc93908208b84ea
Add second passing test
maximum_equality.py
maximum_equality.py
''' Maximum equality ================ Your colleague Beta Rabbit, top notch spy and saboteur, has been working tirelessly to discover a way to break into Professor Boolean's lab and rescue the rabbits being held inside. He has just excitedly informed you of a breakthrough - a secret bridge that leads over a moat (like...
Python
0
cd325c15dd23d1047dc0ca8fc5108ee93e38568d
Create บวกลบธรรมดา.py
บวกลบธรรมดา.py
บวกลบธรรมดา.py
__author__ = 'วรรณพงษ์' #import re print("Text") a = input("Text") if a.find("+"): s = a.split("+") in1 = int(s[0]) in2 = int(s[1]) cal = in1 + in2 elif a.find("-"): s = a.split("-") in1 = int(s[0]) in2 = int(s[1]) cal = in1 - in2 elif a.find("*"): s = a.split("*") in1 = int(s[0]...
Python
0.000001
0f1003cf17acdb3ee9b9614131f7e8d7c9cebb41
add list of events
yaranullin/events.py
yaranullin/events.py
# yaranullin/events.py # # Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS...
Python
0
66625f050d158f76b508bfa94ea8a3efe998f9d5
backup on setting deploy version
contacttools/settings_used_on_deploy.py
contacttools/settings_used_on_deploy.py
""" Django settings for contacttools project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import ...
Python
0
1c09bfb7c999fba548730a5a9249455f709d7f16
Convert contribution zip codes to county names
data_cleanup/data_cleanup.py
data_cleanup/data_cleanup.py
import os import pandas as pd import csv # Directory path constants ROOT_PATH = os.path.abspath(__file__ + "/../../") DATA_DIR_PATH = os.path.join(ROOT_PATH, "data_files") # File path constants CONTRIBUTIONS_PATH = os.path.join(DATA_DIR_PATH, "contributions.csv") ZIP_CODES_PATH = os.path.join(DATA_DIR_PATH, "zip_code...
Python
0.999999
39f2b145aebbc68ce8e07bc38ff553d5414393bb
add handcontrolmacros.py, not used for now
software/ddapp/src/python/ddapp/handcontrolmacros.py
software/ddapp/src/python/ddapp/handcontrolmacros.py
class HandControlMacros(object): @staticmethod def openLeft(): handcontrolpanel.panel.ui.leftButton.click() handcontrolpanel.panel.ui.openButton.animateClick() @staticmethod def openRight(): handcontrolpanel.panel.ui.rightButton.click() handcontrolpanel.panel.ui.openB...
Python
0
fe25d61a64d81a5958ab4e2f099ffde3f19d94c9
Add simple oscillator animation
animator.py
animator.py
""" Animate evolution of system of oscillators """ import numpy as np import networkx as nx import matplotlib as mpl mpl.use('Agg', force=True) import matplotlib.pylab as plt import matplotlib.animation as animation from tqdm import tqdm from scarce_information import System class Animator(object): """ Ge...
Python
0.000001
252e81efb687fecc1961a908444d0f096e9587b5
rename pieChart example
examples/pieChart.py
examples/pieChart.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Examples for Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from nvd3 imp...
Python
0.000003
e8e8a07ba70ff3defbc529b6619054001cb692b0
Add RemoveOutliers python example
src/python/RemoveOutliers.py
src/python/RemoveOutliers.py
""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1000]) >>> sorted(removeOutliers(b).collect() [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] """ import sys import math from pyspark import SparkContext def removeOutliers(nums): """Rem...
Python
0
9ab0ead47220d704a3c80cae25ddd05afac55271
Add example plugin to solve with angr
python/examples/angr_plugin.py
python/examples/angr_plugin.py
# This plugin assumes angr is already installed and available on the system. See the angr documentation # for information about installing angr. It should be installed using the virtualenv method. # # This plugin is currently only known to work on Linux using virtualenv. Switch to the virtual environment # (using a com...
Python
0
2c651b7083ec368ebf226364a1a1aba5f5ec147e
Add migration for datetime change.
fjord/feedback/migrations/0003_auto__chg_field_simple_created.py
fjord/feedback/migrations/0003_auto__chg_field_simple_created.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Simple.created' db.alter_column('feedback_simple', 'created', self.gf('django.db.models.f...
Python
0
0ce5c678b52c9e3bd3a2c9a2bd4c0208eefd51c7
Add files via upload
apf_plds.py
apf_plds.py
''' Implements the Fully Adapted Auxiliary Particle Filter as described by Whiteley and Johansen (Recent Developments in Auxiliary Particle Filtering) Algorithm 2 on page 5 of Chapter 3: http://www.maths.bris.ac.uk/~manpw/apf_chapter.pdf Quadrature is defined for a 2 dimensional state space model according to Gaussia...
Python
0
b4fe0a903e5a7bff2dca0c6c7c66613d27d14ef9
add defalt tests
actionslog/tests/__init__.py
actionslog/tests/__init__.py
"""Test model definitions.""" from __future__ import unicode_literals from django.core.management import call_command call_command('makemigrations', verbosity=0) call_command('migrate', verbosity=0)
Python
0.000001
6e77dbbad4cde687ab112c7c0a5da2a958a3ea42
Add synthtool scripts (#3765)
java-websecurityscanner/google-cloud-websecurityscanner/synth.py
java-websecurityscanner/google-cloud-websecurityscanner/synth.py
# Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
0.000001
4677085404e41dac88b92418bbc46c6a1dea30df
Add snapshot function.
src/main/python/pgshovel/snapshot.py
src/main/python/pgshovel/snapshot.py
import collections from contextlib import contextmanager from psycopg2.extensions import ISOLATION_LEVEL_REPEATABLE_READ @contextmanager def prepare(connection, table): """ Prepares a function that can be used to take a consistent snapshot of a set of capture groups by their primary keys. """ con...
Python
0.998964
3e5abf8d7a265e5b873336db04945fca591afb80
add Read_xls.py file
Read_xls.py
Read_xls.py
__author__ = 'wyb' # -*- coding:utf-8 -*- # testing gdal-lib import gdal import numpy import struct from gdalconst import * dataset = gdal.Open('/home/wyb/data/SPOT.img', GA_ReadOnly) if dataset is None: print 'Nodata' else: print 'Driver:', dataset.GetDriver().ShortName, '/', \ dataset.GetDriver().Long...
Python
0.000001
e80b1f81152313947b1a94efe78279b575186731
Create autoexec.py
autoexec.py
autoexec.py
#!/usr/bin/python # # XBMC MQTT Subscriber and custom popup # october 2013 v1.0 # # by Matthew Bordignon @bordignon # # Format mqtt message using json # {"lvl":"1","sub":"xxxxxx","txt":"xxxxxx","img":"xxx","del":"10000"} # {"lvl":"level either 1 or 2","sub":"subject text","txt":"main text 150 characters m...
Python
0
635ed78543b3e3e8fe7c52fa91ee8516d617249d
Add client sample for test - Connect to server - Receive data from server - Strip the data and print
data-travel/test_client.py
data-travel/test_client.py
from socket import * host = '127.0.0.1' port = 1234 bufsize = 1024 addr = (host, port) client = socket(AF_INET, SOCK_STREAM) client.connect(addr) while True: data = client.recv(bufsize) if not data: break print data.strip() client.close()
Python
0
40c19953e55e11a8b7e48e9894d8dd2322d6bd11
Add engine zoom functions
temp_volume.py
temp_volume.py
#!/usr/bin/env python from __future__ import print_function from OCC.STEPControl import STEPControl_Reader from OCC.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity from OCC.Display.SimpleGui import init_display from OCC.gp import gp_Ax1, gp_Pnt, gp_Dir, gp_Trsf from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox...
Python
0
e9979dc54b884c8a300cc3d663e44c793b7afd57
Add script term-weight.py, computting term-weight for query/bidword.
term-weight.py
term-weight.py
#!/usr/bin/env python # -*- coding: utf-8 from codecs import open from argparse import ArgumentParser def load_entropy_dict(entropy_file): entropy_dict = {} with open(entropy_file, 'r') as fd: for line in fd: splited_line = line.strip().split("\t") if len(splited_line) != 2: ...
Python
0
769a255fbcaf1b657f1a76ff89d3ffa6998e4ada
Support unix socket connections in redis pool
src/sentry/utils/redis.py
src/sentry/utils/redis.py
from __future__ import absolute_import from threading import Lock import rb from redis.connection import ConnectionPool from sentry.exceptions import InvalidConfiguration from sentry.utils.versioning import ( Version, check_versions, ) _pool_cache = {} _pool_lock = Lock() def _shared_pool(**opts): if...
from __future__ import absolute_import from threading import Lock import rb from redis.connection import ConnectionPool from sentry.exceptions import InvalidConfiguration from sentry.utils.versioning import ( Version, check_versions, ) _pool_cache = {} _pool_lock = Lock() def _shared_pool(**opts): ke...
Python
0
2f7de7af9e2bce2a559c69f04a38f5b7cd6c55a8
Add avl tree implementation
avl_tree.py
avl_tree.py
#import random, math outputdebug = False def debug(msg): if outputdebug: print msg class Node(): def __init__(self, key): self.key = key self.left = None self.right = None class AVLTree(): def __init__(self, *args): self.node = None self.height = -1...
Python
0
8dcda61421af49320aa7865d9a51847a94dc1904
Create retrieve_lowest_fares_to_db.py
retrieve_lowest_fares_to_db.py
retrieve_lowest_fares_to_db.py
# -*- coding: utf-8 -*- """ Retrieve airfare pricing data, for a list of routekeys, from an internal API. Load to a database. """ from __future__ import print_function, division, absolute_import, unicode_literals import requests import json import datetime import pyodbc as db import datetime import time # Database C...
Python
0
3222504bd076368c7a3069f9accf2627ad1dab86
Add __init__ to repo root for subclassing
__init__.py
__init__.py
from rivescript import RiveScript
Python
0
849adb1ea4c6ff46145e18dbe4fd949b5d5a4d7d
Create __init__.py
__init__.py
__init__.py
Python
0.000429
4d8aaca73a8dbe8895ca4a523828fbb7ecd3fc7f
Add __init__ file
__init__.py
__init__.py
from snapbill import *
Python
0.00026
b64e7af67161fecb7aec8797497e1d3a4f3e91fe
complete 35 circular primes
35-circular-primes.py
35-circular-primes.py
from utils import prime_gen def rotate(l): for x in range(len(l)): yield l[-x:] + l[:-x] def circular_primes(): p = prime_gen() while True: prime = next(p) if prime > 1_000_000: break else: s.add(str(prime)) for prime in s: if all((''.joi...
Python
0.000001
313e9cae068192fe11ad10ea0b5c05061b0e5c60
Add unit test for _validate_key_file_permissions in ec2 module
tests/unit/cloud/clouds/ec2_test.py
tests/unit/cloud/clouds/ec2_test.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import os import tempfile # Import Salt Libs from salt.cloud.clouds import ec2 from salt.exceptions import SaltCloudSystemExit # Import Salt Testing Libs from salttesting import TestCase, skipIf from salttesting.mock import MagicMock...
Python
0.000001
22f57f6490826b99e35b80d85837c95921cd6c97
add test to reproduce keyerror
tests/unit/dht/test_routingtable.py
tests/unit/dht/test_routingtable.py
import unittest from lbrynet.dht import contact, routingtable, constants class KeyErrorFixedTest(unittest.TestCase): """ Basic tests case for boolean operators on the Contact class """ def setUp(self): own_id = (2 ** constants.key_bits) - 1 # carefully chosen own_id. here's the logic ...
Python
0
0202f0bd4358d68917af19910bb4e1f0a3dda602
Add usb bridge test(CDC & HID)
scripts/avalon-usb2iic-test.py
scripts/avalon-usb2iic-test.py
#!/usr/bin/env python2.7 # This script aim to make a loopback test on cdc or hid. # The statics is used for comparison, it is not accurate. from serial import Serial from optparse import OptionParser import time import binascii import usb.core import usb.util import sys parser = OptionParser() parser.add_option("-M"...
Python
0
33028c8955e8d1b65416e52169a53b40d9a0dbe4
add new package : rt-tests (#14174)
var/spack/repos/builtin/packages/rt-tests/package.py
var/spack/repos/builtin/packages/rt-tests/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RtTests(Package): """ Suite of real-time tests - cyclictest, hwlatdetect, pip_stress, ...
Python
0
467439729ef97c1d48b3409294889e912af00834
Add hidden Markov model demo
bayespy/demos/demo_hidden_markov_model.py
bayespy/demos/demo_hidden_markov_model.py
###################################################################### # Copyright (C) 2014 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ####################...
Python
0.001303
058380775fcfed77373512946c4a32b9df4aac87
add benchmark for signal.lfilter. Follow-up of gh-4628.
benchmarks/benchmarks/signal_filtering.py
benchmarks/benchmarks/signal_filtering.py
from __future__ import division, absolute_import, print_function import numpy as np try: from scipy.signal import lfilter, firwin except ImportError: pass from .common import Benchmark class Lfilter(Benchmark): param_names = ['n_samples', 'numtaps'] params = [ [1e3, 50e3, 1e6], [9, ...
Python
0
fd838bdb57d126464042e074a80148beb8a3cd01
Create rob_client.py
Control/rob_client.py
Control/rob_client.py
# ----------------------- # Author: Alex Anderson # Purpose: Send commands to server on robot # with IP address of self.HOST based # on the activity of the hat/D-pad of # a joystick/gamepad # Date: 11/20/13 # --------------------------- import socket from gamepad_manager import * #gampad_manager must be in the...
Python
0.000001
4c925c6134e705dd5f304a983c66ad60ce6bf901
add diagnostic
scripts/plots/huc12_flowpath_counts.py
scripts/plots/huc12_flowpath_counts.py
"""Diagnostic on HUC12 flowpath counts.""" import numpy as np import cartopy.crs as ccrs from matplotlib.patches import Polygon import matplotlib.colors as mpcolors from geopandas import read_postgis from pyiem.util import get_dbconn from pyiem.plot.use_agg import plt from pyiem.plot.geoplot import MapPlot def main(...
Python
0.000001
3a285bcb6bf06df1d0e8f60a8e754280a9f05dd9
Copy arp_request.py to arp_fake.py.
arp_fake.py
arp_fake.py
#!/usr/local/bin/python2.7 # send Address Resolution Protocol Request # expect Address Resolution Protocol response and check all fields # RFC 826 An Ethernet Address Resolution Protocol # Packet Generation import os from addr import * from scapy.all import * arp=ARP(op='who-has', hwsrc=LOCAL_MAC, psrc=LOCAL_ADDR, ...
Python
0
734fdc5f331414556b61486bf956ed27e4b077dc
Indent was off on the content generation piece with attachments, would have run the encoding part more often than necessary
django_mailgun/__init__.py
django_mailgun/__init__.py
import requests from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from requests.packages.urllib3.filepost import encode_multipart_formdata class MailgunAPIError(Exception): pass class MailgunBackend(BaseEmailBackend)...
import requests from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from requests.packages.urllib3.filepost import encode_multipart_formdata class MailgunAPIError(Exception): pass class MailgunBackend(BaseEmailBackend)...
Python
0
05635750a53a5a6f72a90eecea74a08e11a11ca8
Add 37signals products
services/thirtysevensignals.py
services/thirtysevensignals.py
from werkzeug.urls import url_decode import foauth.providers class ThirtySevenSignals(foauth.providers.OAuth2): # General info about the provider alias = '37signals' name = '37signals' provider_url = 'https://37signals.com/' docs_url = 'https://github.com/37signals/api' category = 'Productivit...
Python
0.000001