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
7b949393c0cf20b9f21ff3e743a6ad35b3cccb49
Create 22.py
imylyanyk/AdventOfCode
22.py
22.py
import copy import math # [ 0 | 1 | 2 | 3 | 4 | 5 ] #spell = [spell id | mana | damage | armor | mana | timer] spells = [(0, 53, 4, 0, 0, 0), (1, 73, 2, 2, 0, 0), (2, 113, 0, 0, 0, 6), (3, 173, 3, 0, 0, 6), (4, 229, 0, 0, 101, 5)] #2 = Shield #timer = [spell id, turns left] bossDamage ...
mit
Python
62237000f3ae92638214d96f323a81d6a492d9cd
Update existing FAs with current tier programs (#4829)
mitodl/micromasters,mitodl/micromasters,mitodl/micromasters,mitodl/micromasters
financialaid/management/commands/migrate_finaid_program_tiers.py
financialaid/management/commands/migrate_finaid_program_tiers.py
""" Update FinancialAid objects with current tier program """ from django.core.management import BaseCommand, CommandError from financialaid.models import FinancialAid, TierProgram class Command(BaseCommand): """ Updates the existing financial aid objects to current tier programs """ help = "Updates ...
bsd-3-clause
Python
57af6d6d8b4c67f7b437f512e4d8eb4ea66a20f9
Add morse script
OiNutter/microbit-scripts
morse/morse.py
morse/morse.py
# Import modules from microbit import * # define morse code dictionary morse = { "a": ".-", "b": "-...", "c": "-.-.", "d": "-..", "e": ".", "f": "..-.", "s": "...", "o": "---", "m": "--", "1": ".----", "2": "..---", "3": "....
mit
Python
9609529e3a5c25c37be342d2bd1efe33e25128ff
Add IO file
ion201/thermopi,ion201/thermopi,ion201/thermopi,ion201/thermopi
IO.py
IO.py
import RPi.GPIO as GPIO def gettemp(): return 80 def setfan(state): pass def setac(state): if state: # Always turn on the fan when the ac is on setfan(True)
mit
Python
47fffb67871325f1b12d6150f12b2d9c44984837
implement top contributors functionality in gitguard
cs3219-team6/assignment-5
gitguard.py
gitguard.py
import re import subprocess import github """ gitguard_extractor.py Extracts data for the visualizer. repo_link is in the format USER/REPO_NAME or ORGANIZATION/REPO_NAME """ REGEX_REPO_LINK_DELIMITER = '\s*/\s*' def process_repo_link(repo_link): #returns owner, repo_name return re.compile(REGEX_REPO_LINK_D...
mit
Python
a9fa88d11f5338f8662d4d6e7dc2103a80144be0
Revert "Remove model"
shymonk/django-datatable,arambadk/django-datatable,arambadk/django-datatable,shymonk/django-datatable,arambadk/django-datatable,shymonk/django-datatable
table/models.py
table/models.py
from django.db import models # Create your models here.
mit
Python
c821be39a3853bf8a14e8c4089904dfe633ad276
Solve task #412
Zmiecer/leetcode,Zmiecer/leetcode
412.py
412.py
class Solution(object): def fizzBuzz(self, n): """ :type n: int :rtype: List[str] """ def fizzBuzz(i, x): return {1: str(i), 3: "Fizz", 5: "Buzz", 15: "FizzBuzz"}[x] ans = [] x = 1 for i in range(1, n + 1): if i % 3 == ...
mit
Python
e51322e7ee4afabee8b98137bc5e56b0a0f803ec
Solve #461
Zmiecer/leetcode,Zmiecer/leetcode
461.py
461.py
class Solution(object): def hammingDistance(self, x, y): """ :type x: int :type y: int :rtype: int """ x, y = list(bin(x)[2:]), list(bin(y)[2:]) s1 = list('0' * max(len(x), len(y))) s2 = list('0' * max(len(x), len(y))) s1[len(s1) - len(x):] = x...
mit
Python
2206f2dac5cb15c10fa59f14597133b6a0d3a314
Create ALE.py
4dsolutions/async_learning_engine
ALE.py
ALE.py
""" Asynchronous Learning Engine (ALE) Supports PWS standard desktop (studio) Mentor Queues Load Balancing / Air Traffic Control Courses / Flights A mentor queue is a worker queue with tasks pending, in process, complete. The many subclasses of Task are only hinted at in this overview. Example Tasks (Transactions ar...
apache-2.0
Python
2e2a8f24cc8fc7e1614bf12a0d6d42c70d1efcf8
Create GUI.py
kellogg76/ArduinoTelescopeDustCover
GUI.py
GUI.py
#!/usr/bin/python from Tkinter import * root = Tk() root.title("Elentirmo Observatory Controller v0.1") dust_cover_text = StringVar() dust_cover_text.set('Cover Closed') flat_box_text = StringVar() flat_box_text.set('Flat Box Off') def dust_cover_open(): print "Opening" ## Open a serial connection with Ardu...
mit
Python
6be70d01bdf58389db2a6adc4035f82669d02a61
Allow use of GoogleMaps plugin without Multilingual support
cyberintruder/django-cms,chmberl/django-cms,owers19856/django-cms,jproffitt/django-cms,vstoykov/django-cms,MagicSolutions/django-cms,isotoma/django-cms,jproffitt/django-cms,chkir/django-cms,stefanw/django-cms,jeffreylu9/django-cms,divio/django-cms,Vegasvikk/django-cms,jrief/django-cms,pbs/django-cms,farhaadila/django-c...
cms/plugins/googlemap/cms_plugins.py
cms/plugins/googlemap/cms_plugins.py
from django.conf import settings from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from django.utils.translation import ugettext_lazy as _ from cms.plugins.googlemap.models import GoogleMap from cms.plugins.googlemap.settings import GOOGLE_MAPS_API_KEY from django.forms.widgets import Me...
from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from django.utils.translation import ugettext_lazy as _ from cms.plugins.googlemap.models import GoogleMap from cms.plugins.googlemap.settings import GOOGLE_MAPS_API_KEY from cms.plugins.googlemap import settings from django.forms.widgets...
bsd-3-clause
Python
5c952e7a54bcff7bcdbd3b2a2d85f1f93ce95242
add first test: config+store
icing/mod_md,icing/mod_md,icing/mod_md,icing/mod_md,icing/mod_md
test/test_1100_conf_store.py
test/test_1100_conf_store.py
# test mod_md basic configurations import os.path import pytest import re import subprocess import sys import time from ConfigParser import SafeConfigParser from datetime import datetime from httplib import HTTPConnection from testbase import TestEnv config = SafeConfigParser() config.read('test.ini') PREFIX = confi...
apache-2.0
Python
c15c4a663c257cad6763cf92c50b7ad706017c74
Remove extraneous imports in the base view package
eskwire/evesrp,eskwire/evesrp,paxswill/evesrp,eskwire/evesrp,paxswill/evesrp,paxswill/evesrp,eskwire/evesrp
evesrp/views/__init__.py
evesrp/views/__init__.py
from flask import render_template from flask.ext.login import login_required from .. import app @app.route('/') @login_required def index(): return render_template('base.html')
from collections import OrderedDict from urllib.parse import urlparse import re from flask import render_template, redirect, url_for, request, abort, jsonify,\ flash, Markup, session from flask.views import View from flask.ext.login import login_user, login_required, logout_user, \ current_user from fl...
bsd-2-clause
Python
d40b4c250f7d1c0c6a6c198b3e1ea69e0049830e
Create syb.py
supersonictw/syb
syb.py
syb.py
# -*- coding: utf-8 -*- """ Star Yuuki Bot ~~~~~~~~~~~ LineClient for sending and receiving message from LINE server. Copyright: (c) 2015 SuperSonic Software Foundation and Star Inc. Website: SuperSonic Software Foundation: http://supersonic-org.cf Star Inc.: http://startw.cf Li...
mpl-2.0
Python
774877893b9f94711b717d01b896deefe65eb211
create file
jbelgamazzi/recomendacao_semantica
app.py
app.py
""" @import rdflib external lib """ import rdflib jsonldData = open("LearningObjectsExpanded.jsonld").read() queryData = open("findRecommendations.query").read() graph = rdflib.Graph() graph.parse(data=jsonldData,format='json-ld') results = graph.query(queryData) for result in results: print(result)
mit
Python
921221e4ad7d74b6f9d8b0b75417fe84fd01715f
Add script to concatenate all titers to one file tracking source/passage Fixes #76
blab/nextstrain-db,blab/nextstrain-db,nextstrain/fauna,nextstrain/fauna
tdb/concatenate.py
tdb/concatenate.py
import argparse parser = argparse.ArgumentParser() parser.add_argument('-f', '--files', nargs='*', default=[], help="tsvs that will be concatenated") parser.add_argument('-o', '--output', type=str, default="data/titers_complete.tsv") def concat(files,out): with open(out, 'w') as o: for filename in files: ...
agpl-3.0
Python
c26d570e949483224b694574120e37a215dcc348
Add dataframewriter api example to python graphene (#4520)
intel-analytics/analytics-zoo,intel-analytics/analytics-zoo,intel-analytics/analytics-zoo
ppml/trusted-big-data-ml/python/docker-graphene/examples/sql_dataframe_writer_example.py
ppml/trusted-big-data-ml/python/docker-graphene/examples/sql_dataframe_writer_example.py
from pyspark.sql.functions import * from pyspark.sql import Row, Window, SparkSession, SQLContext from pyspark.sql.types import IntegerType, FloatType, StringType from pyspark.sql import functions as F from pyspark.sql.functions import rank, min, col, mean import random import os import tempfile def sql_dataframe_writ...
apache-2.0
Python
ad489edc8059b75d9ec78d0aeb03ac3592b93923
Add Federal Labor Relations Authority.
lukerosiak/inspectors-general,divergentdave/inspectors-general
inspectors/flra.py
inspectors/flra.py
#!/usr/bin/env python import datetime import logging import os from urllib.parse import urljoin from bs4 import BeautifulSoup from utils import utils, inspector # https://www.flra.gov/OIG # Oldest report: 1999 # options: # standard since/year options for a year range to fetch from. # # Notes for IG's web team: # ...
cc0-1.0
Python
241cc8fc668b9f6c38d23a97d9ff28cc4c481bf3
Create github_watchdog,py
gkorg1/watchdog
github_watchdog.py
github_watchdog.py
#!/usr/bin/bash
apache-2.0
Python
45af6f13e302fb4e790f8ec5a5730f25c6a9450b
add new segmenter debugging script
mittagessen/kraken,mittagessen/kraken,mittagessen/kraken,mittagessen/kraken
kraken/contrib/heatmap_overlay.py
kraken/contrib/heatmap_overlay.py
#! /usr/bin/env python """ Produces semi-transparent neural segmenter output overlays """ import sys import torch import numpy as np from PIL import Image from kraken.lib import segmentation, vgsl, dataset import torch.nn.functional as F from typing import * import glob from os.path import splitext, exists model = vg...
apache-2.0
Python
d39a3bae3f6ca66df044e725cd164082170f4ec7
Modify the config file.
xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet
snippet/lib/python/config.py
snippet/lib/python/config.py
# coding: utf-8 from oslo_config import cfg from oslo_log import log CONF = cfg.CONF _ROOTS = ["root"] _DEFAULT_LOG_LEVELS = ['root=INFO'] _DEFAULT_LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" def parse_args(argv, project, version=None, default_config_files=None, default_log_f...
mit
Python
be2f50aae308377dbabd66b5ec78ffb2bd8ae218
Add tse_number as index
scorphus/politicos
politicos/migrations/versions/488fc5ad2ffa_political_party_add_tse_number_as_index.py
politicos/migrations/versions/488fc5ad2ffa_political_party_add_tse_number_as_index.py
"""political party: add tse_number as index Revision ID: 488fc5ad2ffa Revises: 192bd4ccdacb Create Date: 2015-07-08 13:44:38.208146 """ # revision identifiers, used by Alembic. revision = '488fc5ad2ffa' down_revision = '192bd4ccdacb' from alembic import op def upgrade(): op.create_index('idx_tse_number', 'pol...
agpl-3.0
Python
96ecfaa423b2d7829fcda0e56e9adba41a4c6819
Add unit_tests/s2s_vpn
daxm/fmcapi,daxm/fmcapi
unit_tests/s2s_vpn.py
unit_tests/s2s_vpn.py
import logging import fmcapi import time def test_ftds2svpns(fmc): logging.info('Testing FTDS2SVPNs class. Requires at least one registered device.') starttime = str(int(time.time())) namer = f'_fmcapi_test_{starttime}' # Create a Site2Site VPN Policy vpnpol1 = fmcapi.FTDS2SVPNs(fmc=fmc, name=...
bsd-3-clause
Python
75756f20d4b63daa8425609620e4b32dcb9faab4
Add cryptography unit with morse code functions
Harmon758/Harmonbot,Harmon758/Harmonbot
units/cryptography.py
units/cryptography.py
from .errors import UnitOutputError character_to_morse = { 'A': ".-", 'B': "-...", 'C': "-.-.", 'D': "-..", 'E': '.', 'F': "..-.", 'G': "--.", 'H': "....", 'I': "..", 'J': ".---", 'K': "-.-", 'L': ".-..", 'M': "--", 'N': "-.", 'O': "---", 'P': ".--.", 'Q': "--.-", 'R': ".-.", 'S': "...", 'T': '-', 'U': "..-", 'V...
mit
Python
93b3cfb5dd465f956fa6c9ceb09be430684c85ae
Add two pass solution
lemming52/white_pawn,lemming52/white_pawn
leetcode/q019/solution.py
leetcode/q019/solution.py
""" Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Note: Given n will always be valid. """ # Definition for singly-linked list. #...
mit
Python
295823afe17cedaa1934afbcd19d955974089c63
Add producer written in Python
jovannypcg/rabbitmq_usage,jovannypcg/rabbitmq_usage
python/send.py
python/send.py
#!/usr/bin/env python import pika # Host in which RabbitMQ is running. HOST = 'localhost' # Name of the queue. QUEUE = 'pages' # The message to send. MESSAGE = 'Hi there! This is a test message =)' # Getting the connection using pika. # Creating the channel. # Declaring the queue. connection = pika.BlockingConnecti...
apache-2.0
Python
04c8b38ac43c84abe64858cfd22a721e803b87eb
add mocked tests for internal /run folder
lookout/dd-agent,a20012251/dd-agent,gphat/dd-agent,pmav99/praktoras,cberry777/dd-agent,jvassev/dd-agent,c960657/dd-agent,AntoCard/powerdns-recursor_check,takus/dd-agent,truthbk/dd-agent,joelvanvelden/dd-agent,AntoCard/powerdns-recursor_check,ess/dd-agent,tebriel/dd-agent,a20012251/dd-agent,takus/dd-agent,Mashape/dd-age...
tests/core/test_run_files.py
tests/core/test_run_files.py
# stdlib import os import shlex import signal import subprocess import time import unittest # 3p import mock from nose.plugins.attrib import attr # Mock gettempdir for testing import tempfile; tempfile.gettempdir = mock.Mock(return_value='/a/test/tmp/dir') # project # Mock _windows_commondata_path for testing import...
bsd-3-clause
Python
cf9299aad62828f1cd116403076b2a6b086721d8
add meta utilities
fr3akout/flask_ember
flask_ember/util/meta.py
flask_ember/util/meta.py
import inspect def get_class_fields(klass, predicate=None): return [(name, field) for name, field in klass.__dict__.items() if (predicate(name, field) if predicate else True)] def get_fields(klass, predicate=None): fields = list() for base in inspect.getmro(klass)[::-1]: fields.exten...
bsd-3-clause
Python
481a920fe89ea7f0e518b8cf815f966715b20ca3
add new package : activemq (#14142)
iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/activemq/package.py
var/spack/repos/builtin/packages/activemq/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 Activemq(Package): """ Apache ActiveMQ is a high performance Apache 2.0 licensed Messa...
lgpl-2.1
Python
6b9adf9f00b481562cedf2debc5aede947734744
remove dot
credativUK/OCB,goliveirab/odoo,markeTIC/OCB,cdrooom/odoo,jaxkodex/odoo,guerrerocarlos/odoo,sv-dev1/odoo,Daniel-CA/odoo,nuncjo/odoo,rschnapka/odoo,sebalix/OpenUpgrade,nuncjo/odoo,feroda/odoo,Endika/OpenUpgrade,PongPi/isl-odoo,shaufi/odoo,alexteodor/odoo,pplatek/odoo,jaxkodex/odoo,Ernesto99/odoo,OpenUpgrade/OpenUpgrade,j...
addons/account_analytic_analysis/cron_account_analytic_account.py
addons/account_analytic_analysis/cron_account_analytic_account.py
#!/usr/bin/env python from osv import osv from mako.template import Template import time try: import cStringIO as StringIO except ImportError: import StringIO import tools MAKO_TEMPLATE = u"""Hello ${user.name}, Here is a list of contracts that have to be renewed for two possible reasons: - the end of cont...
#!/usr/bin/env python from osv import osv from mako.template import Template import time try: import cStringIO as StringIO except ImportError: import StringIO import tools MAKO_TEMPLATE = u"""Hello ${user.name}, Here is a list of contracts that have to be renewed for two possible reasons: - the end of cont...
agpl-3.0
Python
2aa7a6260d9d5a74ee81677be2bd5f97774f9116
Add tests for internal gregorian functions.
jwg4/calexicon,jwg4/qual
calexicon/internal/tests/test_gregorian.py
calexicon/internal/tests/test_gregorian.py
import unittest from calexicon.internal.gregorian import is_gregorian_leap_year class TestGregorian(unittest.TestCase): def test_is_gregorian_leap_year(self): self.assertTrue(is_gregorian_leap_year(2000)) self.assertTrue(is_gregorian_leap_year(1984)) self.assertFalse(is_gregorian_leap_yea...
apache-2.0
Python
387d05dbdb81bacc4851adffbfd7f827e709d4cc
Add Step class - Create Step.py to hold code for the Step class. - The Step class represents a single step/instruction for a Recipe object.
VictorLoren/pyRecipeBook
Step.py
Step.py
# Step object class Step: # Initiate object def __init__(self,description): self.description = description
mit
Python
7d8a566ac51e7e471603c2160dce2046eb698738
add sn domains conversion tool
exzhawk/ipv6-hosts,danny200309/ipv6-hosts,Phecda/ipv6-hosts,tel5169553/ipv6-hosts,offbye/ipv6-hosts,greatlse/ipv6-hosts,zhenghj7/ipv6-hosts,afdnlw/ipv6-hosts,tjshi/ipv6-hosts,Lan-minqi/ipv6-hosts,AlexDialga/ipv6-hosts,zhenghj7/ipv6-hosts,lennylxx/ipv6-hosts,AlexDialga/ipv6-hosts,JYzor/ipv6-hosts,Badredapple/ipv6-hosts,...
conv.py
conv.py
#!/usr/bin/env python # Read the wiki for more infomation # https://github.com/lennylxx/ipv6-hosts/wiki/sn-domains import sys table = '1023456789abcdefghijklmnopqrstuvwxyz' def iata2sn(iata): global table sn = '' for v in iata[0:3]: i = ((ord(v) - ord('a')) * 7 + 5) % 36 sn += table[i] ...
mit
Python
d2bdbd0d851fda046c0be55105a211a382c22766
Add Day 2
icydoge/AdventOfCodeSolutions
day2.py
day2.py
#Advent of Code December 2 #Written by icydoge - icydoge AT gmail dot com with open('paper.txt') as f: content = f.read().splitlines()[:-1] #Remove last empty line part_one_answer = 0 part_two_answer = 0 for box in content: dimensions = sorted(map(int,box.split('x'))) slack = dimensions[0] * dimensions[1...
mit
Python
acf4ad1e5948354281fec040badfe412f5194529
add wsgi
jmcomber/FlaskDB,jmcomber/FlaskDB,jmcomber/FlaskDB
flaskr/flaskr.wsgi
flaskr/flaskr.wsgi
<VirtualHost *> ServerName example.com WSGIDaemonProcess flaskr user=user1 group=group1 threads=5 WSGIScriptAlias / /var/www/FlaskDB/flaskr/flaskr.wsgi <Directory /var/www/FlaskDB/flaskr> WSGIProcessGroup flaskr WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from...
mit
Python
b6fbdd70a0486718d711a7efc310e350a1837b9c
add collapse reads code
lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster
seqcluster/collapse.py
seqcluster/collapse.py
import os from libs.fastq import collapse, splitext_plus import logging logger = logging.getLogger('seqbuster') def collapse_fastq(args): """collapse fasq files after adapter trimming """ idx = 0 try: seqs = collapse(args.fastq) out_file = splitext_plus(os.path.basename(args.fastq))[...
mit
Python
871ec5597059934bce64f7d31fa7e5ab165063ee
Add basic GUI frontend
claudemuller/memorise-py
memorise-frontend.py
memorise-frontend.py
#!/usr/bin/env python # -*- Coding: utf-8 -*- from tkinter import Tk, Menu from ttk import Frame, Button, Style class MemoriseFrontend(Frame): version = "0.1-py" padding = 10 def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.style = Style() ...
mit
Python
db81e8ca0b0321994f188daf45211e6ae2dda4a4
Make a control dataset that only contains sequences with titer data.
nextstrain/augur,blab/nextstrain-augur,nextstrain/augur,nextstrain/augur
dengue/utils/make_titer_strain_control.py
dengue/utils/make_titer_strain_control.py
from Bio import SeqIO from pprint import pprint with open('../../data/dengue_titers.tsv', 'r') as f: titerstrains = set([ line.split()[0] for line in f ]) with open('../../data/dengue_titers.tsv', 'r') as f: serastrains = set([ line.split()[1] for line in f ]) autologous = titerstrains.intersection(serastrains) pri...
agpl-3.0
Python
d1024a2892c6e171b3d465d56c8a1fad25d7fbdc
Create ESLint styler
stopthatcow/zazu,stopthatcow/zazu
zazu/plugins/eslint_styler.py
zazu/plugins/eslint_styler.py
# -*- coding: utf-8 -*- """eslint plugin for zazu.""" import zazu.styler zazu.util.lazy_import(locals(), [ 'subprocess', 'os', 'tempfile' ]) __author__ = "Patrick Moore" __copyright__ = "Copyright 2018" class eslintStyler(zazu.styler.Styler): """ESLint plugin for code styling.""" def style_strin...
mit
Python
6d53fcd788ef985c044657a6bf2e6faa5b8b9673
Create CVE-2014-2206.py
rcesecurity/exploits,rcesecurity/exploits,rcesecurity/exploits
CVE-2014-2206/CVE-2014-2206.py
CVE-2014-2206/CVE-2014-2206.py
#!/usr/bin/python # Exploit Title: GetGo Download Manager HTTP Response Header Buffer Overflow Remote Code Execution # Version: v4.9.0.1982 # CVE: CVE-2014-2206 # Date: 2014-03-09 # Author: Julien Ahrens (@MrTuxracer) # Homepage: http://www.rcesecurity.com # Software Link: http://ww...
mit
Python
690b5a994bc20b561632d9aa3e332061457a3d72
Add missing __init__.py to overkiz tests (#62727)
rohitranjan1991/home-assistant,w1ll1am23/home-assistant,toddeye/home-assistant,home-assistant/home-assistant,toddeye/home-assistant,nkgilley/home-assistant,w1ll1am23/home-assistant,GenericStudent/home-assistant,GenericStudent/home-assistant,nkgilley/home-assistant,mezz64/home-assistant,mezz64/home-assistant,rohitranjan...
tests/components/overkiz/__init__.py
tests/components/overkiz/__init__.py
"""Tests for the overkiz component."""
apache-2.0
Python
318b775a150f03e3311cb1a2b93cf21999fac70d
Create base class for openbox messages and create most of the Messages objects
DeepnessLab/obsi,pavel-lazar/obsi,OpenBoxProject/obsi,DeepnessLab/obsi,pavel-lazar/obsi,pavel-lazar/obsi,pavel-lazar/obsi,OpenBoxProject/obsi,OpenBoxProject/obsi,OpenBoxProject/obsi,DeepnessLab/obsi,DeepnessLab/obsi
openbox/messages.py
openbox/messages.py
""" Messages between OBC and OBI """ import json class MessageParsingError(Exception): pass class MessageMeta(type): def __init__(cls, name, bases, dct): if not hasattr(cls, "messages_registry"): # this is the base class. Create an empty registry cls.messages_registry = {} ...
apache-2.0
Python
d08426ffde22c2ded72425f1d1c54923b9aa0b97
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4b193958ac9b893b33dc03cc6882c70ad4ad509d.
karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,t...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "4b193958ac9b893b33dc03cc6882c70ad4ad509d" TFRT_SHA256 = "5b011d3f3b25e6c9646da078d0db...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "f5ea7e9c419b881d7f3136de7a7388a23feee70e" TFRT_SHA256 = "723c9b1fabc504fed5b391fc766e...
apache-2.0
Python
79a38e9ef0ac04c4efef55c26f74ad2b11442a7b
add a command to fix the missing packages
dstufft/jutils
crate_project/apps/crate/management/commands/fix_missing_files.py
crate_project/apps/crate/management/commands/fix_missing_files.py
from django.core.management.base import BaseCommand from packages.models import ReleaseFile from pypi.processor import PyPIPackage class Command(BaseCommand): def handle(self, *args, **options): i = 0 for rf in ReleaseFile.objects.filter(digest="").distinct("release__package"): p = P...
bsd-2-clause
Python
50b9aff7914885b590748ebd8bca4350d138670c
Add admin section for the ``Resources``.
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
us_ignite/resources/admin.py
us_ignite/resources/admin.py
from django.contrib import admin from us_ignite.resources.models import Resource class ResourceAdmin(admin.ModelAdmin): list_display = ('name', 'slug', 'status', 'is_featured') search_fields = ('name', 'slug', 'description', 'url') list_filter = ('is_featured', 'created') date_hierarchy = 'created' ...
bsd-3-clause
Python
20c9f1416243c020b270041621098ca20e09eca4
tag retrieval script added
stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment
private/scripts/extras/timus_tag_retrieval.py
private/scripts/extras/timus_tag_retrieval.py
""" Copyright (c) 2015-2018 Raj Patel(raj454raj@gmail.com), StopStalk 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 ...
mit
Python
9932b1989038bd3376b1c5d3f5d9c65a21670831
add energy calibration to xpd
NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd
profile_collection/startup/42-energy-calib.py
profile_collection/startup/42-energy-calib.py
from __future__ import division, print_function import numpy as np from lmfit.models import VoigtModel from scipy.signal import argrelmax import matplotlib.pyplot as plt def lamda_from_bragg(th, d, n): return 2 * d * np.sin(th / 2.) / n def find_peaks(chi, sides=6, intensity_threshold=0): # Find all potential...
bsd-2-clause
Python
0136d50265fc390d194436238b88655327982231
add gobOauth.py
BearlyKoalafied/GGGGobbler
gobOauth.py
gobOauth.py
import praw import configparser SAVEFILE = "oauth.ini" def read_ini(): cfg = configparser.ConfigParser() cfg.read(SAVEFILE) return cfg def get_refreshable_instance(): cfg = read_ini() reddit = praw.Reddit(client_id=cfg['app']['client_id'], client_secret=cfg['app']['client_...
mit
Python
e0b84a97e4c7ad5dcef336080657a884cff603fc
Test two windows drawing GL with different contexts.
infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore
tests/gl_test_2.py
tests/gl_test_2.py
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import pyglet.window from pyglet.window.event import * import time from pyglet.GL.VERSION_1_1 import * from pyglet.GLU.VERSION_1_1 import * from pyglet import clock factory = pyglet.window.WindowFactory() factory.config._attribut...
bsd-3-clause
Python
8affb8e4a3744e604b88157a918ef690203cbfa8
Remove disallowed characters from stream names.
zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,rht/zulip,andersk/zulip,kou/zulip,zulip/zulip,andersk/zulip,rht/zulip,zulip/zulip,rht/zulip,andersk/zulip,andersk/zulip,zulip/zulip,zulip/zulip,rht/zulip,kou/zulip,kou/zulip,zulip/zulip,kou/zulip,kou/zulip,kou/zulip,andersk/zulip,rht/zulip,rht/zulip,kou/zulip,andersk/zuli...
zerver/migrations/0375_invalid_characters_in_stream_names.py
zerver/migrations/0375_invalid_characters_in_stream_names.py
import unicodedata from django.db import connection, migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps # There are 66 Unicode non-characters; see # https://www.unicode.org/faq/private_use.html#nonchar4 unicode_non_chars = set( chr(x) ...
apache-2.0
Python
1deb35d9aa62a6c950cb978063c7f4aed645067b
Add utility module for logging
berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud
mediacloud/mediawords/util/log.py
mediacloud/mediawords/util/log.py
import logging def create_logger(name): """Create and return 'logging' instance.""" formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(module)s - %(message)s') handler = logging.StreamHandler() handler.setFormatter(formatter) l = logging.getLogger(name) l.setLevel(logging.DEB...
agpl-3.0
Python
12c483953f39a3bacaab6d49ba17c4920db52179
Add script to clean up all FD phone and fax numbers.
FireCARES/firecares,HunterConnelly/firecares,HunterConnelly/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,HunterConnelly/firecares,HunterConnelly/firecares
firecares/firestation/management/commands/cleanup_phonenumbers.py
firecares/firestation/management/commands/cleanup_phonenumbers.py
from django.core.management.base import BaseCommand from firecares.firestation.models import FireDepartment from phonenumber_field.modelfields import PhoneNumber import re """ This command is for cleaning up every phone and fax number in the database. It removes all non-numeric characters, such as parenthesis, hyphens...
mit
Python
7d128f2386fd3bbcbff1a407018f9ab9ed580810
Add tests for path join
tesera/pygypsy,tesera/pygypsy
tests/test_path.py
tests/test_path.py
from gypsy.path import _join def test_join(): assert _join('s3://', 'bucket', 'prefix') == 's3://bucket/prefix' assert _join('s3://bucket', 'prefix') == 's3://bucket/prefix' assert _join('bucket', 'prefix') == 'bucket/prefix'
mit
Python
7589e8c746d264b4e8ebcdcf932ddd9620d419a3
Implement user tests
Alweezy/cp2-bucketlist-api,Alweezy/cp2-bucketlist-api,Alweezy/cp2-bucketlist-api
tests/test_user.py
tests/test_user.py
import unittest import json from app import create_app, db class UserTest(unittest.TestCase): def setUp(self): """Define test variables and initialize app.""" self.app = create_app(config_name="testing") self.client = self.app.test_client # binds the app to the current context ...
mit
Python
af2654df47b8b7ea60d78fd7f692e911c2d3a82c
allow oveerride of font used
odyaka341/pyglet,mpasternak/michaldtz-fix-552,Alwnikrotikz/pyglet,cledio66/pyglet,google-code-export/pyglet,cledio66/pyglet,arifgursel/pyglet,Alwnikrotikz/pyglet,kmonsoor/pyglet,qbektrix/pyglet,Alwnikrotikz/pyglet,mpasternak/michaldtz-fixes-518-522,cledio66/pyglet,arifgursel/pyglet,kmonsoor/pyglet,mpasternak/pyglet-fix...
tests/text_test.py
tests/text_test.py
import sys import os import time import pyglet.window from pyglet.window.event import * from pyglet.GL.VERSION_1_1 import * from pyglet.GLU.VERSION_1_1 import * from pyglet import clock from pyglet.text import Font from ctypes import * factory = pyglet.window.WindowFactory() factory.config._attributes['doublebuffer'...
import sys import os import time import pyglet.window from pyglet.window.event import * from pyglet.GL.VERSION_1_1 import * from pyglet.GLU.VERSION_1_1 import * from pyglet import clock from pyglet.text import Font from ctypes import * factory = pyglet.window.WindowFactory() factory.config._attributes['doublebuffer'...
bsd-3-clause
Python
4e5a1a799bea020c145e544de255e3322ecc5aed
add kerasCNN
puyokw/kaggle_digitRecognizer,puyokw/kaggle_digitRecognizer
kerasCNN.py
kerasCNN.py
from __future__ import absolute_import from __future__ import print_function import numpy as np import pandas as pd np.random.seed(1337) # for reproducibility from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, Ma...
mit
Python
7336cc3c89727383c7a9cbbf564f6cfce7f198f9
add similiarty3.py
yzvickie/new_insightfl,yzvickie/new_insightfl,yzvickie/new_insightfl
app/find_similarity3.py
app/find_similarity3.py
import sys import string import requests import json import pymysql import numpy as np import pandas as pd from operator import itemgetter from sklearn.metrics.pairwise import cosine_similarity from sklearn.decomposition import PCA, RandomizedPCA, TruncatedSVD from sklearn.preprocessing import Normalizer def find_com...
mit
Python
08988d19c712ad4604f0acced71a069c7c20067a
Add kv store for file storage
cgwire/zou
zou/app/stores/file_store.py
zou/app/stores/file_store.py
import flask_fs as fs from zou.app import app pictures = fs.Storage("pictures", overwrite=True) movies = fs.Storage("movies", overwrite=True) pictures.configure(app) movies.configure(app) def make_key(prefix, id): return "%s-%s" % (prefix, id) def add_picture(prefix, id, path): key = make_key(prefix, id...
agpl-3.0
Python
56c27d56ca16f6659a478af0b6529291b1140636
Create find-peak-element-ii.py
kamyu104/LintCode,jaredkoontz/lintcode,jaredkoontz/lintcode,jaredkoontz/lintcode,kamyu104/LintCode,kamyu104/LintCode
Python/find-peak-element-ii.py
Python/find-peak-element-ii.py
# Time: O(max(m, n)) # Space: O(1) class Solution: #@param A: An list of list integer #@return: The index of position is a list of integer, for example [2,2] def findPeakII(self, A): upper, down = 0, len(A) - 1 left, right = 0, len(A[0]) - 1 while upper < down and le...
mit
Python
49882e51faa26dbaa17a5f3510f0ba215b317dac
add simple test
mode89/snn,mode89/snn,mode89/snn
test/simple.py
test/simple.py
import matplotlib.pyplot as plt import numpy numpy.random.seed(0) N = 1000 Ne = N * 0.8 Ni = N - Ne a = numpy.concatenate(( 0.02 * numpy.ones((Ne, 1)), 0.1 * numpy.ones((Ni, 1)) )) b = numpy.concatenate(( 0.2 * numpy.ones((Ne, 1)), 0.2 * numpy.ones((Ni, 1)) )) c = numpy.concatenate(( -65 * numpy....
mit
Python
32c5a681c7dd498204d38d5d1152aa7f67e09069
Add feedback entries to the Admin panel
19kestier/taiga-back,gauravjns/taiga-back,Zaneh-/bearded-tribble-back,jeffdwyatt/taiga-back,crr0004/taiga-back,CoolCloud/taiga-back,astagi/taiga-back,frt-arch/taiga-back,joshisa/taiga-back,coopsource/taiga-back,rajiteh/taiga-back,astronaut1712/taiga-back,coopsource/taiga-back,astronaut1712/taiga-back,gauravjns/taiga-ba...
taiga/feedback/admin.py
taiga/feedback/admin.py
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
Python
f68b1a9d5aa2c36f9301588a55bc217a9ed120c1
Create PowerofThree_001.py
Chasego/cod,cc13ny/algo,Chasego/codi,cc13ny/algo,cc13ny/Allin,Chasego/codi,Chasego/codirit,Chasego/codi,cc13ny/algo,Chasego/codirit,Chasego/codi,cc13ny/Allin,Chasego/codirit,Chasego/cod,Chasego/codirit,Chasego/cod,Chasego/codi,cc13ny/Allin,cc13ny/Allin,cc13ny/algo,Chasego/codirit,Chasego/cod,cc13ny/Allin,Chasego/cod,cc...
leetcode/326-Power-of-Three/PowerofThree_001.py
leetcode/326-Power-of-Three/PowerofThree_001.py
class Solution(object): def isPowerOfThree(self, n): """ :type n: int :rtype: bool """ return n > 0 and 3 ** round(math.log(n, 3)) == n
mit
Python
6c00711a5440fe958691c8064227565461e0acdf
add tools for laa analysis
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
sequana/laa.py
sequana/laa.py
from sequana import BAM import glob import pandas as pd import pylab class LAA(): def __init__(self, where="bc*"): self.filenames = glob.glob(where + "/" + "amplicon_*summary.csv") self.data = [pd.read_csv(this) for this in self.filenames] def hist_amplicon(self, fontsize=12): data = ...
bsd-3-clause
Python
bbbe3b7d79d57e350b1203a636b6ea64fe818caa
Update migration chain
edofic/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,...
src/ggrc/migrations/versions/20160421141928_1257140cbce5_delete_responses_table.py
src/ggrc/migrations/versions/20160421141928_1257140cbce5_delete_responses_table.py
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: goodson@google.com # Maintained By: goodson@google.com """Delete responses table and any other references to responses Create Date: 2016-04-21 14:...
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: peter@reciprocitylabs.com """Delete responses table and any other references to responses Create Date: 20...
apache-2.0
Python
1d3327d8d804a6e53c020e69b77efbea2086379b
Add staging settings file
ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas
manchester_traffic_offences/settings/staging.py
manchester_traffic_offences/settings/staging.py
from .base import * import os DEBUG = False TEMPLATE_DEBUG = DEBUG INSTALLED_APPS += ('raven.contrib.django.raven_compat', ) RAVEN_CONFIG = { 'dsn': os.environ['RAVEN_DSN'], } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': os.environ['POSTGRES_DB'], ...
mit
Python
0d2520001a0666114f9a977f6a5dc2d3ed640464
Create parse.py
tare/Lux
BS-seq_oxBS-seq_fixed_parameters/parse.py
BS-seq_oxBS-seq_fixed_parameters/parse.py
#!/usr/bin/env python import sys import os import numpy import scipy.stats import scipy.special import argparse def generate_output_files(data_file,prior_file,bsEff,bsBEff,oxEff,seqErr,prefix): # prior for g g_a, g_b = 2, 2/6.0 # read the input files data = numpy.loadtxt(data_file,delimiter='\t',skiprows=0,...
mit
Python
a79a463624ab8bf62fe54d2392d4768c5a38626a
Add migration for removing challenge from Participant. (#203)
taranjeet/EvalAI,taranjeet/EvalAI,taranjeet/EvalAI,taranjeet/EvalAI
apps/participants/migrations/0003_remove_participant_challenge.py
apps/participants/migrations/0003_remove_participant_challenge.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-12-02 14:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('participants', '0002_participantteam_participantteammember'), ] operations = [ migr...
bsd-3-clause
Python
d78b6c8d0efa3c4b29f254b7465e5e6fcb889395
Initialize P1_multiplicationTable
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P1_multiplicationTable.py
books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P1_multiplicationTable.py
# Create a program multiplicationTable.py that takes a number N from the # command line and creates an N×N multiplication table in an Excel spreadsheet. # Row 1 and column A should be used for labels and should be in bold.
mit
Python
58cfcfbde61859a98b317f0498f35f7b7921e41b
Add dummy FileBrowseField
sephii/mezzanine-grappelli,sephii/mezzanine-grappelli
mezzanine_grappelli/filebrowser/fields.py
mezzanine_grappelli/filebrowser/fields.py
from filebrowser.fields import FileBrowseField as BaseFileBrowseField class FileBrowseField(BaseFileBrowseField): pass
bsd-2-clause
Python
775104979a8ee5be040ac830133e69ca848d1ce1
add snpPriority.py, LD score and effect size weighted SNP scoring
MikeDMorgan/gwas_pipeline,MikeDMorgan/gwas_pipeline,MikeDMorgan/gwas_pipeline,MikeDMorgan/gwas_pipeline,MikeDMorgan/gwas_pipeline
snpPriority.py
snpPriority.py
''' snpPriority.py - score SNPs based on their LD score and SE weighted effect sizes =============================================================================== :Author: Mike Morgan :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- .. Score SNPs based on their LD score and SE weighted effect sizes from...
mit
Python
80d579bd9376d955eab4a431fb3bcb493518582a
Create __init__.py
vickydasta/grammarripper
kernel/__init__.py
kernel/__init__.py
cc0-1.0
Python
6deb5c1f2f614e6e6cb420c56c250a27fa032c8b
Add undelete script
scitran/core,scitran/core,scitran/api,scitran/api,scitran/core,scitran/core
bin/undelete.py
bin/undelete.py
#!/usr/bin/env python """ Remove the `deleted` tag from containers (recursively) or from individual files. """ import argparse import logging import sys import bson from api import config from api.dao.containerutil import propagate_changes log = logging.getLogger('scitran.undelete') def main(): cont_names = [...
mit
Python
d0cb340a874cc0430c8b77a0af052d8f2fd4d8c3
test script to cache Genewiki content
SuLab/scheduled-bots,SuLab/scheduled-bots,SuLab/scheduled-bots
scheduled_bots/cache/genes/getWDHumanGenes.py
scheduled_bots/cache/genes/getWDHumanGenes.py
from wikidataintegrator import wdi_core import pandas as pd from rdflib import Graph import time import sys query = """ SELECT * WHERE { ?item wdt:P31 wd:Q7187 ; wdt:P703 wd:Q15978631 . } """ kg = Graph() results = wdi_core.WDItemEngine.execute_sparql_query(query) i =0 for qid in results["results"]["binding...
mit
Python
4f2df78c7d8a9621340ff4ee5cfc6f22548d26d5
add TracedThread that continues the context propagation
palazzem/ot-examples
proposal/helpers.py
proposal/helpers.py
"""Helpers that are used in examples. In the current state, we may not require to put these classes and functions as part of the main proposal. """ from threading import Thread from proposal import tracer class TracedThread(Thread): """Helper class OpenTracing-aware, that continues the propagation of the curr...
mit
Python
8f1beddb8e3d1a63df10fcde9d3faae0d8d11171
Add kodi_automation.py
HawkMachine/kodi_automation,HawkMachine/kodi_automation,HawkMachine/kodi_automation
kodi_automation.py
kodi_automation.py
import sys import argparse def Classification(paths): return ([], []) def MoveMoveFile(path, movies_dir, dry_run=False): if dry_run: sys.stderr.write('Moving movie', path) return def MoveEpisodeFile(path, seria, season, episode, series_dir, dry_run=False): if dry_run: sys.stderr.write('Moving e...
mit
Python
d1ca3e7363b835aeca7be2fa00cd7083d9fc8c08
Create divide_by_year.py
hellrich/JeSemE,hellrich/JeSemE,hellrich/JeSemE,hellrich/JeSemE,hellrich/JeSemE
pipeline/preprocessing/google/divide_by_year.py
pipeline/preprocessing/google/divide_by_year.py
import glob import gzip import codecs import re import sys import os with_pos = False targets = {} my_buffer = {} def flush(a_buffer, some_targets, a_year): for line in a_buffer[a_year]: some_targets[a_year].write(line) a_buffer[a_year].clear() if len(sys.argv) != 3: raise ...
mit
Python
8832a542405a1999c296cc8b55d454b8cf35b5ea
Add merge.py
bluedai180/PythonExercise,bluedai180/PythonExercise
algorithms/merge.py
algorithms/merge.py
import sys sys.setrecursionlimit(1000000) class Merge: def merge_sort(self, lists): if len(lists) <= 1: return lists num = len(lists) // 2 left = self.merge_sort(lists[:num]) right = self.merge_sort(lists[num:]) return self.merge(left, right) def merge(sel...
apache-2.0
Python
85b518638e990cb7be298ea4b533aa465dd681b5
Add models to store data in...
GuardedRisk/Google-Apps-Auditing
acctwatch/models.py
acctwatch/models.py
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( scoped_session, sessionmaker, relationship, ) DBSession = scoped_session(sessionmaker()) Base = declarative_base() class LoginItem(Base): __table__ = Table('login_item', Base.metadata, ...
isc
Python
42e88bc8e6d81916164e8e0fe6b8b6c476567526
add script to integrate disambiguated results
funginstitute/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor
integrate.py
integrate.py
#!/usr/bin/env python """ Takes in a CSV file that represents the output of the disambiguation engine: Patent Number, Firstname, Lastname, Unique_Inventor_ID Groups by Unique_Inventor_ID and then inserts them into the Inventor table using lib.alchemy.match """ import sys import lib.alchemy as alchemy from lib.util.c...
bsd-2-clause
Python
80ecafd51cf258880bb5b1e183d5dd166c2d18fc
Add lockrun.py
kmalov/lockrun
lockrun.py
lockrun.py
import optparse import signal import threading import syslog import time import os import re def find_process(first_pid, process): # Find a process in /proc process = re.sub(" +", " ", process).strip() m = re.compile("^[0-9]+$") all_proc = [ x for x in os.listdir("/proc") if m.search(x)] for p in ...
mit
Python
1551cb57ab21364a4e96fa109786ccb0a4ccc3a0
Create MergeCSVs.py
berteh/ScribusGenerator
utils/MergeCSVs.py
utils/MergeCSVs.py
# merge all columns of the csv file in current directory into a single 'merge.csv' file. # requires pandas librairy to be installed. # you can customize the merge in many ways: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html import pandas as pd import glob dfs = glob.glob('*.csv') resul...
mit
Python
9b6c1af3420653124495103169865036df4f7705
Add logging module for Pyro-related debugging
opensistemas-hub/osbrain
osbrain/logging.py
osbrain/logging.py
import os os.environ["PYRO_LOGFILE"] = "pyro_osbrain.log" os.environ["PYRO_LOGLEVEL"] = "DEBUG"
apache-2.0
Python
bb188bcc196b12842378aa1c0c535800717a6b61
add example to extract word frequencies
codeforfrankfurt/PolBotCheck,codeforfrankfurt/PolBotCheck,codeforfrankfurt/PolBotCheck,codeforfrankfurt/PolBotCheck
polbotcheck/word_frequencies.py
polbotcheck/word_frequencies.py
import nltk from nltk.corpus import stopwords def get_word_frequencies(text, words_n=10, lang='german'): default_stopwords = set(nltk.corpus.stopwords.words(lang)) words = nltk.tokenize.word_tokenize(text) words = [word for word in words if len(word) > 1] words = [word for word in words if not word.isn...
mit
Python
1281d0e298d5b68f55e5c290e145ec0255552d7a
add tests
Arvedui/i3pystatus,enkore/i3pystatus,yang-ling/i3pystatus,schroeji/i3pystatus,m45t3r/i3pystatus,teto/i3pystatus,schroeji/i3pystatus,m45t3r/i3pystatus,fmarchenko/i3pystatus,richese/i3pystatus,drwahl/i3pystatus,teto/i3pystatus,richese/i3pystatus,Arvedui/i3pystatus,facetoe/i3pystatus,ncoop/i3pystatus,ncoop/i3pystatus,enko...
tests/test_backlight.py
tests/test_backlight.py
import i3pystatus.backlight as backlight import os import pytest from contextlib import contextmanager from operator import itemgetter from tempfile import TemporaryDirectory @contextmanager def setattr_temporarily(obj, attr, value): old_value = getattr(obj, attr) setattr(obj, attr, value) yield set...
mit
Python
20ecbf00c05d1f959e78cbf87cf459fd46dea59f
Create pythonhelloworld.py
nashme818/commandlinearlington
pythonhelloworld.py
pythonhelloworld.py
print "hello world"
unlicense
Python
99a63431e441a1c52d3f16f6faf0594497755d45
add a new special case install_zstack. It only installs zstack and initalize database, but not do any real cloud deployment
zstackorg/zstack-woodpecker,zstackio/zstack-woodpecker,zstackio/zstack-woodpecker,zstackorg/zstack-woodpecker,SoftwareKing/zstack-woodpecker,SoftwareKing/zstack-woodpecker,zstackio/zstack-woodpecker,quarkonics/zstack-woodpecker,zstackorg/zstack-woodpecker,quarkonics/zstack-woodpecker
integrationtest/vm/basic/install_zstack.py
integrationtest/vm/basic/install_zstack.py
''' @author: Youyk ''' import os import zstackwoodpecker.setup_actions as setup_actions import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_util as test_util USER_PATH = os.path.expanduser('~') EXTRA_SUITE_SETUP_SCRIPT = '%s/.zstackwoodpecker/extra_suite_setup_config.sh' % USER_PATH ...
apache-2.0
Python
c6ded12845f25e305789840e1687bfee83e82be5
Add a few simple pytest tests
zachpanz88/mlbgame,panzarino/mlbgame
tests/test_standings.py
tests/test_standings.py
#!/usr/bin/env python import pytest from datetime import datetime from mlbgame import standings date = datetime(2017, 5, 15, 19, 4, 59, 367187) s = standings.Standings(date) def test_standings_url(): standings_url = 'http://mlb.mlb.com/lookup/json/named.standings_schedule_date.bam?season=2017&' \ 'sche...
mit
Python
5f5c98df4349fb31f0311b1fb7f0e6b9092b4b59
add API example
live4thee/zstack-utility,ghxandsky/zstack-utility,mrwangxc/zstack-utility,mrwangxc/zstack-utility,ghxandsky/zstack-utility,zstackorg/zstack-utility,mrwangxc/zstack-utility,mingjian2049/zstack-utility,mingjian2049/zstack-utility,zstackorg/zstack-utility,zstackio/zstack-utility,mingjian2049/zstack-utility,zstackio/zstack...
apibinding/examples/example.py
apibinding/examples/example.py
import httplib import json import time # return a dict containing API return value def api_call(session_uuid, api_id, api_content): conn = httplib.HTTPConnection("localhost", 8080) headers = {"Content-Type": "application/json"} if session_uuid: api_content["session"] = {"uuid": session_uuid} ...
apache-2.0
Python
01ee5e64093bfd6f6c57c27d189408f2f765f2b4
Create load_from_numpy.py
guillitte/pytorch-sentiment-neuron
load_from_numpy.py
load_from_numpy.py
import os import torch from torch.autograd import Variable from torch import optim import torch.nn.functional as F import torch.nn as nn import numpy as np import models import argparse import time import math parser = argparse.ArgumentParser(description='load_from_numpy.py') parser.add_argument('-save_model', defau...
mit
Python
03123c64835f0a1d4cb16cbc638a432b99cc9d04
Add a test case for #605 - the issue has been fixed by #606
slackhq/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient
integration_tests/rtm/test_issue_605.py
integration_tests/rtm/test_issue_605.py
import asyncio import collections import logging import os import threading import time import unittest import pytest from integration_tests.env_variable_names import SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN, \ SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID from slack import RTMClient, WebClient class TestRTMClient_Issue_605(u...
mit
Python
66d3d329674521c8756a8644f2f0a58824a1ec41
add spider for ups freight
iandees/all-the-places,iandees/all-the-places,iandees/all-the-places
locations/spiders/ups_freight_service_centers.py
locations/spiders/ups_freight_service_centers.py
# -*- coding: utf-8 -*- import re import scrapy from locations.items import GeojsonPointItem class UPSFreightServiceCenter(scrapy.Spider): download_delay = 0.2 name = "ups_freight_service_centers" allowed_domains = ["upsfreight.com"] start_urls = ( 'https://www.upsfreight.com/ProductsandServi...
mit
Python
9311d3d4acd8c67c20d76cc74d00e0f5a83318e6
add product-of-array-except-self
zeyuanxy/leet-code,EdisonAlgorithms/LeetCode,zeyuanxy/leet-code,zeyuanxy/leet-code,EdisonAlgorithms/LeetCode,EdisonAlgorithms/LeetCode
vol5/product-of-array-except-self/product-of-array-except-self.py
vol5/product-of-array-except-self/product-of-array-except-self.py
class Solution(object): def productExceptSelf(self, nums): """ :type nums: List[int] :rtype: List[int] """ n = len(nums) ret = [1] * n product = 1 for i in range(n): ret[i] = product product *= nums[i] product = 1 ...
mit
Python
2c1e5286eca392854bf311e01d1131c45167973f
add coco benchmarking
mehdidc/fluentopt,mehdidc/fluentopt
benchmarks/coco.py
benchmarks/coco.py
""" This benchmark example uses the coco benchmark set of functions (<http://coco.gforge.inria.fr/>, <https://github.com/numbbo/coco>) to compare optimizers provided by fluentopt between themselves and also with CMA-ES[1]. To run these benchmarks, the package 'cocoex' must be installed, check <https://github.com/numbbo...
bsd-3-clause
Python
6ae6544cca07e857d680d199b2c2f436cb1d9a82
add wordpress stats
JulienLeonard/socialstats
wordpress_stats.py
wordpress_stats.py
from utils import * import urllib, json import time import datetime def dump(blogid,filepath): posts = [] offset = 0 while True: puts("offset",offset) url = "https://public-api.wordpress.com/rest/v1/sites/" + blogid + "/posts?number=100&offset=" + str(offset) response = ...
mit
Python
9cc09c6143025d88eedfa4f8eedcd23e2fe7990e
Create sahilprakash.py
WebClub-NITK/Hacktoberfest-2k17,vansjyo/Hacktoberfest-2k17,vansjyo/Hacktoberfest-2k17,WebClub-NITK/Hacktoberfest-2k17,WebClub-NITK/Hacktoberfest-2k17,WebClub-NITK/Hacktoberfest-2k17,vansjyo/Hacktoberfest-2k17,WebClub-NITK/Hacktoberfest-2k17,vansjyo/Hacktoberfest-2k17,vansjyo/Hacktoberfest-2k17,WebClub-NITK/Hacktoberfes...
Python/sahilprakash.py
Python/sahilprakash.py
print("Hello World!")
mit
Python
9cc13ca511987584ea4f52cf0c2e57e6b98a9e8b
Add lc0350_intersection_of_two_arrays_ii.py
bowen0701/algorithms_data_structures
lc0350_intersection_of_two_arrays_ii.py
lc0350_intersection_of_two_arrays_ii.py
"""Leetcode 350. Intersection of Two Arrays II Easy URL: https://leetcode.com/problems/intersection-of-two-arrays-ii/ Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [4,9...
bsd-2-clause
Python
eb3882051241843716ef9b7ceef8aeb6ee2a35c6
add mysqlproxy.py
nakagami/CyMySQL
misc/mysqlproxy.py
misc/mysqlproxy.py
#!/usr/bin/env python3 ############################################################################## #The MIT License (MIT) # #Copyright (c) 2016 Hajime Nakagami # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to dea...
mit
Python
f1c389a0028c6f92300573bef587c084204e858f
Create circlecli.py
TheRealJoeLinux/circlecli,TheRealJoeLinux/circlecli
mocks/circlecli.py
mocks/circlecli.py
# -*- coding: utf-8 -*- """ Mocks for the CircleCLI API library tests. """ from httmock import response, urlmatch NETLOC = r'(.*\.)?circleci\.com$' HEADERS = {'content-type': 'application/json'} GET = 'get' class Resource: """ A CircleCli resource. :param path: The file path to the resource. """ ...
mit
Python
30359b6e9ec105b2938cedd59127e5fa40964396
Create setrun.py
mandli/surge-examples
rect-shelf/setrun.py
rect-shelf/setrun.py
mit
Python
39d2a5eec167e659cd30f5522a9e4e9ca11a620a
Create layoutUVPlus.py
aaronfang/personal_scripts
af_scripts/uv/layoutUVPlus.py
af_scripts/uv/layoutUVPlus.py
import pymel.core as pm import math sels = pm.ls(sl=1) gap = 0.003 for i, x in enumerate(sels): x=x.getShape() pm.select('{0}.map[:]'.format(x), r=1) buv = pm.polyEvaluate(x,b2=1) w = abs(buv[0][1] - buv[0][0]) if i==0: pm.polyEditUV(u=-buv[0][0]+(gap*(i+1)),v=-buv[1][0]+gap) else: pm.polyEditUV(u=-buv[0][0]+...
mit
Python