commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
d1cc22a5ab94b6df503679cc8b6a19948f4049c9 | maildump/web_realtime.py | maildump/web_realtime.py | from flask import current_app
from gevent.queue import Queue
clients = set()
def broadcast(event, data=None):
for q in clients:
q.put((event, data))
def handle_sse_request():
return current_app.response_class(_gen(), mimetype='text/event-stream')
def _gen():
yield _sse('connected')
q = Qu... | from flask import current_app
from gevent.queue import Empty, Queue
clients = set()
def broadcast(event, data=None):
for q in clients:
q.put((event, data))
def handle_sse_request():
return current_app.response_class(_gen(), mimetype='text/event-stream')
def _gen():
yield _sse('connected')
... | Send regular ping on SSE channel | Send regular ping on SSE channel
Otherwise dead clients stay around for a very long time (they are
only detected and removed when sending data fails, and that used to
depend on new emails arriving).
| Python | mit | ThiefMaster/maildump,ThiefMaster/maildump,ThiefMaster/maildump,ThiefMaster/maildump | ---
+++
@@ -1,5 +1,5 @@
from flask import current_app
-from gevent.queue import Queue
+from gevent.queue import Empty, Queue
clients = set()
@@ -18,7 +18,11 @@
q = Queue()
clients.add(q)
while True:
- msg = q.get()
+ try:
+ msg = q.get(timeout=60)
+ except Empty:
+... |
332a9086e1481697389774648cfcfefa332ff3e2 | adb-enhanced/setup.py | adb-enhanced/setup.py | from setuptools import setup, find_packages
import sys, os
with open('version.txt', 'r') as fh:
version = fh.read().strip()
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(name='adb-enhanced',
version=version,
description='Swiss-army knife for Android testing and develop... | from setuptools import setup, find_packages
import sys, os
_DIR_OF_THIS_SCRIPT = os.path.split(__file__)[0]
_VERSION_FILE_NAME = 'version.txt'
_VERSION_FILE_PATH = os.path.join(_DIR_OF_THIS_SCRIPT, _VERSION_FILE_NAME)
with open(_VERSION_FILE_PATH, 'r') as fh:
version = fh.read().strip()
with open('README.md', 'r... | Make path to version file relative | Make path to version file relative
| Python | apache-2.0 | ashishb/adb-enhanced | ---
+++
@@ -1,7 +1,11 @@
from setuptools import setup, find_packages
import sys, os
-with open('version.txt', 'r') as fh:
+_DIR_OF_THIS_SCRIPT = os.path.split(__file__)[0]
+_VERSION_FILE_NAME = 'version.txt'
+_VERSION_FILE_PATH = os.path.join(_DIR_OF_THIS_SCRIPT, _VERSION_FILE_NAME)
+
+with open(_VERSION_FILE_PAT... |
be67ff47938be435f1eb713ed1c9b08f3f98bc5b | number_to_words.py | number_to_words.py | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | Add condition to handle the case when `number` is 0 | Add condition to handle the case when `number` is 0 | Python | mit | ianfieldhouse/number_to_words | ---
+++
@@ -32,3 +32,7 @@
if not isinstance(number, (int, long)):
raise ValueError(self.EXCEPTION_STRING)
+ sentence = ""
+ if number is 0:
+ sentence = "zero"
+ return sentence |
ab3d830ca682805180710bf1aeb79519c826a7f0 | frontend.py | frontend.py | from flask import Flask
from flask import render_template
import requests
import json
app = Flask(__name__)
@app.route('/')
def index():
r = requests.get("http://127.0.0.1:5000/playlist")
playlist = json.loads(r.text)
return render_template('index.html', playlist=playlist)
@app.route('/settings')
def s... | from flask import Flask
from flask import render_template
import requests
import json
app = Flask(__name__)
@app.route('/')
def index():
r = requests.get("http://127.0.0.1:5000/playlist")
playlist = json.loads(r.text)
return render_template('index.html', playlist=playlist)
@app.route('/settings')
def s... | Add tunein search and use flask new run | Add tunein search and use flask new run
| Python | mit | MCG-Radio/frontend,MCG-Radio/frontend,MCG-Radio/frontend | ---
+++
@@ -23,5 +23,14 @@
return render_template('player.html')
-if __name__ == '__main__':
- app.run(port=5001)
+@app.route('/search/<name>')
+def search(name):
+ params = {
+ "render": "json",
+ "locale": "fr-FR",
+ "call": name,
+ "query": name,
+ "c": "stations"
... |
d791577e797bdcdabe68ef4999e39d2b2d99a291 | sugar/activity/__init__.py | sugar/activity/__init__.py | import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
def get_default_type(activity_type):
"""Get the activity default type.
It's ... | import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
settings.set_string_property('gtk-font-name', 'Sans 14', '')
def get_default_type... | Set default font size to 14 | Set default font size to 14
| Python | lgpl-2.1 | i5o/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,tchx84/debian-pkg-sugar-toolkit,quozl/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,Daksh/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit,godiard/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit... | ---
+++
@@ -8,6 +8,8 @@
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
+settings.set_string_property('gtk-font-name', 'Sans 14', '')
+
def get_default_type(activity_type):
"""Get the activity default type.
|
f735e813d1babba1c488f8ea761ffd1295103451 | systemofrecord/__init__.py | systemofrecord/__init__.py | import os
import logging
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
def configure_logging(obj):
logger = logging.getLogger(obj.__class__.__name__)
logg... | import os
import logging
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
db = SQLAlchemy(app)
def con... | Add proxy fix as in lr this will run with reverse proxy | Add proxy fix as in lr this will run with reverse proxy
| Python | mit | LandRegistry/system-of-record-alpha,LandRegistry/system-of-record-alpha,LandRegistry/system-of-record-alpha | ---
+++
@@ -6,8 +6,11 @@
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
+
+from werkzeug.contrib.fixers import ProxyFix
+app.wsgi_app = ProxyFix(app.wsgi_app)
+
db = SQLAlchemy(app)
-
def configure_logging(obj):
logger = logging.getLogger(obj.__class__.__name__) |
937db1a685da31a9b00d7652835f2fafc7493fc7 | applebot/botmodule.py | applebot/botmodule.py | import logging
import discord
from applebot.utils import caller_attr
log = logging.getLogger(__name__)
class BotModule(object):
def __init__(self, client=None):
self.__name__ = None
self.client = client or caller_attr('client', levels=3) or discord.Client()
self.__register_handlers()
... | import logging
import discord
from applebot.utils import caller_attr
log = logging.getLogger(__name__)
class BotModule(object):
def __init__(self, client=None):
self.__name__ = None
self.client = client or caller_attr('client', levels=3) or discord.Client()
self.__register_handlers()
... | Allow for multiple events with the @BotModule.event decorator. | Allow for multiple events with the @BotModule.event decorator.
| Python | mit | appul/applebot | ---
+++
@@ -16,20 +16,20 @@
def __register_handlers(self):
for method in [getattr(self, m) for m in dir(self) if '__' not in m]:
if callable(method):
- commands = method.__dict__.get('command_names')
- event = method.__dict__.get('event_name')
- ... |
d7454240f4f888309a63bba07526a821962c9670 | masters/master.chromium.webrtc.fyi/master_source_cfg.py | masters/master.chromium.webrtc.fyi/master_source_cfg.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import gitiles_poller
def Update(config, c):
webrtc_repo_url = config.Master.git_server_url + '/external/webrtc/'
webrtc_poller = gitil... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import gitiles_poller
def Update(config, c):
webrtc_repo_url = config.Master.git_server_url + '/external/webrtc/'
webrtc_poller = gitil... | Remove poller for webrtc-samples repo. | WebRTC: Remove poller for webrtc-samples repo.
Having multiple GittilesPollers produces blamelists
with hashes from different repos, but more importantly perf
dashboard links that are not valid, since the from-hash can be
from the Chromium repo and the to-hash from the webrtc-samples repo.
Since breakages by changes ... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | ---
+++
@@ -10,9 +10,3 @@
webrtc_poller = gitiles_poller.GitilesPoller(webrtc_repo_url,
project='webrtc')
c['change_source'].append(webrtc_poller)
-
- samples_poller = gitiles_poller.GitilesPoller(
- config.Master.git_server_url + '/external/webrtc-samples',... |
f46e91ae286dbc1dd86180d2920017d3222a48e2 | btdjango/__init__.py | btdjango/__init__.py | #!/usr/bin/env python
"""
Braintree Django Python Module
"""
import braintree
from django.conf import settings
VERSION = "1.0"
if not hasattr(braintree.Configuration, "merchant_id"):
braintree.Configuration.configure(
getattr(settings, "BRAINTREE_ENV", braintree.Environment.Sandbox),
getatt... | #!/usr/bin/env python
"""
Braintree Django Python Module
"""
import braintree
from django.conf import settings
VERSION = "1.1"
if not hasattr(braintree.Configuration, "merchant_id"):
braintree.Configuration.configure(
getattr(settings, "BRAINTREE_ENV", braintree.Environment.Sandbox),
getatt... | Fix small typo to make unsafe SSL really work, minor version bump | Fix small typo to make unsafe SSL really work, minor version bump
| Python | mit | danielgtaylor/braintree_django | ---
+++
@@ -8,7 +8,7 @@
from django.conf import settings
-VERSION = "1.0"
+VERSION = "1.1"
if not hasattr(braintree.Configuration, "merchant_id"):
braintree.Configuration.configure(
@@ -18,6 +18,6 @@
getattr(settings, "BRAINTREE_PRIVATE_KEY", ""),
)
- if getattr(settings, "BRAINTREE_UN... |
57d4e10636b9593ef650f0f62410f0b0d7effdf2 | test/test_e2e.py | test/test_e2e.py | import h2o
import socket
import threading
import unittest
import urllib.request
SIMPLE_PATH = b'/simple'
SIMPLE_BODY = b'<h1>It works!</h1>'
class E2eTest(unittest.TestCase):
def setUp(self):
config = h2o.Config()
host = config.add_host(b'default', 65535)
host.add_path(SIMPLE_PATH).add_ha... | import h2o
import socket
import threading
import unittest
import urllib.request
SIMPLE_PATH = b'/simple'
SIMPLE_BODY = b'<h1>It works!</h1>'
class E2eTest(unittest.TestCase):
def setUp(self):
config = h2o.Config()
host = config.add_host(b'default', 65535)
host.add_path(SIMPLE_PATH).add_ha... | Fix test under python 3.4 | Fix test under python 3.4
| Python | mit | iceb0y/pyh2o,iceb0y/pyh2o | ---
+++
@@ -17,13 +17,14 @@
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
self.sock.bind(('127.0.0.1', 0))
- self.sock.listen()
- self.url_prefix = b'http://127.0.0.1:%d' % self.sock.getsockname... |
89b164781ba433c9209f306889463e189006778c | board.py | board.py | """
Board represents a four in a row game board.
Author: Isaac Arvestad
"""
class Board:
"""
Initializes the game with a certain number of rows
and columns.
"""
def __init(self, rows, columns):
self.rows = rows
self.columns = columns
| import numpy
"""
Board represents a four in a row game board.
Author: Isaac Arvestad
"""
class Board:
"""
Initializes the game with a certain number of rows
and columns.
"""
def __init(self, rows, columns):
self.rows = rows
self.columns = columns
self.boardMatrix = numpy.ze... | Add matrix and addPiece function. | Add matrix and addPiece function.
| Python | mit | isaacarvestad/four-in-a-row | ---
+++
@@ -1,3 +1,5 @@
+import numpy
+
"""
Board represents a four in a row game board.
@@ -11,3 +13,26 @@
def __init(self, rows, columns):
self.rows = rows
self.columns = columns
+ self.boardMatrix = numpy.zeros((rows, columns))
+
+ """
+ Attempts to add a piece to a certain ... |
e53da7173bfa63ea4acbe5a1884d41ed295e978f | TUI/Scripts/TSpec/Focus.py | TUI/Scripts/TSpec/Focus.py | """Take a series of exposures at different focus positions to estimate best focus.
"""
import TUI.Base.BaseFocusScript
# make script reload also reload BaseFocusScript
reload(TUI.Base.BaseFocusScript)
SlitviewerFocusScript = TUI.Base.BaseFocusScript.SlitviewerFocusScript
Debug = False # run in debug-only mode (which d... | """Take a series of exposures at different focus positions to estimate best focus.
History:
2008-03-25 ROwen First version
2008-04-03 ROwen Changed doWindow to True because the TripleSpec slitviewer can now window
"""
import TUI.Base.BaseFocusScript
# make script reload also reload BaseFocusScript
reload(TUI.Bas... | Change TSpec focus script to use windowing (now that it is supported). | Change TSpec focus script to use windowing (now that it is supported).
git-svn-id: a38512e6531051f4ba6aaa1c8358347ddeca2e1b@117751 b00c9580-4927-0410-8824-811d448ea4c7
| Python | bsd-3-clause | r-owen/stui,r-owen/stui | ---
+++
@@ -1,4 +1,8 @@
"""Take a series of exposures at different focus positions to estimate best focus.
+
+History:
+2008-03-25 ROwen First version
+2008-04-03 ROwen Changed doWindow to True because the TripleSpec slitviewer can now window
"""
import TUI.Base.BaseFocusScript
# make script reload also rel... |
56da6b0b39fc3b4b9fa5c19ed0738ff526bf5072 | src/sugar/__init__.py | src/sugar/__init__.py | # Copyright (C) 2006-2007, Red Hat, Inc.
# Copyright (C) 2007, One Laptop Per Child
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option... | # Copyright (C) 2006-2007, Red Hat, Inc.
# Copyright (C) 2007-2008, One Laptop Per Child
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your o... | Use the right gettext domain. | Use the right gettext domain.
| Python | lgpl-2.1 | tchx84/debian-pkg-sugar-base,ceibal-tatu/sugar-base,ceibal-tatu/sugar-base,sugarlabs/sugar-base,ceibal-tatu/sugar-base,tchx84/debian-pkg-sugar-base,sugarlabs/sugar-base,sugarlabs/sugar-base,tchx84/debian-pkg-sugar-base | ---
+++
@@ -1,5 +1,5 @@
# Copyright (C) 2006-2007, Red Hat, Inc.
-# Copyright (C) 2007, One Laptop Per Child
+# Copyright (C) 2007-2008, One Laptop Per Child
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -16,3 +16,15 @@
# Free So... |
e94d40af916fa51e7e8737fd151d8cfc8a94891a | cmsplugin_iframe/models.py | cmsplugin_iframe/models.py | from cms.models import CMSPlugin
from django.db import models
class IframePlugin(CMSPlugin):
src = models.URLField()
| from cms.models import CMSPlugin
from django.db import models
class IframePlugin(CMSPlugin):
src = models.URLField(max_length=400)
| Increase urlfield size from 200 to 500 to deal with large embed urls for google calendar and other embeds | Increase urlfield size from 200 to 500 to deal with large embed urls for google calendar and other embeds
| Python | mit | jonasmcarson/cmsplugin-iframe,jonasmcarson/cmsplugin-iframe | ---
+++
@@ -3,4 +3,4 @@
class IframePlugin(CMSPlugin):
- src = models.URLField()
+ src = models.URLField(max_length=400) |
116e76557d239edab69bab47c96cb5835618c31f | tilenol/xcb/keysymparse.py | tilenol/xcb/keysymparse.py | import re
keysym_re = re.compile(r"^#define\s+(XF86)?XK_(\w+)\s+(\S+)")
class Keysyms(object):
__slots__ = ('name_to_code', 'code_to_name', '__dict__')
def __init__(self):
self.name_to_code = {}
self.code_to_name = {}
def add_from_file(self, filename):
with open(filename, 'rt') ... | import os
import re
keysym_re = re.compile(r"^#define\s+(XF86)?XK_(\w+)\s+(\S+)")
class Keysyms(object):
__slots__ = ('name_to_code', 'code_to_name', '__dict__')
def __init__(self):
self.name_to_code = {}
self.code_to_name = {}
def add_from_file(self, filename):
with open(filena... | Allow to override include dir of xproto | Allow to override include dir of xproto
| Python | mit | tailhook/tilenol,tailhook/tilenol | ---
+++
@@ -1,3 +1,4 @@
+import os
import re
keysym_re = re.compile(r"^#define\s+(XF86)?XK_(\w+)\s+(\S+)")
@@ -23,6 +24,7 @@
self.code_to_name[code] = name
def load_default(self):
- self.add_from_file('/usr/include/X11/keysymdef.h')
- self.add_from_file('/usr/include/X11/XF86... |
6f9a2ef636c8ac5272de15ddfeb7c80b3bd00246 | test/test_arena.py | test/test_arena.py | from support import lib,ffi
from qcgc_test import QCGCTest
class ArenaTestCase(QCGCTest):
def test_size_calculations(self):
exp = lib.QCGC_ARENA_SIZE_EXP
size = 2**exp
bitmap = size / 128
cells = (size - 2 * bitmap) / 16
self.assertEqual(size, lib.qcgc_arena_size)
se... | from support import lib,ffi
from qcgc_test import QCGCTest
class ArenaTestCase(QCGCTest):
def test_size_calculations(self):
exp = lib.QCGC_ARENA_SIZE_EXP
size = 2**exp
bitmap = size / 128
cells = size / 16
self.assertEqual(size, lib.qcgc_arena_size)
self.assertEqual(... | Fix wrong cell count calculation | Fix wrong cell count calculation
| Python | mit | ntruessel/qcgc,ntruessel/qcgc,ntruessel/qcgc | ---
+++
@@ -6,7 +6,7 @@
exp = lib.QCGC_ARENA_SIZE_EXP
size = 2**exp
bitmap = size / 128
- cells = (size - 2 * bitmap) / 16
+ cells = size / 16
self.assertEqual(size, lib.qcgc_arena_size)
self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size)
self.asser... |
5fd3bed281018a556cfd6305670317bf5acb2a16 | tests/test_auth.py | tests/test_auth.py | import random
import unittest
from .config import *
from tweepy import API, OAuthHandler
class TweepyAuthTests(unittest.TestCase):
def testoauth(self):
auth = OAuthHandler(oauth_consumer_key, oauth_consumer_secret)
# test getting access token
auth_url = auth.get_authorization_url()
... | import random
import unittest
from .config import *
from tweepy import API, OAuthHandler
class TweepyAuthTests(unittest.TestCase):
def testoauth(self):
auth = OAuthHandler(consumer_key, consumer_secret)
# test getting access token
auth_url = auth.get_authorization_url()
print('P... | Update consumer key and secret usage in auth tests | Update consumer key and secret usage in auth tests
| Python | mit | svven/tweepy,tweepy/tweepy | ---
+++
@@ -8,7 +8,7 @@
class TweepyAuthTests(unittest.TestCase):
def testoauth(self):
- auth = OAuthHandler(oauth_consumer_key, oauth_consumer_secret)
+ auth = OAuthHandler(consumer_key, consumer_secret)
# test getting access token
auth_url = auth.get_authorization_url()
@@ ... |
fc08fb4086b3438cbe84042903b855c6fb55c30e | sshuttle/assembler.py | sshuttle/assembler.py | import sys
import zlib
import imp
z = zlib.decompressobj()
while 1:
name = sys.stdin.readline().strip()
if name:
name = name.decode("ASCII")
nbytes = int(sys.stdin.readline())
if verbosity >= 2:
sys.stderr.write('server: assembling %r (%d bytes)\n'
... | import sys
import zlib
import imp
z = zlib.decompressobj()
while 1:
global verbosity
name = sys.stdin.readline().strip()
if name:
name = name.decode("ASCII")
nbytes = int(sys.stdin.readline())
if verbosity >= 2:
sys.stderr.write('server: assembling %r (%d bytes)\n'
... | Declare 'verbosity' as global variable to placate linters | Declare 'verbosity' as global variable to placate linters | Python | lgpl-2.1 | sshuttle/sshuttle,sshuttle/sshuttle | ---
+++
@@ -4,6 +4,7 @@
z = zlib.decompressobj()
while 1:
+ global verbosity
name = sys.stdin.readline().strip()
if name:
name = name.decode("ASCII") |
964da81ef5a90130a47ff726839798a7a7b716ef | buildcert.py | buildcert.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from subprocess import call
from ca import app, db, mail
from ca.models import Request
from flask import Flask, render_template
from flask_mail import Message
def mail_certificate(id, email):
msg = Message('Freifunk Vpn03 Key', sender = 'no-reply@ca... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from subprocess import call
from ca import app, db, mail
from ca.models import Request
from flask import Flask, render_template
from flask_mail import Message
def mail_certificate(id, email):
with app.app_context():
msg = Message('Freifunk V... | Add app.context() to populate context for render_template | Add app.context() to populate context for render_template
| Python | mit | freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net | ---
+++
@@ -12,11 +12,12 @@
def mail_certificate(id, email):
- msg = Message('Freifunk Vpn03 Key', sender = 'no-reply@ca.berlin.freifunk.net', recipients = [email])
- msg.body = render_template('mail.txt')
- with app.open_resource("/etc/openvpn/clients/freifunk_{}.tgz".format(id)) as fp:
- msg.at... |
d95eda2f88a8b493e40cd6628c7e532a1f510610 | src/dashboard/src/main/urls.py | src/dashboard/src/main/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template, redirect_to
UUID_REGEX = '[\w]{8}(-[\w]{4}){3}-[\w]{12}'
urlpatterns = patterns('dashboard.main.views',
# Ingest
url(r'ingest/$', direct_to_template, {'template': 'main/in... | from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template, redirect_to
UUID_REGEX = '[\w]{8}(-[\w]{4}){3}-[\w]{12}'
urlpatterns = patterns('dashboard.main.views',
# Index
(r'^$', redirect_to, {'url': '/ingest/'}),
# Ingest
... | Remove default route because it is not the desired behavior. | Remove default route because it is not the desired behavior.
Autoconverted from SVN (revision:1409)
| Python | agpl-3.0 | artefactual/archivematica-history,artefactual/archivematica-history,artefactual/archivematica-history,artefactual/archivematica-history | ---
+++
@@ -6,17 +6,18 @@
urlpatterns = patterns('dashboard.main.views',
+ # Index
+ (r'^$', redirect_to, {'url': '/ingest/'}),
+
# Ingest
url(r'ingest/$', direct_to_template, {'template': 'main/ingest.html', 'extra_context': {'polling_interval': settings.POLLING_INTERVAL, 'microservices_help': settings.... |
1a35294baac296bbd665dc55e35cd2b383ae7116 | alembic/versions/87acbbe5887b_add_freeform_profile_for_user.py | alembic/versions/87acbbe5887b_add_freeform_profile_for_user.py | """Add freeform profile for user
Revision ID: 87acbbe5887b
Revises: f2a71c7b93b6
Create Date: 2016-09-11 21:39:20.753000
"""
# revision identifiers, used by Alembic.
revision = '87acbbe5887b'
down_revision = 'f2a71c7b93b6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def u... | """Add freeform profile for user
Revision ID: 87acbbe5887b
Revises: f2a71c7b93b6
Create Date: 2016-09-11 21:39:20.753000
"""
# revision identifiers, used by Alembic.
revision = '87acbbe5887b'
down_revision = 'f2a71c7b93b6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def u... | Set default value for user profile data | Set default value for user profile data
| Python | mit | katajakasa/aetherguild2,katajakasa/aetherguild2 | ---
+++
@@ -17,7 +17,7 @@
def upgrade():
- op.add_column('user', sa.Column('profile_data', sa.Text(), nullable=False))
+ op.add_column('user', sa.Column('profile_data', sa.Text(), nullable=False, server_default=u'{}'))
def downgrade(): |
12a9ef54d82d9508852e5596dbb9df321986e067 | tests/test_heroku.py | tests/test_heroku.py | """Tests for the Wallace API."""
import subprocess
import re
import requests
class TestHeroku(object):
"""The Heroku test class."""
def test_sandbox(self):
"""Launch the experiment on Heroku."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | Refactor Heroku tests to have shared setup | Refactor Heroku tests to have shared setup
| Python | mit | Dallinger/Dallinger,berkeley-cocosci/Wallace,jcpeterson/Dallinger,jcpeterson/Dallinger,suchow/Wallace,berkeley-cocosci/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,suchow/Wallace,suchow/Wallace,jcpeterson/Dallinger,Dallinger/Dalli... | ---
+++
@@ -2,6 +2,7 @@
import subprocess
import re
+import os
import requests
@@ -9,18 +10,22 @@
"""The Heroku test class."""
- def test_sandbox(self):
+ sandbox_output = subprocess.check_output(
+ "cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
+
+ os.environ['ap... |
3c66efc142d53a4c8f9f88fb33d942c6840bd343 | tests/test_trivia.py | tests/test_trivia.py |
import unittest
from units.trivia import check_answer
class TestCheckAnswer(unittest.TestCase):
def test_correct_answer(self):
self.assertTrue(check_answer("correct", "correct"))
def test_incorrect_answer(self):
self.assertFalse(check_answer("correct", "incorrect"))
def test_parenthes... |
import unittest
from units.trivia import check_answer
class TestCheckAnswer(unittest.TestCase):
def test_correct_answer(self):
self.assertTrue(check_answer("correct", "correct"))
def test_incorrect_answer(self):
self.assertFalse(check_answer("correct", "incorrect"))
def test_large_num... | Test large number as response for check_answer | [Tests] Test large number as response for check_answer
| Python | mit | Harmon758/Harmonbot,Harmon758/Harmonbot | ---
+++
@@ -11,6 +11,14 @@
def test_incorrect_answer(self):
self.assertFalse(check_answer("correct", "incorrect"))
+
+ def test_large_number(self):
+ self.assertFalse(
+ check_answer(
+ "33 1/3",
+ "128347192834719283561293847129384719238471234"
+ ... |
46807ee4923a5799ec371cd8094c36f0b672f4b4 | common/highlights.py | common/highlights.py | import common.time
SPREADSHEET = "1yrf6d7dPyTiWksFkhISqEc-JR71dxZMkUoYrX4BR40Y"
def format_row(title, description, video, timestamp, nick):
if '_id' in video:
url = "https://www.twitch.tv/loadingreadyrun/manager/%s/highlight" % video['_id']
else:
url = video['url']
return [
("SHOW", title),
("QUOTE or MOME... | import common.time
SPREADSHEET = "1yrf6d7dPyTiWksFkhISqEc-JR71dxZMkUoYrX4BR40Y"
def format_row(title, description, video, timestamp, nick):
if '_id' in video:
# Allow roughly 15 seconds for chat delay, 10 seconds for chat reaction time,
# 20 seconds for how long the actual event is...
linkts = timestamp - 45
... | Add timestamp to link too | Add timestamp to link too
| Python | apache-2.0 | andreasots/lrrbot,mrphlip/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,mrphlip/lrrbot,andreasots/lrrbot | ---
+++
@@ -4,7 +4,11 @@
def format_row(title, description, video, timestamp, nick):
if '_id' in video:
- url = "https://www.twitch.tv/loadingreadyrun/manager/%s/highlight" % video['_id']
+ # Allow roughly 15 seconds for chat delay, 10 seconds for chat reaction time,
+ # 20 seconds for how long the actual eve... |
b06f0e17541f7d424e73fd200ae10db0722b1a5a | organizer/views.py | organizer/views.py | from django.shortcuts import (
get_object_or_404, render)
from .forms import TagForm
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'star... | from django.shortcuts import (
get_object_or_404, redirect, render)
from .forms import TagForm
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
... | Create and redirect to Tag in tag_create(). | Ch09: Create and redirect to Tag in tag_create().
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | ---
+++
@@ -1,5 +1,5 @@
from django.shortcuts import (
- get_object_or_404, render)
+ get_object_or_404, redirect, render)
from .forms import TagForm
from .models import Startup, Tag
@@ -25,9 +25,8 @@
if request.method == 'POST':
form = TagForm(request.POST)
if form.is_valid():
- ... |
5553dd2aba90749fdedda55067c2010cf1522f54 | mesobox/boxes.py | mesobox/boxes.py | from django.conf import settings
import importlib
# Merge two lots of mesobox-compatible context additions
def merge_context_additions(additions):
context = {}
boxes = {}
for c in additions:
try:
context.update(c.get("context"))
except TypeError:
pass
try:
... | from django.conf import settings
import importlib
# Merge two lots of mesobox-compatible context additions
def merge_context_additions(additions):
context = {}
boxes = {}
for c in additions:
try:
context.update(c.get("context"))
except TypeError:
pass
try:
... | Remove a debugging print that should never have been left there anyway. | Remove a debugging print that should never have been left there anyway.
| Python | mit | grundleborg/mesosphere | ---
+++
@@ -28,7 +28,6 @@
# Get the boxes and accompanying context additions from all the installed apps.
for app in settings.INSTALLED_APPS:
- print(app)
try:
module = importlib.import_module(app+".boxes")
except ImportError: |
bde51dc314bd920dafd5f72fbc4ccae099f5be59 | tsune/settings/ci.py | tsune/settings/ci.py | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
#'NAME': 'db.sqlite3',
}
}
INSTALLED_APPS += ('django_jenkins',)
PROJECT_APPS = {
'cardbox',
} | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
#'NAME': 'db.sqlite3',
}
}
INSTALLED_APPS += ('django_jenkins',)
PROJECT_APPS = {
'cardbox',
'deckglue',
'memorize',
}
| Add deckglue and memorize to django_jenkins | Add deckglue and memorize to django_jenkins
| Python | mit | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | ---
+++
@@ -11,4 +11,7 @@
PROJECT_APPS = {
'cardbox',
+ 'deckglue',
+ 'memorize',
}
+ |
2492803223060ecf92f8c60a2aa07db8f450e7b1 | get_dev_id.py | get_dev_id.py | from gmusicapi import Mobileclient
# Try to print out some valid device IDs.
if __name__ == '__main__':
api = Mobileclient()
email = input('Enter your email: ')
password = input('Enter your password: ')
if not api.login(email, password, Mobileclient.FROM_MAC_ADDRESS):
print('Login failed, veri... | import getpass
from gmusicapi import Mobileclient
# Try to print out some valid device IDs.
if __name__ == '__main__':
api = Mobileclient()
email = input('Enter your email: ').strip()
assert '@' in email, 'Please enter a valid email.'
password = getpass.getpass('Enter password for {}: '.format(email))... | Secure with getpass(), Simplify with enumerate() | Secure with getpass(), Simplify with enumerate() | Python | mit | christopher-dG/pmcli,christopher-dG/pmcli | ---
+++
@@ -1,20 +1,19 @@
+import getpass
from gmusicapi import Mobileclient
+
# Try to print out some valid device IDs.
if __name__ == '__main__':
api = Mobileclient()
- email = input('Enter your email: ')
- password = input('Enter your password: ')
+ email = input('Enter your email: ').strip()
+ ... |
443172dd4f8717f55da8f8a4af1397044f66ccf0 | yunity/users/api.py | yunity/users/api.py | from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework import viewsets
from yunity.users.serializers import UserSerializer
class UserViewSet(viewsets.ModelViewSet):
queryset = get_user_model().objects.all()
serializer_class = UserSerializer
filter_backends = ... | from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated, AllowAny, BasePermission
from yunity.users.serializers import UserSerializer
class IsRequestUser(BasePermission):
message = 'You can modify... | Extend Users API to conform to tests | Extend Users API to conform to tests
| Python | agpl-3.0 | yunity/yunity-core,yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend | ---
+++
@@ -1,7 +1,16 @@
from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework import viewsets
+from rest_framework.permissions import IsAuthenticated, AllowAny, BasePermission
+
from yunity.users.serializers import UserSerializer
+
+
+class IsRequestUser(BasePermis... |
20a938892492defb1063a63b12e1aeb5b47c5508 | web/core/models.py | web/core/models.py | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
import django.db.models.signals
import django.dispatch.dispatcher
import web.core
import re
import os
import uuid
class File(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=... | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
import django.db.models.signals
import django.dispatch.dispatcher
import web.core
import re
import os
import uuid
class File(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=... | Remove directories when deleting files | Remove directories when deleting files
| Python | bsd-3-clause | ambientsound/rsync,ambientsound/rsync,ambientsound/rsync,ambientsound/rsync | ---
+++
@@ -21,7 +21,9 @@
expiry = models.DateTimeField(default=web.core.default_expiry, blank=True)
def delete_file(self):
- return self.file.delete()
+ base_path = os.path.dirname(self.file.name)
+ os.unlink(self.file.name)
+ os.rmdir(base_path)
def __unicode__(self):
... |
d7d9fcb260b85a3f785852239acaea6ccda1725a | what_meta/views.py | what_meta/views.py | from django.core import serializers
from django.http.response import HttpResponse
from what_meta.models import WhatTorrentGroup
def search_torrent_groups(request, query):
return HttpResponse(
serializers.serialize('json', WhatTorrentGroup.objects.filter(name__icontains=query)),
content_type='text... | from django.core import serializers
from django.http.response import HttpResponse
from what_meta.models import WhatTorrentGroup
def search_torrent_groups(request, query):
response = HttpResponse(
serializers.serialize('json', WhatTorrentGroup.objects.filter(name__icontains=query)),
content_type='... | Support for super simple player. | Support for super simple player.
| Python | mit | grandmasterchef/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,MADindustries/WhatManager2,davols/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2,davols/WhatManager2,grandmasterchef/WhatManager2,grandmasterchef/WhatManager2,grandmasterchef/WhatManager2,karamanolev/WhatManager2,karamanolev/W... | ---
+++
@@ -5,7 +5,9 @@
def search_torrent_groups(request, query):
- return HttpResponse(
+ response = HttpResponse(
serializers.serialize('json', WhatTorrentGroup.objects.filter(name__icontains=query)),
- content_type='text/plain',
+ content_type='text/json',
)
+ response['A... |
9312a291d09df1314497e8d438f388d8eb37cc7b | shuup/front/apps/carousel/migrations/0003_add_shops.py | shuup/front/apps/carousel/migrations/0003_add_shops.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-05-09 01:13
from __future__ import unicode_literals
from django.db import migrations, models
def add_shop_for_carousels(apps, schema_editor):
Shop = apps.get_model("shuup", "Shop")
Carousel = apps.get_model("carousel", "Carousel")
shop = Shop.o... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-05-09 01:13
from __future__ import unicode_literals
from django.db import migrations, models
def add_shop_for_carousels(apps, schema_editor):
Shop = apps.get_model("shuup", "Shop")
Carousel = apps.get_model("carousel", "Carousel")
shop = Shop.o... | Fix migration issue with Django 1.8 | Fix migration issue with Django 1.8
| Python | agpl-3.0 | shoopio/shoop,shoopio/shoop,shoopio/shoop | ---
+++
@@ -10,7 +10,7 @@
Carousel = apps.get_model("carousel", "Carousel")
shop = Shop.objects.first()
for carousel in Carousel.objects.all():
- carousel.shops.set([shop])
+ carousel.shops = [shop]
class Migration(migrations.Migration): |
68211b703e15309b1a384f46d7bd70a8657decde | piper/process.py | piper/process.py | import logbook
import sh
from piper.logging import SEPARATOR
class Process:
"""
Helper class for running processes
"""
def __init__(self, config, cmd, parent_key):
self.config = config
self.cmd = cmd
self.sh = None
self.success = None
self.log = logbook.Logg... | import logbook
import sh
from piper.logging import SEPARATOR
class Process:
"""
Helper class for running processes
"""
def __init__(self, config, cmd, parent_key):
self.config = config
self.cmd = cmd
self.sh = None
self.success = None
self.log = logbook.Logg... | Fix output with trailing newlines from sh. | Fix output with trailing newlines from sh.
Closes #39
| Python | mit | thiderman/piper | ---
+++
@@ -34,7 +34,7 @@
try:
for line in self.sh:
- self.log.info(line)
+ self.log.info(line.strip())
except sh.ErrorReturnCode:
self.log.error(self.sh.stderr)
finally: |
fd516d3b80e63c6883d5eec47a8bf9ff6042509b | pandoc-figref.py | pandoc-figref.py | #! /usr/bin/env python3
"""Pandoc filter that replaces labels of format {#?:???}, where ? is a
single lower case character defining the type and ??? is an alphanumeric
label, with numbers. Different types are counted separately.
"""
from pandocfilters import toJSONFilter, Str
import re
REF_PAT = re.compile('\{#([a-z... | #! /usr/bin/env python3
"""Pandoc filter that replaces labels of format {#?:???}, where ? is a
single lower case character defining the type and ??? is an alphanumeric
label, with numbers. Different types are counted separately.
"""
from pandocfilters import toJSONFilter, Str
import re
REF_PAT = re.compile('(.*)\{#(... | Fix error with no space before tag | Fix error with no space before tag
| Python | mit | scotthartley/pandoc-figref | ---
+++
@@ -8,13 +8,13 @@
from pandocfilters import toJSONFilter, Str
import re
-REF_PAT = re.compile('\{#([a-z]):(\w*)\}(.*)')
+REF_PAT = re.compile('(.*)\{#([a-z]):(\w*)\}(.*)')
known_labels = {}
def figref(key, val, fmt, meta):
if key == 'Str' and REF_PAT.match(val):
- kind, label, end = REF_... |
7642359c1ecf2b5dc38f70924e7c9885739a79c8 | jungle/emr.py | jungle/emr.py | # -*- coding: utf-8 -*-
import boto3
import click
@click.group()
def cli():
"""EMR CLI group"""
pass
@cli.command(help='List EMR clusters')
@click.argument('name', default='*')
def ls(name):
"""List EMR instances"""
client = boto3.client('emr', region_name='us-east-1')
results = client.list_clus... | # -*- coding: utf-8 -*-
import subprocess
import boto3
import click
@click.group()
def cli():
"""EMR CLI group"""
pass
@cli.command(help='List EMR clusters')
@click.argument('name', default='*')
def ls(name):
"""List EMR instances"""
client = boto3.client('emr')
results = client.list_clusters(
... | Add ssh subcommand for EMR | Add ssh subcommand for EMR
| Python | mit | achiku/jungle | ---
+++
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+import subprocess
+
import boto3
import click
@@ -13,9 +15,23 @@
@click.argument('name', default='*')
def ls(name):
"""List EMR instances"""
- client = boto3.client('emr', region_name='us-east-1')
+ client = boto3.client('emr')
results = client.l... |
9168abf53be960d1630ec6ecb01c6d8f55d21739 | promotions_app/models.py | promotions_app/models.py | from django.db import models
from authentication_app.models import Account
'''
@name : Promotion
@desc : The promotion model.
'''
class Promotion(models.Model):
account = models.ForeignKey(Account)
name = models.CharField(max_length=50, unique=True)
desc = models.TextField()
created_at = mode... | from django.db import models
from authentication_app.models import Account
'''
@name : PromotionManager.
@desc : The PromotionManager is responsible to create, delete and update the promotions.
'''
class PromotionManager(models.Manager):
def create_promotion(self, name, desc, expire_date, image):
... | Add the promotion manager to the promotions app. | Add the promotion manager to the promotions app.
| Python | mit | mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app | ---
+++
@@ -3,7 +3,27 @@
from authentication_app.models import Account
'''
- @name : Promotion
+ @name : PromotionManager.
+ @desc : The PromotionManager is responsible to create, delete and update the promotions.
+'''
+class PromotionManager(models.Manager):
+
+ def create_promotion(self, name, desc,... |
657d2d7e5aaefd2ee3b543ab9eb03f4a91d26d37 | Lib/xml/__init__.py | Lib/xml/__init__.py | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parser -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Megginso... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | Add magic to replace the xml package with _xmlplus at import time. Update docstring to reflect change of name for the parsers subpackage. | Add magic to replace the xml package with _xmlplus at import time.
Update docstring to reflect change of name for the parsers subpackage.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | ---
+++
@@ -5,9 +5,19 @@
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
-parser -- Python wrappers for XML parsers (currently only supports Expat).
+parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML... |
61f4d269e745a24209e1719049f25dab3e3171a0 | preconditions.py | preconditions.py | class PreconditionError (TypeError):
pass
def preconditions(*precs):
pass # stub.
| class PreconditionError (TypeError):
pass
def preconditions(*precs):
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate
| Implement a stub decorator factory. | Implement a stub decorator factory.
| Python | mit | nejucomo/preconditions | ---
+++
@@ -3,4 +3,8 @@
def preconditions(*precs):
- pass # stub.
+ def decorate(f):
+ def g(*a, **kw):
+ return f(*a, **kw)
+ return g
+ return decorate |
5e1ffdab41c322a9bcd466b34aabaa37ef08a6e2 | profiling_run.py | profiling_run.py | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 15:23:58 2015
@author: jensv
"""
import skin_core_scanner_simple as scss
reload(scss)
import equil_solver as es
reload(es)
import newcomb_simple as new
reload(new)
(lambda_a_mesh, k_a_mesh,
stability_maps) = scss.scan_lambda_k_space([0.01, 3.0, 25.], [0.01, 1.5, 25]... | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 15:23:58 2015
@author: jensv
"""
import skin_core_scanner_simple as scss
reload(scss)
import equil_solver as es
reload(es)
import newcomb_simple as new
reload(new)
(lambda_a_mesh, k_a_mesh,
stability_maps) = scss.scan_lambda_k_space([0.01, 3.0, 25.], [0.01, 1.5, 25]... | Make jacobian use more explicit. | Make jacobian use more explicit.
| Python | mit | jensv/fluxtubestability,jensv/fluxtubestability | ---
+++
@@ -18,4 +18,4 @@
transition_width_norm=0.033,
skin_width_norm=0.034,
method='lsoda',
- max_step=1E-2, nsteps=1000)
+ max_step=1E-2, nsteps=1000, use_jac=True) |
653e40e15bfbf5c24c990ecdf90c0e6deb6d5636 | test/macro_tests/test_macros.py | test/macro_tests/test_macros.py | #!/usr/bin/env python
import unittest
import os.path
from macropolo import MacroTestCase, JSONTestCaseLoader
from macropolo.environments import SheerEnvironment
class CFGovTestCase(SheerEnvironment, MacroTestCase):
"""
A MacroTestCase subclass for cfgov-refresh.
"""
def search_root(self):
""... | #!/usr/bin/env python
import unittest
import os.path
from macropolo import MacroTestCase, JSONTestCaseLoader
from macropolo.environments import SheerEnvironment
class CFGovTestCase(SheerEnvironment, MacroTestCase):
"""
A MacroTestCase subclass for cfgov-refresh.
"""
def search_root(self):
""... | Adjust macro tests to new template location | Adjust macro tests to new template location
| Python | cc0-1.0 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | ---
+++
@@ -23,7 +23,7 @@
os.path.dirname(__file__),
os.pardir,
os.pardir,
- 'cfgov/v1/jinja2/v1'))
+ 'cfgov/jinja2/v1'))
return templates
@@ -33,7 +33,7 @@
Return a list of subdirectory names that should not be searched
for t... |
845b9b9be9c5a7f0f4e214215854d2d3c05a11f3 | bfg9000/shell/__init__.py | bfg9000/shell/__init__.py | import os
import subprocess
from ..platform_name import platform_name
if platform_name() == 'windows':
from .windows import *
else:
from .posix import *
class shell_list(list):
"""A special subclass of list used to mark that this command line uses
special shell characters."""
pass
def execute(... | import os
import subprocess
from ..platform_name import platform_name
if platform_name() == 'windows':
from .windows import *
else:
from .posix import *
class shell_list(list):
"""A special subclass of list used to mark that this command line uses
special shell characters."""
pass
def execute(... | Fix closing /dev/null when executing in quiet mode | Fix closing /dev/null when executing in quiet mode
| Python | bsd-3-clause | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | ---
+++
@@ -20,10 +20,10 @@
if quiet:
stderr = open(os.devnull, 'wb')
try:
- return subprocess.check_output(
+ result = subprocess.check_output(
args, universal_newlines=True, shell=shell, env=env, stderr=stderr
)
- except:
+ finally:
if quiet:
... |
daaf58639148b220d6dcce13e054374a68f9b01a | testfixtures/tests/test_docs.py | testfixtures/tests/test_docs.py | # Copyright (c) 2009 Simplistix Ltd
#
# See license.txt for more details.
import unittest
from glob import glob
from os.path import dirname,join,pardir
from doctest import DocFileSuite,REPORT_NDIFF,ELLIPSIS
options = REPORT_NDIFF|ELLIPSIS
def test_suite():
return unittest.TestSuite((
DocFileSuite(
... | # Copyright (c) 2009 Simplistix Ltd
#
# See license.txt for more details.
from glob import glob
from manuel import doctest,codeblock
from manuel.testing import TestSuite
from os.path import dirname,join,pardir
from doctest import REPORT_NDIFF,ELLIPSIS
def test_suite():
m = doctest.Manuel(optionflags=REPORT_NDIFF... | Use Manuel instead of doctest. | Use Manuel instead of doctest.
| Python | mit | nebulans/testfixtures,Simplistix/testfixtures | ---
+++
@@ -2,19 +2,16 @@
#
# See license.txt for more details.
-import unittest
-
from glob import glob
+from manuel import doctest,codeblock
+from manuel.testing import TestSuite
from os.path import dirname,join,pardir
-from doctest import DocFileSuite,REPORT_NDIFF,ELLIPSIS
-
-options = REPORT_NDIFF|ELLIPSIS
... |
a8726f9acf3d2a1b0287046d0ffb5236892c6535 | tests/django_test_app/models.py | tests/django_test_app/models.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 Raphaël Barrois
from django.db import models
from semantic_version import django_fields as semver_fields
class VersionModel(models.Model):
version = semver_fields.VersionField(verbose_name='my version')
spec = semver_fields.SpecField(verbose_name='my spec')
... | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 Raphaël Barrois
try:
from django.db import models
django_loaded = True
except ImportError:
django_loaded = False
if django_loaded:
from semantic_version import django_fields as semver_fields
class VersionModel(models.Model):
version = se... | Fix test running when Django isn't available. | tests: Fix test running when Django isn't available.
| Python | bsd-2-clause | rbarrois/python-semanticversion,marcelometal/python-semanticversion,mhrivnak/python-semanticversion,pombredanne/python-semanticversion | ---
+++
@@ -1,21 +1,28 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 Raphaël Barrois
-from django.db import models
-from semantic_version import django_fields as semver_fields
+try:
+ from django.db import models
+ django_loaded = True
+except ImportError:
+ django_loaded = False
-class Versio... |
2a867ea42e5ebe978ed41ef166893cb4a0e86de2 | tests/multi_memory_mgmt_test.py | tests/multi_memory_mgmt_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
import gc
debug = False
class MultiMemoryMgmtTest(unittest.TestCase):
def test_opensocketfunction_collection(self):
self.check_callback(pycurl.M_SOCKETFUNCTION)
def test_seekfunction_collection(self):
... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
import gc
import flaky
debug = False
@flaky.flaky(max_runs=3)
class MultiMemoryMgmtTest(unittest.TestCase):
def test_opensocketfunction_collection(self):
self.check_callback(pycurl.M_SOCKETFUNCTION)
def tes... | Mark multi memory management test flaky | Mark multi memory management test flaky
| Python | lgpl-2.1 | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | ---
+++
@@ -5,9 +5,11 @@
import pycurl
import unittest
import gc
+import flaky
debug = False
+@flaky.flaky(max_runs=3)
class MultiMemoryMgmtTest(unittest.TestCase):
def test_opensocketfunction_collection(self):
self.check_callback(pycurl.M_SOCKETFUNCTION) |
b8c4d7aabcd07fcba443558a02cdcb38d32009df | pages/tests.py | pages/tests.py | from django.test import TestCase
from pages.models import *
from django.test.client import Client
class PagesTestCase(TestCase):
fixtures = ['tests.json']
def test_01_add_page(self):
"""
Test that the add admin page could be displayed via the admin
"""
c = Client()
c.l... | from django.test import TestCase
import settings
from pages.models import *
from django.test.client import Client
page_data = {'title':'test page', 'slug':'test-page', 'language':'en', 'sites':[1], 'status':1}
class PagesTestCase(TestCase):
fixtures = ['tests.json']
def test_01_add_page(self):
"""
... | Add a test for slug collision | Add a test for slug collision
git-svn-id: 54fea250f97f2a4e12c6f7a610b8f07cb4c107b4@320 439a9e5f-3f3e-0410-bc46-71226ad0111b
| Python | bsd-3-clause | pombredanne/django-page-cms-1,remik/django-page-cms,pombredanne/django-page-cms-1,oliciv/django-page-cms,oliciv/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms,oliciv/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,batiste/django-page-cms,batiste/django-page-cm... | ---
+++
@@ -1,10 +1,13 @@
from django.test import TestCase
-
+import settings
from pages.models import *
from django.test.client import Client
+page_data = {'title':'test page', 'slug':'test-page', 'language':'en', 'sites':[1], 'status':1}
+
class PagesTestCase(TestCase):
fixtures = ['tests.json']
+
... |
89c906fc0ff6490de07543292c6e1e738652e2ef | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Leonardo Zhou'
SITENAME = u'\u4e91\u7ffc\u56fe\u5357'
SITEURL = ''
TIMEZONE = 'Asia/Shanghai'
DEFAULT_LANG = u'zh'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = Non... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Leonardo Zhou'
SITENAME = u'\u4e91\u7ffc\u56fe\u5357'
SITEURL = ''
TIMEZONE = 'Asia/Shanghai'
DEFAULT_LANG = u'zh'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = Non... | Change custom theme settings and url pattern | Change custom theme settings and url pattern
| Python | cc0-1.0 | glasslion/zha,glasslion/zha-beta,glasslion/zha,glasslion/zha-beta,glasslion/zha-beta,glasslion/zha | ---
+++
@@ -32,3 +32,8 @@
STATIC_PATHS = ['images', 'extra/CNAME']
EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'},}
+
+THEME = 'themes/BT3-Flat-4zha'
+
+ARTICLE_URL = '{slug}/'
+ARTICLE_SAVE_AS = '{slug}/index.html' |
0ac40dd99823ccff795361c9e0f49409d9d4d95e | bpython/test/test_keys.py | bpython/test/test_keys.py | #!/usr/bin/env python
import unittest
import bpython.keys as keys
class TestKeys(unittest.TestCase):
def test_keymap_map(self):
"""Verify KeyMap.map being a dictionary with the correct length."""
self.assertEqual(len(keys.key_dispatch.map), 43)
def test_keymap_setitem(self):
"""Verify ... | #!/usr/bin/env python
import unittest
import bpython.keys as keys
class TestKeys(unittest.TestCase):
def test_keymap_getitem(self):
"""Verify keys.KeyMap correctly looking up items."""
self.assertEqual(keys.key_dispatch['C-['], (chr(27), '^['))
self.assertEqual(keys.key_dispatch['F11'], ('K... | Add __delitem__, and dict length checking to tests for keys | Add __delitem__, and dict length checking to tests for keys
| Python | mit | myint-archive/bpython,hirochachacha/apython,thomasballinger/old-bpython-with-hy-support | ---
+++
@@ -3,22 +3,6 @@
import bpython.keys as keys
class TestKeys(unittest.TestCase):
- def test_keymap_map(self):
- """Verify KeyMap.map being a dictionary with the correct length."""
- self.assertEqual(len(keys.key_dispatch.map), 43)
-
- def test_keymap_setitem(self):
- """Verify ke... |
aedd144895d6ff6da0766d935cd0221985fccca8 | kaf2html.py | kaf2html.py | """Script to generate an HTML page from a KAF file that shows the text contents
including line numbers.
"""
from bs4 import BeautifulSoup
with open('data/minnenijd.kaf') as f:
xml_doc = BeautifulSoup(f)
output_html = ['<html><head>',
'<meta http-equiv="Content-Type" content="text/html; '
... | """Script to generate an HTML page from a KAF file that shows the text contents
including line numbers.
"""
from bs4 import BeautifulSoup
import sys
xml_doc = None
if len(sys.argv) < 2:
print 'Please provide a kaf input file.'
print 'Usage: python kaf2html.py <kaf input>'
s... | Read kaf input from command line argument | Read kaf input from command line argument
The kaf input file used in the script is read from the command line.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | ---
+++
@@ -2,10 +2,18 @@
including line numbers.
"""
from bs4 import BeautifulSoup
+import sys
-with open('data/minnenijd.kaf') as f:
- xml_doc = BeautifulSoup(f)
+xml_doc = None
+
+if len(sys.argv) < 2:
+ print 'Please provide a kaf input file.'
+ print 'Usage: python kaf2html.py <kaf input>' ... |
6661c7afe060e21b29483cb01d30473211cef830 | timepiece/urls.py | timepiece/urls.py | from django.core.urlresolvers import reverse
from django.http import HttpResponsePermanentRedirect
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Redirect the base URL to the dashboard.
url(r'^$', lambda r: HttpResponsePermanentRedirect(reverse('dashboard'))),
url('', i... | from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
urlpatterns = patterns('',
# Redirect the base URL to the dashboard.
url(r'^$', RedirectView.as_view(url=reverse_lazy('dashboard')),
url('', include('timepie... | Use generic RedirectView rather than lambda function | Use generic RedirectView rather than lambda function
| Python | mit | dannybrowne86/django-timepiece,caktus/django-timepiece,josesanch/django-timepiece,caktus/django-timepiece,dannybrowne86/django-timepiece,gaga3966/django-timepiece,arbitrahj/django-timepiece,arbitrahj/django-timepiece,gaga3966/django-timepiece,josesanch/django-timepiece,arbitrahj/django-timepiece,BocuStudio/django-timep... | ---
+++
@@ -1,12 +1,11 @@
-from django.core.urlresolvers import reverse
-from django.http import HttpResponsePermanentRedirect
-
from django.conf.urls import patterns, include, url
+from django.core.urlresolvers import reverse_lazy
+from django.views.generic import RedirectView
urlpatterns = patterns('',
#... |
995d0067dd1bd1823e3a7cb4fbc8e4ad1bf8208c | registration/__init__.py | registration/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# TODO: When Python 2.7 is released this becomes a try/except falling
# back to Django's implementation.
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backe... | Add reminder to myself to to importlib fallback. | Add reminder to myself to to importlib fallback.
| Python | bsd-3-clause | bruth/django-registration2,ogirardot/django-registration,wuyuntao/django-registration,danielsokolowski/django-registration,andresdouglas/django-registration,stefankoegl/django-registration-couchdb,stefankoegl/django-couchdb-utils,schmidsi/django-registration,wuyuntao/django-registration,stefankoegl/django-registration-... | ---
+++
@@ -1,5 +1,8 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
+
+# TODO: When Python 2.7 is released this becomes a try/except falling
+# back to Django's implementation.
from django.utils.importlib import import_module
def get_backend(): |
6eacc0a0736edc410c011003986831b5f58da03e | tests/command_test.py | tests/command_test.py | import os, sys
import unittest
class SqliteTest(unittest.TestCase):
TESTING_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testing_dir'))
def test_command(self):
command = 'diary generate sqlite %s/log.sqlite3' % self.TESTING_DIR
os.system(command)
self.assertTrue(os.... | import os, sys
import unittest
class SqliteTest(unittest.TestCase):
TESTING_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testing_dir'))
def test_command(self):
command = 'diary generate sqlite %s/log.sqlite3' % self.TESTING_DIR
os.system(command)
self.assertTrue(os.... | Add test for odd extension to diary command | Add test for odd extension to diary command
| Python | mit | GreenVars/diary | ---
+++
@@ -25,6 +25,12 @@
self.assertTrue(os.path.exists(target_path))
os.remove(target_path)
+ def test_command_weird_extension(self):
+ command = 'diary generate sqlite mylog.diary.log'
+ os.system(command)
+ target_path = os.path.join(os.getcwd(), 'mylog.diary.log')
+ ... |
abef969505fc5cb30367a4c16c7daf1205c1c2aa | tests/test_twisted.py | tests/test_twisted.py | from __future__ import absolute_import, unicode_literals
from unittest import skipUnless
from prometheus_client import Counter
from prometheus_client import CollectorRegistry, generate_latest
try:
from prometheus_client.twisted import MetricsResource
from twisted.trial.unittest import TestCase
from twis... | from __future__ import absolute_import, unicode_literals
from unittest import skipUnless
from prometheus_client import Counter
from prometheus_client import CollectorRegistry, generate_latest
try:
from prometheus_client.twisted import MetricsResource
from twisted.trial.unittest import TestCase
from twis... | Make tests pass on python3 | Make tests pass on python3
| Python | apache-2.0 | thomaso-mirodin/client_python,prometheus/client_python | ---
+++
@@ -39,7 +39,7 @@
agent = Agent(reactor)
port = server.getHost().port
- url = u"http://localhost:{port}/metrics".format(port=port)
+ url = "http://localhost:{port}/metrics".format(port=port)
d = agent.request(b"GET", url.encode("ascii"))
d.addCallback(read... |
55a6d1204543b9fea3b955f39722779d153c3752 | update_checker_app/__init__.py | update_checker_app/__init__.py | #!/usr/bin/env python
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
__version__ = '0.1'
DB_URI = 'postgresql://@/updatechecker'
APP = Flask(__name__)
APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI
APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(APP)
# Delay these imports u... | #!/usr/bin/env python
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from os import getenv
__version__ = '0.1'
DB_URI = 'postgresql://@/updatechecker'
APP = Flask(__name__)
APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI
APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
APP.debug = getenv('DEB... | Enable debugging based on environment variable. | Enable debugging based on environment variable.
| Python | bsd-2-clause | bboe/update_checker_app | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
+from os import getenv
__version__ = '0.1'
@@ -9,6 +10,7 @@
APP = Flask(__name__)
APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI
APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
+APP.debug ... |
f2ecbe9020746a00c9f68918697a45b7f68e23fa | utils/tests/test_math_utils.py | utils/tests/test_math_utils.py | import numpy as np
from nose2 import tools
import utils
@tools.params(((1000, 25), 10, 0),
((1000, 25), 10, 1),
((1000, 25), 77, 0)
)
def test_online_statistics(shape, batch_size, axis):
online_stats = utils.OnlineStatistics(axis=axis)
X = np.random.random(shape)
... | import numpy as np
from nose2 import tools
import utils
@tools.params(((1000, 25), 10, 0),
((1000, 25), 10, 1),
((1000, 25), 77, 0),
((1000, 1, 2, 3), 10, (0, 3))
)
def test_online_statistics(shape, batch_size, axis):
online_stats = utils.OnlineStatistics(ax... | Add test case for OnlineStatistics where axis is a tuple | Add test case for OnlineStatistics where axis is a tuple
| Python | mit | alexlee-gk/visual_dynamics | ---
+++
@@ -5,12 +5,16 @@
@tools.params(((1000, 25), 10, 0),
((1000, 25), 10, 1),
- ((1000, 25), 77, 0)
+ ((1000, 25), 77, 0),
+ ((1000, 1, 2, 3), 10, (0, 3))
)
def test_online_statistics(shape, batch_size, axis):
online_stats = utils.Onlin... |
3814a07c44c7d97a2ca4aa0f2741a913149d4acd | support/update-converity-branch.py | support/update-converity-branch.py | #!/usr/bin/env python
# Update the coverity branch from the master branch.
# It is not done automatically because Coverity Scan limits
# the number of submissions per day.
from __future__ import print_function
import shutil, tempfile
from subprocess import check_call
class Git:
def __init__(self, dir):
self.dir... | #!/usr/bin/env python
# Update the coverity branch from the master branch.
# It is not done automatically because Coverity Scan limits
# the number of submissions per day.
from __future__ import print_function
import shutil, tempfile
from subprocess import check_output, STDOUT
class Git:
def __init__(self, dir):
... | Handle fast forward in update-coverity-branch.py | Handle fast forward in update-coverity-branch.py | Python | bsd-2-clause | lightslife/cppformat,alabuzhev/fmt,mojoBrendan/fmt,dean0x7d/cppformat,Jopie64/cppformat,alabuzhev/fmt,cppformat/cppformat,alabuzhev/fmt,mojoBrendan/fmt,cppformat/cppformat,lightslife/cppformat,cppformat/cppformat,dean0x7d/cppformat,lightslife/cppformat,dean0x7d/cppformat,mojoBrendan/fmt,Jopie64/cppformat,Jopie64/cppfor... | ---
+++
@@ -5,23 +5,26 @@
from __future__ import print_function
import shutil, tempfile
-from subprocess import check_call
+from subprocess import check_output, STDOUT
class Git:
def __init__(self, dir):
self.dir = dir
def __call__(self, *args):
- check_call(['git'] + list(args), cwd=self.dir)
... |
1c5cd470002b256677f9dc0a7c25c141880cd916 | leonardo/widgets/__init__.py | leonardo/widgets/__init__.py |
from leonardo.module.nav.mixins import NavigationWidgetMixin
from leonardo.module.nav.models import NavigationWidget
from leonardo.module.web.models import ListWidget, Widget
from leonardo.module.web.widgets.mixins import (AuthContentProxyWidgetMixin,
ContentProxyWidgetM... |
from leonardo.module.nav.mixins import NavigationWidgetMixin
from leonardo.module.nav.models import NavigationWidget
from leonardo.module.web.models import ListWidget, Widget
from leonardo.module.web.widgets.mixins import (AuthContentProxyWidgetMixin,
ContentProxyWidgetM... | Include get htmltext widget in widgets module. | Include get htmltext widget in widgets module.
| Python | bsd-3-clause | django-leonardo/django-leonardo,django-leonardo/django-leonardo,django-leonardo/django-leonardo,django-leonardo/django-leonardo | ---
+++
@@ -7,6 +7,9 @@
JSONContentMixin,
ListWidgetMixin)
+from leonardo.utils.widgets import get_htmltext_widget
+
__all__ = ('Widget', 'ListWidgetMixin', 'ContentProxyWidgetMixin',
'JSONContentMixin', '... |
ffff57041cf8d2a13a941a8f0e39d92fe082f28a | welt2000/__init__.py | welt2000/__init__.py | from flask import Flask, request, session
from flask.ext.babel import Babel
from welt2000.__about__ import (
__title__, __summary__, __uri__, __version__, __author__, __email__,
__license__,
) # noqa
app = Flask(__name__)
app.secret_key = '1234567890'
babel = Babel(app)
translations = ['en']
translations.... | from flask import Flask, request, session
from flask.ext.babel import Babel
from babel.core import negotiate_locale
from welt2000.__about__ import (
__title__, __summary__, __uri__, __version__, __author__, __email__,
__license__,
) # noqa
app = Flask(__name__)
app.secret_key = '1234567890'
babel = Babel(a... | Use babel.negotiate_locale() instead of best_match() | app: Use babel.negotiate_locale() instead of best_match()
The babel version takes care of handling territory codes etc.
| Python | mit | Turbo87/welt2000,Turbo87/welt2000 | ---
+++
@@ -1,5 +1,6 @@
from flask import Flask, request, session
from flask.ext.babel import Babel
+from babel.core import negotiate_locale
from welt2000.__about__ import (
__title__, __summary__, __uri__, __version__, __author__, __email__,
@@ -23,7 +24,8 @@
if lang and lang in translations:
... |
ef91f18f7fce637643ad58351b96e13c37eb8925 | traits/qt/__init__.py | traits/qt/__init__.py | #------------------------------------------------------------------------------
# Copyright (c) 2010, Enthought Inc
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
#
# Author: Enthought Inc
# Description: Qt API selector. Can be used to switch between pyQt and ... | #------------------------------------------------------------------------------
# Copyright (c) 2010, Enthought Inc
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
#
# Author: Enthought Inc
# Description: Qt API selector. Can be used to switch between pyQt and ... | Fix bug in the PyQt4 binding selection logic. | Fix bug in the PyQt4 binding selection logic.
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | ---
+++
@@ -11,23 +11,28 @@
import os
+def prepare_pyqt4():
+ # Set PySide compatible APIs.
+ import sip
+ sip.setapi('QString', 2)
+ sip.setapi('QVariant', 2)
+
qt_api = os.environ.get('QT_API')
+
if qt_api is None:
try:
import PySide
qt_api = 'pyside'
except ImportErro... |
9b020b87cede9dc2014c86946b3fa9bfedbd0577 | tests/rules_tests/FromSymbolComputeTest.py | tests/rules_tests/FromSymbolComputeTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class Simple(Rule):
fromSymbol = 0
toSymbol = 1
class FromSymbolComputeTest(TestCase):
def test_rules_simple(self):
r = Si... | Add tests of converting from symbol to rest of rule's property | Add tests of converting from symbol to rest of rule's property
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -11,8 +11,29 @@
from grammpy import Rule
+class Simple(Rule):
+ fromSymbol = 0
+ toSymbol = 1
+
+
class FromSymbolComputeTest(TestCase):
- pass
+ def test_rules_simple(self):
+ r = Simple.rules
+ self.assertIsInstance(r, list)
+ self.assertEqual(len(r), 1)
+ se... |
d44010acc32fcb78570cd34478d0f4e8f1cfa979 | utility/dbproc.py | utility/dbproc.py | from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
import discord
import asyncio
class Baydb:
engine = create_engine('sqlite:///bayohwoolph.db')
Base.metadata.bind = engine
DBSession = sessionma... | from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
from config import Config
import discord
import asyncio
class Baydb:
engine = create_engine(Config.MAIN['dbpath'])
Base.metadata.bind = engine
... | Move another usage of DB into ini file thing. | Move another usage of DB into ini file thing.
| Python | agpl-3.0 | dark-echo/Bay-Oh-Woolph,freiheit/Bay-Oh-Woolph | ---
+++
@@ -3,13 +3,14 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
+from config import Config
import discord
import asyncio
class Baydb:
- engine = create_engine('sqlite:///bayohwoolph.db')
+ engine = create_engine(Config.MAIN['dbpa... |
bb1722d4ac346823551c65861a8ac58f77dca2d0 | setup.py | setup.py | from setuptools import setup
import numpy
from numpy.distutils.core import Extension
import railgun
from railgun import __author__, __version__, __license__
setup(
name='railgun',
version=__version__,
packages=['railgun'],
description=('ctypes utilities for faster and easier '
'simulat... | from setuptools import setup
import numpy
from numpy.distutils.core import Extension
import railgun
from railgun import __author__, __version__, __license__
setup(
name='railgun',
version=__version__,
packages=['railgun'],
description=('ctypes utilities for faster and easier '
'simulat... | Change "Development Status" to beta | Change "Development Status" to beta
| Python | mit | tkf/railgun,tkf/railgun | ---
+++
@@ -17,7 +17,7 @@
keywords='numerical simulation, research, ctypes, numpy, c',
license=__license__,
classifiers=[
- "Development Status :: 3 - Alpha",
+ "Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
... |
65e72a7688d6382bd07896cc8c86914277fca422 | setup.py | setup.py | import setuptools
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='... | import setuptools
from io import open
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar'... | Use io framework from python 3.0 to fix build on python 2.7 | Use io framework from python 3.0 to fix build on python 2.7
| Python | unlicense | michael-lazar/mailcap_fix | ---
+++
@@ -1,4 +1,5 @@
import setuptools
+from io import open
setuptools.setup(
name='mailcap-fix', |
7660b601d068652487cc97a704ae54acc33c6889 | setup.py | setup.py | from distutils.core import setup
setup(name='hermes-gui',
version='0.1',
packages=[
'acme',
'acme.acmelab',
'acme.core',
'acme.core.views',
],
package_data={
'acme.acmelab': ['images/*'],
'acme.core': ['images/*.png'],
}
... | from distutils.core import setup
setup(name='hermes-gui',
version='0.1',
packages=[
'acme',
'acme.acmelab',
'acme.core',
'acme.core.views',
],
package_data={
'acme.acmelab': ['images/*'],
'acme.core': ['images/*.png'],
},
... | Install the hermes-gui.py executable too | Install the hermes-gui.py executable too
| Python | bsd-3-clause | certik/hermes-gui | ---
+++
@@ -10,5 +10,6 @@
package_data={
'acme.acmelab': ['images/*'],
'acme.core': ['images/*.png'],
- }
+ },
+ scripts = ['hermes-gui.py'],
) |
01d3027e568bcd191e7e25337c6597eb75b82789 | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name='todoman',
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
url='https://github.com/pimutils/todoman',
license='MIT',
packages=['todoman'],
entry_points={
... | #!/usr/bin/env python3
from setuptools import setup
setup(
name='todoman',
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
url='https://github.com/pimutils/todoman',
license='MIT',
packages=['todoman'],
entry_points={
... | Add classifiers for supported python versions | Add classifiers for supported python versions
| Python | isc | Sakshisaraswat/todoman,AnubhaAgrawal/todoman,hobarrera/todoman,pimutils/todoman,asalminen/todoman,rimshaakhan/todoman | ---
+++
@@ -31,6 +31,11 @@
'Environment :: Console :: Curses',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ ... |
425de8b01ccaef3aa7b6ac988158609fa237e96b | setup.py | setup.py | from setuptools import setup, find_packages
setup(
version='0.43',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research',
author='DV Klopfenstein',
author_email='music_pupil@yahoo.com',
scripts=['./pydvkbiology/NCBI/cols.py'],... | from setuptools import setup, find_packages
setup(
version='0.44',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research',
author='DV Klopfenstein',
author_email='music_pupil@yahoo.com',
scripts=['./pydvkbiology/NCBI/cols.py'],... | Put latest additions in package. | Put latest additions in package.
| Python | mit | dvklopfenstein/biocode | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(
- version='0.43',
+ version='0.44',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research', |
8e5e2dcd6e2743667cbcfb3284b6b01aa6606220 | setup.py | setup.py | from setuptools import setup
setup(name='pyramid_uniform',
version='0.2',
description='Form handling for Pyramid.',
long_description='',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python ... | from setuptools import setup, find_packages
setup(name='pyramid_uniform',
version='0.2',
description='Form handling for Pyramid.',
long_description='',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: MIT License',
'Programming Lang... | Use find_packages() instead of manually specifying package name, so that subpackages get included | Use find_packages() instead of manually specifying package name, so that subpackages get included
| Python | mit | storborg/pyramid_uniform | ---
+++
@@ -1,4 +1,4 @@
-from setuptools import setup
+from setuptools import setup, find_packages
setup(name='pyramid_uniform',
@@ -29,7 +29,7 @@
'nose-cover3',
],
license='MIT',
- packages=['pyramid_uniform'],
+ packages=find_packages(),
test_suite='nose.collector',
... |
37f137003d1b6e9f7361db38e0de109e0327fc42 | setup.py | setup.py | from setuptools import setup, find_packages
__version__ = "0.0.1"
description = "A buildout recipe to create .deb packages"
setup(
name='vdt.recipe.debian',
version=__version__,
description=description,
long_description=description,
classifiers=[
"Framework :: Buildout",
"Program... | from setuptools import setup, find_packages
__version__ = "0.0.1"
description = "A buildout recipe to create .deb packages"
setup(
name='vdt.recipe.debian',
version=__version__,
description=description,
long_description=description,
classifiers=[
"Framework :: Buildout",
"Program... | Remove dependency as plugin is configurable | Remove dependency as plugin is configurable
| Python | bsd-3-clause | devopsconsulting/vdt.recipe.version | ---
+++
@@ -32,7 +32,6 @@
install_requires=[
'setuptools',
'zc.buildout',
- 'vdt.versionplugin.buildout>=0.0.2'
],
# mark test target to require extras.
extras_require={ |
5de287f0b4dbe19ccb46048a4c1b4f792835ec42 | setup.py | setup.py | #!/usr/bin/evn python2
from setuptools import setup, find_packages
setup(name='pprof',
version='0.9.6',
packages=find_packages(),
install_requires=["SQLAlchemy==1.0.4", "cloud==2.8.5", "plumbum==1.4.2",
"regex==2015.5.28", "wheel==0.24.0", "parse==1.6.6",
... | #!/usr/bin/evn python2
from setuptools import setup, find_packages
setup(name='pprof',
version='0.9.6',
packages=find_packages(),
install_requires=["SQLAlchemy==1.0.4", "cloud==2.8.5", "plumbum==1.4.2",
"regex==2015.5.28", "wheel==0.24.0", "parse==1.6.6",
... | Add pyscopg2 to list of dependencies | Add pyscopg2 to list of dependencies
| Python | mit | simbuerg/benchbuild,simbuerg/benchbuild | ---
+++
@@ -6,7 +6,8 @@
packages=find_packages(),
install_requires=["SQLAlchemy==1.0.4", "cloud==2.8.5", "plumbum==1.4.2",
"regex==2015.5.28", "wheel==0.24.0", "parse==1.6.6",
- "virtualenv==13.1.0", "sphinxcontrib-napoleon"],
+ "vir... |
247a42a9839f03f01fb3228505798dffc0659ac9 | setup.py | setup.py | #!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import io
import setuptools
with io.open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
with io.open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + changes.read()... | #!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import io
import sys
import setuptools
with io.open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
with io.open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + cha... | Make pytest-runner and sphinx optionlly required. | Make pytest-runner and sphinx optionlly required.
| Python | mit | jaraco/jaraco.functools | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import io
+import sys
import setuptools
@@ -8,6 +9,11 @@
long_description = readme.read()
with io.open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + change... |
8e194b9598f71a5005601d64b82c563827f14351 | setup.py | setup.py | from __future__ import absolute_import
from setuptools import setup
import json
import version_handling
version = "v%s.%s.%s" % version_handling.get_version()
long_description="""TravisCI results
.. image:: https://travis-ci.org/nanonyme/simplecpreprocessor.svg?tag=v%s
""" ... | from __future__ import absolute_import
from setuptools import setup
import json
import version_handling
version = "%s.%s.%s" % version_handling.get_version()
long_description="""TravisCI results
.. image:: https://travis-ci.org/nanonyme/simplecpreprocessor.svg?tag=v%s
""" %... | Remove the leading v from format | Remove the leading v from format
| Python | mit | nanonyme/simplecpreprocessor | ---
+++
@@ -3,7 +3,7 @@
import json
import version_handling
-version = "v%s.%s.%s" % version_handling.get_version()
+version = "%s.%s.%s" % version_handling.get_version()
long_description="""TravisCI results
.. image:: https://travis-ci.org/nanonyme/simplecpreproces... |
68e6cad67a7b18c28377899bca1716f5e64d3d6f | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "countries",
version = "0.1.1-1",
description = 'Provides models for a "complete" list of countries',
author = 'David Danier',
author_email = 'david.danier@team23.de',
url = 'https://github.com/ddanier/django_countries',
long_descrip... | from setuptools import setup, find_packages
setup(
name = "countries",
version = "0.1.1-2",
description = 'Provides models for a "complete" list of countries',
author = 'David Danier',
author_email = 'david.danier@team23.de',
url = 'https://github.com/ddanier/django_countries',
long_descrip... | Include migrations in package data | Include migrations in package data
| Python | bsd-3-clause | team23/django_countries | ---
+++
@@ -2,7 +2,7 @@
setup(
name = "countries",
- version = "0.1.1-1",
+ version = "0.1.1-2",
description = 'Provides models for a "complete" list of countries',
author = 'David Danier',
author_email = 'david.danier@team23.de',
@@ -14,6 +14,7 @@
'countries.management.commands'... |
95af1be2d31685eca899549fe9656b137cedcf96 | setup.py | setup.py | from setuptools import setup, find_packages
import os
version = __import__('cms_themes').__version__
install_requires = [
'setuptools',
'django',
'django-cms',
]
setup(
name = "django-cms-themes",
version = version,
url = 'http://github.com/megamark16/django-cms-themes',
license = 'BSD',
... | #!/usr/bin/env python2
from setuptools import setup, find_packages
import os
version = __import__('cms_themes').__version__
install_requires = [
'setuptools',
'django',
'django-cms',
]
setup(
name = "django-cms-themes",
version = version,
url = 'http://github.com/megamark16/django-cms-themes'... | Set python2 explicitly as interpreter | Set python2 explicitly as interpreter
| Python | bsd-3-clause | MegaMark16/django-cms-themes | ---
+++
@@ -1,3 +1,4 @@
+#!/usr/bin/env python2
from setuptools import setup, find_packages
import os
|
f6cede5524061faee8ae0f4c0f7dd3ef8c05a0a7 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'pybit',
'jsonpickle',
'requests',
]
test_requirements = []
# These requirements are specifically for the l... | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'requests',
# PyBit and dependencies
'pybit',
# 'psycopg2',
# 'amqplib',
'jsonpickle',
]
test_r... | Put in the necessary pybit dependenies | Put in the necessary pybit dependenies
| Python | agpl-3.0 | Connexions/roadrunners,Connexions/roadrunners | ---
+++
@@ -6,9 +6,12 @@
README = os.path.join(here, 'README.rst')
install_requirements = [
+ 'requests',
+ # PyBit and dependencies
'pybit',
+ # 'psycopg2',
+ # 'amqplib',
'jsonpickle',
- 'requests',
]
test_requirements = []
# These requirements are specifically for the legacy mod... |
08563ac150e6264ca3f57d720bc204998863fbb1 | setup.py | setup.py | import os, sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def main():
setup(
name='stcrestclient',
version= '1.8.3',
author='Andrew Gillis',
author_email='andrew.gillis@spirent.com',
url='https://github.com/Spirent/py-stcr... | import os, sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def main():
setup(
name='stcrestclient',
version= '1.8.3',
author='Andrew Gillis',
author_email='support@spirent.com',
url='https://github.com/Spirent/py-stcrestcli... | Update author email to Spirent support. | Update author email to Spirent support.
| Python | mit | Spirent/py-stcrestclient | ---
+++
@@ -10,7 +10,7 @@
name='stcrestclient',
version= '1.8.3',
author='Andrew Gillis',
- author_email='andrew.gillis@spirent.com',
+ author_email='support@spirent.com',
url='https://github.com/Spirent/py-stcrestclient',
description='stcrestclient: Client m... |
0d3553c38117d0f410d38a5f34510e8a87db10bd | setup.py | setup.py | #!/usr/bin/env python
"""A custom GeoKey extension for WeGovNow functionality."""
from os.path import join
from setuptools import setup, find_packages
name = 'geokey-wegovnow'
version = __import__(name.replace('-', '_')).__version__
repository = join('https://github.com/ExCiteS', name)
setup(
name=name,
ve... | #!/usr/bin/env python
"""A custom GeoKey extension for WeGovNow functionality."""
from os.path import join
from setuptools import setup, find_packages
name = 'geokey-wegovnow'
version = __import__(name.replace('-', '_')).__version__
repository = join('https://github.com/ExCiteS', name)
setup(
name=name,
ve... | Remove extra requirements from install. | Remove extra requirements from install.
| Python | mit | ExCiteS/geokey-wegovnow,ExCiteS/geokey-wegovnow | ---
+++
@@ -21,5 +21,5 @@
license='MIT',
packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*']),
include_package_data=True,
- install_requires=['django-material==0.10.0', 'geokey', 'django-allauth', 'django', 'requests'],
+ install_requires=['django-material==0.10.0'],
) |
2683d93184b8f7b82ce0651c900f3c8b830af33b | setup.py | setup.py | import sys
from setuptools import setup
setup_requires = ['setuptools_scm']
if sys.argv[-1] in ('sdist', 'bdist_wheel'):
setup_requires.append('setuptools-markdown')
setup(
name='tldr',
author='Felix Yan',
author_email='felixonmars@gmail.com',
url='https://github.com/tldr-pages/tldr-python-client'... | import sys
from setuptools import setup
setup_requires = ['setuptools_scm']
if sys.argv[-1] in ('sdist', 'bdist_wheel'):
setup_requires.append('setuptools-markdown')
setup(
name='tldr',
author='Felix Yan',
author_email='felixonmars@gmail.com',
url='https://github.com/tldr-pages/tldr-python-client'... | Add python 3.6 to support array | Add python 3.6 to support array
| Python | mit | tldr-pages/tldr-python-client | ---
+++
@@ -37,6 +37,7 @@
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
"Topic :: Utilities",
"Topic :: System"
] |
eca14d9db21a6cdfdb47261af1a29f6fc294825a | accounts/backends.py | accounts/backends.py | """Custom authentication backends"""
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class SmarterModelBackend(ModelBackend):
"""Authentication backend that is less moronic that the default Django one"""
def authenticate(self, request, username=None, passw... | """Custom authentication backends"""
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
LOGGER = logging.getLogger(__name__)
class SmarterModelBackend(ModelBackend):
"""Authentication backend that is less moronic that the default Django one"""
... | Add a case sensitive login for duplicate usernames | Add a case sensitive login for duplicate usernames
| Python | agpl-3.0 | lutris/website,lutris/website,lutris/website,lutris/website | ---
+++
@@ -1,6 +1,9 @@
"""Custom authentication backends"""
+import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
+
+LOGGER = logging.getLogger(__name__)
class SmarterModelBackend(ModelBackend):
@@ -20,6 +23,24 @@
# Run the default p... |
07806b972dd1bc308e1c7b032b78c7dd8db8810b | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
src_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(src_dir, 'README.txt')) as f:
long_description = f.read()
setup(
name='PyENScript',
version='0.1.0',
description='A Python wrapper for the Evernote ENScript.exe... | # -*- coding: utf-8 -*-
import os
import subprocess
from setuptools import setup
src_dir = os.path.abspath(os.path.dirname(__file__))
try:
# Try to get the latest version string dynamically from git:
# (latest version, commits since latest release, and commit SHA-1)
git_args = ['git', '--work-tree', sr... | Read version number from 'git describe' if available | Read version number from 'git describe' if available
| Python | apache-2.0 | yasserglez/pyenscript | ---
+++
@@ -1,30 +1,42 @@
# -*- coding: utf-8 -*-
import os
+import subprocess
from setuptools import setup
src_dir = os.path.abspath(os.path.dirname(__file__))
+
+try:
+ # Try to get the latest version string dynamically from git:
+ # (latest version, commits since latest release, and commit SHA-1)... |
8026b40fe57f699b3c49bbc95753ab1c54cb35e8 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='pytest-mypy',
version='0.2.0',
author='Daniel Bader'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='pytest-mypy',
version='0.2.0',
author='Daniel Bader'... | Update dependency from mypy-lang to mypy | Update dependency from mypy-lang to mypy
| Python | mit | dbader/pytest-mypy | ---
+++
@@ -23,7 +23,7 @@
description='Mypy static type checker plugin for Pytest',
long_description=read('README.rst'),
py_modules=['pytest_mypy'],
- install_requires=['pytest>=2.9.2', 'mypy-lang>=0.4.5'],
+ install_requires=['pytest>=2.9.2', 'mypy>=0.470'],
classifiers=[
'Developm... |
684bf371bca1a7443e0f77a0f22b2f1ab5d5b4b4 | setup.py | setup.py | from __future__ import absolute_import
import subprocess
from setuptools import setup
try:
pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'],
stdout=subprocess.PIPE)
readme = str(pandoc.communicate()[0])
except OSError:
with open('README.md') as f:
re... | from __future__ import absolute_import
import subprocess
from setuptools import setup
try:
pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'],
stdout=subprocess.PIPE)
readme = str(pandoc.communicate()[0])
except OSError:
with open('README.md') as f:
re... | Add 'six' to the install requirements | Add 'six' to the install requirements
| Python | bsd-2-clause | michhar/notedown,aaren/notedown,michhar/notedown,lgautier/notedown,lgautier/notedown,aaren/notedown | ---
+++
@@ -23,7 +23,7 @@
author_email='dev@aaren.me',
license='BSD 2-Clause',
url='http://github.com/aaren/notedown',
- install_requires=['ipython[nbconvert] >= 3.0', 'pandoc-attributes'],
+ install_requires=['ipython[nbconvert] >= 3.0', 'pandoc-attributes', 'six'],
entry_points={'console_s... |
6c75574504489ddd26b236db0ce7246c545db14c | setup.py | setup.py | from setuptools import setup
setup(
name='twitter-text-py',
version='1.0.3',
description='A library for auto-converting URLs, mentions, hashtags, lists, etc. in Twitter text. Also does tweet validation and search term highlighting.',
author='Daniel Ryan',
author_email='dryan@dryan.com',
url='h... | from setuptools import setup, find_packages
setup(
name='twitter-text-py',
version='1.0.3',
description='A library for auto-converting URLs, mentions, hashtags, lists, etc. in Twitter text. Also does tweet validation and search term highlighting.',
author='Daniel Ryan',
author_email='dryan@dryan.c... | Use find_packages to ensure template library gets installed | Use find_packages to ensure template library gets installed
| Python | apache-2.0 | joebos/twitter-text-py,joebos/twitter-text-py,joebos/twitter-text-py,joebos/twitter-text-py,joebos/twitter-text-py,joebos/twitter-text-py | ---
+++
@@ -1,4 +1,4 @@
-from setuptools import setup
+from setuptools import setup, find_packages
setup(
name='twitter-text-py',
@@ -7,7 +7,7 @@
author='Daniel Ryan',
author_email='dryan@dryan.com',
url='http://github.com/dryan/twitter-text-py',
- packages=['twitter_text'],
+ packages=f... |
495a117cd122ce0d22b7c603eaf2bbdef3df0df9 | setup.py | setup.py | """
Package configuration file
"""
from setuptools import setup
setup(
name='pylint-mccabe',
version='0.1.2',
author='Infoxchange Australia dev team',
author_email='devs@infoxchange.net.au',
py_modules=['pylint_mccabe'],
url='http://pypi.python.org/pypi/pylint-mccabe/',
license='MIT',
d... | """
Package configuration file
"""
from setuptools import setup
setup(
name='pylint-mccabe',
version='0.1.3',
author='Infoxchange Australia dev team',
author_email='devs@infoxchange.net.au',
py_modules=['pylint_mccabe'],
url='http://pypi.python.org/pypi/pylint-mccabe/',
license='MIT',
d... | Bump the version, update dependencies | Bump the version, update dependencies | Python | mit | infoxchange/pylint-mccabe | ---
+++
@@ -5,7 +5,7 @@
setup(
name='pylint-mccabe',
- version='0.1.2',
+ version='0.1.3',
author='Infoxchange Australia dev team',
author_email='devs@infoxchange.net.au',
py_modules=['pylint_mccabe'],
@@ -15,7 +15,7 @@
long_description=open('README.rst').read(),
install_require... |
dda39cf93fdbd9e40becfc82bb4e1e49e08c44f3 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
import lithium
packages = ['lithium',]
core = ['conf', 'views',]
apps = ['blog', 'contact',]
templatetags = ['blog',]
package_data = {}
for item in templatetags:
packages.append('lithium.%s.templatetags' % item)
for item in apps + core + templatetags:
pa... | #!/usr/bin/env python
from distutils.core import setup
import lithium
packages = ['lithium',]
core = ['conf', 'views',]
apps = ['blog', 'contact',]
templatetags = ['blog',]
package_data = {}
for item in templatetags:
packages.append('lithium.%s.templatetags' % item)
for item in apps + core + templatetags:
pa... | Include *.txt in package data, since lithium.contact has a txt template | Include *.txt in package data, since lithium.contact has a txt template
| Python | bsd-2-clause | kylef/lithium | ---
+++
@@ -15,7 +15,7 @@
packages.append('lithium.%s' % item)
for app in apps:
- package_data['lithium.%s' % app] = [('templates/%s/*.html' % app),]
+ package_data['lithium.%s' % app] = ['templates/%s/*.html' % app, 'templates/%s/*.txt' % app]
setup(
name='lithium', |
e5c949d33bb40c32d05932e4dfe8fe75f87fbf16 | lcp/urls.py | lcp/urls.py | """lcp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | """lcp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | Make the API not use trailing slashes. This is what Ember expects. | Make the API not use trailing slashes. This is what Ember expects.
| Python | bsd-2-clause | mblayman/lcp,mblayman/lcp,mblayman/lcp | ---
+++
@@ -19,7 +19,7 @@
from planner.views import SchoolViewSet
-router = routers.DefaultRouter()
+router = routers.DefaultRouter(trailing_slash=False)
router.register('schools', SchoolViewSet)
urlpatterns = [ |
fcc030b960965f9ac462bbefa48f629b73db5c8b | etd_drop_app/validators.py | etd_drop_app/validators.py | from django.core.exceptions import ValidationError
import magic
class MimetypeValidator(object):
def __init__(self, mimetypes):
self.mimetypes = mimetypes
def __call__(self, value):
mime = magic.from_buffer(value.read(1024), mime=True)
if not mime in self.mimetypes:
raise ValidationError('%s is not an ac... | from django.core.exceptions import ValidationError
import magic
class MimetypeValidator(object):
def __init__(self, mimetypes):
self.mimetypes = mimetypes
def __call__(self, value):
try:
mime = magic.from_buffer(value.read(1024), mime=True)
if not mime in self.mimetypes:
raise ValidationError('%s is... | Make mimetype validator slightly more robust | Make mimetype validator slightly more robust
| Python | bsd-3-clause | MetaArchive/etd-drop,MetaArchive/etd-drop | ---
+++
@@ -7,6 +7,9 @@
self.mimetypes = mimetypes
def __call__(self, value):
- mime = magic.from_buffer(value.read(1024), mime=True)
- if not mime in self.mimetypes:
- raise ValidationError('%s is not an acceptable file type' % value)
+ try:
+ mime = magic.from_buffer(value.read(1024), mime=True)
+ ... |
e549c9382e2a75c1607a33925a6532d7859836d7 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
exec(open('jira/version.py').read())
setup(
name='jira-python',
version=__version__,
packages=find_packages(),
install_requires=['requests>=0.13.6', 'ipython>=0.13', 'python-magic==0.4.2', 'tlslite==0.4.1'],
# can't get this working ... | #!/usr/bin/env python
from setuptools import setup, find_packages
exec(open('jira/version.py').read())
setup(
name='jira-python',
version=__version__,
packages=find_packages(),
install_requires=['requests>=0.13.6', 'ipython>=0.13', 'python-magic==0.4.2', 'tlslite==0.4.1'],
# can't get this working ... | Update to new address + contact info | Update to new address + contact info
| Python | bsd-2-clause | milo-minderbinder/jira,milo-minderbinder/jira,m42e/jira,systemadev/jira-python,jameskeane/jira-python,dwmarshall/pycontribs-jira,kinow/jira,awurster/jira,coddingtonbear/jira,VikingDen/jira,tsarnowski/jira-python,pycontribs/jira,systemadev/jira-python,jameskeane/jira-python,rayyen/jira,awurster/jira,kinow/jira,dbaxa/jir... | ---
+++
@@ -18,11 +18,11 @@
['jirashell = tools.jirashell:main'],
},
- url='http://bitbucket.org/bspeakmon_atlassian/jira-python',
+ url='http://bitbucket.org/bspeakmon/jira-python',
license='BSD',
description='A library to ease use of the JIRA 5 REST APIs.',
author='Ben Speak... |
db41d77cbdb42d0bb8326e4585d1c2f73ec8c708 | setup.py | setup.py | #!/usr/bin/env python
# from distutils.core import setup
from setuptools import setup, find_packages
from pip.req import parse_requirements
import pip
import sys
try:
import multiprocessing
except ImportError:
pass
try:
# parse_requirements() returns generator of pip.req.InstallRequirement objects
in... | #!/usr/bin/env python
from setuptools import setup
import os, sys
setup_path = os.path.dirname(__file__)
reqs_file = open(os.path.join(setup_path, 'requirements.txt'), 'r')
reqs = reqs_file.readlines()
reqs_file.close()
tests_require = ['nose', 'mock']
if sys.version_info < (2, 7):
tests_require.append('unittes... | Simplify requirements inclusion for compatibility with old pip | Simplify requirements inclusion for compatibility with old pip
| Python | mit | isotoma/KeenClient-Python,keenlabs/KeenClient-Python | ---
+++
@@ -1,28 +1,14 @@
#!/usr/bin/env python
-# from distutils.core import setup
-from setuptools import setup, find_packages
-from pip.req import parse_requirements
-import pip
-import sys
+from setuptools import setup
+import os, sys
-try:
- import multiprocessing
-except ImportError:
- pass
-
-try:
-... |
82597c5bc118ef9a3e53268614cfe398fc848477 | setup.py | setup.py | # Copyright (c) 2018 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
from setuptools import setup
setup( name='switools',
version='1.0',
description='Tools for handling Arista SWI/X',
packages=['switools', 'swixtools']... | # Copyright (c) 2018 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
from setuptools import setup
setup( name='switools',
version='1.0',
description='Tools for handling Arista SWI/X',
packages=['switools', 'swixtools']... | Introduce `swix-signatre` which is handled by switools/swisignature | Introduce `swix-signatre` which is handled by switools/swisignature
| Python | apache-2.0 | aristanetworks/swi-tools,aristanetworks/swi-tools | ---
+++
@@ -13,7 +13,9 @@
entry_points = {
'console_scripts': [ 'verify-swi=switools.verifyswi:main',
'swi-signature=switools.swisignature:main',
- 'swix-create=swixtools.create:main' ],
+ 'swix-create=s... |
e15f9e221e81d41f2da3ed06253fd4ff8b5d9199 | setup.py | setup.py | import re
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
version = None
for line in open('./soundcloud/__init__.py'):
m = re.search('__version__\s*=\s*(.*)', line)
if m:
version = m.group(1).strip()[1:-1] # quotes
break
assert version
setup(
nam... | import re
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
version = None
for line in open('./soundcloud/__init__.py'):
m = re.search('__version__\s*=\s*(.*)', line)
if m:
version = m.group(1).strip()[1:-1] # quotes
break
assert version
setup(
nam... | Allow never version of fudge (1.0.3 and up) | Allow never version of fudge (1.0.3 and up)
| Python | bsd-2-clause | phijor/soundcloud-python,soundcloud/soundcloud-python | ---
+++
@@ -27,7 +27,7 @@
'': ['README.rst']
},
install_requires=[
- 'fudge==1.0.3',
+ 'fudge>=1.0.3',
'requests>=0.14.0',
'simplejson>=2.0',
], |
9bec0bfcf8f12dc3f95a04918331c99c77b4914b | exercises/chapter_04/exercise_04_01/exercise_04_01.py | exercises/chapter_04/exercise_04_01/exercise_04_01.py | # 4-1. Pizzas
favorite_pizzas = ["Columpus", "Marco Polo", "Amerikana"]
for pizza in favorite_pizzas:
print(pizza)
| # 4-1. Pizzas
favorite_pizzas = ["Columpus", "Marco Polo", "Amerikana"]
for pizza in favorite_pizzas:
print("I like " + pizza + " pizza.")
| Add version 2 of exercise 4.1. | Add version 2 of exercise 4.1.
| Python | mit | HenrikSamuelsson/python-crash-course | ---
+++
@@ -3,4 +3,4 @@
favorite_pizzas = ["Columpus", "Marco Polo", "Amerikana"]
for pizza in favorite_pizzas:
- print(pizza)
+ print("I like " + pizza + " pizza.") |
5645946d9a99ff86c43c7801053a0ef279dc1382 | ynr/apps/candidates/csv_helpers.py | ynr/apps/candidates/csv_helpers.py | from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row["name"].split()[-1],
row["name"].rsplit(None, 1)[0],
not row["election_current"],
row["election_date"],
row["election"],
row["post_label"],
... | from collections import defaultdict
from compat import BufferDictWriter
from django.conf import settings
from popolo.models import Membership
from candidates.models import PersonRedirect
def list_to_csv(membership_list):
csv_fields = settings.CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
... | Move to using membership based CSV output | Move to using membership based CSV output
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | ---
+++
@@ -1,39 +1,40 @@
+from collections import defaultdict
+
from compat import BufferDictWriter
-from .models import CSV_ROW_FIELDS
+from django.conf import settings
+
+from popolo.models import Membership
+from candidates.models import PersonRedirect
-def _candidate_sort_by_name_key(row):
- return (
- ... |
0975c706c503d403810ddeba24ea14b5c9bdd133 | d1_client_cli/src/setup.py | d1_client_cli/src/setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`setup`
====================
:Synopsis: Create egg.
:Author: DataONE (Pippin)
"""
from setuptools import setup, find_packages
import d1_client_cli
setup(
name='Python DataONE CLI',
version=d1_client_cli.__version__,
author='Roger Dahl, and the DataONE Deve... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`setup`
====================
:Synopsis: Create egg.
:Author: DataONE (Pippin)
"""
from setuptools import setup, find_packages
import d1_client_cli
setup(
name='Python DataONE CLI',
version=d1_client_cli.__version__,
author='Roger Dahl, and the DataONE Dev... | Add references to common and libclient, which will not be deployed to PyPi. | Add references to common and libclient, which will not be deployed to PyPi.
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | ---
+++
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+
"""
:mod:`setup`
====================
@@ -19,14 +20,21 @@
url='http://dataone.org',
license='Apache License, Version 2.0',
description='A DataONE Command-line interface',
- packages=find_packages(),
-
+ packages = find_packages(),... |
99b69babaf5ed1517ecb0681a4110a8511876241 | catwatch/tests/user/test_tasks.py | catwatch/tests/user/test_tasks.py | from catwatch.extensions import mail
from catwatch.blueprints.user.tasks import deliver_password_reset_email
from catwatch.blueprints.user.models import User
class TestTasks(object):
def test_deliver_password_reset_email(self, session, token):
""" Deliver a password reset email. """
with mail.reco... | from catwatch.extensions import mail
from catwatch.blueprints.user.tasks import deliver_password_reset_email
from catwatch.blueprints.user.models import User
class TestTasks(object):
def test_deliver_password_reset_email(self, token):
""" Deliver a password reset email. """
with mail.record_messag... | Remove unnecessary fixture from password reset test | Remove unnecessary fixture from password reset test
| Python | mit | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask | ---
+++
@@ -4,7 +4,7 @@
class TestTasks(object):
- def test_deliver_password_reset_email(self, session, token):
+ def test_deliver_password_reset_email(self, token):
""" Deliver a password reset email. """
with mail.record_messages() as outbox:
user = User.find_by_identity('a... |
39404dfa8ab921977347d4405c525935a0ce234d | cc/license/tests/test_licenses.py | cc/license/tests/test_licenses.py | from nose.tools import assert_true
def test_find_sampling_selector():
from zope.interface import implementedBy
import cc.license
sampling_selector = cc.license.get_selector('recombo')()
return sampling_selector
def test_find_sampling_licenses():
selector = test_find_sampling_selector()
lic = ... | from nose.tools import assert_true
def test_find_sampling_selector():
from zope.interface import implementedBy
import cc.license
sampling_selector = cc.license.get_selector('recombo')()
return sampling_selector
def test_find_standard_selector():
from zope.interface import implementedBy
import... | Add a test for grabbing the standard selector | Add a test for grabbing the standard selector
| Python | mit | creativecommons/cc.license,creativecommons/cc.license | ---
+++
@@ -6,6 +6,13 @@
sampling_selector = cc.license.get_selector('recombo')()
return sampling_selector
+
+def test_find_standard_selector():
+ from zope.interface import implementedBy
+ import cc.license
+
+ standard_selector = cc.license.get_selector('standard')()
+ return standard_select... |
5568e84b715ed2de20d325aa1e66e9959e5e8b89 | feed/feed.home.loadtest.py | feed/feed.home.loadtest.py | #!/usr/local/bin/python3 -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
# Make sure we have access to SentientHome commons
import os, sys
sys.path.append(os.path.dirname(os.path.abspath(__file_... | #!/usr/local/bin/python3 -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
# Make sure we have access to SentientHome commons
import os, sys
sys.path.append(os.path.dirname(os.path.abspath(__file_... | Remove no longer needed python libs | Remove no longer needed python libs
| Python | apache-2.0 | fxstein/SentientHome | ---
+++
@@ -10,9 +10,6 @@
# Sentient Home Application
from common.shapp import shApp
from common.sheventhandler import shEventHandler
-
-import logging as log
-import time
# Simple loadtest that 'fires' events as fast as possible
|
9c6532aad52f8eb950aeae97dd43f1d921006b6b | tasks.py | tasks.py | from invoke import run, task
TESTPYPI = "https://testpypi.python.org/pypi"
@task
def lint(ctx):
"""Run flake8 to lint code"""
run("flake8")
@task(lint)
def test(ctx):
"""Lint, unit test, and check setup.py"""
cmd = "{} {}".format(
"nosetests",
"--with-coverage --cover-erase --cover-... | from invoke import run, task
TESTPYPI = "https://testpypi.python.org/pypi"
@task
def lint(ctx):
"""Run flake8 to lint code"""
run("flake8")
@task
def freeze(ctx):
"""Freeze the pip requirements"""
run("pip freeze -l > requirements.txt")
@task(lint)
def test(ctx):
"""Lint, unit test, and check... | Add freeze task to invoke | Add freeze task to invoke
| Python | mit | questrail/keysight | ---
+++
@@ -9,6 +9,12 @@
run("flake8")
+@task
+def freeze(ctx):
+ """Freeze the pip requirements"""
+ run("pip freeze -l > requirements.txt")
+
+
@task(lint)
def test(ctx):
"""Lint, unit test, and check setup.py"""
@@ -18,7 +24,7 @@
run(cmd)
-@task()
+@task
def release(ctx, deploy=Fals... |
f75d06702274257215229b83c4ff74de3dc72463 | nnpy/tests.py | nnpy/tests.py | from __future__ import print_function
import nnpy, unittest
class Tests(unittest.TestCase):
def test_basic(self):
pub = nnpy.Socket(nnpy.AF_SP, nnpy.PUB)
pub.bind('inproc://foo')
self.assertEqual(pub.getsockopt(nnpy.SOL_SOCKET, nnpy.DOMAIN), 1)
sub = nnpy.Socket(nnpy.AF_SP, nnpy.S... | from __future__ import print_function
import nnpy, unittest
class Tests(unittest.TestCase):
def test_basic(self):
pub = nnpy.Socket(nnpy.AF_SP, nnpy.PUB)
pub.setsockopt(nnpy.SOL_SOCKET, nnpy.IPV4ONLY, 0)
pub.bind('inproc://foo')
self.assertEqual(pub.getsockopt(nnpy.SOL_SOCKET, nnpy... | Add some more test coverage | Add some more test coverage
| Python | mit | nanomsg/nnpy | ---
+++
@@ -5,11 +5,12 @@
def test_basic(self):
pub = nnpy.Socket(nnpy.AF_SP, nnpy.PUB)
+ pub.setsockopt(nnpy.SOL_SOCKET, nnpy.IPV4ONLY, 0)
pub.bind('inproc://foo')
self.assertEqual(pub.getsockopt(nnpy.SOL_SOCKET, nnpy.DOMAIN), 1)
sub = nnpy.Socket(nnpy.AF_SP, nnpy.... |
e409e8d77eec8e53978512da56bf52f768d46c1a | create-application.py | create-application.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess, os, sys, optparse
fullpath = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))
capath = os.path.abspath(
os.path.join(fullpath, "qooxdoo", "tool", "bin", "create-application.py")
)
skeletonpath = os.path.abspath(
os.path.join(fullpath, "un... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Create skeleton application for Unify
# Copyright (C) 2012 Sebastian Fastner, Mainz, Germany
# License: MIT or Apache2
import os, sys, shutil
print("Unify create skeleton")
print("(C) 2012 Sebastian Fastner, Mainz, Germany")
print()
if (len(sys.argv) != 2):
print... | Add variable replacements to create application | Add variable replacements to create application
| Python | mit | unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify | ---
+++
@@ -1,14 +1,63 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-import subprocess, os, sys, optparse
+# Create skeleton application for Unify
+# Copyright (C) 2012 Sebastian Fastner, Mainz, Germany
+# License: MIT or Apache2
-fullpath = os.path.join(os.getcwd(), os.path.dirname(... |
3d6015649e50a2f55e5dc1ef84406e229607cdaa | test2.py | test2.py | import json
#from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
import jsonrpclib
class StanfordNLP:
def __init__(self, port_number=8080):
self.server = jsonrpclib.Server("http://localhost:%d" % port_number)
def parse(self, text):
return json.loads(self.server.parse(text))
nlp = Stanf... | import json
#from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
import jsonrpclib
import fileinput
class StanfordNLP:
def __init__(self, port_number=8080):
self.server = jsonrpclib.Server("http://localhost:%d" % port_number)
def parse(self, text):
return json.loads(self.server.parse(te... | Add loop, allowing several tests. | Add loop, allowing several tests.
| Python | agpl-3.0 | ProjetPP/PPP-QuestionParsing-Grammatical,ProjetPP/PPP-QuestionParsing-Grammatical | ---
+++
@@ -1,6 +1,7 @@
import json
#from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
import jsonrpclib
+import fileinput
class StanfordNLP:
def __init__(self, port_number=8080):
@@ -10,6 +11,8 @@
return json.loads(self.server.parse(text))
nlp = StanfordNLP()
-result = nlp.parse("What... |
23dac5f2e5be725eff7d329a6af399f6d80c59de | logintokens/tokens.py | logintokens/tokens.py | """module containing generator for login tokens
"""
import base64
from django.core.signing import TimestampSigner, BadSignature
from django.contrib.auth import get_user_model
class LoginTokenGenerator:
"""Generator for the timestamp signed tokens used for logging in.
"""
def __init__(self):
sel... | """module containing generator for login tokens
"""
import base64
from django.contrib.auth import get_user_model
from django.core.signing import TimestampSigner, BadSignature
USER = get_user_model()
class LoginTokenGenerator:
"""Generator for the timestamp signed tokens used for logging in.
"""
def _... | Use last login of user in signed value | Use last login of user in signed value
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | ---
+++
@@ -3,8 +3,11 @@
"""
import base64
+from django.contrib.auth import get_user_model
from django.core.signing import TimestampSigner, BadSignature
-from django.contrib.auth import get_user_model
+
+
+USER = get_user_model()
class LoginTokenGenerator:
@@ -15,12 +18,20 @@
self.signer = Timestam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.