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 |
|---|---|---|---|---|---|---|---|---|
c4d583966ef1a4d9bdb57715ef5e766ba62fbed6 | Add tests for the Django directory | prophile/jacquard,prophile/jacquard | jacquard/directory/tests/test_django.py | jacquard/directory/tests/test_django.py | from jacquard.directory.base import UserEntry
from jacquard.directory.django import DjangoDirectory
import pytest
import unittest.mock
try:
import sqlalchemy
except ImportError:
sqlalchemy = None
if sqlalchemy is not None:
test_database = sqlalchemy.create_engine('sqlite://')
test_database.execute("... | mit | Python | |
6babb6e64e93ed74a72203fdc67955ae8ca3bfb3 | Add a baseline set of _MultiCall performance tests | RonnyPfannschmidt/pluggy,nicoddemus/pluggy,hpk42/pluggy,pytest-dev/pluggy,pytest-dev/pluggy,RonnyPfannschmidt/pluggy,tgoodlet/pluggy | testing/benchmark.py | testing/benchmark.py | """
Benchmarking and performance tests.
"""
import pytest
from pluggy import _MultiCall, HookImpl
from pluggy import HookspecMarker, HookimplMarker
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
def MC(methods, kwargs, firstresult=False):
hookfuncs = []
for method in methods:
... | mit | Python | |
21dc462b47f5b5577d51119ddd340c518d8cfb94 | Add script to rename photos in directory | deadlyraptor/reels | photos.py | photos.py | import os
from datetime import date
# Programs at the Coral Gables Art Cinema.
programs = ['1. Main Features', '2. After Hours', '3. Special Screenings',
'4. Family Day on Aragon', '5. National Theatre Live',
'6. See It in 70mm', '7. Alternative Content']
for program in programs:
print(pro... | mit | Python | |
f182dae6eb0a17f8b7a437694b69b273595f9549 | Add YAML export | maebert/jrnl,notbalanced/jrnl,philipsd6/jrnl,MinchinWeb/jrnl | jrnl/plugins/yaml_exporter.py | jrnl/plugins/yaml_exporter.py | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, unicode_literals, print_function
from .text_exporter import TextExporter
import re
import sys
import yaml
class MarkdownExporter(TextExporter):
"""This Exporter can convert entries and journals into Markdown with YAML front matter.""... | mit | Python | |
41bd33421f14498737aa0088f2d93b00bb521d7b | implement a viewset controller, capable of containing controllers | jjongbloets/julesTk | julesTk/controller/viewset.py | julesTk/controller/viewset.py |
from . import ViewController
class ViewSetController(ViewController):
def __init__(self, parent, view=None):
super(ViewSetController, self).__init__(parent, view)
self._controllers = {}
@property
def controllers(self):
""" Dictionary with all controllers used in this viewset
... | mit | Python | |
8c5fb07b37eebf484c33ca735bd2b9dac5d0dede | solve 1 problem | Shuailong/Leetcode | solutions/nested-list-weight-sum.py | solutions/nested-list-weight-sum.py | #!/usr/bin/env python
# encoding: utf-8
"""
nested-list-weight-sum.py
Created by Shuailong on 2016-03-30.
https://leetcode.com/problems/nested-list-weight-sum/.
"""
# """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
# cla... | mit | Python | |
0738b3816db752b8cb678324ff4c113625660b94 | add test for pathops.operations.intersection | fonttools/skia-pathops | tests/operations_test.py | tests/operations_test.py | from pathops import Path, PathVerb
from pathops.operations import union, difference, intersection, reverse_difference, xor
import pytest
@pytest.mark.parametrize(
"subject_path, clip_path, expected",
[
[
[
(PathVerb.MOVE, ((0, 0),)),
(PathVerb.LINE, ((0, 10)... | bsd-3-clause | Python | |
f3c11599ef1714f7337191719172614c43b87eff | Add tests.test_OrderedSet. | therealfakemoot/collections2,JustusW/BetterOrderedDict | tests/test_OrderedSet.py | tests/test_OrderedSet.py | from twisted.trial import unittest
from better_od import OrderedSet
class TestOrderedDict(unittest.TestCase):
def setUp(self):
self.values = 'abcddefg'
self.s = OrderedSet(self.values)
def test_order(self):
expected = list(enumerate('abcdefg'))
self.assertEquals(list(enumerat... | mit | Python | |
7df6189dbfd69c881fedf71676dd4fdbc7dba2f0 | Add test for renormalize migration | CenterForOpenScience/scrapi,fabianvf/scrapi,ostwald/scrapi,erinspace/scrapi,mehanig/scrapi,felliott/scrapi,erinspace/scrapi,alexgarciac/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,icereval/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,fabianvf/scrapi | tests/test_migrations.py | tests/test_migrations.py | import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument
from scrapi import tasks
from scrapi import registry
from scrapi.migrations import delete
from scrapi.migrations import rename
from scrapi.migrations import renormalize
# Need to force cassandra to ignore set k... | import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument
from scrapi import tasks
from scrapi import registry
from scrapi.migrations import delete
from scrapi.migrations import rename
# Need to force cassandra to ignore set keyspace
from scrapi.processing.cassandra i... | apache-2.0 | Python |
85fc51ef3d75d2f78e80b346897d22bebf797424 | add mf_helpers | kylewm/mf2py,kylewm/mf2py,tommorris/mf2py,tommorris/mf2py | mf2py/mf_helpers.py | mf2py/mf_helpers.py | def get_url(mf):
"""parses the mf dictionary obtained as returns the URL"""
urls = []
for item in mf:
if isinstance(item, basestring):
urls.append(item)
else:
itemtype = [x for x in item.get('type',[]) if x.startswith('h-')]
if itemtype is not []:
... | mit | Python | |
1831dbd065a8776a77d18e10b44f84c99bca4c75 | Add test of simple textcat workflow | aikramer2/spaCy,aikramer2/spaCy,aikramer2/spaCy,honnibal/spaCy,honnibal/spaCy,aikramer2/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/sp... | spacy/tests/textcat/test_textcat.py | spacy/tests/textcat/test_textcat.py | from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.), ('bbbb', 0),... | mit | Python | |
47af5fc466936f46e05f4ebaf89257e5c731a38e | add test_handle_conversation_after_delete | rickmak/chat,lakoo/chat,SkygearIO/chat,lakoo/chat,SkygearIO/chat,lakoo/chat | plugin/test/test_handle_conversation_after_delete.py | plugin/test/test_handle_conversation_after_delete.py | import unittest
import copy
from unittest.mock import Mock
import chat_plugin
from chat_plugin import handle_conversation_after_delete
class TestHandleConversationAfterDelete(unittest.TestCase):
def setUp(self):
self.conn = None
self.mock_publish_event = Mock()
chat_plugin._publish_event ... | apache-2.0 | Python | |
a4620f5371cea0a90360c6968c7ecbe426e9e1f4 | Create genomic_range_query.py | py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges | codility/genomic_range_query.py | codility/genomic_range_query.py | """
https://codility.com/programmers/task/genomic_range_query/
"""
from collections import Counter
def solution(S, P, Q):
# Instead of counters, could've also used four prefix-sum and four suffix-sum
# arrays. E.g., `pref_1` would just do a prefix sum across S, summing up
# only the ones; `pref_2` woul... | mit | Python | |
ce93955bc9a5f16129ec93293a6debdb7e75891a | add script to generate gexf from csvs | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | tools/graph/generate_gexf_from_csv.py | tools/graph/generate_gexf_from_csv.py | #!/usr/bin/env python3
# generate a gexf file from a node csv and an edges csv
import argparse
import csv
import networkx as nx
import re
import mediawords.util.log
logger = mediawords.util.log.create_logger(__name__)
def main():
parser = argparse.ArgumentParser(description='generate a gexf file from nodes a... | agpl-3.0 | Python | |
911da4d608883931166db3db27668cbc20413a6f | Create a .csv file from the CRISPR database. | mbonsma/phageParser,phageParser/phageParser,goyalsid/phageParser,goyalsid/phageParser,mbonsma/phageParser,mbonsma/phageParser,phageParser/phageParser,goyalsid/phageParser,phageParser/phageParser,phageParser/phageParser,mbonsma/phageParser | extract_CRISPRdb.py | extract_CRISPRdb.py | import requests
from pattern import web
import re
import csv
def get_dom(url):
html = requests.get(url).text
dom = web.Element(html)
return dom
def get_taxons_from_CRISPRdb():
url = "http://crispr.u-psud.fr/crispr/"
dom_homepage = get_dom(url)
container = dom_homepage('div[class="strainlist... | mit | Python | |
1cb55aa6b3abd4a3a20ff0f37b6c80c0c89ef1ff | Add a dummy pavement file. | njwilson23/scipy,efiring/scipy,jonycgn/scipy,pnedunuri/scipy,sonnyhu/scipy,raoulbq/scipy,witcxc/scipy,nmayorov/scipy,pizzathief/scipy,WarrenWeckesser/scipy,ilayn/scipy,zerothi/scipy,andyfaff/scipy,Kamp9/scipy,Newman101/scipy,maniteja123/scipy,Shaswat27/scipy,josephcslater/scipy,ChanderG/scipy,pyramania/scipy,WarrenWeck... | tools/win32/build_scripts/pavement.py | tools/win32/build_scripts/pavement.py | options(
setup=Bunch(
name = "scipy-superpack",
)
)
@task
def setup():
print "Setting up package %s" % options.name
| bsd-3-clause | Python | |
cef74f6d84f1d7fec54fd9a314888e7d0e84ac3f | Create telnet-cmdrunner.py | pynetscript/FromZeroToHero | telnet-cmdrunner.py | telnet-cmdrunner.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import netmiko
import json
import tools
import sys ### Capture and handle signals past from the Operating System.
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL) ### IOERror: Broken pipe
signal.signal(signal.SIGINT... | mit | Python | |
ecb6390c800260cedddba655f253a8307e096d76 | Create setup.py | hagne/atm-py,lo-co/atm-py,hagne/atm-py,mtat76/atm-py,msrconsulting/atm-py | setup.py | setup.py | from distutils.core import setup
setup(name='atmPy',
version='0.1',
description='Python Distribution Utilities',
author='Hagen Telg and Matt Richardson',
author_email='matt.richardson@msrconsults.com',
packages=['atmPy'],
)
| mit | Python | |
93cb8184fe5fdbf294c1e8f36b45ed8b514b2ce5 | Allow setup file to enable pip installation | rlworkgroup/metaworld,rlworkgroup/metaworld,kschmeckpeper/multiworld | setup.py | setup.py | from distutils.core import setup
setup(
name='multiworld',
packages=('multiworld', ),
)
| mit | Python | |
dad2024344f581aa042f767e4aa473d50a8f78bc | Create individual_dist_label.py | soligschlager/topography,soligschlager/topography,margulies/topography,soligschlager/topography,margulies/topography,soligschlager/topography,margulies/topography,margulies/topography | sandbox/individual_distance/individual_dist_label.py | sandbox/individual_distance/individual_dist_label.py | #!/usr/bin/python
import os, numpy as np, scipy as sp, nibabel.freesurfer as fs
from sklearn.utils.arpack import eigsh
# Set defaults:
base_dir = '/scr/liberia1/LEMON_LSD/LSD_rest_surf'
output_base_dir = '/scr/liberia1'
subjects = [26410]
for subject in subjects:
for hemi in ['lh', 'rh']:
# read in cort... | mit | Python | |
a2865b712d0a28e3a0b8943f67703a77b5d90894 | Add a stub for testing _utils | dask-image/dask-ndfourier | tests/test__utils.py | tests/test__utils.py | # -*- coding: utf-8 -*-
| bsd-3-clause | Python | |
181833870da1921e280d2439ae08ed74c7b137a5 | Add test for h5diag | UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy | tests/test_h5diag.py | tests/test_h5diag.py | from os.path import dirname
import numpy as np
import hdf5plugin
import h5py
from blimpy.h5diag import cmd_tool
from tests.data import voyager_h5, voyager_fil
import pytest
header = [
["fruit", "apple"],
["color", "red"],
["plant", "tree"]
]
DIR = dirname(voyager_fil)
TEST_H5 = DIR + "/test.h5"
TIME_I... | bsd-3-clause | Python | |
ec9944bdb7945543c95ec43d627d213536d5735a | Add monitor for volume tags | blrm/openshift-tools,openshift/openshift-tools,blrm/openshift-tools,openshift/openshift-tools,drewandersonnz/openshift-tools,drewandersonnz/openshift-tools,blrm/openshift-tools,drewandersonnz/openshift-tools,drewandersonnz/openshift-tools,openshift/openshift-tools,drewandersonnz/openshift-tools,openshift/openshift-tool... | scripts/monitoring/cron-send-snapshots-tags-check.py | scripts/monitoring/cron-send-snapshots-tags-check.py | #!/usr/bin/env python
""" Check Persistent Volumes Snapshot Tags """
# We just want to see any exception that happens
# don't want the script to die under any cicumstances
# script must try to clean itself up
# pylint: disable=broad-except
# main() function has a lot of setup and error handling
# pylint: disable=too-... | apache-2.0 | Python | |
a986397ca1bdc3bdc8894fab8b336803c172b295 | add settings file for staging (has a database url but no Sentry) | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | txlege84/txlege84/settings/staging.py | txlege84/txlege84/settings/staging.py | #######################
# PRODUCTION SETTINGS #
#######################
import dj_database_url
from .base import *
LOGGING = {
'version': 1,
'handlers': {
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
},
},
'loggers': {
'django.request':... | mit | Python | |
f5ba686196866c78dfeafb34a5f78f5cfc2c50bd | Add buildbot.py with required coverage | steinwurf/sak,steinwurf/sak | buildbot.py | buildbot.py | #!/usr/bin/env python
# encoding: utf-8
project_name = 'sak'
def configure(options):
pass
def build(options):
pass
def run_tests(options):
pass
def coverage_settings(options):
options['required_line_coverage'] = 94.9
| bsd-3-clause | Python | |
7bbf99a60526e1b15aaf7a7fc9f5b7d6889a9efc | Create getnotfound.py | bontchev/wlscrape | tools/getnotfound.py | tools/getnotfound.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import requests
import json
import wget
import sys
import os
__author__ = "Vesselin Bontchev <vbontchev@yahoo.com>"
__license__ = "GPL"
__VERSION__ = "1.00"
def error(e):
print("Error: %s." % e, file=sys.stderr)
sys.exit(-1)
def mak... | mit | Python | |
1a1e9123313fdedab14700ead90748d9e6182a42 | Add revision for new boardmoderator columns | Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan | migrations/versions/da8b38b5bdd5_add_board_moderator_roles.py | migrations/versions/da8b38b5bdd5_add_board_moderator_roles.py | """Add board moderator roles
Revision ID: da8b38b5bdd5
Revises: 90ac01a2df
Create Date: 2016-05-03 09:32:06.756899
"""
# revision identifiers, used by Alembic.
revision = 'da8b38b5bdd5'
down_revision = '90ac01a2df'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy... | mit | Python | |
4213e9756872cd3a64ca75f374b5bc292e08e3be | add scraping script | shunk031/ameblo-crawler | scrapingArticle.py | scrapingArticle.py | # -*- coding: utf-8 -*-
from urllib.request import urlopen
from urllib.error import HTTPError
from bs4 import BeautifulSoup
def scrapingArticleText(url):
"""
引数から得たURLからブログ本文を取得して
一文ずつ区切ったstringのlistをreturnする
"""
try:
html = urlopen(url)
except HTTPError as e:
print(e)
... | mit | Python | |
0c5f2c0003ceb1568aa4f6dccce5f6de42b5462e | Add a simple monitoring solution | torhve/Amatyr,torhve/Amatyr,torhve/Amatyr | scripts/monitor.py | scripts/monitor.py | #!/usr/bin/python
# -*- coding: UTF-8
# Copyright: 2014 Tor Hveem <thveem>
# License: GPL3
#
# Simple Python script for polling amatyr installation and check latest date
#
# Usage: python monitor.py <AMATYR BASEURL> <EMAIL RECIPIENT>
# Check every 5 minute in crontab:
# */5 * * * * <AMATYRPATH>/scripts/monitor.py
#
i... | bsd-3-clause | Python | |
23dab9c4a0220a7a35b4a88daeda79bd65bdeb3b | fix in range | OstapHEP/ostap,OstapHEP/ostap,OstapHEP/ostap,OstapHEP/ostap | ostap/fitting/tests/test_in_range_2d.py | ostap/fitting/tests/test_in_range_2d.py | import sys
from ostap.core.pyrouts import *
import ROOT, random, time
import ostap.fitting.roofit
import ostap.fitting.models as Models
from ostap.core.core import cpp, VE, dsID
from ostap.logger.utils import rooSilent
from builtins import range
from ostap.fitting.background import make_b... | bsd-3-clause | Python | |
5e20df222456fe17fa78290e8fa08b051a951b38 | Add events.py | irqed/octokit.py | octokit/resources/events.py | octokit/resources/events.py | # encoding: utf-8
"""Methods for the Events API
http://developer.github.com/v3/activity/events/
http://developer.github.com/v3/issues/events/
"""
| mit | Python | |
3b22994b26db1c224ef0076bf9a031f661953ada | create Feed of latest articles on the current site. | opps/opps,opps/opps,jeanmask/opps,opps/opps,opps/opps,williamroot/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps | opps/articles/views/feed.py | opps/articles/views/feed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import get_current_site
from opps.articles.models import Article
class ArticleFeed(Feed):
link = "/RSS"
def __call__(self, request, *args, **kwargs):
self.site = get_curr... | mit | Python | |
111eb59d2390a008cad5edc8e18456d42b7f7117 | Add hearthPwnCrawler.py, for crawling deck strings from hearthPwn websize. | lanhin/deckAdvisor | hearthPwnCrawler.py | hearthPwnCrawler.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2017-07-17 08:52:38 by lanhin
# Project: Deckstring Crawler
#
# Use this file as a pyspider script
# To crawl deck from http://www.hearthpwn.com/decks
# Refer to http://docs.pyspider.org/en/latest/Quickstart/ for more details
from pyspider.libs.base_handler ... | mit | Python | |
4cfc07a275a473ed14f7c99150b2f233c680d7c0 | Add db dumping utility | ekollof/pymetrics | dbcat.py | dbcat.py | #!/usr/bin/env python
import sys
import anydbm as dbm
def main():
for k,v in dbm.open(sys.argv[1]).iteritems():
print "key: {0:s} value: {1:s}".format(k, v)
if __name__ == '__main__':
sys.exit(main()) | bsd-3-clause | Python | |
1631731657af28c275b35f9b084807e4f244c334 | debug module. initial code | albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player | debug.py | debug.py | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
# This is the debug module: tools to debug MusicPlayer.
# This is... | bsd-2-clause | Python | |
ed43384ece07bf1a02529d2f79423e96c8283443 | Add mangling experimental sample | eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples | src_clang/experimental/show-mangle.py | src_clang/experimental/show-mangle.py | import pprint
import sys
import clang.cindex
def get_cursor(source, spelling):
"""Obtain a cursor from a source object.
This provides a convenient search mechanism to find a cursor with specific
spelling within a source. The first argument can be either a
TranslationUnit or Cursor instance.
If th... | unlicense | Python | |
472d23ec5706d081cbdbf32687884b133fdf6864 | Add benchmark for ogbg_molpcba example. | google/flax,google/flax | examples/ogbg_molpcba/ogbg_molpcba_benchmark.py | examples/ogbg_molpcba/ogbg_molpcba_benchmark.py | # Copyright 2021 The Flax Authors.
#
# 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 wri... | apache-2.0 | Python | |
0caaf977096d5936747ad4931d14041675a9864a | create a paths utility to better work with ceph paths | trhoden/ceph-deploy,ddiss/ceph-deploy,ktdreyer/ceph-deploy,zhouyuan/ceph-deploy,SUSE/ceph-deploy,ceph/ceph-deploy,rtulke/ceph-deploy,isyippee/ceph-deploy,isyippee/ceph-deploy,osynge/ceph-deploy,zhouyuan/ceph-deploy,Vicente-Cheng/ceph-deploy,jumpstarter-io/ceph-deploy,alfredodeza/ceph-deploy,trhoden/ceph-deploy,rtulke/c... | ceph_deploy/util/paths.py | ceph_deploy/util/paths.py | from os.path import join
from ceph_deploy.util import constants
class mon(object):
_base = join(constants.mon_path, 'ceph-')
@classmethod
def path(cls, hostname):
return "%s%s" % (cls._base, hostname)
@classmethod
def done(cls, hostname):
return join(cls.path(hostname), 'done')... | mit | Python | |
1aeb34f003e5d437ac55c560ef062b22e9f02c0a | Define health blueprint. | soasme/rio,soasme/rio,soasme/rio | rio/blueprints/health.py | rio/blueprints/health.py | # -*- coding: utf-8 -*-
from flask import Blueprint
bp = Blueprint('health', __name__)
@bp.route('/')
def index():
return 'OK'
| mit | Python | |
a8b48d9174ce9c30166c0c2a8011c2c40624c4bd | Add a spider for Planned Parenthood | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/planned_parenthood.py | locations/spiders/planned_parenthood.py | # -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
class PlannedParenthoodSpider(scrapy.Spider):
name = "planned_parenthood"
allowed_domains = ["www.plannedparenthood.org"]
start_urls = (
'https://www.plannedparenthood.org/health-center',
... | mit | Python | |
397f31c8b43da123f2a55350a7d572b3a13431a6 | Add module to ease handling of CKAN filestores. | etalab/ckan-toolbox | ckantoolbox/filestores.py | ckantoolbox/filestores.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# CKAN-Toolbox -- Various modules that handle CKAN API and data
# By: Emmanuel Raviart <emmanuel@raviart.com>
#
# Copyright (C) 2013 Emmanuel Raviart
# http://gitorious.org/etalab/ckan-toolbox
#
# This file is part of CKAN-Toolbox.
#
# CKAN-Toolbox is free software; you ... | agpl-3.0 | Python | |
0331bffc755ad4234edcca3edaf1b9697b8ae8c3 | Create A.py | Pouf/CodingCompetition,Pouf/CodingCompetition | Google-Code-Jam/2010-Africa/A.py | Google-Code-Jam/2010-Africa/A.py | mit | Python | ||
c568256dac3c13f6740d2a2df5a8a848e2f7d68e | check in new stream settings file | RCOSDP/waterbutler,felliott/waterbutler,CenterForOpenScience/waterbutler | waterbutler/core/streams/settings.py | waterbutler/core/streams/settings.py | from waterbutler import settings
config = settings.child('STREAMS_CONFIG')
ZIP_EXTENSIONS = config.get('ZIP_EXTENSIONS', '.zip .gz .bzip .bzip2 .rar .xz .bz2 .7z').split(' ')
| apache-2.0 | Python | |
5bea532c7651faacb163745fbbf28fa4f53ba438 | add predicting-office-space-price | zeyuanxy/hacker-rank,zeyuanxy/hacker-rank,EdisonCodeKeeper/hacker-rank,zeyuanxy/hacker-rank,EdisonAlgorithms/HackerRank,EdisonCodeKeeper/hacker-rank,EdisonCodeKeeper/hacker-rank,EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,EdisonCodeKeepe... | ai/machine-learning/predicting-office-space-price/predicting-office-space-price.py | ai/machine-learning/predicting-office-space-price/predicting-office-space-price.py | import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
if __name__ == "__main__":
(f, n) = map(int, raw_input().split())
x = []
y = []
poly = PolynomialFeatures(degree = 4)
for i in range(n):
v = map(float, raw_input().split())
x.app... | mit | Python | |
45fea3847e2800a920ccb06e102ebaf9a5f9a4ce | Add forgotten migration for newly introduced default ordering | GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa | tk/material/migrations/0002_auto_20170704_2155.py | tk/material/migrations/0002_auto_20170704_2155.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-04 19:55
from __future__ import unicode_literals
from django.db import migrations
import localized_fields.fields.field
class Migration(migrations.Migration):
dependencies = [
('material', '0001_initial'),
]
operations = [
m... | agpl-3.0 | Python | |
af0486cd767564cda7259aa30a0d7c90420e226e | Add get json example | designiot/code,phodal/iot-code,designiot/code,phodal/iot-code,designiot/code,designiot/code,phodal/iot-code,phodal/iot-code | chapter2/get.py | chapter2/get.py | import urllib2,json
results = urllib2.urlopen('http://192.168.168.84/api.json').read()
json.loads(results)['led'] | mit | Python | |
1acbad02071a4d1ef953bc2c0643525e5d681d54 | Add in a script to run the linter manually | Khan/khan-linter,Khan/khan-linter,Khan/khan-linter,Khan/khan-linter | runlint.py | runlint.py | #!/usr/bin/env python
import optparse
import sys
from closure_linter import checker
from closure_linter import error_fixer
from closure_linter import gjslint
USAGE = """%prog [options] [file1] [file2]...
Run a JavaScript linter on one or more files.
This will invoke the linter, and optionally attempt to auto-fix ... | apache-2.0 | Python | |
3e5d6e5dd31193f42ebddaeff856bfe53703a19e | Add script to get evidence sources | sorgerlab/indra,sorgerlab/indra,bgyori/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/belpy,bgyori/indra,johnbachman/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,johnbachman/belpy | models/fallahi_eval/evidence_sources.py | models/fallahi_eval/evidence_sources.py | from util import pklload
from collections import defaultdict
import indra.tools.assemble_corpus as ac
if __name__ == '__main__':
# Load cached Statements just before going into the model
stmts = pklload('pysb_stmts')
# Start a dictionary for source counts
sources_count = defaultdict(int)
# Count ... | bsd-2-clause | Python | |
276435cc3b4f77dc16dde4a73cd930e461e1ef47 | Implement LM in defn/lm.py | gchrupala/reimaginet,gchrupala/reimaginet | imaginet/defn/lm.py | imaginet/defn/lm.py | from funktional.layer import Layer, Dense, StackedGRU, StackedGRUH0, \
Embedding, OneHot, clipped_rectify, CrossEntropy, \
last, softmax3d, params
import funktional.context as context
from funktional.layer import params
import imaginet.task
from funkti... | mit | Python | |
bcb8615fb0d009ad4e7899b9e91701333dc56990 | Add abyss package (#4555) | matthiasdiener/spack,tmerrick1/spack,krafczyk/spack,skosukhin/spack,tmerrick1/spack,LLNL/spack,matthiasdiener/spack,iulian787/spack,EmreAtes/spack,tmerrick1/spack,skosukhin/spack,mfherbst/spack,TheTimmy/spack,iulian787/spack,tmerrick1/spack,iulian787/spack,lgarren/spack,TheTimmy/spack,lgarren/spack,mfherbst/spack,tmerr... | var/spack/repos/builtin/packages/abyss/package.py | var/spack/repos/builtin/packages/abyss/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python | |
418e714e3d544abc7120c7252c51493cd59081a0 | Add custom CommentedObjectManager | jezdez-archive/django-comment-utils,paltman/django-comment-utils,clones/django-comment-utils | comment_utils/managers.py | comment_utils/managers.py | """
Custom manager which managers of objects which allow commenting can
inheit from.
"""
from django.db import models
class CommentedObjectManager(models.Manager):
"""
A custom manager class which provides useful methods for types of
objects which allow comments.
Models which allow comments but ... | bsd-3-clause | Python | |
f189ed9401e82e55a7b3b73ce06a8f5c642344ac | Add functional test file | Soaring-Outliers/news_graph,Soaring-Outliers/news_graph,Soaring-Outliers/news_graph,Soaring-Outliers/news_graph | functional_tests.py | functional_tests.py | from selenium import webdriver
import unittest
class Test(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3) # Browser will eventually wait 3 secs
# for a thing to appear if needed
def tearDown(self):... | mit | Python | |
09a25009965d9951614ed0702185947f796c41a0 | Create scraper.py | shauryashahi/Indian-Schools-Database | scraper.py | scraper.py | from lxml.html import parse
def main():
baseurl = 'http://www.schoolcolleges.com/school.select.php?offset=%s&val=city=%270%27&select=%s'
states = [
'Andhra Pradesh',
'Arunachal Pradesh',
'Assam',
'BIHAR',
'Chhattisgarh',
'Goa',
'Gujarat',
'Haryana',
'Himachal Pradesh',
'Jammu & Kashmir',
'Jharkhand',
'Ka... | apache-2.0 | Python | |
691543bb43b67dd9cc9ff6d6ee6a212badd4c61e | add valid unicode example | AlanCoding/Ansible-inventory-file-examples,AlanCoding/Ansible-inventory-file-examples | scripts/unicode_valid.py | scripts/unicode_valid.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
print(json.dumps({
"_meta": {
"hostvars": {
"not_unicode": {"host_var": "unicode here 日本語"}
}
},
"all": {
"vars": {
"inventory_var": "this is an inventory var 日本語"
}
},
"group_日本語": {
... | mit | Python | |
2bc7acd167d6e18dfbc2bc2625957f2bd58fa1f5 | Create spacial_prototype.py | jbobotek/elcano,jbobotek/elcano,jbobotek/elcano,jbobotek/elcano,jbobotek/elcano,jbobotek/elcano | Vision/spacial_prototype.py | Vision/spacial_prototype.py | import numpy as np
import math as m
# Prototype code for the image-to-world location system. Requires numpy.
# TODO
def _inverse_perspective():
pass
# Convert a global coordinate to a relative coordinate
# (roll, pitch, yaw) = camera_angle
# (x, y, z) = camera_pos, cone_pos (global coordinates)
# (width, height)... | mit | Python | |
785f6a4f435c68bb6336b4e42da0964cf5cbfce4 | Add module that finds classifier training examples given a ground truth in the graph | chaubold/hytra,chaubold/hytra,chaubold/hytra | hytra/jst/classifiertrainingexampleextractor.py | hytra/jst/classifiertrainingexampleextractor.py | '''
Provide methods to find positive and negative training examples from a hypotheses graph and
a ground truth mapping, in the presence of multiple competing segmentation hypotheseses.
'''
import numpy as np
import logging
from hytra.core.random_forest_classifier import RandomForestClassifier
def getLogger():
''... | mit | Python | |
23f6d87b94bf0340b70b9803f1b8c712f1d88726 | Add models in session module. | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | dataviva/apps/session/models.py | dataviva/apps/session/models.py | from dataviva.apps.session.login_providers import facebook, twitter, google
from dataviva.apps.account.models import User
from dataviva.utils.encode import sha512
from flask import Blueprint, request, render_template, session, redirect, Response
from flask.ext.login import login_user, logout_user
from forms import Log... | mit | Python | |
ccd1822d65f5565d4881e5a6a32b535e55cc2b50 | Implement preview of entries for restricted users in EntryPreviewMixin | 1844144/django-blog-zinnia,ghachey/django-blog-zinnia,petecummings/django-blog-zinnia,marctc/django-blog-zinnia,bywbilly/django-blog-zinnia,ghachey/django-blog-zinnia,Zopieux/django-blog-zinnia,ghachey/django-blog-zinnia,extertioner/django-blog-zinnia,1844144/django-blog-zinnia,ZuluPro/django-blog-zinnia,extertioner/dj... | zinnia/views/mixins/entry_preview.py | zinnia/views/mixins/entry_preview.py | """Preview mixins for Zinnia views"""
from django.http import Http404
from django.utils.translation import ugettext as _
from zinnia.managers import PUBLISHED
class EntryPreviewMixin(object):
"""
Mixin implementing the preview of Entries.
"""
def get_object(self, queryset=None):
"""
... | bsd-3-clause | Python | |
120c93a2dd0022de5cb3a30ceffc027e69b23c3a | Add ProgressMonitor | jimfleming/recurrent-entity-networks,mikalyoung/recurrent-entity-networks,jimfleming/recurrent-entity-networks,mikalyoung/recurrent-entity-networks | entity_networks/monitors.py | entity_networks/monitors.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import tensorflow as tf
from tqdm import tqdm
class ProgressMonitor(tf.contrib.learn.monitors.EveryN):
def __init__(self, tensor_names, every_n_steps=100, first_n_steps=1):
sup... | mit | Python | |
770ed3ea3ec2ab8d76172b85bd8b37c22517139c | add initial define function | PrestigeDox/Watashi-SelfBot | cogs/define.py | cogs/define.py | import discord
from discord.ext import commands
from bs4 import BeautifulSoup
class Define:
def __init__(self, bot):
self.bot = bot
self.aiohttp_session = bot.aiohttp_session
self.url = 'https://google.com/search'
self.headers = {'User-Agent':
'Mozilla/5.0 (W... | mit | Python | |
fe7d8e23a6ab8d86c39ef8ede2ddafa40a7fc1fb | Add RIPE space lookup thread | job/irrexplorer,job/irrexplorer,job/irrexplorer,job/irrexplorer | irrexplorer/ripe.py | irrexplorer/ripe.py | #!/usr/bin/env python
# Copyright (C) 2015 Job Snijders <job@instituut.net>
#
# This file is part of IRR Explorer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the abo... | bsd-2-clause | Python | |
a91386a802d3346c945e107aa3abd6aa5fcfe0d7 | Solve double base palindrome | daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various | project_euler/036.double_palindromes.py | project_euler/036.double_palindromes.py | '''
Problem 036
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in
base 10 and base 2.
(Please note that the palindromic number, in either base, may not include
leading zeros.)
Solution: Copyright 2017 D... | mit | Python | |
892b6b6cb334ec3f932881f7e698e3ab6619cbf3 | add a script to get an API token | browniebroke/deezer-python,browniebroke/deezer-python,browniebroke/deezer-python | oauth.py | oauth.py | """Simple script to obtain an API token via OAuth."""
import webbrowser
from argparse import ArgumentParser
from http.server import BaseHTTPRequestHandler, HTTPServer
from typing import Dict
from urllib.parse import urlencode
import requests
HOST_NAME = "localhost"
SERVER_PORT = 8080
REDIRECT_PATH = "/oauth/return"
... | mit | Python | |
3096af347f1cda453eb48f7002371a49b389c568 | use keep_lazy if available | haakenlid/django-extensions,haakenlid/django-extensions,django-extensions/django-extensions,linuxmaniac/django-extensions,linuxmaniac/django-extensions,django-extensions/django-extensions,linuxmaniac/django-extensions,haakenlid/django-extensions,django-extensions/django-extensions | django_extensions/utils/text.py | django_extensions/utils/text.py | # -*- coding: utf-8 -*-
import six
from django.utils.encoding import force_text
try:
from django.utils.functional import keep_lazy
KEEP_LAZY = True
except ImportError:
from django.utils.functional import allow_lazy
KEEP_LAZY = False
def truncate_letters(s, num):
"""
truncates a string to a num... | # -*- coding: utf-8 -*-
import six
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy
def truncate_letters(s, num):
"""
truncates a string to a number of letters, similar to truncate_words
"""
s = force_text(s)
length = int(num)
if len(s) > length:
... | mit | Python |
005c9d1a51793fe76c798be2f546552bb2ee2088 | add word graph boilerplate code | parrt/msan501-starterkit | graphs/wordgraph.py | graphs/wordgraph.py | def gml2adjlist(G):
"""
Return a dict mapping word to adjacent nodes. G.node dict in memory
looks like:
{0: {'id': 0, 'value': 0, 'label': 'agreeable'},
1: {'id': 1, 'value': 1, 'label': 'man'}, ... }
and G.edge dict looks like:
{0: {1: {}, 2: {}, 3: {}}, 1: {0: {}, 19: {}, 2: {}, 102: {}... | bsd-2-clause | Python | |
7c10150d5e667921450e8663fa9440253a495160 | Add migration for moving recomended articles recomended section | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | gem/migrations/0014_convert_recomended_articles.py | gem/migrations/0014_convert_recomended_articles.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import ArticlePage, ArticlePageRecommendedSections
from wagtail.wagtailcore.blocks import StreamValue
def create_recomended_articles(main_article, article_list):
'''
Creates recommended arti... | bsd-2-clause | Python | |
909f2c9739429ea3e6954a829e0776d84714d4fd | Add migration | webkom/holonet,webkom/holonet,webkom/holonet | holonet/core/migrations/0007_auto_20150324_1049.py | holonet/core/migrations/0007_auto_20150324_1049.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20150324_0035'),
]
operations = [
migrations.AlterField(
model_name='user',
name='... | mit | Python | |
abd05378eb6acf742f2deff4228a0bca4492521b | Add example showing scraping/parsing of an HTML table into a Python dict | pyparsing/pyparsing,pyparsing/pyparsing | examples/htmlTableParser.py | examples/htmlTableParser.py | #
# htmlTableParser.py
#
# Example of parsing a simple HTML table into a list of rows, and optionally into a little database
#
# Copyright 2019, Paul McGuire
#
import pyparsing as pp
import urllib.request
# define basic HTML tags, and compose into a Table
table, table_end = pp.makeHTMLTags('table')
thead, thead_end ... | mit | Python | |
5aeb0e41621eeb397ea16aff22d7f4deaf8fa7a2 | Add python play example | Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io,Drooids/sipgate.io | examples/python/play-url.py | examples/python/play-url.py | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import urlparse
import logging
from xml.dom.minidom import Document
logging.basicConfig(level=logging.DEBUG)
class MegaAwesomePythonServer(BaseHTTPRequestHandler):
def do_POST(self):
length = int(self.headers.getheader('... | bsd-2-clause | Python | |
c1f3bb8b3bc3a6685cd839df92a035298ecea2b9 | Create compoundword.py | disasterisk/itc110 | compoundword.py | compoundword.py | import random
dic1 = ["life", "moon", "butter", "fire", "basket", "foot", "weather", "earth", "play", "super", "grand", "rattle", "skate", "grass", "eye", "honey", "dish", "pop", "book", "thunder", "head", "glass", "boot", "air", "baby", "ham", "common", "sea", "sand", "river", "tooth", "town", "sauce", "disk", "horse"... | mit | Python | |
b48bd670084cd1b2e443eb284813b949edbff6ca | Add gunicorn config | angstwad/linky,angstwad/linky | linky/config/gunicorn.conf.py | linky/config/gunicorn.conf.py | import multiprocessing
appname = "linky"
procname = appname
bind = "unix:/tmp/%s" % appname
workers = multiprocessing.cpu_count() * 2 + 1
max_requests = 1000
preload_app = True
accesslog = "/home/webapp/apps/linky/logs/access.log"
errorlog = "/home/webapp/apps/linky/logs/error.log"
loglevel = "info"
| apache-2.0 | Python | |
19f8cf043437d3ed0feac6ce1619636189904277 | add get_partners.py | Mesitis/community | sample-code/Python/get_partners.py | sample-code/Python/get_partners.py | '''
- login and get token
- process 2FA if 2FA is setup for this account
- returns all user types if user is a partner admin (or above) - else error
'''
import requests
import json
get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/"
validate_otp_url = "https://api.canopy.cloud:443/api/v1/sessions/otp/val... | mit | Python | |
355094293afbe0836304be495307155aea6c26a8 | Create Brain_TTS.py | MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI | EmeraldAI/Application/Main/Brain_TTS.py | EmeraldAI/Application/Main/Brain_TTS.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import time
from os.path import dirname, abspath
sys.path.append(dirname(dirname(dirname(dirname(abspath(__file__))))))
reload(sys)
sys.setdefaultencoding('utf-8')
import rospy
from std_msgs.msg import String
from EmeraldAI.Logic.Modules import Pid
from E... | apache-2.0 | Python | |
99b0596f8bdef41e08ff04e53316ae8edaab29c4 | Add loggers helper | mina-asham/pictures-dedupe-and-rename | pictures/loggers.py | pictures/loggers.py | import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)s %(levelname)s %(message)s')
def logger_from(name):
return logging.getLogger(name)
| mit | Python | |
8c2305844c2c0ac501d72567c7f70f5cf784fc7c | Add script to apply a tilix colorscheme file. (#524) | alacritty/alacritty,jwilm/alacritty,jwilm/alacritty,alacritty/alacritty,jwilm/alacritty,jwilm/alacritty | scripts/apply-tilix-colorscheme.py | scripts/apply-tilix-colorscheme.py | #!/usr/bin/env python3
import collections
import logging
import shutil
import json
import sys
import os
import yaml
log = logging.getLogger(__name__)
XDG_CONFIG_HOME = os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
ALACONF_FN = os.path.join(XDG_CONFIG_HOME, 'alacritty', 'alacritty.yml')
Palette... | apache-2.0 | Python | |
62fe7541fd1c9272616f9e7021617f2fb766bd93 | add models placeholder for django | qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | pillowtop/models.py | pillowtop/models.py | # placeholder for django | bsd-3-clause | Python | |
2ab86a15b956954f5de99db177a6a69b48677e2b | Add Webcam object | ptomato/Beams | src/Webcam.py | src/Webcam.py | import cv
class Webcam:
def __init__(self, cam=-1):
self.capture = None
self.camera_number = cam
def __enter__(self):
self.open()
return self
def __exit__(self):
self.close()
def open()
self.capture = cv.CaptureFromCAM(self.camera_number)
def close()
cv.ReleaseCapture(self.capture)
def qu... | mit | Python | |
231943a950b49e46b86467991ca6e4c7b3505be0 | update python learn - module | heysion/1ghl,heysion/1ghl,heysion/1ghl,heysion/1ghl | python/study/module-test.py | python/study/module-test.py | #module test
import sys
print 'the sys argv list:'
for i in sys.argv:
print i
print sys.path
| bsd-3-clause | Python | |
3d3602faf4a47855be264f05d9d52253e8bd0f9d | Add RPC test for the p2p mempool command in conjunction with disabled bloomfilters | daliwangi/bitcoin,cannabiscoindev/cannabiscoin420,h4x3rotab/BTCGPU,sipsorcery/bitcoin,core-bitcoin/bitcoin,21E14/bitcoin,h4x3rotab/BTCGPU,instagibbs/bitcoin,sebrandon1/bitcoin,Rav3nPL/bitcoin,Sjors/bitcoin,mb300sd/bitcoin,mb300sd/bitcoin,HashUnlimited/Einsteinium-Unlimited,zcoinofficial/zcoin,sstone/bitcoin,myriadteam/... | qa/rpc-tests/p2p-mempool.py | qa/rpc-tests/p2p-mempool.py | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | mit | Python | |
db9b756dbf68fde9930da8ab6b4594fa3f1d361e | Fix cascades for RecurringEventOverride table | gale320/sync-engine,Eagles2F/sync-engine,nylas/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,closeio/nylas,ErinCall/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,gale320/sync-engine,jobscore/sync-engine,wakermahmud/sync-engine,gale320/sync-engine,ErinCall/sync-engine,ErinCall/sync-e... | migrations/versions/175_fix_recurring_override_cascade.py | migrations/versions/175_fix_recurring_override_cascade.py | """fix recurring override cascade
Revision ID: 6e5b154d917
Revises: 41f957b595fc
Create Date: 2015-05-25 16:23:40.563050
"""
# revision identifiers, used by Alembic.
revision = '6e5b154d917'
down_revision = '4ef055945390'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text
def upgrade()... | agpl-3.0 | Python | |
730548fe74dda462d7aac1e3c5ee8e8ba47f4371 | Add script that extracts clips from HDF5 file. | HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper | scripts/extract_clips_from_hdf5_file.py | scripts/extract_clips_from_hdf5_file.py | from pathlib import Path
import wave
import h5py
DIR_PATH = Path('/Users/harold/Desktop/Clips')
INPUT_FILE_PATH = DIR_PATH / 'Clips.h5'
CLIP_COUNT = 5
def main():
with h5py.File(INPUT_FILE_PATH, 'r') as file_:
clip_group = file_['clips']
for i, clip_id in enumerate(clip_group):
... | mit | Python | |
d5aa5aa96aad03b1bd32504b1c9d0a87c1a1c796 | Create y=Wx+b.py | bayvictor/distributed-polling-system,bayvictor/distributed-polling-system,bayvictor/distributed-polling-system,bayvictor/distributed-polling-system,bayvictor/distributed-polling-system | y=Wx+b.py | y=Wx+b.py | import tensorflow as tf
import numpy as np
x_data = np.random.rand(100).astype("float32")
y_data = x_data * .1 +.3
W = tf.Variable(tf.random_uniform([1], -1.0, 1.0 ))
b = tf.Variable(tf.zeros([1]))
y = W * x_data + b
loss = tf.reduce_mean(tf.square(y - y_data ))
optimizer = tf.train.GradientDescentOptimizer(0.5)
trai... | apache-2.0 | Python | |
a570730af71e3263af2f265a1730db3f808cd201 | Add ex_add_noise.py | waynegm/OpendTect-External-Attributes | Python_3/Miscellaneous/ex_addnoise.py | Python_3/Miscellaneous/ex_addnoise.py | # Add gaussian noise to an input
#
# Copyright (C) 2016 Wayne Mogg All rights reserved.
#
# This file may be used under the terms of the MIT License
# (https://github.com/waynegm/OpendTect-External-Attributes/blob/master/LICENSE)
#
# Author: Wayne Mogg
# Date: September, 2016
# Homepage: http://waynegm.github.io/Op... | mit | Python | |
b72a4bb06fda18ebca91649808cd2f2c531b392e | Set all events to show banner text | NewAcropolis/api,NewAcropolis/api,NewAcropolis/api | migrations/versions/0060.py | migrations/versions/0060.py | """empty message
Revision ID: 0060 set all show_banner_text
Revises: 0059 add show_banner_text
Create Date: 2021-10-03 00:31:22.285217
"""
# revision identifiers, used by Alembic.
revision = '0060 set all show_banner_text'
down_revision = '0059 add show_banner_text'
from alembic import op
def upgrade():
op.ex... | mit | Python | |
9132678df072e0c11685aea21c04410fe699ce4f | Create Majority_Element.py | UmassJin/Leetcode | Array/Majority_Element.py | Array/Majority_Element.py | '''
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the majority element always exist in the array.
'''
class Solution:
# @param {integer[]} nums
# @return {integer}
def majorityEl... | mit | Python | |
4b1ac6217d054bd2fe8e5e6b4cfe036e2a4d0360 | Add a template of setup.py. | FGtatsuro/flask-boilerplate,FGtatsuro/flask-boilerplate,FGtatsuro/flask-boilerplate | setup.py | setup.py | from setuptools import setup, find_packages
import os
version = '0.1'
setup(name='flask-boilerplate',
version=version,
description='',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
classifiers=[
], # Get strings from http://pypi.python.org/pypi?%3Aa... | mit | Python | |
b1f689f82bbb6d26511b6a310be798dad1791fc5 | add setup.py | vanatteveldt/saf | setup.py | setup.py | from distutils.core import setup
setup(
version='0.10',
name="saf",
description="Python toolkit for handling Simple Annotation Framework files",
author="Wouter van Atteveldt",
author_email="wouter@vanatteveldt.com",
packages=["saf"],
classifiers=[
"License :: OSI Approved :: MIT License",
],
)
| mit | Python | |
e37dae306f2dcf17e95a988b332c064fde11fb1a | Create setup.py | chrisdpa/rakolighting | setup.py | setup.py | from setuptools import setup
setup(name='rakolighting',
version='0.1',
description='rakolighting library',
url='https://github.com/chrisdpa/rakolighting',
author='chrisdpa',
author_email='unknown',
license='MIT',
packages=['rakolighting'],
zip_safe=False)
| mit | Python | |
e1c35ee11d281692f916ebf57b38390b90501304 | Create texted.py | introprogramming/exercises,introprogramming/exercises,introprogramming/exercises | exercises/text-editor/texted.py | exercises/text-editor/texted.py | import Tkinter as Tk
import tkFileDialog
# Text Editor Skeleton
def on_new():
# reset path and delete all text in the text box
print "Not implemented"
def on_open():
# let user choose what file to open from a dialog (tkFileDialog)
# replace text in text box with text from file
# handle cancelli... | mit | Python | |
d2cbe26e14e23a4482e54a74da1412c5c0c28500 | Update package info | napuzba/zagoload,napuzba/FileLoader | setup.py | setup.py | from distutils.core import setup
setup(
name = 'fileloader',
packages = ['fileloader'],
version = '0.1',
description = 'Downloading files (http,ftp). Supports cachinhg and allows uniform access to remote and local files',
author = 'napuzba',
author_email = 'kobi@napuzba.com',
url = 'https://git... | from distutils.core import setup
setup(
name = 'fileloader',
packages = ['fileloader'],
version = '0.1',
description = 'Downloading files (support http and ftp protocols, cachinhg, allows accessing remote and local files in uniform way',
author = 'napuzba',
author_email = 'kobi@napuzba.com',
ur... | mit | Python |
d6ccfdf365b8df4eefcbe1131dd8b19d184b0fa4 | add monkey patch test for convert command. | cournape/Bento,cournape/Bento,cournape/Bento,cournape/Bento | bento/commands/tests/test_convert.py | bento/commands/tests/test_convert.py | import sys
from bento.misc.testing \
import \
SubprocessTestCase
from bento.commands.convert \
import \
monkey_patch
class TestMonkeyPath(SubprocessTestCase):
def test_distutils(self):
monkey_patch("distutils", "setup.py")
self.assertTrue("setuptools" not in sys.modules)
... | bsd-3-clause | Python | |
082c48bcd747c096abd0cd2970edb8cbb0f3d20b | Add contribution admin | stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten | features/contributions/admin.py | features/contributions/admin.py | from django.contrib import admin
from . import models
admin.site.register(models.Contribution)
| agpl-3.0 | Python | |
65f903a1de88cee2fdd6fe16cf86aceee3545d7b | Add example | JohnLunzer/flexx,JohnLunzer/flexx,jrversteegh/flexx,jrversteegh/flexx,JohnLunzer/flexx,zoofIO/flexx,zoofIO/flexx | flexx/ui/examples/serve_data.py | flexx/ui/examples/serve_data.py | """
This example demonstrates how data can be provided to the client with the
Flexx asset management system.
There are two ways to provide data: via the asset store (``app.assets``),
and via the session (``some_model.session``). In the former, the data
is shared between sessions. In the latter, the data is specific fo... | bsd-2-clause | Python | |
17018750ac3ea39c4fe5a96c05db2375ecd4973e | Add regression test for #717 | recognai/spaCy,recognai/spaCy,raphael0202/spaCy,honnibal/spaCy,aikramer2/spaCy,raphael0202/spaCy,explosion/spaCy,spacy-io/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,spacy-io/spaCy,raphael0202/spaCy,recognai/spaCy,oroszgy/spaCy.hu,oroszgy/spaCy.hu,raphael0202/spaCy,aikramer2/spaCy,spacy-io/spaCy,explo... | spacy/tests/regression/test_issue717.py | spacy/tests/regression/test_issue717.py | # coding: utf8
from __future__ import unicode_literals
import pytest
@pytest.mark.xfail
@pytest.mark.models
@pytest.mark.parametrize('text1,text2', [("You're happy", "You are happy")])
def test_issue717(EN, text1, text2):
"""Test that contractions are assigned the correct lemma."""
doc1 = EN(text1)
doc2 ... | mit | Python | |
b7efac523bab70532dd2e703f8d4175ec22b3044 | Add output.base unit test. | amorphic/braubuddy,amorphic/braubuddy,amorphic/braubuddy | braubuddy/tests/outputs/test_base.py | braubuddy/tests/outputs/test_base.py | # -*- coding: utf-8 -*-
"""
Braubuddy Base unit tests
"""
import unittest
from braubuddy.output import base
class IOutput(unittest.TestCase):
def test_map_c_to_symbol(self):
"""c is mapped to °C"""
self.assertEqual(
base.IOutput.map_temp_units_to_symbol('c'), '°C')
def test_map... | bsd-3-clause | Python | |
437c45509bb2f6387b83cf7d47e51ce46d1c2776 | Add unit test | WoLpH/py-trello,sarumont/py-trello,Wooble/py-trello,mehdy/py-trello,gchp/py-trello,portante/py-trello,ntrepid8/py-trello,merlinpatt/py-trello,nMustaki/py-trello | tests.py | tests.py | from models import AuthenticationError,AuthenticationRequired
import trello
import unittest
import os
class TestTrello(unittest.TestCase):
def test_login(self):
username = os.environ['TRELLO_TEST_USER']
password = os.environ['TRELLO_TEST_PASS']
try:
trello.login(username, password)
except AuthenticationEr... | bsd-3-clause | Python | |
2324be51d7ded00ad9b92ededff93b57f8b656c0 | add labeltile program | lunkwill42/homebrewtools | labeltile.py | labeltile.py | #!/usr/bin/env python3
import argparse
from collections import Counter
from math import ceil, floor
import colorsys
import logging
from PIL import Image, ImageDraw
__author__ = 'Morten Brekkevold <morten@snabel.org>'
__copyright__ = '(C) 2015 Morten Brekkevold'
__license__ = 'MIT'
_logger = logging.getLogger('beerlab... | mit | Python | |
fdcdfb6f710be10cdead865b09d98b4bd0c0cebd | Create tests.py | word-killers/mark2down,word-killers/mark2down,word-killers/mark2down | tests.py | tests.py | pass
| mit | Python | |
6200bce410eb966b97a5edf2ea8efdcd94e736db | test script which creates a tun tunnel and prints what it received. | Gawen/pytun | tests.py | tests.py | import pytun
import logging
import select
def pprint_buf(buf):
""" Dirty & convenient function to display the hexademical
repr. of a buffer.
"""
DEFAULT_SIZE = 4
def hex2(i, l = None):
l = l if l is not None else DEFAULT_SIZE
h = hex(i).upper()[2:]
if len(h) ... | mit | Python | |
cc967aa97954be1614ca49489e1b97a940b2ef2b | Create solution.py | lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges | hackerrank/algorithms/sorting/easy/correctness_and_the_loop_invariant/py/solution.py | hackerrank/algorithms/sorting/easy/correctness_and_the_loop_invariant/py/solution.py | #!/bin/python
def insertion_sort(L):
for i in xrange(1, len(L)):
j = i - 1
key = L[i]
while (j >= 0) and (L[j] > key):
L[j+1], L[j] = L[j], L[j + 1]
j -= 1
m = input()
ar = [int(i) for i in raw_input().strip().split()]
insertion_sort(ar)
print " ".join(map(str,ar))
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.