commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
7356dd66137cbb606c3026802ff42ab666af6c08
jmbo_twitter/admin.py
jmbo_twitter/admin.py
from django.contrib import admin from django.core.urlresolvers import reverse from jmbo.admin import ModelBaseAdmin from jmbo_twitter import models class FeedAdmin(ModelBaseAdmin): inlines = [] list_display = ('title', '_image', 'subtitle', 'publish_on', 'retract_on', \ '_get_absolute_url', 'owner',...
from django.contrib import admin from django.core.urlresolvers import reverse from jmbo.admin import ModelBaseAdmin from jmbo_twitter import models class FeedAdmin(ModelBaseAdmin): inlines = [] list_display = ('title', '_image', 'subtitle', 'publish_on', 'retract_on', \ '_get_absolute_url', 'owner',...
Add a comment explaining AttributeError
Add a comment explaining AttributeError
Python
bsd-3-clause
praekelt/jmbo-twitter,praekelt/jmbo-twitter,praekelt/jmbo-twitter
e0eeba656b42ddd2d79bd0f31ad36d64a70dfda0
moniker/backend/__init__.py
moniker/backend/__init__.py
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
Fix so it invokes on load
Fix so it invokes on load Change-Id: I9806ac61bc1338e566a533f57a50c214ec6e14e7
Python
apache-2.0
kiall/designate-py3,openstack/designate,tonyli71/designate,cneill/designate,cneill/designate-testing,richm/designate,muraliselva10/designate,NeCTAR-RC/designate,muraliselva10/designate,kiall/designate-py3,melodous/designate,cneill/designate,kiall/designate-py3,ionrock/designate,melodous/designate,tonyli71/designate,ram...
32ca2e07aae40fea18a55875760c506281113313
examples/dbus_client.py
examples/dbus_client.py
import dbus bus = dbus.SystemBus() # This adds a signal match so that the client gets signals sent by Blivet1's # ObjectManager. These signals are used to notify clients of changes to the # managed objects (for blivet, this will be devices, formats, and actions). bus.add_match_string("type='signal',sender='com.redha...
import dbus bus = dbus.SystemBus() # This adds a signal match so that the client gets signals sent by Blivet1's # ObjectManager. These signals are used to notify clients of changes to the # managed objects (for blivet, this will be devices, formats, and actions). bus.add_match_string("type='signal',sender='com.redha...
Update example dbus client to account for Format interface.
Update example dbus client to account for Format interface.
Python
lgpl-2.1
jkonecny12/blivet,rvykydal/blivet,AdamWill/blivet,jkonecny12/blivet,AdamWill/blivet,vpodzime/blivet,vojtechtrefny/blivet,rvykydal/blivet,vpodzime/blivet,vojtechtrefny/blivet
d5458286244d2ba14fe0af33a9e8fdc9ab728669
tests/test_replies.py
tests/test_replies.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import time import unittest class ReplyTestCase(unittest.TestCase): def test_base_reply(self): from wechatpy.replies import TextReply timestamp = int(time.time()) reply = TextReply(source='user1', target='us...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import time import unittest class ReplyTestCase(unittest.TestCase): def test_base_reply(self): from wechatpy.replies import TextReply timestamp = int(time.time()) reply = TextReply(source='user1', target='us...
Fix test error under Python 2.6 where assertLessEqual not defined
Fix test error under Python 2.6 where assertLessEqual not defined
Python
mit
cloverstd/wechatpy,wechatpy/wechatpy,cysnake4713/wechatpy,tdautc19841202/wechatpy,zaihui/wechatpy,hunter007/wechatpy,Luckyseal/wechatpy,cysnake4713/wechatpy,navcat/wechatpy,Luckyseal/wechatpy,mruse/wechatpy,chenjiancan/wechatpy,mruse/wechatpy,zhaoqz/wechatpy,zhaoqz/wechatpy,EaseCloud/wechatpy,zaihui/wechatpy,tdautc1984...
508965ffac8b370cbc831b394b8939c26793f58c
installer/installer_config/admin.py
installer/installer_config/admin.py
from django.contrib import admin from installer_config.models import EnvironmentProfile from installer_config.models import UserChoice, Step # class PackageAdmin(admin.ModelAdmin): # model = Package # list_display = ('id', 'display_name', 'version', 'website') # class TerminalPromptAdmin(admin.ModelAdmin): ...
from django.contrib import admin from installer_config.models import EnvironmentProfile from installer_config.models import UserChoice, Step # class PackageAdmin(admin.ModelAdmin): # model = Package # list_display = ('id', 'display_name', 'version', 'website') # class TerminalPromptAdmin(admin.ModelAdmin): ...
Add inline for steps to User Choice
Add inline for steps to User Choice
Python
mit
alibulota/Package_Installer,alibulota/Package_Installer,ezPy-co/ezpy,ezPy-co/ezpy
c017d8fa711724fc7acb7e90b85f208be074d1ec
drupdates/plugins/repolist/__init__.py
drupdates/plugins/repolist/__init__.py
from drupdates.utils import * from drupdates.repos import * ''' Note: you need an ssh key set up with Stash to make this script work ''' class repolist(repoTool): def __init__(self): currentDir = os.path.dirname(os.path.realpath(__file__)) self.localsettings = Settings(currentDir) def gitRepos(self): ...
from drupdates.utils import * from drupdates.repos import * ''' Note: you need an ssh key set up with Stash to make this script work ''' class repolist(repoTool): def __init__(self): currentDir = os.path.dirname(os.path.realpath(__file__)) self.localsettings = Settings(currentDir) def gitRepos(self): ...
Add extra check to repo list to verify a dictionary is returned
Add extra check to repo list to verify a dictionary is returned
Python
mit
jalama/drupdates
d4ef63250075dbbefbeed4bb37e8679f1ae2495f
tms/__init__.py
tms/__init__.py
from tms.workday import WorkDay from tms.scraper import scraper from tms.workweek import WorkWeek
from tms.workday import WorkDay from tms.scraper import scraper from tms.workweek import WorkWeek from tms.breakrule import BreakRule
Change to account for the move of the breakrule call
Change to account for the move of the breakrule call
Python
mit
marmstr93ng/TimeManagementSystem,marmstr93ng/TimeManagementSystem
f76086c1900bce156291e2180827570477342f70
tweepy/error.py
tweepy/error.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from __future__ import print_function import six class TweepError(Exception): """Tweepy exception""" def __init__(self, reason, response=None, api_code=None): self.reason = six.text_type(reason) self.response = respon...
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from __future__ import print_function import six class TweepError(Exception): """Tweepy exception""" def __init__(self, reason, response=None, api_code=None): self.reason = six.text_type(reason) self.response = respon...
Use super in TweepError initialization
Use super in TweepError initialization
Python
mit
svven/tweepy,tweepy/tweepy
d81a6930d21262464ee06ae8afb51b65920f378c
tap/tests/test_pytest_plugin.py
tap/tests/test_pytest_plugin.py
# Copyright (c) 2015, Matt Layman try: from unittest import mock except ImportError: import mock from tap.plugins import pytest from tap.tests import TestCase from tap.tracker import Tracker class TestPytestPlugin(TestCase): def setUp(self): """The pytest plugin uses module scope so a fresh tra...
# Copyright (c) 2015, Matt Layman try: from unittest import mock except ImportError: import mock import tempfile from tap.plugins import pytest from tap.tests import TestCase from tap.tracker import Tracker class TestPytestPlugin(TestCase): def setUp(self): """The pytest plugin uses module scop...
Fix test to not create a new directory in the project.
Fix test to not create a new directory in the project.
Python
bsd-2-clause
mblayman/tappy,python-tap/tappy,Mark-E-Hamilton/tappy
0ab7d60f02abe3bd4509c3377ebc6cb11f0a5e0f
ydf/templating.py
ydf/templating.py
""" ydf/templating ~~~~~~~~~~~~~~ Contains functions to be exported into the Jinja2 environment and accessible from templates. """ import jinja2 import os from ydf import instructions, __version__ DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates') def render...
""" ydf/templating ~~~~~~~~~~~~~~ Contains functions to be exported into the Jinja2 environment and accessible from templates. """ import jinja2 import os from ydf import instructions, __version__ DEFAULT_TEMPLATE_NAME = 'default.tpl' DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname...
Add global for default template name.
Add global for default template name.
Python
apache-2.0
ahawker/ydf
8354cfd953bb09723abcff7fefe620fc4aa6b855
tests/test_git_helpers.py
tests/test_git_helpers.py
from unittest import TestCase, mock from invoke.runner import Result from semantic_release.git_helpers import commit_new_version, get_commit_log class GetCommitLogTest(TestCase): def test_first_commit_is_not_initial_commit(self): self.assertNotEqual(next(get_commit_log()), 'Initial commit') class Comm...
from unittest import TestCase, mock from invoke.runner import Result from semantic_release.git_helpers import (commit_new_version, get_commit_log, push_new_version, tag_new_version) class GitHelpersTests(TestCase): def test_first_commit_is_not_initial_commit(self): ...
Add test for git helpers
Add test for git helpers
Python
mit
relekang/python-semantic-release,relekang/python-semantic-release,wlonk/python-semantic-release,riddlesio/python-semantic-release,jvrsantacruz/python-semantic-release
9ad4944b8c37902e80c684f8484105ff952f3dba
tests/test_program.py
tests/test_program.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import io from hypothesis import given from hypothesis.strategies import lists, integers from sensibility import Program, vocabulary #semicolon = vocabulary.to_index(';') @given(lists(integers(min_value=vocabulary.start_token_index + 1, max_value...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import io from hypothesis import given from hypothesis.strategies import builds, lists, integers, just from sensibility import Program, vocabulary tokens = integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1)...
Clean up test a bit.
Clean up test a bit.
Python
apache-2.0
naturalness/sensibility,naturalness/sensibility,naturalness/sensibility,naturalness/sensibility
3b2dab6b7c7a2e0f155825d2819c14de20135fd1
scripts/add_global_subscriptions.py
scripts/add_global_subscriptions.py
""" This migration subscribes each user to USER_SUBSCRIPTIONS_AVAILABLE if a subscription does not already exist. """ import logging import sys from website.app import init_app from website import models from website.notifications.model import NotificationSubscription from website.notifications import constants from ...
""" This migration subscribes each user to USER_SUBSCRIPTIONS_AVAILABLE if a subscription does not already exist. """ import logging import sys from website.app import init_app from website import models from website.notifications.model import NotificationSubscription from website.notifications import constants from ...
Add check for active and registered users
Add check for active and registered users
Python
apache-2.0
caneruguz/osf.io,alexschiller/osf.io,rdhyee/osf.io,SSJohns/osf.io,DanielSBrown/osf.io,HalcyonChimera/osf.io,chrisseto/osf.io,mfraezz/osf.io,aaxelb/osf.io,mattclark/osf.io,baylee-d/osf.io,CenterForOpenScience/osf.io,samchrisinger/osf.io,cslzchen/osf.io,laurenrevere/osf.io,chennan47/osf.io,caseyrollins/osf.io,mfraezz/osf...
4018f7414ca88cc51cf05591f9aec44e5d4b4944
python/foolib/setup.py
python/foolib/setup.py
from distutils.core import setup, Extension module1 = Extension('foolib', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '0')], sources = ['foolibmodule.c']) setup (name = 'foolib', version = '1.0', description = 'T...
from distutils.core import setup, Extension module1 = Extension('foolib', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '0')], include_dirs = ['../../cxx/include'], sources = ['foolibmodule.c', '../../cxx/src/...
Add include directory and c library file.
Add include directory and c library file.
Python
apache-2.0
tomkraljevic/polyglot-to-cxx-examples,tomkraljevic/polyglot-to-cxx-examples,tomkraljevic/polyglot-to-cxx-examples
2cbbcb6c900869d37f9a11ae56ea38f548233274
dask/compatibility.py
dask/compatibility.py
from __future__ import absolute_import, division, print_function import sys PY3 = sys.version_info[0] == 3 PY2 = sys.version_info[0] == 2 if PY3: import builtins from queue import Queue, Empty from itertools import zip_longest from io import StringIO, BytesIO from urllib.request import urlopen ...
from __future__ import absolute_import, division, print_function import sys PY3 = sys.version_info[0] == 3 PY2 = sys.version_info[0] == 2 if PY3: import builtins from queue import Queue, Empty from itertools import zip_longest from io import StringIO, BytesIO from urllib.request import urlopen ...
Allow for tuple-based args in map also
Allow for tuple-based args in map also
Python
bsd-3-clause
vikhyat/dask,blaze/dask,mrocklin/dask,wiso/dask,mikegraham/dask,pombredanne/dask,pombredanne/dask,clarkfitzg/dask,jayhetee/dask,cowlicks/dask,blaze/dask,jayhetee/dask,cpcloud/dask,jcrist/dask,mraspaud/dask,jakirkham/dask,jakirkham/dask,ContinuumIO/dask,mrocklin/dask,chrisbarber/dask,dask/dask,ssanderson/dask,PhE/dask,d...
6b4df3c1784cf2933933fc757c9a097909709ea1
permachart/charter/forms.py
permachart/charter/forms.py
from collections import defaultdict from django.http import QueryDict from google.appengine.ext import db from google.appengine.ext.db import djangoforms from charter.models import Chart, ChartDataSet, DataRow from charter.form_utils import BaseFormSet class ChartForm(djangoforms.ModelForm): class Meta: mo...
from collections import defaultdict from django.http import QueryDict from google.appengine.ext import db from google.appengine.ext.db import djangoforms from charter.models import Chart, ChartDataSet, DataRow from charter.form_utils import BaseFormSet class ChartForm(djangoforms.ModelForm): class Meta: mo...
Exclude counter from chart form
Exclude counter from chart form
Python
bsd-3-clause
justinabrahms/permachart,justinabrahms/permachart
1dca7eeb036423d1d5889e5ec084f9f91f90eb74
spacy/tests/regression/test_issue957.py
spacy/tests/regression/test_issue957.py
import pytest from ... import load as load_spacy def test_issue913(en_tokenizer): '''Test that spaCy doesn't hang on many periods.''' string = '0' for i in range(1, 100): string += '.%d' % i doc = en_tokenizer(string) # Don't want tests to fail if they haven't installed pytest-timeout plugin ...
from __future__ import unicode_literals import pytest from ... import load as load_spacy def test_issue957(en_tokenizer): '''Test that spaCy doesn't hang on many periods.''' string = '0' for i in range(1, 100): string += '.%d' % i doc = en_tokenizer(string) # Don't want tests to fail if they...
Add unicode declaration on new regression test
Add unicode declaration on new regression test
Python
mit
honnibal/spaCy,raphael0202/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,honnibal/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,recognai/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,recognai/spaCy,recognai/spaCy,explosion/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,recognai/spaCy,G...
934eeaf4fcee84f22c4f58bdebc1d99ca5e7a31d
tests/rules/test_git_push.py
tests/rules/test_git_push.py
import pytest from thefuck.rules.git_push import match, get_new_command from tests.utils import Command @pytest.fixture def stderr(): return '''fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master ''' ...
import pytest from thefuck.rules.git_push import match, get_new_command from tests.utils import Command @pytest.fixture def stderr(): return '''fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master ''' ...
Test that `git push -u origin` still works
Test that `git push -u origin` still works This was broken by https://github.com/nvbn/thefuck/pull/538
Python
mit
nvbn/thefuck,nvbn/thefuck,Clpsplug/thefuck,SimenB/thefuck,mlk/thefuck,SimenB/thefuck,Clpsplug/thefuck,scorphus/thefuck,scorphus/thefuck,mlk/thefuck
18e6f40dcd6cf675f26197d6beb8a3f3d9064b1e
app.py
app.py
import tornado.ioloop import tornado.web from tornado.websocket import WebSocketHandler from tornado import template class MainHandler(tornado.web.RequestHandler): DEMO_TURN = { 'player_id': 'abc', 'player_turn': 1, 'card': { 'id': 'card_1', 'name': 'Card Name', ...
import json import tornado.ioloop import tornado.web from tornado.websocket import WebSocketHandler from tornado import template class MainHandler(tornado.web.RequestHandler): DEMO_TURN = { 'player_id': 'abc', 'player_turn': 1, 'card': { 'id': 'card_1', 'name': 'Ca...
Send demo turn over websocket.
Send demo turn over websocket.
Python
apache-2.0
ohmygourd/dewbrick,ohmygourd/dewbrick,ohmygourd/dewbrick
d8c6f429c875a2cfdc5d520d91ea9d3a37b33ac9
bot.py
bot.py
import praw import urllib import cv2, numpy as np DOWNSCALE = 2 r = praw.Reddit('/u/powderblock Glasses Bot') foundImage = False for post in r.get_subreddit('all').get_new(limit=15): if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url): print str(post.url) ...
import praw import urllib import cv2, numpy as np from PIL import Image DOWNSCALE = 2 r = praw.Reddit('/u/powderblock Glasses Bot') foundImage = False for post in r.get_subreddit('all').get_new(limit=15): if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url): prin...
Load image from URL into buffer
Load image from URL into buffer Feed image into array, convert it, display it.
Python
mit
powderblock/DealWithItReddit,porglezomp/PyDankReddit,powderblock/PyDankReddit
bf08dfaa3384c67dbaf86f31006c1cea462ae7db
bot.py
bot.py
import discord import commands bot = discord.Client() @bot.event def on_ready(): print('Logged in as:') print('Username: ' + bot.user.name) print('ID: ' + bot.user.id) print('------') @bot.event def on_message(message): commands.dispatch_messages(bot, message) if __name__ == '__main__': comm...
import discord import commands bot = discord.Client() @bot.event def on_ready(): print('Logged in as:') print('Username: ' + bot.user.name) print('ID: ' + bot.user.id) print('------') @bot.event def on_message(message): commands.dispatch_messages(bot, message) @bot.event def on_member_join(membe...
Add welcome message for /r/splatoon chat.
Add welcome message for /r/splatoon chat.
Python
mpl-2.0
Rapptz/RoboDanny,haitaka/DroiTaka
48402464f8e1feb9b50c0c98003bc808a7c33ed9
card_match.py
card_match.py
import pyglet def draw_card(): pyglet.graphics.draw(4, pyglet.gl.GL_QUADS, ('v2i', (10, 15, 10, 35, 20, 35, 20, 15) ) ) window = ...
import pyglet card_vertices = [ 0, 0, 0, 1, 1, 1, 1, 0 ] def draw_card(window): pyglet.graphics.draw(4, pyglet.gl.GL_QUADS, ('v2i', (get_scaled_vertices(window)) ) ) def get_scale(window): ...
Add skelton code for scaling card size
Add skelton code for scaling card size
Python
mit
SingingTree/CardMatchPyglet
c3eac81cffbfbb2cc00629d6c773e7b2e985d071
cider/_lib.py
cider/_lib.py
def lazyproperty(fn): @property def _lazyproperty(self): attr = "_" + fn.__name__ if not hasattr(self, attr): setattr(self, attr, fn(self)) return getattr(self, attr) return _lazyproperty
from functools import wraps def lazyproperty(fn): @property @wraps(fn) def _lazyproperty(self): attr = "_" + fn.__name__ if not hasattr(self, attr): setattr(self, attr, fn(self)) return getattr(self, attr) return _lazyproperty
Fix lazyproperty decorator to preserve property attribute
Fix lazyproperty decorator to preserve property attribute
Python
mit
msanders/cider
f8d793eef586f2097a9a80e79c497204d2f6ffa0
banner/models.py
banner/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from jmbo.models import Image, ModelBase from link.models import Link from banner.styles import BANNER_STYLE_CLASSES class Banner(ModelBase): """Base class for all banners""" link = models.ForeignKey( Link, help_tex...
from django.db import models from django.utils.translation import ugettext_lazy as _ from jmbo.models import Image, ModelBase from link.models import Link from banner.styles import BANNER_STYLE_CLASSES class Banner(ModelBase): """Base class for all banners""" link = models.ForeignKey( Link, help_tex...
Make link on Banner model nullable
Make link on Banner model nullable
Python
bsd-3-clause
praekelt/jmbo-banner,praekelt/jmbo-banner
b18cea920e5deea57adabd98872f0a6fa0490e33
rover.py
rover.py
class Rover: compass = ['N', 'E', 'S', 'W'] def __init__(self, x=0, y=0, direction='N'): self.x = x self.y = y self.direction = direction @property def position(self): return self.x, self.y, self.direction @property def compass_index(self): return next...
class Rover: compass = ['N', 'E', 'S', 'W'] def __init__(self, x=0, y=0, direction='N'): self.x = x self.y = y self.direction = direction @property def position(self): return self.x, self.y, self.direction @property def compass_index(self): return next...
Fix failing move forward tests
Fix failing move forward tests
Python
mit
authentik8/rover
e0ba0ea428fb4691b43d9be91b22105ce5aa0dc6
alg_selection_sort.py
alg_selection_sort.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(nums): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last num, select next max num to swap. for i in reversed(...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(nums): """Selection sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from pos=n-1,..1, select next max num to swap with its num. for i ...
Revise docstring & comment, reduce redundant for loop
Revise docstring & comment, reduce redundant for loop
Python
bsd-2-clause
bowen0701/algorithms_data_structures
d48ceb2364f463c725175010c3d29ea903dbcd1a
setup.py
setup.py
from distutils.core import setup DESCRIPTION = """ Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution. """ setup( name='money', description='Python Money Class', # long_description=DESCRIPTION, version='1.1.0-dev', author='Carlos Palo...
from distutils.core import setup DESCRIPTION = """ Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution. """ SOURCE_ROOT = 'src' # Python 2 backwards compatibility if sys.version_info[0] == 2: SOURCE_ROOT = 'src-py2' setup( name='money', des...
Switch source root if py2
Switch source root if py2
Python
mit
carlospalol/money,Isendir/money
f53675c17449d414eff9263faad8d18530c23b5d
setup.py
setup.py
from distutils.core import setup setup( name='boundary', version='0.0.6', url="https://github.com/boundary/boundary-api-cli", author='David Gwartney', author_email='davidg@boundary.com', packages=['boundary',], scripts=[ 'bin/alarm-create', 'bin/alarm-list', 'bin/action-ins...
from distutils.core import setup setup( name='boundary', version='0.0.6', url="https://github.com/boundary/boundary-api-cli", author='David Gwartney', author_email='davidg@boundary.com', packages=['boundary',], scripts=[ 'bin/alarm-create', 'bin/alarm-list', 'bin/action-ins...
Add bash script to add measures
Add bash script to add measures
Python
apache-2.0
jdgwartney/boundary-api-cli,wcainboundary/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/boundary-api-cli,jdgwartney/pulse-api-cli,boundary/boundary-api-cli,boundary/pulse-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli
7d75b96211404902c2fd3ae977860ed97f351b7d
tests/test_conductor.py
tests/test_conductor.py
"""Test the conductor REST module.""" from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from _pytest.python import raises from future import standard_library standard_library.install_aliases() from responses import ac...
"""Test the conductor REST module.""" from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from _pytest.python import raises from future import standard_library standard_library.install_aliases() import responses import ...
Switch to module imports for readability.
Switch to module imports for readability.
Python
mit
openspending/gobble
3eae6b2f66831259f1f1e237e1581207d0256e3e
setup.py
setup.py
import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() packages = [] package_dir = "dbbackup" for dirpath, dirnames, filenames in os.walk(package_dir): # ignore dirnames that start with '.' for i, dirname in enumerate(dirnames): ...
import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() packages = [] package_dir = "dbbackup" for dirpath, dirnames, filenames in os.walk(package_dir): # ignore dirnames that start with '.' for i, dirname in enumerate(dirnames): ...
Remove dropbox and boto as dependencies because they are optional and boto is not py3 compat
Remove dropbox and boto as dependencies because they are optional and boto is not py3 compat
Python
bsd-3-clause
leukeleu/django-dbbackup
16db51ec820381ccfb48ad1c5ada6fb25dbf1e9c
setup.py
setup.py
from distutils.core import setup, Extension import numpy.distutils.misc_util module = Extension( 'cnaturalneighbor', include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(), library_dirs=['/usr/local/lib'], extra_compile_args=['--std=c++11'], sources=[ 'naturalneighbor/cnaturalnei...
from distutils.core import setup, Extension import numpy.distutils.misc_util module = Extension( 'cnaturalneighbor', include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(), library_dirs=['/usr/local/lib'], extra_compile_args=['--std=c++11'], sources=[ 'naturalneighbor/cnaturalnei...
Make sure the package is exported by distutils
Make sure the package is exported by distutils
Python
mit
innolitics/natural-neighbor-interpolation,innolitics/natural-neighbor-interpolation,innolitics/natural-neighbor-interpolation
8ac39062cf1a0fbc3fd3483491e0719e1482f42a
setup.py
setup.py
from distutils.core import setup setup( name = 'PyFVCOM', packages = ['PyFVCOM'], version = '1.2', description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."), author = 'Pierre Cazenave', author_email...
from distutils.core import setup setup( name = 'PyFVCOM', packages = ['PyFVCOM'], version = '1.2', description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."), author = 'Pierre Cazenave', author_email...
Fix links for the archive and the homepage too.
Fix links for the archive and the homepage too.
Python
mit
pwcazenave/PyFVCOM
55fa7b929e855ea98ac00f700c7c41bb5a971ddb
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup( name="stale", version='1.1', description="Identifies (and optionally removes) stale Delicious and Pinboard links", author="Jon Parise", author_email="jon@indelible.org", url="https://github.com/jparise/stale", scripts=['stale'],...
#!/usr/bin/env python from distutils.core import setup setup( name="stale", version='1.1', description="Identifies (and optionally removes) stale Delicious and Pinboard links", author="Jon Parise", author_email="jon@indelible.org", url="https://github.com/jparise/stale", scripts=['stale'],...
Declare 'pydelicious' as a package dependency.
Declare 'pydelicious' as a package dependency. Stock distutils will ignore this, but a setuptools-based installer (easy_install or pip) will honor it.
Python
mit
jparise/stale
6b26102efdee4ae365ddd0bce126d6045865a9bc
stock.py
stock.py
import bisect import collections PriceEvent = collections.namedtuple("PriceEvent", ["timestamp", "price"]) class Stock: def __init__(self, symbol): """Constructor for Stock instance. Args: symbol: The stock symbol. """ self.symbol = symbol self.price_history =...
# -*- coding: utf-8 -*- """Stock class and associated features. Attributes: stock_price_event: A namedtuple with timestamp and price of a stock price update. """ import bisect import collections stock_price_event = collections.namedtuple("stock_price_event", ["timestamp", "price"]) class Stock: def __init_...
Update comments and variable names.
Update comments and variable names.
Python
mit
bsmukasa/stock_alerter
d725a22557f9fef564ae00cde9829064c7616f54
setup.py
setup.py
import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='django-uuslug', version='0.3', description = "A Unicode slug that is also guaranteed to be unique", long_description = read('README'), author='Val L33', au...
import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='django-uuslug', version='0.4', description = "A Unicode slug that is also guaranteed to be unique", long_description = read('README'), author='Val L33', au...
Switch to github and up the version
Switch to github and up the version
Python
mit
un33k/django-uuslug,un33k/django-uuslug
a18a19345298c43400dbfb984f97e97b3d0b624a
pyelasticsearch/__init__.py
pyelasticsearch/__init__.py
from __future__ import absolute_import from pyelasticsearch.client import ElasticSearch from pyelasticsearch.exceptions import (Timeout, ConnectionError, ElasticHttpError, InvalidJsonResponseError, E...
from __future__ import absolute_import from pyelasticsearch.client import ElasticSearch from pyelasticsearch.exceptions import (Timeout, ConnectionError, ElasticHttpError, InvalidJsonResponseError, E...
Change author and bump version.
Change author and bump version.
Python
bsd-3-clause
erikrose/pyelasticsearch
4022e09632602e65328f4561fe1b87a490ab587b
nau_timetable/wsgi.py
nau_timetable/wsgi.py
""" WSGI config for nau_timetable project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
""" WSGI config for nau_timetable project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import...
Fix flake8: E402 module level import not at top of file
Fix flake8: E402 module level import not at top of file
Python
mit
bluebirrd/nau-timetable,bluebirrd/nau-timetable,bluebirrrrd/nau-timetable,bluebirrrrd/nau-timetable,bluebirrd/nau-timetable,bluebirrd/nau-timetable,bluebirrrrd/nau-timetable,bluebirrrrd/nau-timetable
7aa140778cd689a8efa86f0890c4ccb8fc7f0d43
infrastructure/tests/test_api_views.py
infrastructure/tests/test_api_views.py
from django.test import Client, TestCase from infrastructure import utils from infrastructure import models import json from infrastructure.models import FinancialYear, QuarterlySpendFile, Expenditure, Project from scorecard.models import Geography from scorecard.profiles import MunicipalityProfile from scorecard.adm...
from django.test import TestCase class TestProject(TestCase): fixtures = ["test_infrastructure.json"] def test_infrastructure_project_filters(self): response = self.client.get( "/api/v1/infrastructure/search/?q=&province=Western+Cape&municipality=City+of+Cape+Town&project_type=New&functio...
Add test for infra search API and some refactoring
Add test for infra search API and some refactoring
Python
mit
Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data
fa0d478aeb167422a56d6e9e8c3e0a35947765e9
pipeline_notifier_test/routes_test.py
pipeline_notifier_test/routes_test.py
import unittest from unittest.mock import Mock from pipeline_notifier.routes import setup_routes class RoutesTests(unittest.TestCase): def test_route_setup_works(self): setup_routes(Mock(), [])
import unittest from unittest.mock import Mock from pipeline_notifier.routes import setup_routes class RoutesTests(unittest.TestCase): def setUp(self): self.pipeline = Mock() self.app = AppMock() setup_routes(self.app, [self.pipeline]) def test_root_route_returns_something(self): ...
Add framework for unit testing flask routes
Add framework for unit testing flask routes
Python
mit
pimterry/pipeline-notifier
a44eecac4306504e7d3e6b8253deeb35e6b1fb43
numpy/typing/setup.py
numpy/typing/setup.py
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('typing', parent_package, top_path) config.add_subpackage('tests') config.add_data_dir('tests/data') return config if __name__ == '__main__': from numpy.distutils.cor...
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('typing', parent_package, top_path) config.add_subpackage('tests') config.add_data_dir('tests/data') config.add_data_files('*.pyi') return config if __name__ == '__ma...
Add `.pyi` data files to the `numpy.typing` sub-package
BLD: Add `.pyi` data files to the `numpy.typing` sub-package
Python
bsd-3-clause
mattip/numpy,jakirkham/numpy,seberg/numpy,rgommers/numpy,anntzer/numpy,numpy/numpy,numpy/numpy,charris/numpy,jakirkham/numpy,anntzer/numpy,charris/numpy,pdebuyl/numpy,rgommers/numpy,charris/numpy,mattip/numpy,rgommers/numpy,simongibbons/numpy,mattip/numpy,jakirkham/numpy,pdebuyl/numpy,endolith/numpy,anntzer/numpy,seber...
70cfff61c8b3841e71674da0b13c6fc8eee3e924
api/institutions/serializers.py
api/institutions/serializers.py
from rest_framework import serializers as ser from api.base.serializers import JSONAPISerializer, RelationshipField, LinksField class InstitutionSerializer(JSONAPISerializer): filterable_fields = frozenset([ 'id', 'name' ]) name = ser.CharField(read_only=True) id = ser.CharField(read...
from rest_framework import serializers as ser from api.base.serializers import JSONAPISerializer, RelationshipField, LinksField class InstitutionSerializer(JSONAPISerializer): filterable_fields = frozenset([ 'id', 'name' ]) name = ser.CharField(read_only=True) id = ser.CharField(read...
Add get_absolute_url method to institutions
Add get_absolute_url method to institutions
Python
apache-2.0
zamattiac/osf.io,doublebits/osf.io,Nesiehr/osf.io,laurenrevere/osf.io,TomHeatwole/osf.io,chennan47/osf.io,mluo613/osf.io,jnayak1/osf.io,Nesiehr/osf.io,leb2dg/osf.io,caneruguz/osf.io,SSJohns/osf.io,mluke93/osf.io,sloria/osf.io,hmoco/osf.io,binoculars/osf.io,RomanZWang/osf.io,DanielSBrown/osf.io,rdhyee/osf.io,binoculars/...
e2d74754ad42f412b8344257cb3c1c9943931b17
test/integration/ggrc/models/test_control.py
test/integration/ggrc/models/test_control.py
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from ggrc import db from ggrc.models import Control from integration.ggrc import TestCase from .factories import ControlCategoryFactory, ControlFactory from nose.plugins.skip import SkipTest from nose.tools...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for control model.""" from ggrc import db from ggrc.models import Control from integration.ggrc import TestCase from integration.ggrc.models import factories class TestControl(TestCase): def tes...
Clean up control model tests
Clean up control model tests
Python
apache-2.0
plamut/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,selahs...
fbb3c38417e85f327e6a347338a005162779314b
run_tests.py
run_tests.py
from __future__ import print_function import os import imp import fnmatch # Test directory DIR_TEST = 'tests' def find_tests(pathname): """Recursively finds the test modules. :param str pathname: Path name where the tests are stored. :returns: List of paths to each test modules. :rtype: :class:`li...
from __future__ import print_function import os import sys import imp import fnmatch # Test directory DIR_TEST = 'tests' def find_tests(pathname): """Recursively finds the test modules. :param str pathname: Path name where the tests are stored. :returns: List of paths to each test modules. :rtype:...
Allow to chose a specific case test.
[tests] Allow to chose a specific case test.
Python
bsd-3-clause
owtf/ptp,DoomTaper/ptp
5ee6e2ce3854d8ca60b5aedfb21cd61172511a8f
hrmpy/tests/test_parser.py
hrmpy/tests/test_parser.py
import pytest from hrmpy import parser def test_parse_program_empty(): with pytest.raises(RuntimeError): parser.parse_program("") def test_parse_program_no_header(): with pytest.raises(RuntimeError): parser.parse_program("\n".join([ "INBOX", "OUTBOX", ])) d...
import pytest from hrmpy import parser class TestParseProgram(object): def test_empty_program(self): """ An empty string is not a program. """ with pytest.raises(RuntimeError): parser.parse_program("") def test_no_header(self): """ A program witho...
Test a (very) few more things.
Test a (very) few more things.
Python
mit
jerith/hrmpy
a44665230d2b589a1550b1293cb690d9116d0dca
acme/__init__.py
acme/__init__.py
# python3 # Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Remove unused comments related to Python 2 compatibility.
Remove unused comments related to Python 2 compatibility. PiperOrigin-RevId: 440310765 Change-Id: I7afdea122cd2565b06f387509de2476106d46d8c
Python
apache-2.0
deepmind/acme,deepmind/acme
ea315b018fb3fab6925f1194fcd3e341166ab6fb
opt/resource/common.py
opt/resource/common.py
import json from urllib.parse import urljoin import sys def get_payload(): return json.load(sys.stdin) def get_index_url(payload): source = payload['source'] uri = source['uri'] index = source['index'] if not uri.endswith('/'): uri += '/' if not index.endswith('/'): index += ...
import json from urllib.parse import urljoin import sys def get_payload(): return json.load(sys.stdin) def get_index_url(payload): source = payload['source'] uri = source['uri'] index = source['index'] if not uri.endswith('/'): uri += '/' if not index.endswith('/'): index += ...
Handle missing version in payload.
Handle missing version in payload.
Python
mit
mdomke/concourse-devpi-resource
cf0fa32efc6d89aad5d569ad59aefb66e9f7df12
wsgiservice/__init__.py
wsgiservice/__init__.py
"""This root level directives are importend from the submodules. They are made available here as well to keep the number of imports to a minimum for most applications. """ import wsgiservice.routing from wsgiservice.decorators import mount, validate, expires from wsgiservice.objects import Response from wsgiservice.app...
"""This root level directives are importend from the submodules. They are made available here as well to keep the number of imports to a minimum for most applications. """ import wsgiservice.routing from wsgiservice.decorators import mount, validate, expires from wsgiservice.objects import Response from wsgiservice.app...
Remove the unused duration access.
Remove the unused duration access.
Python
bsd-2-clause
pneff/wsgiservice,beekpr/wsgiservice
f1ef0652acdd9211f8e39eb57845251e7ccc496e
commands.py
commands.py
import generate as gen commands = {} def cmd_func(name): def _cmd_func(f): commands.setdefault(name, f) return f return _cmd_func @cmd_func('get-latest-rev') def get_latest_rev(args): return "%s %s" % (gen.success('( )', gen.string('test')), gen.success('12')) def ...
import generate as gen commands = {} def cmd_func(name): def _cmd_func(f): commands.setdefault(name, f) return f return _cmd_func @cmd_func('get-latest-rev') def get_latest_rev(args): return "%s %s" % (gen.success('( )', gen.string('test')), gen.success('12')) def ...
Use the real unknown command err-code
Use the real unknown command err-code Using the real unknown command error code means that the client actually understands the error and behaves appropriately.
Python
bsd-3-clause
slonopotamus/git_svn_server
9d4908d28efd31a16a47bdfaf09895913dc2977f
sympy/utilities/tests/test_timeutils.py
sympy/utilities/tests/test_timeutils.py
"""Tests for simple tools for timing functions' execution. """ from sympy.utilities.timeutils import timed def test_timed(): result = timed(lambda: 1 + 1, limit=100000) assert result[0] == 100000 and result[3] == "ns" result = timed("1 + 1", limit=100000) assert result[0] == 100000 and result[3] == "...
"""Tests for simple tools for timing functions' execution. """ import sys if sys.version_info[:2] <= (2, 5): disabled = True from sympy.utilities.timeutils import timed def test_timed(): result = timed(lambda: 1 + 1, limit=100000) assert result[0] == 100000 and result[3] == "ns" result = timed("1 +...
Disable timed() tests on Python 2.5
utilities: Disable timed() tests on Python 2.5
Python
bsd-3-clause
jbbskinny/sympy,kumarkrishna/sympy,oliverlee/sympy,shipci/sympy,yashsharan/sympy,meghana1995/sympy,vipulroxx/sympy,Vishluck/sympy,drufat/sympy,cswiercz/sympy,MechCoder/sympy,mcdaniel67/sympy,saurabhjn76/sympy,jaimahajan1997/sympy,dqnykamp/sympy,rahuldan/sympy,AunShiLord/sympy,Sumith1896/sympy,pandeyadarsh/sympy,shikil/...
4c7f36e6a5f277b1c84d665edb279476a9e15063
src/pyop/exceptions.py
src/pyop/exceptions.py
from oic.oauth2.message import ErrorResponse from .util import should_fragment_encode class BearerTokenError(ValueError): pass class InvalidAuthorizationCode(ValueError): pass class InvalidAccessToken(ValueError): pass class InvalidRefreshToken(ValueError): pass class InvalidSubjectIdentifier...
import json from oic.oauth2.message import ErrorResponse from .util import should_fragment_encode class BearerTokenError(ValueError): pass class InvalidAuthorizationCode(ValueError): pass class InvalidAccessToken(ValueError): pass class InvalidRefreshToken(ValueError): pass class InvalidSubj...
Add JSON convenience to InvalidRegistrationRequest.
Add JSON convenience to InvalidRegistrationRequest.
Python
apache-2.0
its-dirg/pyop
48ec1d9494ae8215f6b4bc4b79bcefe318d8a5b4
create_csv.py
create_csv.py
import csv from datetime import date from scraper.draft_scraper import scrape CSV_FILE = 'datasets/%s_nbadraft.csv' for year in range(1947, date.today().year): draft = scrape(year) header = [key for key in draft[1].keys()] with open(CSV_FILE % year, 'w', newline='') as outfile: dw = csv.DictWrite...
import csv from datetime import date from scraper.draft_scraper import scrape CSV_FILE = 'datasets/%s_nbadraft.csv' for year in range(1947, date.today().year): draft = scrape(year) header = [key for key in draft[1].keys()] with open(CSV_FILE % year, 'w', newline='') as outfile: dw = csv.DictWrite...
Print line after creating each csv
Print line after creating each csv
Python
mit
kshvmdn/nbadrafts
bf7571dfbf2f3081e539d5f3a5558d80fcd3fbee
app/utils/fields.py
app/utils/fields.py
from wtforms import Field from wtforms.widgets import TextInput class TagListField(Field): """ Field for comma-separated list of tags. From http://wtforms.readthedocs.org/en/latest/fields.html#custom-fields """ widget = TextInput() def _value(self): if self.data: try: ...
from wtforms import Field from wtforms.widgets import TextInput class TagListField(Field): """ Field for comma-separated list of tags. """ widget = TextInput() def _value(self): if self.data: try: # The data is a list of strings return ', '.join(self.d...
Remove explicit unicode encoding on strings
Remove explicit unicode encoding on strings
Python
mit
Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger
007cd14cd3fd215cd91403ebe09cd5c0bb555f23
armstrong/apps/related_content/admin.py
armstrong/apps/related_content/admin.py
from django.contrib import admin from django.contrib.contenttypes.generic import GenericTabularInline from .models import RelatedContent from .models import RelatedType class RelatedContentInline(GenericTabularInline): ct_field = "source_type" ct_fk_field = "source_id" model = RelatedContent admin.sit...
from django import forms from django.contrib import admin from django.contrib.contenttypes.generic import GenericTabularInline from armstrong.hatband import widgets from .models import RelatedContent from .models import RelatedType class RelatedContentInlineForm(forms.ModelForm): class Meta: widgets = { ...
Add in visualsearch for GFK
Add in visualsearch for GFK
Python
apache-2.0
texastribune/armstrong.apps.related_content,armstrong/armstrong.apps.related_content,armstrong/armstrong.apps.related_content,texastribune/armstrong.apps.related_content
f9e5ee2bcb088aec6f0d1c012caaaca05fe69560
lims/celery.py
lims/celery.py
import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings') app = Celery('lims', broker=os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379'), backend='redis') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodisco...
import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings') app = Celery('lims', broker=os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379'), backend=os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379')) app.config_from_objec...
Fix issue with backend not being recognised
Fix issue with backend not being recognised
Python
mit
GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend
027178a21083ceaa4151806e877a58ec7792f625
pysswords/__main__.py
pysswords/__main__.py
import argparse from getpass import getpass from pysswords.db import Database from pysswords.crypt import CryptOptions def get_args(): parser = argparse.ArgumentParser() parser.add_argument('path') parser.add_argument('--create', action='store_true') parser.add_argument('--password', default=None) ...
import argparse from getpass import getpass from pysswords.db import Database from pysswords.crypt import CryptOptions def get_args(): parser = argparse.ArgumentParser() main_group = parser.add_argument_group('Main options') main_group.add_argument('path', help='Path to database file') main_group.add_...
Refactor get args function from console interface
Refactor get args function from console interface
Python
mit
eiginn/passpie,scorphus/passpie,marcwebbie/passpie,scorphus/passpie,marcwebbie/pysswords,eiginn/passpie,marcwebbie/passpie
1b3c6c7dd8116ce0e523de4acd02aa19cedcfd70
appengine_config.py
appengine_config.py
# appengine_config.py from google.appengine.ext import vendor # Add any libraries install in the "lib" folder. vendor.add('lib')
# appengine_config.py from google.appengine.ext import vendor import os # Add any libraries install in the "lib" folder. vendor.add(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib'))
Use new-style method of setting module path
Use new-style method of setting module path
Python
agpl-3.0
sleinen/zrcal,sleinen/zrcal
d28fa7874d7b0602eb5064d9f43b8b01674de69f
presentation/models.py
presentation/models.py
from django.db import models from model_utils.models import TimeStampedModel from warp.users.models import User class Presentation(TimeStampedModel): subject = models.CharField(max_length=50) author = models.ForeignKey(User, on_delete=models.CASCADE) views = models.IntegerField(default=0) is_public =...
from django.db import models from django.db.models import Manager from django.db.models import QuerySet from model_utils.models import TimeStampedModel from warp.users.models import User class PresentationQuerySet(QuerySet): def public(self): return self.filter(is_public=True) def authored_by(self, ...
Add presentation queryset and model manager
Add presentation queryset and model manager
Python
mit
SaturDJang/warp,SaturDJang/warp,SaturDJang/warp,SaturDJang/warp
8d55268fb3239dd429cb488a6c13e09d7839aa1a
registration/forms.py
registration/forms.py
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_lengt...
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_lengt...
Make description field a textarea in company form
Make description field a textarea in company form
Python
mit
uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier
925f112863f128907862b230ed1767e10d91deed
run_tests.py
run_tests.py
import sys import os import subprocess def main(): executableName = './CuraEngine' if len(sys.argv) > 1: executableName = sys.argv[1] exitValue = 0 for subPath in os.listdir('testcase_models'): print 'Running test on %s' % (subPath) ret = subprocess.call([executableName, os.path.join('testcase_models', sub...
import sys import os import subprocess def main(): executableName = './CuraEngine' if len(sys.argv) > 1: executableName = sys.argv[1] exitValue = 0 for subPath in os.listdir('testcase_models'): print 'Running test on %s' % (subPath) ret = subprocess.call([executableName, '-o', 'temp.gcode', os.path.join('t...
Fix the python script that runs the tests.
Fix the python script that runs the tests.
Python
agpl-3.0
patrick3coffee/CuraTinyG,Ultimaker/CuraEngine,be3d/CuraEngine,uus169/CuraEngine,totalretribution/CuraEngine,be3d/CuraEngine,jacobdai/CuraEngine-1,electrocbd/CuraEngine,Intrinsically-Sublime/CuraEngine,robotustra/curax,derekhe/CuraEngine,uus169/CuraEngine,totalretribution/CuraEngine,phonyphonecall/CuraEngine,markwal/Cur...
a72c494c5c0f010192f39d84c13c90c0f0f8941e
sympycore/calculus/__init__.py
sympycore/calculus/__init__.py
from .algebra import Calculus, I, integrate, oo, undefined from .functions import exp, log, sqrt, sin, cos, tan, cot, pi, E Symbol = Calculus.Symbol Number = Calculus.Number Add = lambda *args: Calculus.Add(*map(Calculus.convert, args)) Mul = lambda *args: Calculus.Mul(*map(Calculus.convert, args)) Pow = la...
from .algebra import Calculus, I, integrate, oo, undefined from .functions import exp, log, sqrt, sin, cos, tan, cot, pi, E Symbol = Calculus.Symbol def Number(num, denom=None): n = Calculus.Number(Calculus.convert_coefficient(num)) if denom is None: return n return n / denom Add = l...
Fix calculus.Number to handle floats.
Fix calculus.Number to handle floats.
Python
bsd-3-clause
pearu/sympycore,pearu/sympycore
006a37819372ae9d161bece9c44a83bc26b7d43e
test/probe/__init__.py
test/probe/__init__.py
from test import get_config from swift.common.utils import config_true_value config = get_config('probe_test') CHECK_SERVER_TIMEOUT = int(config.get('check_server_timeout', 30)) VALIDATE_RSYNC = config_true_value(config.get('validate_rsync', False))
# Copyright (c) 2010-2017 OpenStack Foundation # # 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 agree...
Add license in swift code file
Add license in swift code file Source code should be licensed under the Apache 2.0 license. Add Apache License in swift/probe/__init__.py file. Change-Id: I3b6bc2ec5fe5caac87ee23f637dbcc7a5d8fc331
Python
apache-2.0
tipabu/swift,tipabu/swift,psachin/swift,smerritt/swift,smerritt/swift,smerritt/swift,matthewoliver/swift,clayg/swift,notmyname/swift,nadeemsyed/swift,swiftstack/swift,openstack/swift,matthewoliver/swift,matthewoliver/swift,nadeemsyed/swift,tipabu/swift,openstack/swift,psachin/swift,openstack/swift,swiftstack/swift,psac...
7df2e3bc6f651b9caa45d57a1cd21eac374148a3
compile/00-shortcuts.dg.py
compile/00-shortcuts.dg.py
builtins = import operator = import functools = import importlib = import # Choose a function based on the number of arguments. varary = (*fs) -> (*xs) -> (fs !! (len: xs - 1)): (*): xs builtins . $ = (f, *xs) -> f: (*): xs builtins . : = (f, *xs) -> f: (*): xs builtins . , = (*xs) -> xs builtins . < = operator.l...
builtins = import operator = import functools = import importlib = import # Choose a function based on the number of arguments. varary = (*fs) -> (*xs) -> (fs !! (len: xs)): (*): xs builtins . $ = (f, *xs) -> f: (*): xs builtins . : = (f, *xs) -> f: (*): xs builtins . , = (*xs) -> xs builtins . < = operator.lt bu...
Fix the infinite recursion when calling runtime +/-.
Fix the infinite recursion when calling runtime +/-.
Python
mit
pyos/dg
702fabfc96b3b07efb4d5c30a6807031b803a551
kolibri/deployment/default/wsgi.py
kolibri/deployment/default/wsgi.py
""" WSGI config for kolibri project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import logging import os import time from django.core.wsgi import get_wsgi_application from djang...
""" WSGI config for kolibri project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import logging import os import time from django.core.wsgi import get_wsgi_application from djang...
Add kolibri version to server start logging.
Add kolibri version to server start logging.
Python
mit
indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri
202027ac9a2680ba8825d488c146d152beaa4b5d
tests/test_coursera.py
tests/test_coursera.py
import unittest from mooc_aggregator_restful_api import coursera class CourseraTestCase(unittest.TestCase): ''' Unit Tests for module udacity ''' def setUp(self): self.coursera_test_object = coursera.CourseraAPI() def test_coursera_api_courses_response(self): self.assertEqual(s...
import unittest from mooc_aggregator_restful_api import coursera class CourseraTestCase(unittest.TestCase): ''' Unit Tests for module udacity ''' def setUp(self): self.coursera_test_object = coursera.CourseraAPI() def test_coursera_api_courses_response(self): self.assertEqual(s...
Remove test for sessions for Coursera API
Remove test for sessions for Coursera API
Python
mit
ueg1990/mooc_aggregator_restful_api
8db7072cef4c5ddbf408cdf1740e926f4d78747b
Functions/echo-python/lambda_function.py
Functions/echo-python/lambda_function.py
"""Created By: Andrew Ryan DeFilippis""" print('Lambda cold-start...') from json import dumps, loads # Disable 'testing_locally' when deploying to AWS Lambda testing_locally = False verbose = False class CWLogs(object): def __init__(self, context): self.context = context def event(self, message, ...
"""Created By: Andrew Ryan DeFilippis""" print('Lambda cold-start...') from json import dumps, loads # Disable 'testing_locally' when deploying to AWS Lambda testing_locally = True verbose = True class CWLogs(object): """Define the structure of log events to match all other CloudWatch Log Events logged by AWS ...
Add documentation, and modify default values
Add documentation, and modify default values
Python
apache-2.0
andrewdefilippis/aws-lambda
5de08e3b7be029a3a10dab9e4a259b046488d4af
examples/django_app/tests/test_integration.py
examples/django_app/tests/test_integration.py
from django.test import TestCase from django.core.urlresolvers import reverse import unittest class ApiIntegrationTestCase(TestCase): def setUp(self): super(ApiIntegrationTestCase, self).setUp() self.api_url = reverse('chatterbot:chatterbot') def _get_json(self, response): import jso...
from django.test import TestCase from django.core.urlresolvers import reverse import unittest class ApiIntegrationTestCase(TestCase): def setUp(self): super(ApiIntegrationTestCase, self).setUp() self.api_url = reverse('chatterbot:chatterbot') def tearDown(self): super(ApiIntegrationT...
Add test method to clear response queue.
Add test method to clear response queue.
Python
bsd-3-clause
Reinaesaya/OUIRL-ChatBot,Gustavo6046/ChatterBot,maclogan/VirtualPenPal,davizucon/ChatterBot,gunthercox/ChatterBot,Reinaesaya/OUIRL-ChatBot,vkosuri/ChatterBot
3ea9a14cdc4e19595ae8b14667d86ae42ba3d58c
astropy/wcs/tests/extension/test_extension.py
astropy/wcs/tests/extension/test_extension.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import os import subprocess import sys def test_wcsapi_extension(tmpdir): # Test that we can build a simple C extension with the astropy.wcs C API setup_path = ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import os import subprocess import sys def test_wcsapi_extension(tmpdir): # Test that we can build a simple C extension with the astropy.wcs C API setup_path = ...
Make work when astropy isn't installed.
Make work when astropy isn't installed.
Python
bsd-3-clause
dhomeier/astropy,dhomeier/astropy,StuartLittlefair/astropy,joergdietrich/astropy,astropy/astropy,kelle/astropy,mhvk/astropy,stargaser/astropy,larrybradley/astropy,kelle/astropy,kelle/astropy,dhomeier/astropy,mhvk/astropy,joergdietrich/astropy,kelle/astropy,mhvk/astropy,astropy/astropy,saimn/astropy,MSeifert04/astropy,D...
493e6e96795fa812a6a3890ffde8004a2153cb75
util/plot.py
util/plot.py
from __future__ import division import numpy as NP import pylab as PL from mpl_toolkits.axes_grid1 import make_axes_locatable def centers2edges(x): """ Given the array of (assumed) uniformly spaced coordinate centers *x*, return the array of cell edge coordinates. """ delta = x[1] - x[0] retu...
from __future__ import division import numpy as NP import pylab as PL from mpl_toolkits.axes_grid1 import make_axes_locatable def centers2edges(x): """ Given the array of (assumed) uniformly spaced coordinate centers *x*, return the array of cell edge coordinates. """ delta = x[1] - x[0] retu...
Set axes back to input axes at end of add_colorbar.
Set axes back to input axes at end of add_colorbar.
Python
mit
butala/pyrsss
eae216cc2d1bbe6e1c1aab1c4cf53d57b29b057c
froide/helper/csv_utils.py
froide/helper/csv_utils.py
from django.utils import six from django.http import StreamingHttpResponse def export_csv_response(queryset, fields, name='export.csv'): response = StreamingHttpResponse(export_csv(queryset, fields), content_type='text/csv') response['Content-Disposition'] = 'attachment; filen...
from django.utils import six from django.http import StreamingHttpResponse def export_csv_response(generator, name='export.csv'): response = StreamingHttpResponse(generator, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="%s"' % name return response class FakeFile(objec...
Fix export_csv_response function to take generator
Fix export_csv_response function to take generator
Python
mit
LilithWittmann/froide,catcosmo/froide,fin/froide,stefanw/froide,catcosmo/froide,catcosmo/froide,ryankanno/froide,catcosmo/froide,catcosmo/froide,ryankanno/froide,okfse/froide,fin/froide,CodeforHawaii/froide,CodeforHawaii/froide,okfse/froide,stefanw/froide,stefanw/froide,LilithWittmann/froide,okfse/froide,ryankanno/froi...
ecc9efaf3bbbb3d6231d1217ff124d8237ac09bb
chef/role.py
chef/role.py
from chef.base import ChefObject class Role(ChefObject): """A model object for a Chef role.""" url = '/roles' attributes = [ 'description', ]
from chef.base import ChefObject class Role(ChefObject): """A model object for a Chef role.""" url = '/roles' attributes = [ 'description', 'run_list', ]
Add run_list to Role for testing.
Add run_list to Role for testing.
Python
apache-2.0
cread/pychef,Scalr/pychef,Scalr/pychef,cread/pychef,jarosser06/pychef,coderanger/pychef,coderanger/pychef,dipakvwarade/pychef,jarosser06/pychef,dipakvwarade/pychef
26598254cd48a716527eb4689ad96551c5a39790
ksp_login/__init__.py
ksp_login/__init__.py
__version__ = '0.6.0' __version_info__ = __version__.split('.') from django.utils.translation import ugettext_lazy as _ def __activate_social_auth_monkeypatch(): from social_core.backends.base import BaseAuth from social_core.backends.open_id import (OPENID_ID_FIELD, OpenIdAuth) from social_core.backends...
__version__ = '0.6.0' __version_info__ = tuple(map(int, __version__.split('.'))) from django.utils.translation import ugettext_lazy as _ def __activate_social_auth_monkeypatch(): from social_core.backends.base import BaseAuth from social_core.backends.open_id import (OPENID_ID_FIELD, OpenIdAuth) from soc...
Make version info tuple of ints.
Make version info tuple of ints.
Python
bsd-3-clause
koniiiik/ksp_login,koniiiik/ksp_login,koniiiik/ksp_login
d9fd011a2750a01cac67aa6ca37c0aedc2a7ad94
law/workflow/local.py
law/workflow/local.py
# -*- coding: utf-8 -*- """ Local workflow implementation. """ __all__ = ["LocalWorkflow"] from law.workflow.base import Workflow, WorkflowProxy class LocalWorkflowProxy(WorkflowProxy): workflow_type = "local" def requires(self): reqs = super(LocalWorkflowProxy, self).requires() reqs["b...
# -*- coding: utf-8 -*- """ Local workflow implementation. """ __all__ = ["LocalWorkflow"] from law.workflow.base import Workflow, WorkflowProxy class LocalWorkflowProxy(WorkflowProxy): workflow_type = "local" def __init__(self, *args, **kwargs): super(LocalWorkflowProxy, self).__init__(*args, ...
Add missing run method to LocalWorkflow.
Add missing run method to LocalWorkflow.
Python
bsd-3-clause
riga/law,riga/law
3b92d215a42a8c4047d2be57b7679b87a6bfb737
cnxmathml2svg.py
cnxmathml2svg.py
# -*- coding: utf-8 -*- # ### # Copyright (c) 2015, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### from pyramid.config import Configurator __all__ = ('main',) def main(global_config, **settings): ""...
# -*- coding: utf-8 -*- # ### # Copyright (c) 2015, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### from pyramid.config import Configurator from pyramid.response import Response __all__ = ('main',) def co...
Add the conversion view to the app.
Add the conversion view to the app.
Python
agpl-3.0
Connexions/cnx-mathml2svg,pumazi/cnx-mathml2svg
4dae2456d36a92951beaca2f57ddbed575103cf6
moksha/api/hub/consumer.py
moksha/api/hub/consumer.py
# This file is part of Moksha. # # Moksha is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Moksha is distributed in the hope that it...
# This file is part of Moksha. # # Moksha is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Moksha is distributed in the hope that it...
Add a send_message and stop methods to the Consumer, along with some module docs.
Add a send_message and stop methods to the Consumer, along with some module docs.
Python
apache-2.0
lmacken/moksha,ralphbean/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,mokshaproject/moksha,mokshaproject/moksha,lmacken/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha
d106719a0b7bcbd87989bd36f618f90c4df02c46
sequana/gui/browser.py
sequana/gui/browser.py
# coding: utf-8 from PyQt5 import QtCore from PyQt5.QtWebKitWidgets import QWebView class MyBrowser(QWebView): closing = QtCore.Signal() def __init(self): super().__init__() self.loadFinished.connec(self._results_available) def _results_available(self, ok): print("results") ...
# coding: utf-8 from PyQt5 import QtCore from PyQt5.QtWebKitWidgets import QWebView class MyBrowser(QWebView): #closing = QtCore.Signal() def __init(self): super().__init__() self.loadFinished.connec(self._results_available) def _results_available(self, ok): frame = self.page().m...
Fix issue with signal on tars
Fix issue with signal on tars
Python
bsd-3-clause
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
99cb654ec5730f6be33bb091aa3ac9e70963470c
hc/front/tests/test_add_channel.py
hc/front/tests/test_add_channel.py
from django.contrib.auth.models import User from django.test import TestCase from hc.api.models import Channel class AddChannelTestCase(TestCase): def setUp(self): self.alice = User(username="alice") self.alice.set_password("password") self.alice.save() def test_it_works(self): ...
from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase from hc.api.models import Channel class AddChannelTestCase(TestCase): def setUp(self): self.alice = User(username="alice") self.alice.set_password("password") self.alice.save() ...
Fix tests when Pushover is not configured
Fix tests when Pushover is not configured
Python
bsd-3-clause
healthchecks/healthchecks,iphoting/healthchecks,BetterWorks/healthchecks,BetterWorks/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks,BetterWorks/healthchecks,BetterWorks/healthchecks,iphoting/healthchecks
f65fd97940cb1f9c146de1b95c6e1e8652ae0c52
bonspy/__init__.py
bonspy/__init__.py
# -*- coding: utf-8 -*- from __future__ import ( print_function, division, generators, absolute_import, unicode_literals ) from .bonsai import BonsaiTree from .logistic import LogisticConverter
# -*- coding: utf-8 -*- from __future__ import ( print_function, division, generators, absolute_import, unicode_literals ) from bonspy.bonsai import BonsaiTree from bonspy.logistic import LogisticConverter
Use more robust absolute imports
Use more robust absolute imports
Python
bsd-3-clause
markovianhq/bonspy
fbaf1a64621e8b72b7ee46b8c58a12ed96a0f41f
utils/summary_downloader.py
utils/summary_downloader.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from dateutil.parser import parse from dateutil.relativedelta import DAILY from dateutil.rrule import rrule class SummaryDownloader(): # base url for official schedule json page SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule" # url template...
#!/usr/bin/env python # -*- coding: utf-8 -*- from dateutil.parser import parse from dateutil.rrule import rrule, DAILY class SummaryDownloader(): # base url for official schedule json page SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule" # url template for official json gamefeed page ...
Add function to find downloadable files
Add function to find downloadable files
Python
mit
leaffan/pynhldb
a490a85e5842bd31a99a94f2530dbbea2d1c2584
bot/game/launch.py
bot/game/launch.py
import telegram def callback_query_handler(bot: telegram.Bot, update: telegram.Update): callback_query = update.callback_query game_short_name = callback_query.game_short_name if game_short_name == "rock_paper_scissors": callback_query_id = callback_query.id bot.answerCallbackQuery(callbac...
import telegram def callback_query_handler(bot: telegram.Bot, update: telegram.Update): callback_query = update.callback_query game_short_name = callback_query.game_short_name if game_short_name == "rock_paper_scissors": callback_query_id = callback_query.id bot.answerCallbackQuery(callbac...
Update url to point to return develop branch html page
Update url to point to return develop branch html page
Python
apache-2.0
alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games
ba0471464ab3f6d29fcc12fa2de9231581c07944
tst/utils.py
tst/utils.py
from __future__ import print_function import sys import string import json from colors import * def is_posix_filename(name, extra_chars=""): CHARS = string.letters + string.digits + "._-" + extra_chars return all(c in CHARS for c in name) def cprint(color, msg, file=sys.stdout, end='\n'): data = msg._...
from __future__ import print_function import sys import string import json from colors import * def is_posix_filename(name, extra_chars=""): CHARS = string.letters + string.digits + "._-" + extra_chars return all(c in CHARS for c in name) def cprint(color, msg, file=sys.stdout, end='\n'): if type(msg)...
Fix cprint with unicode characters
Fix cprint with unicode characters
Python
agpl-3.0
daltonserey/tst,daltonserey/tst
5523946b35d076c47be92d703cdb071c18f6d0ec
tests/test_subgenerators.py
tests/test_subgenerators.py
import pytest from resumeback import send_self from . import CustomError, defer, wait_until_finished, State def test_subgenerator_next(): ts = State() def subgenerator(this): yield defer(this.next) ts.run = True @send_self def func(this): yield from subgenerator(this) ...
import pytest from resumeback import send_self from . import CustomError, defer, wait_until_finished, State def test_subgenerator_next(): ts = State() def subgenerator(this): yield defer(this.next) ts.run = True @send_self def func(this): yield from subgenerator(this) ...
Add test for decorated subgenerator
Add test for decorated subgenerator
Python
mit
FichteFoll/resumeback
a2b1d10e042d135c3c014622ffeabd7e96a46f9f
tests/test_update_target.py
tests/test_update_target.py
""" Tests for helper function for updating a target from a Vuforia database. """ import io import pytest from vws import VWS from vws.exceptions import UnknownTarget class TestUpdateTarget: """ Test for updating a target. """ def test_get_target( self, client: VWS, high_qua...
""" Tests for helper function for updating a target from a Vuforia database. """ import io import pytest from vws import VWS from vws.exceptions import UnknownTarget class TestUpdateTarget: """ Test for updating a target. """ def test_get_target( self, client: VWS, high_qua...
Comment out part done code
Comment out part done code
Python
mit
adamtheturtle/vws-python,adamtheturtle/vws-python
cd0426dbbfc6f1573cf5d09485b8930eb498e1c6
mbuild/tests/test_utils.py
mbuild/tests/test_utils.py
import difflib import pytest from mbuild.tests.base_test import BaseTest from mbuild.utils.io import get_fn from mbuild.utils.validation import assert_port_exists class TestUtils(BaseTest): def test_assert_port_exists(self, ch2): assert_port_exists('up', ch2) with pytest.raises(ValueError): ...
import difflib import numpy as np import pytest from mbuild.tests.base_test import BaseTest from mbuild.utils.io import get_fn, import_ from mbuild.utils.validation import assert_port_exists class TestUtils(BaseTest): def test_assert_port_exists(self, ch2): assert_port_exists('up', ch2) with py...
Add some unit test on utils.io
Add some unit test on utils.io
Python
mit
iModels/mbuild,iModels/mbuild
7b17a42713d0afedb594d184fb82fa3feab5681a
api/applications/urls.py
api/applications/urls.py
from django.conf.urls import url from api.applications import views urlpatterns = [ url(r'^$', views.ApplicationList.as_view(), name='application-list'), url(r'^(?P<client_id>\w+)/$', views.ApplicationDetail.as_view(), name='application-detail') ]
from django.conf.urls import url from api.applications import views urlpatterns = [ url(r'^$', views.ApplicationList.as_view(), name='application-list'), url(r'^(?P<client_id>\w+)/$', views.ApplicationDetail.as_view(), name='application-detail'), url(r'^(?P<client_id>\w+)/reset/$', views.ApplicationReset....
Add url for client secret resetting
Add url for client secret resetting
Python
apache-2.0
CenterForOpenScience/osf.io,samchrisinger/osf.io,SSJohns/osf.io,mfraezz/osf.io,alexschiller/osf.io,kwierman/osf.io,wearpants/osf.io,kwierman/osf.io,hmoco/osf.io,sloria/osf.io,binoculars/osf.io,brandonPurvis/osf.io,aaxelb/osf.io,ticklemepierce/osf.io,doublebits/osf.io,leb2dg/osf.io,brandonPurvis/osf.io,ticklemepierce/os...
f23ee95c7b662dec71ed7fd527854a7f832e3603
Lib/test/test_ctypes.py
Lib/test/test_ctypes.py
# trivial test import _ctypes import ctypes
import unittest from test.test_support import run_suite import ctypes.test def test_main(): skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0) suites = [unittest.makeSuite(t) for t in testcases] run_suite(unittest.TestSuite(suites)) if __name__ == "__main__": test_main(...
Replace the trivial ctypes test (did only an import) with the real test suite.
Replace the trivial ctypes test (did only an import) with the real test suite.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
075d6e6cfe225c7bc57b8cb2ea66be646a207f10
cars196_dataset.py
cars196_dataset.py
# -*- coding: utf-8 -*- """ Created on Fri Dec 23 19:02:49 2016 @author: sakurai """ from fuel.datasets import H5PYDataset from fuel.utils import find_in_data_path from fuel.schemes import SequentialScheme from fuel.streams import DataStream class Cars196Dataset(H5PYDataset): _filename = 'cars196/cars196.hdf5'...
# -*- coding: utf-8 -*- """ Created on Fri Dec 23 19:02:49 2016 @author: sakurai """ from fuel.datasets import H5PYDataset from fuel.utils import find_in_data_path from fuel.schemes import SequentialScheme from fuel.streams import DataStream class Cars196Dataset(H5PYDataset): _filename = 'cars196/cars196.hdf5'...
Load datasets as raw ndarray
Load datasets as raw ndarray
Python
mit
ronekko/deep_metric_learning
d05b9effc6d230aeb2a13759a67df644d75140ca
cts/views.py
cts/views.py
from django.http import HttpResponse def health_view(request): return HttpResponse()
from django.http import HttpResponse def health_view(request): return HttpResponse("I am okay.", content_type="text/plain")
Return some text on a health check
Return some text on a health check
Python
bsd-3-clause
theirc/CTS,theirc/CTS,theirc/CTS,stbenjam/CTS,stbenjam/CTS,stbenjam/CTS,stbenjam/CTS,theirc/CTS
c156dd50e8f6b699ba87b7e185207e9ad3654979
examples/ssl_server.py
examples/ssl_server.py
import secure_smtpd import asyncore, logging, time, signal, sys from secure_smtpd import SMTPServer, FakeCredentialValidator class SSLSMTPServer(SMTPServer): def __init__(self): pass def process_message(self, peer, mailfrom, rcpttos, message_data): print message_data ...
import logging from secure_smtpd import SMTPServer, FakeCredentialValidator, LOG_NAME class SSLSMTPServer(SMTPServer): def process_message(self, peer, mailfrom, rcpttos, message_data): print message_data logger = logging.getLogger( LOG_NAME ) logger.setLevel(logging.INFO) server = SSLSMTPServer( ('0....
Use unprivlidged port to make testing easier.
Use unprivlidged port to make testing easier. Use new server run() method. Refactor example class to make things simpler.
Python
isc
bcoe/secure-smtpd
42285c696dc2bcbcc1aeb6ed0bd46b6418e4223f
program.py
program.py
import json import csv from collections import namedtuple from player_class import Players def main(): filename = get_data_file() data = load_file(filename) division_standings() playoff_standings() playoff_standings() player_stats() points_for() tiebreaker() player_score() # Imp...
import json import csv import requests import secret base_url = https://www.mysportsfeeds.com/api/feed/pull/nfl/2016-2017-regular/ def main(): division_standings() playoff_standings() playoff_standings() player_stats() points_for() tiebreaker() player_score() # Get Division Standings f...
Add stub for pulling player_stats including a new base_url for MySportsFeed
Add stub for pulling player_stats including a new base_url for MySportsFeed
Python
mit
prcutler/nflpool,prcutler/nflpool
6a48f6c0a4dec53a0094706957eecef10c2a6001
medical_appointment/__openerp__.py
medical_appointment/__openerp__.py
# -*- coding: utf-8 -*- # © 2016 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Medical Appointment', 'summary': 'Add Appointment concept to medical_physician', 'version': '9.0.1.0.0', 'author': 'LasLabs, Odoo Community Association (OCA)', 'category': ...
# -*- coding: utf-8 -*- # © 2016 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Medical Appointment', 'summary': 'Add Appointment concept to medical_physician', 'version': '9.0.1.0.0', 'author': 'LasLabs, Odoo Community Association (OCA)', 'category': ...
Add medical_physician requirement to medical_appointment
Add medical_physician requirement to medical_appointment
Python
agpl-3.0
laslabs/vertical-medical,laslabs/vertical-medical
75486c41bd648e63f1baf118000300cb7dee164b
ovirt-guest-agent/setup.py
ovirt-guest-agent/setup.py
from distutils.core import setup from glob import glob import os import sys import py2exe if len(sys.argv) == 1: sys.argv.append("py2exe") sys.argv.append("-b 1") class Target: def __init__(self, **kw): self.__dict__.update(kw) self.version = "1.0.16" self.company_name = "Red Ha...
from distutils.core import setup from glob import glob import os import sys import py2exe if len(sys.argv) == 1: sys.argv.append("py2exe") sys.argv.append("-b 1") class Target: def __init__(self, **kw): self.__dict__.update(kw) self.version = "1.0.16" self.package_version = "1.0...
Add explicit package version to the oVirt GA executable
Add explicit package version to the oVirt GA executable We really need to track 2 different versions in case of oVirt GA: - the version of the oVirt GA package itself - RH(E)V specific version of the oVirt GA package This patch adds setting of the package_version. Change-Id: I2dea656facbf2aa33a733316136e0e4d1b8d4744...
Python
apache-2.0
oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent
7c2ef2ce6b31d6188c4ea25d2c885d47a67ad5cb
OnlineParticipationDataset/pipelines.py
OnlineParticipationDataset/pipelines.py
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json,os from datetime import datetime from scrapy.exporters import JsonLinesItemExporter path = "downloads" class Onl...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json,os from datetime import datetime from scrapy.exporters import JsonLinesItemExporter path = "downloads" class Onl...
Save datetime in JSON as ISO
Save datetime in JSON as ISO
Python
mit
Liebeck/OnlineParticipationDatasets
b5059e1d525b0e774923fade7c1b2f183c499622
addons/web_calendar/contacts.py
addons/web_calendar/contacts.py
from openerp.osv import fields, osv class web_calendar_contacts(osv.osv): _name = 'web_calendar.contacts' _columns = { 'user_id': fields.many2one('res.users','Me'), 'partner_id': fields.many2one('res.partner','Contact'), 'active':fields.boolean('active'), } _defaul...
from openerp.osv import fields, osv class web_calendar_contacts(osv.osv): _name = 'web_calendar.contacts' _columns = { 'user_id': fields.many2one('res.users','Me'), 'partner_id': fields.many2one('res.partner','Contact',required=True), 'active':fields.boolean('active'), ...
Add required on field res.partner from model Contacts to avoid the creation of empty coworkers
[FIX] Add required on field res.partner from model Contacts to avoid the creation of empty coworkers bzr revid: jke@openerp.com-20131218091020-8upymhda9nd84fg8
Python
agpl-3.0
Gitlab11/odoo,havt/odoo,acshan/odoo,oihane/odoo,fdvarela/odoo8,ApuliaSoftware/odoo,hassoon3/odoo,tinkerthaler/odoo,chiragjogi/odoo,rowemoore/odoo,mmbtba/odoo,abdellatifkarroum/odoo,eino-makitalo/odoo,jusdng/odoo,Eric-Zhong/odoo,colinnewell/odoo,acshan/odoo,spadae22/odoo,minhtuancn/odoo,apocalypsebg/odoo,GauravSahu/odoo...
14503786d1ff3a91cee1b05698faf60e1f7bb371
edit.py
edit.py
# Open your $EDITOR to compose a message in weechat # # Usage: # /edit # # History: # 10-18-2015 # Version 1.0.0: initial release import os import os.path import subprocess import weechat def edit(data, buf, args): editor = os.environ.get("EDITOR", "vim") path = os.path.expanduser("~/.weechat/message.txt") ...
# Open your $EDITOR to compose a message in weechat # # Usage: # /edit # # History: # 10-18-2015 # Version 1.0.0: initial release import os import os.path import subprocess import weechat def edit(data, buf, args): editor = os.environ.get("EDITOR", "vim") path = os.path.expanduser("~/.weechat/message.txt") ...
Remove file after using it
Remove file after using it
Python
mit
keith/edit-weechat
ece48034dac3466e2ebf5ced85afc0a36cf4997b
api/base/content_negotiation.py
api/base/content_negotiation.py
from rest_framework.negotiation import BaseContentNegotiation class CustomClientContentNegotiation(BaseContentNegotiation): def select_parser(self, request, parsers): """ Select the first parser in the `.parser_classes` list. """ return parsers[0] def select_renderer(self, req...
from rest_framework.negotiation import BaseContentNegotiation class CustomClientContentNegotiation(BaseContentNegotiation): def select_parser(self, request, parsers): """ Select the first parser in the `.parser_classes` list. """ content_type = request.QUERY_PARAMS.get('content_typ...
Change select_parser to choose parser based on content_type instead of manadating a parser
Change select_parser to choose parser based on content_type instead of manadating a parser
Python
apache-2.0
ZobairAlijan/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,danielneis/osf.io,abought/osf.io,SSJohns/osf.io,felliott/osf.io,cwisecarver/osf.io,kwierman/osf.io,HalcyonChimera/osf.io,laurenrevere/osf.io,GageGaskins/osf.io,RomanZWang/osf.io,cslzchen/osf.io,doublebits/osf.io,samchrisinger/osf.io,acshi/osf.io,mluo613/osf.io,bill...
2b58a34a6bde9c7db39fc436928e344284de633b
app/DataLogger/sqlite_logger.py
app/DataLogger/sqlite_logger.py
import sqlite3 import time class SQLiteLogger: def __init__(self, filename="g2x.db"): self.filename = filename self.connection = None def __enter__(self): try: with open(self.filename): self.connection = sqlite3.connect(self.filename) except IOError...
import sqlite3 import time class SQLiteLogger: def __init__(self, filename="g2x.db"): self.filename = filename self.connection = None def __enter__(self): self.open() return self def __exit__(self, type, value, traceback): self.close() def open(self): ...
Allow logger to be opened and closed directly
Allow logger to be opened and closed directly
Python
mit
gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x
4c4b8f1a9d54d34dd9c2ee89367c7e290f94a12f
archive/archive_api/src/models/_base.py
archive/archive_api/src/models/_base.py
# -*- encoding: utf-8 from flask_restplus import fields, Model class TypedModel(Model): """ A thin wrapper around ``Model`` that adds a ``type`` field. """ def __init__(self, name, model_fields, *args, **kwargs): # When you use a model in ``@api.response``, it triggers an internal #...
# -*- encoding: utf-8 from flask_restplus import fields, Model class TypedModel(Model): """ A thin wrapper around ``Model`` that adds a ``type`` field. """ def __init__(self, name, model_fields, *args, **kwargs): # When you use a model in ``@api.response``, it triggers an internal #...
Make sure we ask callers for the "type" field
Make sure we ask callers for the "type" field
Python
mit
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
d76e4f45f78dc34a22f641cc8c691ac8f35daf0c
src/exhaustive_search/euclidean_mst.py
src/exhaustive_search/euclidean_mst.py
""" Provides a solution (`solve`) to the EMST problem. """ # Euclidean Minimum Spanning Tree (MST) algorithm # # input: a list of n Point objects # # output: a list of (p, q) tuples, where p and q are each input Point # objects, and (p, q) should be connected in a minimum spanning tree # of the input points def solve(...
""" Provides a solution (`solve`) to the EMST problem. """ from .graph import Graph # Euclidean Minimum Spanning Tree (MST) algorithm # # input: a list of n Point objects # # output: a list of (p, q) tuples, where p and q are each input Point # objects, and (p, q) should be connected in a minimum spanning tree # of t...
Use (still wrong) Graph implementation in MST.py
Use (still wrong) Graph implementation in MST.py
Python
isc
ciarand/exhausting-search-homework
b60bcae61d2da4a6869db25f233e8bec40740ffc
test/test_notebook.py
test/test_notebook.py
import glob from nbconvert.preprocessors import ExecutePreprocessor import nbformat import pytest notebooks = sorted(glob.glob("*.ipynb")) @pytest.mark.parametrize("notebook", notebooks) def test_notebook_execution(notebook): with open(notebook) as fin: nb = nbformat.read(fin, as_version=4) ep = Ex...
import glob from nbconvert.preprocessors import ExecutePreprocessor import nbformat import pytest notebooks = sorted(glob.glob("*.ipynb")) @pytest.mark.parametrize("notebook", notebooks) def test_notebook_execution(notebook): with open(notebook) as fin: nb = nbformat.read(fin, as_version=4) ep = Ex...
Remove requirement to clear notebooks
Remove requirement to clear notebooks
Python
mit
alanhdu/AccessibleML,adicu/AccessibleML
9b1ecea92cc629bf659764cf45d63b1d911a24e3
plugins/urlgrabber.py
plugins/urlgrabber.py
from plugins.categories import ISilentCommand try: import requests_pyopenssl from requests.packages.urllib3 import connectionpool connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket except ImportError: pass import requests from bs4 import BeautifulSoup class URLGrabber (ISilentCommand...
from plugins.categories import ISilentCommand try: import requests_pyopenssl from requests.packages.urllib3 import connectionpool connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket except ImportError: pass import requests from bs4 import BeautifulSoup class URLGrabber (ISilentCommand...
Use a realistic User-Agent for reddit
Use a realistic User-Agent for reddit
Python
isc
ComSSA/KhlavKalash