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 |
|---|---|---|---|---|---|---|---|---|---|---|
083d71834e82815dd338a873090df4cda64d74f4 | test/test_logger.py | test/test_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function, unicode_literals
import pytest
from simplesqlite import set_log_level, set_logger
logbook = pytest.importorskip("logbook", minversion="1.1.0")
import logbook # isort:skip
class Test_... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function, unicode_literals
import pytest
from simplesqlite import set_log_level, set_logger
logbook = pytest.importorskip("logbook", minversion="0.12.3")
import logbook # isort:skip
class Test... | Update skip condition for tests | Update skip condition for tests
| Python | mit | thombashi/SimpleSQLite,thombashi/SimpleSQLite | ---
+++
@@ -10,7 +10,7 @@
from simplesqlite import set_log_level, set_logger
-logbook = pytest.importorskip("logbook", minversion="1.1.0")
+logbook = pytest.importorskip("logbook", minversion="0.12.3")
import logbook # isort:skip
|
ac605b9efdfa0a195a4c9a76800e969098a003ae | test/test_ticket.py | test/test_ticket.py | import unittest
from mock import Mock
import sys
import os
import datetime
from pytrac import Ticket
class TestTicket(unittest.TestCase):
def setUp(self):
server = Mock()
self.ticket = Ticket(server)
def testSearchWithAllParams(self):
self.ticket.search(summary='test_summary', owner... | import pytest
from mock import Mock
import sys
import os
import datetime
from pytrac import Ticket
class TestTicket(object):
def setup_class(self):
server = Mock()
self.ticket = Ticket(server)
def testSearchWithAllParams(self):
self.ticket.search(summary='test_summary', owner='someo... | Use pytest for unit test | Use pytest for unit test
| Python | apache-2.0 | Jimdo/pytrac,Jimdo/pytrac | ---
+++
@@ -1,4 +1,4 @@
-import unittest
+import pytest
from mock import Mock
import sys
import os
@@ -7,9 +7,9 @@
from pytrac import Ticket
-class TestTicket(unittest.TestCase):
+class TestTicket(object):
- def setUp(self):
+ def setup_class(self):
server = Mock()
self.ticket = Tick... |
ea56607fa7ae7257682170e881c67ae5e0f6719c | tests/rest_views.py | tests/rest_views.py | from django.views.generic import View
from nap.datamapper.models import ModelDataMapper
from nap.rest import views
from .models import Poll
class PollMapper(ModelDataMapper):
class Meta:
model = Poll
fields = ['question', 'pub_date']
class SinglePollView(views.ObjectGetMixin, views.ObjectPutMi... | from django.views.generic import View
from nap.datamapper.models import ModelDataMapper
from nap.rest import views
from .models import Poll
class PollMapper(ModelDataMapper):
class Meta:
model = Poll
fields = ['question', 'pub_date']
class SinglePollView(views.ObjectGetMixin, views.ObjectPutMi... | Update test to use Base view | Update test to use Base view
| Python | bsd-3-clause | MarkusH/django-nap,limbera/django-nap | ---
+++
@@ -12,6 +12,6 @@
fields = ['question', 'pub_date']
-class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.ObjectMixin, View):
+class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDe... |
9bb1aebbfc0ca0ff893bafe99de3c32c2ba99952 | tests/test_model.py | tests/test_model.py | from context import models
from models import model
import unittest
class test_logic_core(unittest.TestCase):
def setUp(self):
self.room = model.Room(20, 'new_room')
self.room1 = model.Room(6, 'new_room1')
self.livingspace = model.LivingSpace('orange')
self.office = model.Office(... | from context import models
from models import model
import unittest
class test_model(unittest.TestCase):
def setUp(self):
self.room = model.Room(20, 'new_room')
self.room1 = model.Room(6, 'new_room1')
self.livingspace = model.LivingSpace('orange')
self.office = model.Office('manj... | Refactor model test to test added properties | Refactor model test to test added properties
| Python | mit | georgreen/Geoogreen-Mamboleo-Dojo-Project | ---
+++
@@ -5,7 +5,7 @@
import unittest
-class test_logic_core(unittest.TestCase):
+class test_model(unittest.TestCase):
def setUp(self):
self.room = model.Room(20, 'new_room')
self.room1 = model.Room(6, 'new_room1')
@@ -21,6 +21,8 @@
def test_Room_name(self):
self.assertEq... |
3a414d5d4763802bc4bc506a57c1f487655d470a | engineering_project/estimatedtime.py | engineering_project/estimatedtime.py | #!/usr/bin/env python3
import statistics
class estimatedtime:
def __init__(self, numberofpoints):
self.listoftimes = []
self.points = numberofpoints
def append(self, timeinseconds, inferprogress=True):
# print(timeinseconds)
self.listoftimes.append(timeinseconds)
... | #!/usr/bin/env python3
import statistics
class ETC:
''' Estimated Time to Completion '''
def __init__(self, numberofpoints):
self.listoftimes = []
self.points = numberofpoints + 1
def append(self, timeinseconds, inferprogress=True):
# print(timeinseconds)
self.... | Change estimated time class to ETC | Change estimated time class to ETC
| Python | mit | DavidLutton/EngineeringProject | ---
+++
@@ -2,10 +2,11 @@
import statistics
-class estimatedtime:
+class ETC:
+ ''' Estimated Time to Completion '''
def __init__(self, numberofpoints):
self.listoftimes = []
- self.points = numberofpoints
+ self.points = numberofpoints + 1
def append(self, timeinseconds, in... |
77573f639354c35945586bf57222d9125d99e0ba | system/protocols/generic/channel.py | system/protocols/generic/channel.py | from system.translations import Translations
__author__ = 'Sean'
_ = Translations().get()
class Channel(object):
name = ""
users = None
def __init__(self, name, protocol=None):
self.name = name
self.protocol = protocol
self.users = set()
def respond(self, message):
... | from system.translations import Translations
__author__ = 'Sean'
_ = Translations().get()
class Channel(object):
"""
A channel - Represents a channel on a protocol. Subclass this!
@ivar name The name of the channel
@ivar users A set containing all the User objects in the channel
"""
def __... | Remove unneeded properties in base Channel class | Remove unneeded properties in base Channel class
| Python | artistic-2.0 | UltrosBot/Ultros,UltrosBot/Ultros | ---
+++
@@ -6,14 +6,27 @@
class Channel(object):
+ """
+ A channel - Represents a channel on a protocol. Subclass this!
- name = ""
- users = None
+ @ivar name The name of the channel
+ @ivar users A set containing all the User objects in the channel
+ """
def __init__(self, name, p... |
c6d345d01f59965155d9d912615a1eef939c32cb | Xls/Reader/excel_xlrd.py | Xls/Reader/excel_xlrd.py | import xlrd
import json
import sys
import os
import argparse
def run(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--size')
parser.add_argument('--start')
parser.add_argument('--action')
parser.add_argument('--file')
args = parser.parse_args()
if False == os.path.isfile(args.file):
... | import xlrd
import json
import sys
import os
import argparse
def run(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--size')
parser.add_argument('--start')
parser.add_argument('--action')
parser.add_argument('--file')
parser.add_argument('--max-empty-rows', dest="max_empty_rows")
args = p... | Fix empty argument "max-empty-rows" in xls script We send argument "max-empty-rows" to two different script. In xls need to set, that this argument is available | Fix empty argument "max-empty-rows" in xls script
We send argument "max-empty-rows" to two different script. In xls need to set, that this argument is available
| Python | mit | arodiss/XlsBundle,arodiss/XlsBundle | ---
+++
@@ -10,6 +10,7 @@
parser.add_argument('--start')
parser.add_argument('--action')
parser.add_argument('--file')
+ parser.add_argument('--max-empty-rows', dest="max_empty_rows")
args = parser.parse_args()
if False == os.path.isfile(args.file): |
61693f27510567f4f2f5af2b51f95ae465290d9a | tests/test_directory/test_domain.py | tests/test_directory/test_domain.py | '''
Creates all tests to serialize XMLs to xml_curl
'''
import logging
import pytest
from lxml import etree
from mock import Mock
from wirecurly.directory import Domain, User
def test_domain_no_users():
domain = Domain('wirephone.com.ar')
response = domain.todict()
assert domain.domain == 'wirepho... | '''
Creates all tests to serialize XMLs to xml_curl
'''
import logging
import pytest
from lxml import etree
from mock import Mock
from wirecurly.directory import Domain, User
def test_domain_no_users():
domain = Domain('wirephone.com.ar')
response = domain.todict()
assert domain.domain == 'wirepho... | Add tests for addUsersToGroup function | Add tests for addUsersToGroup function
| Python | mpl-2.0 | IndiciumSRL/wirecurly | ---
+++
@@ -27,3 +27,25 @@
response = domain.todict()
assert len(response['children']) == 1
assert response.get('children')[0] == user.todict()
+
+def test_domain_with_group():
+ domain = Domain('wirephone.com.ar')
+ user = Mock(User)
+ domain.addUser(user)
+ domain.addUsersToGroup()
+
... |
48ea5605807ec9798b77317a73446f4dc335f70a | main.py | main.py | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute('onclick', eval... | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute('onclick', eval... | Implement the Python side of Canvas.fillRect | Implement the Python side of Canvas.fillRect
| Python | mit | Zirientis/skulpt-canvas,Zirientis/skulpt-canvas | ---
+++
@@ -18,10 +18,11 @@
break
bridge.innerHTML = 'ready'
# Put Python<->JS class here.
-class FakeCanvas:
+class Canvas:
def fillRect(self, x, y, width, height):
- pass
-
+ cmd = document.createElement('span');
+ cmd.innerHTML = "{0} {1} {2} {3}".format(x, y, width, height)
+ ... |
7559b61aec08dbab4b01affbe017f26a85a108e6 | main.py | main.py | #coding=utf-8
#imports
import pystache as ps
import sys
import json
import imp
views = imp.load_source('views', 'swedish/views.py')
#from views import Invoice
def main():
configFile = "invoice.json"
htmlFile = "invoice.html"
if len(sys.argv) == 2 :
configFile = sys.argv[1]
htmlFile = configFile[:-4] + "html"
... | #coding=utf-8
#imports
import pystache as ps
import sys
import json
import imp
views = imp.load_source('views', 'swedish/views.py')
#from views import Invoice
def main():
configFile = "invoice.sample.json"
htmlFile = "invoice.html"
if len(sys.argv) == 2 :
configFile = sys.argv[1]
htmlFile = configFile[:-4] + "... | Change json file to sample one | Change json file to sample one
| Python | mit | SudoQ/yig,SudoQ/yig | ---
+++
@@ -9,7 +9,7 @@
#from views import Invoice
def main():
- configFile = "invoice.json"
+ configFile = "invoice.sample.json"
htmlFile = "invoice.html"
if len(sys.argv) == 2 :
configFile = sys.argv[1] |
0fb7f7950039d937df35f90a44cabc5603d238de | main.py | main.py | import os
import json
import sys
from pprint import pprint
def loadJSON(fInput):
with open(fInput) as f:
return json.load(f)
return None
if __name__ == '__main__':
filePath = 'data/example.json'
data = loadJSON(filePath)
# check if the data is loaded correctly
if data is None:
... | import os
import json
import sys
from pprint import pprint
def loadJSON(fInput):
with open(fInput) as f:
return json.load(f)
return None
if __name__ == '__main__':
filePath = 'data/example.json'
data = loadJSON(filePath)
# check if the data is loaded correctly
if data is None:
... | Add method definition generator and some sample for test | Add method definition generator and some sample for test
| Python | apache-2.0 | kilikkuo/kernel-mapper,PyOCL/kernel-mapper | ---
+++
@@ -19,6 +19,7 @@
lstTypes = data.get('types')
lstFuncs = data.get('functions')
+ '''
from dsFileBuilder import DSFileBuilder
dsb = DSFileBuilder(name, lstTypes)
dsb.buildDS()
@@ -33,3 +34,4 @@
opg = OCLPyObjGenerator(name, dicNumpyDS, dicKFuncDS)
opg.generateOCLPyObj()... |
f253feac7a4c53bd17958b0c74adbec528ae2e17 | rethinkdb/setup-rethinkdb.py | rethinkdb/setup-rethinkdb.py | #!/usr/bin/env python3
import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB locally')
args = parser.parse_args()
conn = r.connect()
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db(... | #!/usr/bin/env python3
import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB')
parser.add_argument('-H', '--host', default='localhost', help='Specify host')
args = parser.parse_args()
conn = r.connect(host=args.host)
r.db_create('muzhack').run(conn)
r.db('muzhack').tabl... | Allow setting up rethinkdb remotely | Allow setting up rethinkdb remotely
| Python | mit | muzhack/musitechhub,muzhack/musitechhub,muzhack/musitechhub,muzhack/muzhack,muzhack/muzhack,muzhack/musitechhub,muzhack/muzhack,muzhack/muzhack | ---
+++
@@ -3,10 +3,11 @@
import argparse
-parser = argparse.ArgumentParser(description='Set up RethinkDB locally')
+parser = argparse.ArgumentParser(description='Set up RethinkDB')
+parser.add_argument('-H', '--host', default='localhost', help='Specify host')
args = parser.parse_args()
-conn = r.connect()
+c... |
5bd9de24e63c557aed1779f6cee611cfeb52ddc0 | envs.py | envs.py | import os
import gym
from gym.spaces.box import Box
from baselines import bench
from baselines.common.atari_wrappers import wrap_deepmind
try:
import pybullet_envs
except ImportError:
pass
def make_env(env_id, seed, rank, log_dir):
def _thunk():
env = gym.make(env_id)
env.seed(seed + ra... | import os
import gym
from gym.spaces.box import Box
from baselines import bench
from baselines.common.atari_wrappers import wrap_deepmind
try:
import pybullet_envs
except ImportError:
pass
def make_env(env_id, seed, rank, log_dir):
def _thunk():
env = gym.make(env_id)
env.seed(seed + ra... | Change the ugly hack to detect atari | Change the ugly hack to detect atari
| Python | mit | YuhangSong/GTN,YuhangSong/GTN,ikostrikov/pytorch-a2c-ppo-acktr | ---
+++
@@ -20,7 +20,7 @@
os.path.join(log_dir,
"{}.monitor.json".format(rank)))
# Ugly hack to detect atari.
- if env.action_space.__class__.__name__ == 'Discrete':
+ if hasattr(env.env, 'env') and hasattr(env.env.env, 'ale... |
ee130df5b48d1e4196bb9159de64e279656cdfcf | byceps/blueprints/snippet/views.py | byceps/blueprints/snippet/views.py | """
byceps.blueprints.snippet.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import abort, g
from ...services.snippet import mountpoint_service
from ...util.framework.blueprint import create_blueprint
from .templating ... | """
byceps.blueprints.snippet.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import abort, g, url_for
from ...services.snippet import mountpoint_service
from ...util.framework.blueprint import create_blueprint
from .te... | Introduce global template function `url_for_snippet` | Introduce global template function `url_for_snippet`
Use it to ease the transition to a multisite-capable snippet URL rule system.
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | ---
+++
@@ -6,7 +6,7 @@
:License: Modified BSD, see LICENSE for details.
"""
-from flask import abort, g
+from flask import abort, g, url_for
from ...services.snippet import mountpoint_service
from ...util.framework.blueprint import create_blueprint
@@ -17,6 +17,11 @@
blueprint = create_blueprint('snippet', ... |
0ef1e9b77ad31c13a32c285b4b07e5d19a5d6c92 | config.py | config.py | import yaml
def load_config(keys=None):
with open('config.yml', 'r') as yf:
conf = yaml.load(yf)
if keys is not None:
return [conf[k] for k in keys]
return conf | import yaml
def load_config(keys=None):
with open('config.yml', 'r') as yf:
conf = yaml.safe_load(yf)
if keys is not None:
return [conf[k] for k in keys]
return conf
| Use safe_load in place of load | Use safe_load in place of load
| Python | cc0-1.0 | dateutil/tzdata | ---
+++
@@ -2,7 +2,7 @@
def load_config(keys=None):
with open('config.yml', 'r') as yf:
- conf = yaml.load(yf)
+ conf = yaml.safe_load(yf)
if keys is not None:
return [conf[k] for k in keys] |
0cfb43da3c579bca84be1c774c1306ac2f54ffda | config.py | config.py | import os
class Config(object):
DEBUG = True
# WTF_CSRF_ENABLED = False
DATABASE_NAME = "projectp"
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # refers to application_top
APP_STATIC = os.path.join(BASE_DIR, 'static')
# Database (sqlite) configuration
SQLALCHEMY_DATABASE_URI = ... | import os
class Config(object):
DEBUG = False
# WTF_CSRF_ENABLED = False
DATABASE_NAME = "projectp"
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # refers to application_top
APP_STATIC = os.path.join(BASE_DIR, 'static')
# Database (sqlite) configuration
SQLALCHEMY_DATABASE_URI =... | Disable Flask debug - incompatible with SocketIO | Disable Flask debug - incompatible with SocketIO
| Python | mit | Proj-P/project-p-api,Proj-P/project-p-api | ---
+++
@@ -2,7 +2,7 @@
class Config(object):
- DEBUG = True
+ DEBUG = False
# WTF_CSRF_ENABLED = False
DATABASE_NAME = "projectp"
|
26eec2d069075c662d5b935474e8a2eea0d195b5 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Anton Lavrenov
# Copyright (c) 2014 Anton Lavrenov
#
# License: MIT
#
"""This module exports the Tslint plugin class."""
from SublimeLinter.lint import Linter, util
class Tslint(Linter):
"""Provides an interf... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Anton Lavrenov
# Copyright (c) 2014 Anton Lavrenov
#
# License: MIT
#
"""This module exports the Tslint plugin class."""
from SublimeLinter.lint import Linter, util
class Tslint(Linter):
"""Provides an interf... | Add support for typescriptreact *.tsx files | Add support for typescriptreact *.tsx files | Python | mit | lavrton/SublimeLinter-contrib-tslint | ---
+++
@@ -17,7 +17,7 @@
"""Provides an interface to tslint."""
- syntax = 'typescript'
+ syntax = ('typescript', 'typescriptreact')
cmd = ('tslint', '@')
regex = (
r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
@@ -25,7 +25,7 @@
)
error_stream = util.STREAM_BOTH
config_fil... |
0b6aabf043cd96e82972376b632067dc624daf0d | test.py | test.py | import requests
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
r = requests.get('https://api.travis-ci.org/repos/gforsyth/travis_docs_builder/key', headers={'Accept': 'applic... | import requests
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
def encrypt_variable(variable, repo, public_key=None):
"""
Encrypt an environment variable for repo for... | Refactor the encryption into a function, with some type checking | Refactor the encryption into a function, with some type checking
| Python | mit | gforsyth/doctr_testing,doctrtesting/doctr,drdoctr/doctr | ---
+++
@@ -6,11 +6,30 @@
import base64
-r = requests.get('https://api.travis-ci.org/repos/gforsyth/travis_docs_builder/key', headers={'Accept': 'application/vnd.travis-ci.2+json'})
+def encrypt_variable(variable, repo, public_key=None):
+ """
+ Encrypt an environment variable for repo for Travis
-public... |
8dd873a485eba31e5fa99b88708a2771f6ef0240 | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from datetime import datetime
from flask import Flask
from update_wrapper import UpdateWrapper
LOG_FILE = datetime.now().strftime("%Y%m%d%H%M%S%f")
LOG_DIR = "log"
FULL_LOG_PATH = os.path.join(LOG_DIR, LOG_FILE)
if not os.path.isdir(LOG_DIR):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from datetime import datetime
from flask import Flask
from update_wrapper import UpdateWrapper
LOG_FILE = datetime.now().strftime("%Y%m%d%H%M%S%f")
LOG_DIR = "log"
FULL_LOG_PATH = os.path.join(LOG_DIR, LOG_FILE)
if not os.path.isdir(LOG_DIR):
... | Add returning log file content | Add returning log file content
| Python | mit | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | ---
+++
@@ -27,5 +27,12 @@
app = Flask(__name__)
+@app.route("/log")
+def get_log():
+ with open(FULL_LOG_PATH, 'r') as f:
+ read_data = f.read()
+ f.closed
+ return read_data
+
if __name__ == "__main__":
app.run() |
d79edc34bece193b0cf1bc7117c3559ed62e0a7f | main.py | main.py | #!/usr/bin/python3
# -*- coding: utf8 -*
import sys
# Fix for file paths errors
import os
PATH = os.path.dirname(os.path.realpath(__file__))
# Import other files from the project
from game import Game
from idlerpg import IdleRPG
from logger import log, story
# Import Graphic Lib
from PyQt5.QtWidgets import (QApplic... | #!/usr/bin/python3
# -*- coding: utf8 -*
import sys
# Fix for file paths errors
import os
PATH = os.path.dirname(os.path.realpath(__file__))
# Import other files from the project
from game import Game
from idlerpg import IdleRPG
from logger import log, story
# Import Graphic Lib
from PyQt5.QtWidgets import QApplica... | Remove a bunch of unnecessary import | FIX: Remove a bunch of unnecessary import
| Python | mit | DanielNautre/idle-rpg | ---
+++
@@ -13,12 +13,8 @@
from logger import log, story
# Import Graphic Lib
-from PyQt5.QtWidgets import (QApplication, QMainWindow, QToolTip, QPushButton,
- QWidget, QStackedWidget, QHBoxLayout, QVBoxLayout, QLabel, QLineEdit,
- QFormLayout, QDockWidget, QListWidget, QListWidgetItem, QAction, qApp,
- ... |
c8177562558d4b59d6d0a8f3fb4518c067394a31 | comrade/core/decorators.py | comrade/core/decorators.py | from django.utils.decorators import available_attrs
from django.utils.http import urlquote
from django.http import HttpResponse
from django.template import loader, RequestContext
from functools import wraps
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
inst... | from django.utils.decorators import available_attrs
from django.utils.http import urlquote
from django.http import HttpResponse
from django.template import loader, RequestContext
from functools import wraps
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
inst... | Use authorized + test_func instead of custom decorator. | Use authorized + test_func instead of custom decorator.
| Python | mit | bueda/django-comrade | ---
+++
@@ -30,13 +30,3 @@
return wraps(view_func,
assigned=available_attrs(view_func))(_wrapped_view)
return decorator
-
-def admin_login_required(view_func):
- def _decorator(request, *args, **kwargs):
- if request.user.is_authenticated() and request.user.is_staff:
- ... |
30a4281f2602bd6b9d90d89375785a2645854a0d | enthought/enable2/pyglet_backend/pyglet_app.py | enthought/enable2/pyglet_backend/pyglet_app.py | # proxy
from enthought.enable.pyglet_backend.pyglet_app import *
| # proxy
__all__ = ["get_app", "PygletApp"]
from enthought.enable.pyglet_backend.pyglet_app import *
# Import the objects which are not declared in __all__,
# but are still defined in the real module, such that people
# can import them explicitly when needed, just as they could
# with the real module.
#
# It is unli... | Improve the proxy module which maps to a module which uses __all__. | Improve the proxy module which maps to a module which uses __all__.
The notes I made in the code apply to all proxy modules which map
to a module which uses __all__.
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | ---
+++
@@ -1,2 +1,19 @@
-# proxy
+# proxy
+
+__all__ = ["get_app", "PygletApp"]
+
from enthought.enable.pyglet_backend.pyglet_app import *
+
+
+# Import the objects which are not declared in __all__,
+# but are still defined in the real module, such that people
+# can import them explicitly when needed, just as... |
2d0e742c0f8d5f0a9d72b8c2c6fa751ba7842668 | tests/test_json.py | tests/test_json.py | from __future__ import absolute_import
import fnmatch
import os
import unittest
from . import validate_json_format
class TestSettings(unittest.TestCase):
def _get_json_files(self, file_pattern, folder='.'):
for root, dirnames, filenames in os.walk(folder):
for filename in fnmatch.filter(file... | from __future__ import absolute_import
import fnmatch
import os
import unittest
from . import validate_json_format
class TestSettings(unittest.TestCase):
def _get_json_files(self, file_pattern, folder='.'):
for root, dirnames, filenames in os.walk(folder):
for filename in fnmatch.filter(file... | Include sublime-keymap files in JSON format tests. | Include sublime-keymap files in JSON format tests.
| Python | mit | jonlabelle/Trimmer,jonlabelle/Trimmer | ---
+++
@@ -21,9 +21,10 @@
def test_json_settings(self):
"""Test each JSON file."""
file_patterns = (
- '*.sublime-settings',
'*.sublime-commands',
- '*.sublime-menu'
+ '*.sublime-keymap',
+ '*.sublime-menu',
+ '*.sublime-setti... |
ff0ae66ee16bc3ac07cb88ddacb52ffa41779757 | tests/test_func.py | tests/test_func.py | from .utils import assert_eval
def test_simple_func():
assert_eval('(def @a $a 8) (@a)', 1, 8)
def test_simple_func_args():
assert_eval(
'(def @a $a $a)'
'(@a 1)'
'(@a 2)'
'(@a 5)',
1,
1,
2,
5)
def test_func_args_overwrite_globals():
asse... | from .utils import assert_eval
def test_simple_func():
assert_eval('(def @a $a 8) (@a)', 1, 8)
def test_simple_func_args():
assert_eval(
'(def @a $a $a)'
'(@a 1)'
'(@a 2)'
'(@a 5)',
1,
1,
2,
5)
def test_func_args_overwrite_globals():
asse... | Add some more function tests. | Add some more function tests.
| Python | bsd-3-clause | sapir/tinywhat,sapir/tinywhat,sapir/tinywhat | ---
+++
@@ -44,3 +44,23 @@
17,
0, 0, 0, 1, 2, 8, 9, 10,
)
+
+
+def test_no_args():
+ assert_eval(
+ '(def @a (+ 0 5))'
+ '(@a)',
+ 1,
+ 5,
+ )
+
+
+def test_nested_calls():
+ assert_eval(
+ '(def @a $a (+ $a $b))'
+ '(def @b (+ (@a 1 2) (@a... |
95efd017f8adf7b2f3e1b7ee82a865982f8be8df | urls.py | urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
url(regex=r'^$',
view='core.views.index',
... | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
url(regex=r'^$',
view='core.views.index',
... | Use django for static file only in debug mode | Use django for static file only in debug mode
| Python | agpl-3.0 | fgaudin/aemanager,fgaudin/aemanager,fgaudin/aemanager | ---
+++
@@ -28,7 +28,8 @@
)
-urlpatterns += patterns('',
- (r'^static/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT}),
-)
+if settings.DEBUG:
+ urlpatterns += patterns('',
+ (r'^static/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root':... |
c9c618cfcd8caeac9ba23ec1c53d3ebdf32d563d | src/cli/_errors.py | src/cli/_errors.py | """
Error heirarchy for stratis cli.
"""
class StratisCliError(Exception):
"""
Top-level stratis cli error.
"""
pass
class StratisCliValueError(StratisCliError):
""" Raised when a parameter has an unacceptable value.
May also be raised when the parameter has an unacceptable type.
"""... | """
Error heirarchy for stratis cli.
"""
class StratisCliError(Exception):
"""
Top-level stratis cli error.
"""
pass
class StratisCliValueError(StratisCliError):
""" Raised when a parameter has an unacceptable value.
May also be raised when the parameter has an unacceptable type.
"""... | Add an exception useful for prototyping. | Add an exception useful for prototyping.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
| Python | apache-2.0 | stratis-storage/stratis-cli,stratis-storage/stratis-cli | ---
+++
@@ -34,3 +34,11 @@
return fmt_str % (self._value, self._param, self._msg)
else:
return self._FMT_STR % (self._value, self._param)
+
+
+class StratisCliValueUnimplementedError(StratisCliValueError):
+ """
+ Raised if a parameter is not intrinsically bad but functionalit... |
1b15198842d60582930f828656a2353f85a05d44 | apps/events/views.py | apps/events/views.py | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.events.models import Event, AttendanceEvent, Attendee
import datetime
def index(request):
events = Event.objects.filter(event_start__gte=dateti... | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.events.models import Event, AttendanceEvent, Attendee
import datetime
def index(request):
events = Event.objects.filter(event_start__gte=dateti... | Fix no table named event_id | Fix no table named event_id
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | ---
+++
@@ -9,7 +9,7 @@
def index(request):
events = Event.objects.filter(event_start__gte=datetime.date.today())
if len(events) == 1:
- return details(request, events[0].event_id)
+ return details(request, events[0].id)
return render_to_response('events/index.html', {'events': events}, ... |
048dcc39703cb00ce5616e9ed2b07be8dbde4038 | img_pipe/archival_data/single_channel_clean.py | img_pipe/archival_data/single_channel_clean.py |
import sys
'''
Cleans an MS with a single channel given a mask and a model
'''
vis = sys.argv[4]
model = sys.argv[5]
mask = sys.argv[6]
out_root = vis[:-3]
clean(vis=vis, imagename=out_root+'.clean', field='M33*',
restfreq='1420.40575177MHz',
mode='channel', width=1, nchan=1, start=1,
cell='1.5ar... |
import sys
'''
Cleans an MS with a single channel given a mask and a model
'''
vis = sys.argv[4]
model = sys.argv[5]
mask = sys.argv[6]
out_root = vis[:-3]
clean(vis=vis, imagename=out_root+'.clean', field='M33*',
restfreq='1420.40575177MHz',
mode='channel', width=1, nchan=1, start=1,
cell='1.5ar... | Remove the largest scale; causes severe artifacts in some channels | Remove the largest scale; causes severe artifacts in some channels
| Python | mit | e-koch/canfar_scripts,e-koch/canfar_scripts | ---
+++
@@ -14,7 +14,7 @@
clean(vis=vis, imagename=out_root+'.clean', field='M33*',
restfreq='1420.40575177MHz',
mode='channel', width=1, nchan=1, start=1,
- cell='1.5arcsec', multiscale=[0, 4, 8, 20, 40, 80],
+ cell='1.5arcsec', multiscale=[0, 4, 8, 20, 40],
threshold='2.2mJy/beam', i... |
83fdd99aead08614a12b4eb48f6075599ca60cbe | examples/mayavi/standalone_mlab.py | examples/mayavi/standalone_mlab.py | #!/usr/bin/env python
"""A simple example of how you can use MayaVi and mlab without
using Envisage or the MayaVi envisage application.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# Mlab imports
from enthought.mayavi import mlab
from numpy... | #!/usr/bin/env python
"""A simple example of how you can use MayaVi and mlab without
using Envisage or the MayaVi envisage application.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# Mlab imports
from enthought.mayavi import mlab
from numpy... | Replace depreciated show_engine to show_pipeline, in examples. | Replace depreciated show_engine to show_pipeline, in examples.
| Python | bsd-3-clause | liulion/mayavi,dmsurti/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,liulion/mayavi,alexandreleroux/mayavi | ---
+++
@@ -13,7 +13,7 @@
from numpy import mgrid, sin, sqrt
# Display the MayaVi tree view UI.
-ui = mlab.show_engine()
+ui = mlab.show_pipeline()
# Create some data
X, Y = mgrid[-1:1:100j, -1:1:100j] |
8373c005cbf8ebc4069faf5291bb126db2cbb20f | polygraph/types/tests/test_scalars.py | polygraph/types/tests/test_scalars.py | from unittest import TestCase
from polygraph.types.scalar import Int
class IntTest(TestCase):
def test_class_types(self):
x = Int(245)
self.assertIsInstance(x, int)
self.assertIsInstance(x, Int)
self.assertEqual(Int(245) + 55, 300)
y = Int("506")
self.assertIsInsta... | from unittest import TestCase
from polygraph.types.scalar import Boolean, Float, Int, String
class IntTest(TestCase):
def test_class_types(self):
x = Int(245)
self.assertIsInstance(x, int)
self.assertIsInstance(x, Int)
self.assertEqual(Int(245) + 55, 300)
y = Int("506")
... | Add additional tests around scalars | Add additional tests around scalars
| Python | mit | polygraph-python/polygraph | ---
+++
@@ -1,5 +1,6 @@
from unittest import TestCase
-from polygraph.types.scalar import Int
+
+from polygraph.types.scalar import Boolean, Float, Int, String
class IntTest(TestCase):
@@ -13,3 +14,26 @@
self.assertIsInstance(y, int)
self.assertIsInstance(y, Int)
self.assertEqual(y, 5... |
e1ffdcc5f12be623633e2abab2041fcb574173ea | homeassistant/components/zeroconf.py | homeassistant/components/zeroconf.py | """
This module exposes Home Assistant via Zeroconf.
Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS).
For more details about Zeroconf, please refer to the documentation at
https://home-assistant.io/components/zeroconf/
"""
import logging
import socket
from homeassistant.const import (EVENT_HOMEASSIS... | """
This module exposes Home Assistant via Zeroconf.
Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS).
For more details about Zeroconf, please refer to the documentation at
https://home-assistant.io/components/zeroconf/
"""
import logging
import socket
from homeassistant.const import (EVENT_HOMEASSIS... | Use hass.config.api instead of hass.http | Use hass.config.api instead of hass.http
| Python | mit | miniconfig/home-assistant,Julian/home-assistant,toddeye/home-assistant,ct-23/home-assistant,deisi/home-assistant,tchellomello/home-assistant,rohitranjan1991/home-assistant,Julian/home-assistant,Duoxilian/home-assistant,betrisey/home-assistant,keerts/home-assistant,ct-23/home-assistant,tboyce021/home-assistant,kyvinh/ho... | ---
+++
@@ -13,13 +13,13 @@
REQUIREMENTS = ["zeroconf==0.17.5"]
+DEPENDENCIES = ["api"]
+
_LOGGER = logging.getLogger(__name__)
DOMAIN = "zeroconf"
ZEROCONF_TYPE = "_home-assistant._tcp.local."
-
-DEPENDENCIES = ["http"]
def setup(hass, config):
@@ -31,12 +31,12 @@
zeroconf_name = "{}.{}".format... |
c24fa91c900fc4f0d3ac5a10d10bfe5c57c9ef5c | errors.py | errors.py |
class ParserError(Exception):
"""Raised when parsing input fails."""
class OpenParenError(ParserError):
"""Raised when there are too few opening parenthesis."""
@staticmethod
def build():
return OpenParenError("too few opening parenthesis")
class CloseParenError(ParserError):
"""Raised w... |
class ParserError(Exception):
"""Raised when parsing input fails."""
class OpenParenError(ParserError):
"""Raised when there are too few opening parenthesis."""
@staticmethod
def build():
return OpenParenError("too few opening parenthesis")
class CloseParenError(ParserError):
"""Raised w... | Support class tuples as WATE args | Support class tuples as WATE args
| Python | mit | jasontbradshaw/plinth | ---
+++
@@ -36,8 +36,17 @@
@staticmethod
def build(arg, expected_class):
+ expected = ""
+ if hasattr(expected_class, "__name__"):
+ expected = expected_class.__name__ + ","
+ else:
+ # support multiple expected classes
+ expected = "one of "
+ ... |
9af440d8d7d2dc7b6ecf254ee1150f03d090cb6a | numpy/linalg/setup.py | numpy/linalg/setup.py |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg',parent_package,top_path)
config.add_data_dir('tests')
# Configure lapack_lite
lapack_info = get_info('lapack... |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg',parent_package,top_path)
config.add_data_dir('tests')
# Configure lapack_lite
lapack_info = get_info('lapack... | Disable pythonxerbla.c patch for win32 (the MSVC linker failes on multiple defined symbols) when using optimized lapack. | Disable pythonxerbla.c patch for win32 (the MSVC linker failes on multiple defined symbols) when using optimized lapack.
| Python | bsd-3-clause | jschueller/numpy,CMartelLML/numpy,cowlicks/numpy,larsmans/numpy,rudimeier/numpy,bertrand-l/numpy,ViralLeadership/numpy,sonnyhu/numpy,mattip/numpy,moreati/numpy,ViralLeadership/numpy,pyparallel/numpy,dato-code/numpy,mattip/numpy,nbeaver/numpy,dch312/numpy,ajdawson/numpy,WarrenWeckesser/numpy,leifdenby/numpy,larsmans/num... | ---
+++
@@ -13,6 +13,9 @@
print "### Warning: Using unoptimized lapack ###"
return ext.depends[:-1]
else:
+ if sys.platform=='win32':
+ print "### Warning: pythonxerbla.c is disabled ###"
+ return ext.depends[:1]
return ext.dep... |
a0b52b5a9b825e1a17d9c92694ac944f09411011 | db/database.py | db/database.py | import json
import pymongo
import praw
from pymongo import MongoClient
client = MongoClient()
db = client.reddit
posts = db.data
posts.create_index([("text", pymongo.TEXT),
("subreddit", pymongo.ASCENDING),
("created_utc", pymongo.DESCENDING)]);
print "Configuring database"
d... | import json
import pymongo
import praw
from pymongo import MongoClient
client = MongoClient("mongo")
db = client.reddit
posts = db.data
posts.create_index([("text", pymongo.TEXT),
("subreddit", pymongo.ASCENDING),
("created_utc", pymongo.DESCENDING)]);
print "Configuring datab... | Update db host to mongo | db: Update db host to mongo
| Python | unlicense | vilie/rp,vilie/rp | ---
+++
@@ -4,7 +4,7 @@
from pymongo import MongoClient
-client = MongoClient()
+client = MongoClient("mongo")
db = client.reddit
posts = db.data
posts.create_index([("text", pymongo.TEXT), |
3b01b6b67e8cf05c31f2c30a3e45a59ffbb31adb | djangae/fields/computed.py | djangae/fields/computed.py | from django.db import models
class ComputedFieldMixin(object):
def __init__(self, func, *args, **kwargs):
self.computer = func
kwargs["editable"] = False
super(ComputedFieldMixin, self).__init__(*args, **kwargs)
def pre_save(self, model_instance, add):
value = self.computer(... | from django.db import models
class ComputedFieldMixin(object):
def __init__(self, func, *args, **kwargs):
self.computer = func
kwargs["editable"] = False
super(ComputedFieldMixin, self).__init__(*args, **kwargs)
def pre_save(self, model_instance, add):
value = self.computer(... | Add from_db_value instead of removed SubfieldBase fields | Add from_db_value instead of removed SubfieldBase fields
| Python | bsd-3-clause | kirberich/djangae,asendecka/djangae,kirberich/djangae,potatolondon/djangae,kirberich/djangae,potatolondon/djangae,grzes/djangae,asendecka/djangae,grzes/djangae,grzes/djangae,asendecka/djangae | ---
+++
@@ -20,6 +20,9 @@
del kwargs["editable"]
return name, path, args, kwargs
+ def from_db_value(self, value, expression, connection, context):
+ return self.to_python(value)
+
class ComputedCharField(ComputedFieldMixin, models.CharField):
pass |
fc105f413e6683980c5d2fcc93a471ebbc9fecba | utils/files_provider.py | utils/files_provider.py | from string import Template
__author__ = 'maa'
templates_folder = 'file_templates_folder\\'
def create_and_full_fill_file(template_file_name, destination_file_path, file_name, kwargs):
template_file = open(templates_folder + template_file_name, 'r')
file_content = template_file.read()
template_file.clos... | from string import Template
__author__ = 'maa'
templates_folder = 'file_templates_folder\\'
def create_and_full_fill_file(template_file_name, destination_file_path, kwargs):
template_file = open(template_file_name, 'r')
file_content = template_file.read()
template_file.close()
template = Template(f... | Change method params because they are not necessary. | [dev] Change method params because they are not necessary.
| Python | apache-2.0 | amatkivskiy/baidu,amatkivskiy/baidu | ---
+++
@@ -5,8 +5,8 @@
templates_folder = 'file_templates_folder\\'
-def create_and_full_fill_file(template_file_name, destination_file_path, file_name, kwargs):
- template_file = open(templates_folder + template_file_name, 'r')
+def create_and_full_fill_file(template_file_name, destination_file_path, kwargs... |
f8d3b5d4c1d3d81dee1c22a4e2563e6b8d116c74 | openquake/__init__.py | openquake/__init__.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | Make the openquake namespace compatible with old setuptools | Make the openquake namespace compatible with old setuptools
Former-commit-id: 529c98ec0a7c5a3fefa4da6cdf2f6a58b5487ebc [formerly e5f4dc01e94694bf9bfcae3ecd6eca34a33a24eb]
Former-commit-id: e01df405c03f37a89cdf889c45de410cb1ca9b00 | Python | agpl-3.0 | gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine | ---
+++
@@ -16,4 +16,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
-__import__('pkg_resources').declare_namespace(__name__)
+# Make the namespace compatible with old setuptools, like the one
+# provided by QGIS 2... |
8e67071e82e13ae4131da773947f767f1fe91f40 | Code/Python/Kamaelia/Examples/UDP_Systems/SimplePeer_Example.py | Code/Python/Kamaelia/Examples/UDP_Systems/SimplePeer_Example.py | #!/usr/bin/python
"""
Simple Kamaelia Example that shows how to use a simple UDP Peer.
A UDP Peer actually sends and recieves however, so we could have
more fun example here with the two peers sending each other messages.
It's worth noting that these aren't "connected" peers in any shape
or form, and they're fixed who... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Vers... | Change license to Apache 2 | Change license to Apache 2 | Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | ---
+++
@@ -1,4 +1,22 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
+#
+# (1) Kamaelia Contributors are listed in the AUTHORS file and at
+# http://www.kamaelia.org/AUTHORS - please extend this file,
+# not this notice.
+#
+# Lic... |
1c65ef8eeccd433b256ed2cd1d3db7b6264fe8f2 | properties/tests/test_mach_angle.py | properties/tests/test_mach_angle.py | #!/usr/bin/env python
"""Test Mach angle functions.
Test data is obtained from http://www.grc.nasa.gov/WWW/k-12/airplane/machang.html.
"""
import nose
import nose.tools as nt
from properties.prandtl_meyer_function import mu_in_deg
@nt.raises(ValueError)
def test_mach_lesser_than_one():
m = 0.1
mu_in_deg(... | #!/usr/bin/env python
"""Test Mach angle functions.
"""
from __future__ import absolute_import, division
import nose
import nose.tools as nt
from properties.prandtl_meyer_function import mu_in_deg
@nt.raises(ValueError)
def test_mach_lesser_than_one():
m = 0.1
mu_in_deg(m)
def test_normal_mach():
m1... | Correct test data for mach angle | Correct test data for mach angle
| Python | mit | iwarobots/TunnelDesign | ---
+++
@@ -1,10 +1,9 @@
#!/usr/bin/env python
"""Test Mach angle functions.
-
-Test data is obtained from http://www.grc.nasa.gov/WWW/k-12/airplane/machang.html.
"""
+from __future__ import absolute_import, division
import nose
import nose.tools as nt
@@ -20,10 +19,10 @@
def test_normal_mach():
m1... |
d028ada7a1d1c7c66cb6e3e76cd5ed676981bc57 | 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... | Move the API to the root. | Move the API to the root.
| Python | bsd-2-clause | mblayman/lcp,mblayman/lcp,mblayman/lcp | ---
+++
@@ -23,7 +23,7 @@
router.register('schools', SchoolViewSet)
urlpatterns = [
+ url(r'^', include(router.urls)),
url(r'^admin/', admin.site.urls),
- url(r'^api/', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls')),
] |
f5d61059480a2698fc955641819e78cba28173b3 | src/adhocracy_core/adhocracy_core/changelog/test_init.py | src/adhocracy_core/adhocracy_core/changelog/test_init.py | from pytest import mark
from pytest import fixture
from pyramid import testing
def test_changelog_create():
from . import Changelog
from . import changelog_meta
inst = Changelog()
assert inst['/path/'] == changelog_meta
@fixture()
def integration(config):
config.include('adhocracy_core.events')
... | from pytest import mark
from pytest import fixture
from pyramid import testing
def test_changelog_create():
from . import Changelog
from . import changelog_meta
inst = Changelog()
assert inst['/path/'] == changelog_meta
@fixture()
def integration(config):
config.include('adhocracy_core.events')
... | Improve test coverage for changelog module | Improve test coverage for changelog module
| Python | agpl-3.0 | liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocra... | ---
+++
@@ -44,3 +44,15 @@
clear_modification_date_callback(request_)
date_after = get_modification_date(registry)
assert date_before is not date_after
+
+def test_create_changelog():
+ from adhocracy_core.changelog import create_changelog
+ from collections import defaultdict
+ assert type(cr... |
179c13d3fe2589d43e260da86e0465901d149a80 | rsk_mind/datasource/datasource_csv.py | rsk_mind/datasource/datasource_csv.py | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def read(self):
with open(self.path, 'rb') as infile:
reader = csv.reader(infile)
header = reader.next()
rows = []
for row in reader:
... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | Set targe class on csv document | Set targe class on csv document
| Python | mit | rsk-mind/rsk-mind-framework | ---
+++
@@ -3,6 +3,10 @@
from ..dataset import Dataset
class CSVDatasource(Datasource):
+
+ def __init__(self, path, target=None):
+ super(CSVDatasource, self).__init__(path)
+ self.target = target
def read(self):
with open(self.path, 'rb') as infile:
@@ -12,6 +16,11 @@
... |
3e0ecb96845f7b2efbb9b62c5eb1372cbe1452c5 | s2motc.py | s2motc.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Superbil'
__version__ = '0.1.0'
import shapefile
sf = shapefile.Reader("shapefiles/路網數值圖103年_西屯區道路路段")
# 確認 shapeType 種類
if sf.shapeType is 3:
print("PolyLine")
# srs = sf.shapeRecords()
mapping = {}
index = 0
for f in sf.fields:
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Superbil'
__version__ = '0.1.0'
import shapefile
import logging
log = logging.getLogger()
log.setLevel(logging.DEBUG)
sf = shapefile.Reader("shapefiles/路網數值圖103年_西屯區道路路段")
# 確認 shapeType 種類
if sf.shapeType is 3:
log.debug("PolyLine")
# srs = sf.sh... | Use logging to keep debug message | Use logging to keep debug message
| Python | mit | GIS-FCU/sdi-converter | ---
+++
@@ -5,12 +5,15 @@
__version__ = '0.1.0'
import shapefile
+import logging
+log = logging.getLogger()
+log.setLevel(logging.DEBUG)
sf = shapefile.Reader("shapefiles/路網數值圖103年_西屯區道路路段")
# 確認 shapeType 種類
if sf.shapeType is 3:
- print("PolyLine")
+ log.debug("PolyLine")
# srs = sf.shapeRecor... |
42c7b4c7b74a3aeccca73f368a16a2f96295ff3b | radar/radar/models/user_sessions.py | radar/radar/models/user_sessions.py | from sqlalchemy import String, Column, Integer, ForeignKey, DateTime, Index
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import relationship
from radar.database import db
from radar.models.users import User, AnonymousUser
from radar.models.logs import log_changes
@log_changes
class UserSession(db.M... | from sqlalchemy import String, Column, Integer, ForeignKey, DateTime, Index
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import relationship, backref
from radar.database import db
from radar.models.users import User, AnonymousUser
from radar.models.logs import log_changes
@log_changes
class UserSes... | Delete user sessions with user | Delete user sessions with user
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | ---
+++
@@ -1,6 +1,6 @@
from sqlalchemy import String, Column, Integer, ForeignKey, DateTime, Index
from sqlalchemy.dialects import postgresql
-from sqlalchemy.orm import relationship
+from sqlalchemy.orm import relationship, backref
from radar.database import db
from radar.models.users import User, AnonymousUs... |
c2b53224eecd6b5651e75b821ba68a471ed558d6 | runapp.py | runapp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Runs the development server of the downstream_node app.
# Not for production use.
import argparse
from downstream_node.startup import app, db
def initdb(sys=None):
db.engine.execute("CREATE DATABASE downstream")
db.create_all()
def eval_args(args):
if a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Runs the development server of the downstream_node app.
# Not for production use.
import argparse
from downstream_node.startup import app, db
def initdb():
db.create_all()
def eval_args(args):
if args.initdb:
initdb()
else:
app.run(debug... | Remove database engine command in initdb | Remove database engine command in initdb
| Python | mit | Storj/downstream-node,Storj/downstream-node | ---
+++
@@ -9,8 +9,7 @@
from downstream_node.startup import app, db
-def initdb(sys=None):
- db.engine.execute("CREATE DATABASE downstream")
+def initdb():
db.create_all()
|
38d9a85bc23bfcf3e44081d3077bbd5ca333fdf3 | src/damis/api/serializers.py | src/damis/api/serializers.py | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from damis.models import Dataset, Algorithm, Experiment
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSeria... | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from damis.models import Dataset, Algorithm, Experiment
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSeria... | Allow modify experiment status via REST API. | Allow modify experiment status via REST API.
| Python | agpl-3.0 | InScience/DAMIS-old,InScience/DAMIS-old | ---
+++
@@ -26,4 +26,4 @@
class ExperimentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Experiment
- fields = ('title', 'start', 'finish', 'user')
+ fields = ('title', 'start', 'finish', 'user', 'status') |
c265b49a5961f48542d22d8a4174ee885568c08c | luigi/tasks/export/fasta/__init__.py | luigi/tasks/export/fasta/__init__.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | Simplify the general Fasta export task | Simplify the general Fasta export task
It doesn't need to be so complicated, so we simplify it.
| Python | apache-2.0 | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | ---
+++
@@ -31,12 +31,8 @@
def requires(self):
yield FastaReadme()
+ yield NHmmerExport()
yield CompressExport()
- yield ActiveFastaExport()
- yield InactiveFastaExport()
- yield SpeciesSpecificFastaExport()
- yield NHmmerExcludedExport()
- yield NHmm... |
dcdfe91570e185df19daef49be9a368276e20483 | src/core/migrations/0039_fix_reviewer_url.py | src/core/migrations/0039_fix_reviewer_url.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-05-15 15:52
from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
Settin... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-05-15 15:52
from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
Settin... | Handle migrating non-string values (i.e.: NULL) | Handle migrating non-string values (i.e.: NULL)
| Python | agpl-3.0 | BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway | ---
+++
@@ -13,8 +13,9 @@
settings = SettingValueTranslation.objects.all()
for setting in settings:
- setting.value = re.sub(REGEX, OUTPUT, setting.value)
- setting.save()
+ if isinstance(setting.value, str):
+ setting.value = re.sub(REGEX, OUTPUT, setting.value)
+ ... |
43c62ea6d5558b0e6e5104eb05d45d89239e70b8 | q3/FindAllAbbreviations.py | q3/FindAllAbbreviations.py | import sys
def prependAbbrev(front, abbr):
if type(front) is type(abbr[0]):
return [front + abbr[0]] + abbr[1:]
else:
return [front] + abbr
def prefixAll(p, lst):
return [prependAbbrev(p, l) for l in lst]
def findAllAbbrev(s):
if len(s) == 1:
return [[s], [1]]
else:
... | import sys
def prependAbbrev(front, abbr):
if type(front) is type(abbr[0]):
return [front + abbr[0]] + abbr[1:]
else:
return [front] + abbr
def prefixAll(p, lst):
return [prependAbbrev(p, l) for l in lst]
def findAllAbbrev(s):
if len(s) == 1:
return [[s], [1]]
else:
... | Print usage if no word given | Print usage if no word given
| Python | mit | UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016 | ---
+++
@@ -16,5 +16,9 @@
rest = findAllAbbrev(s[1:])
return prefixAll(s[0], rest) + prefixAll(1, rest)
-for s in findAllAbbrev(sys.argv[1]):
- print ''.join([str(i) for i in s])
+if __name__ == '__main__':
+ if len(sys.argv) == 1:
+ print ' '.join(['usage:', sys.argv[0], '<word>'])
+... |
a050d510bce159ba646de322de31b05fede349e7 | catwatch/blueprints/billing/forms.py | catwatch/blueprints/billing/forms.py | from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = HiddenField(_('Stripe key'),
[DataRequired(), Length(1, 254)])
... | from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = HiddenField(_('Stripe key'),
[DataRequired(), Length(1, 254)])
... | Fix typo in cancel subscription submit button | Fix typo in cancel subscription submit button
| Python | mit | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/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,z123/build-a-saas-app-with-flask | ---
+++
@@ -15,4 +15,4 @@
class CancelSubscriptionForm(Form):
- submit = SubmitField(_('Cancel subscriptiption'))
+ submit = SubmitField(_('Cancel subscription')) |
d85d04da0f6ce283f53678bd81bd0987f59ce766 | curldrop/cli.py | curldrop/cli.py | import click
import os
from .app import app
from .server import StandaloneServer
@click.command()
@click.option(
'--port',
default=8000,
help='Port to listen on, default is 8000'
)
@click.option(
'--upload-dir',
default=os.getcwd(),
help='Directory where uploads are stored, if not specified th... | import click
import os
from .app import app
from .server import StandaloneServer
@click.command()
@click.option(
'--port',
default=8000,
help='Port to listen on, default is 8000'
)
@click.option(
'--upload-dir',
default=os.getcwd(),
help='Directory where uploads are stored, if not specified th... | Make gunicorn log to stdout/stderr | Make gunicorn log to stdout/stderr
| Python | mit | kennell/curldrop,kevvvvv/curldrop | ---
+++
@@ -36,6 +36,8 @@
port=port
),
'workers': 4,
+ 'accesslog': '-',
+ 'errorlog': '-'
}
StandaloneServer(app, server_options).run()
|
3e03d66c5351ac5e71f82a56aa01ba06865e1c25 | conda_verify/cli.py | conda_verify/cli.py | import os
import sys
from optparse import OptionParser
from conda_verify.errors import RecipeError
from conda_verify.verify import Verify
from conda_verify.utilities import render_metadata, iter_cfgs
def cli():
p = OptionParser(
usage="usage: %prog [options] <path to recipes or packages>",
descr... | import os
import sys
from optparse import OptionParser
from conda_verify.errors import RecipeError
from conda_verify.verify import Verify
from conda_verify.utilities import render_metadata, iter_cfgs
def cli():
p = OptionParser(
usage="usage: %prog [options] <path to recipes or packages>",
descr... | Change script run message output | Change script run message output
| Python | bsd-3-clause | mandeep/conda-verify | ---
+++
@@ -26,8 +26,9 @@
verifier = Verify()
for path in args:
- if os.path.isfile(os.path.join(path, 'meta.yaml')):
- print("==> %s <==" % path)
+ meta_file = os.path.join(path, 'meta.yaml')
+ if os.path.isfile(meta_file):
+ print('Verifying {}...' .format(meta... |
67637039b95f4030a462edb35d614bb678426dd3 | conversion_check.py | conversion_check.py | def check_iso_mcp(input_file):
"""
Checks if MCP conversion is allowed for the given file.
MCP files are only created if the DIF has an ISO Topic Category of
"OCEANS".
"""
allowed = False
# Cannot use the following check:
# oceans_tag = '<ISO_Topic_Category>OCEANS</ISO_Topic_Category>'
# This is because som... | def check_iso_mcp(input_file):
"""
Checks if MCP conversion is allowed for the given file.
MCP files are only created if the DIF has an ISO Topic Category of
"OCEANS".
"""
allowed = False
# Cannot use the following check:
# oceans_tag = '<ISO_Topic_Category>OCEANS</ISO_Topic_Category>'
# This is because som... | Add ANDS RIF-CS conversion check function | Add ANDS RIF-CS conversion check function
| Python | mit | AustralianAntarcticDataCentre/metadata_xml_convert,AustralianAntarcticDataCentre/metadata_xml_convert | ---
+++
@@ -20,3 +20,9 @@
allowed = True
return allowed
+
+
+def check_ands_rif_cs(file_path):
+ folder_path, file_name = os.path.split(file_path)
+ base_name, ext_name = os.path.splitext(file_name)
+ return not base_name.endswith('AAD_RIFCS_ISO') |
a57d4e3e1fa65b11b55d6f46dd778cdaf1ed8504 | webstack_django_sorting/middleware.py | webstack_django_sorting/middleware.py | def get_field(self):
try:
field = self.REQUEST['sort']
except (KeyError, ValueError, TypeError):
field = ''
return (self.direction == 'desc' and '-' or '') + field
def get_direction(self):
try:
return self.REQUEST['dir']
except (KeyError, ValueError, TypeError):
retu... | def get_field(self):
try:
field = self.GET['sort']
except (KeyError, ValueError, TypeError):
field = ''
return (self.direction == 'desc' and '-' or '') + field
def get_direction(self):
try:
return self.GET['dir']
except (KeyError, ValueError, TypeError):
return 'desc... | Fix deprecated use of REQUEST and only read the GET request | Fix deprecated use of REQUEST and only read the GET request
RemovedInDjango19Warning: `request.REQUEST` is deprecated, use
`request.GET` or `request.POST` instead.
| Python | bsd-3-clause | artscoop/webstack-django-sorting,artscoop/webstack-django-sorting | ---
+++
@@ -1,22 +1,21 @@
def get_field(self):
try:
- field = self.REQUEST['sort']
+ field = self.GET['sort']
except (KeyError, ValueError, TypeError):
field = ''
return (self.direction == 'desc' and '-' or '') + field
def get_direction(self):
try:
- return self.R... |
1b44849f9fac68c6ce0732baded63681cbf58ccb | osmaxx-py/osmaxx/contrib/auth/tests/test_frontend_permissions.py | osmaxx-py/osmaxx/contrib/auth/tests/test_frontend_permissions.py | from django.test import TestCase
from django.contrib.auth.models import User, Group
from osmaxx.contrib.auth.frontend_permissions import user_in_osmaxx_group, FRONTEND_USER_GROUP
class TestFrontendPermissions(TestCase):
def test_superuser_can_access_frontend_even_if_not_in_osmaxx_group(self):
an_admin = U... | from django.test import TestCase
from django.contrib.auth.models import User, Group
from osmaxx.contrib.auth.frontend_permissions import user_in_osmaxx_group, FRONTEND_USER_GROUP
class TestFrontendPermissions(TestCase):
def test_user_can_not_access_frontend_by_default(self):
a_user = User.objects.create_u... | Test that users can not access frontend by default | Test that users can not access frontend by default
| Python | mit | geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx | ---
+++
@@ -4,6 +4,10 @@
class TestFrontendPermissions(TestCase):
+ def test_user_can_not_access_frontend_by_default(self):
+ a_user = User.objects.create_user('U. Ser', 'user@example.com', 'password')
+ self.assertFalse(user_in_osmaxx_group(a_user))
+
def test_superuser_can_access_frontend... |
428ff9d74f52d938b9ee5ac03aec975dd5af191a | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Govet plugin class."""
from SublimeLinter.lint import Linter, util
class Govet(Linter):
"""Provides an interface to g... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Govet plugin class."""
from SublimeLinter.lint import Linter, util
class Govet(Linter):
"""Provides an interface to go... | Fix pep257 - D211: No blank lines allowed before class docstring (found 1) | Fix pep257 - D211: No blank lines allowed before class docstring (found 1)
| Python | mit | sirreal/SublimeLinter-contrib-govet | ---
+++
@@ -14,7 +14,6 @@
class Govet(Linter):
-
"""Provides an interface to go vet."""
syntax = ('go', 'gosublime-go') |
43c3a8a94c7783aadb440e529645f7db7c7913ff | successstories/forms.py | successstories/forms.py | from django import forms
from .models import Story
from cms.forms import ContentManageableModelForm
class StoryForm(ContentManageableModelForm):
class Meta:
model = Story
fields = (
'name',
'company_name',
'company_url',
'category',
'aut... | from django import forms
from .models import Story
from cms.forms import ContentManageableModelForm
class StoryForm(ContentManageableModelForm):
pull_quote = forms.CharField(widget=forms.Textarea(attrs={'rows': 5}))
class Meta:
model = Story
fields = (
'name',
'compan... | Reduce textarea height in Story form | Reduce textarea height in Story form
| Python | apache-2.0 | proevo/pythondotorg,manhhomienbienthuy/pythondotorg,manhhomienbienthuy/pythondotorg,Mariatta/pythondotorg,python/pythondotorg,python/pythondotorg,Mariatta/pythondotorg,manhhomienbienthuy/pythondotorg,proevo/pythondotorg,Mariatta/pythondotorg,python/pythondotorg,manhhomienbienthuy/pythondotorg,python/pythondotorg,Mariat... | ---
+++
@@ -5,6 +5,8 @@
class StoryForm(ContentManageableModelForm):
+ pull_quote = forms.CharField(widget=forms.Textarea(attrs={'rows': 5}))
+
class Meta:
model = Story
fields = ( |
e56e47828d381022cb2742b06f7f47d3fb64a499 | hiicart/gateway/braintree/tasks.py | hiicart/gateway/braintree/tasks.py | import logging
from celery.decorators import task
from hiicart.models import HiiCart
from hiicart.gateway.braintree.ipn import BraintreeIPN
log = logging.getLogger('hiicart.gateway.braintree.tasks')
@task
def update_payment_status(hiicart_id, transaction_id, tries=0):
"""Check the payment status of a Braintree... | import logging
from celery.decorators import task
from hiicart.models import HiiCart
from hiicart.gateway.braintree.ipn import BraintreeIPN
log = logging.getLogger('hiicart.gateway.braintree.tasks')
@task
def update_payment_status(hiicart_id, transaction_id, tries=0, cart_class=HiiCart):
"""Check the payment s... | Make cart class configurable for braintree task | Make cart class configurable for braintree task
| Python | mit | hiidef/hiicart,hiidef/hiicart | ---
+++
@@ -9,9 +9,9 @@
@task
-def update_payment_status(hiicart_id, transaction_id, tries=0):
+def update_payment_status(hiicart_id, transaction_id, tries=0, cart_class=HiiCart):
"""Check the payment status of a Braintree transaction."""
- hiicart = HiiCart.objects.get(pk=hiicart_id)
+ hiicart = cart... |
2bedbab8eb7d2efb9ff8e39a821fd2796dd4ce3f | police_api/service.py | police_api/service.py | import logging
import requests
logger = logging.getLogger(__name__)
class APIError(Exception):
pass
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.requester = requests.session()
self.config = {
'base_url': 'http://data.police.uk/api/'... | import logging
import requests
logger = logging.getLogger(__name__)
class APIError(Exception):
pass
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.requester = requests.session()
self.config = {
'base_url': 'http://data.police.uk/api/'... | Fix GET params bug with BaseService.request | Fix GET params bug with BaseService.request
| Python | mit | rkhleics/police-api-client-python | ---
+++
@@ -28,7 +28,7 @@
def request(self, verb, method, **kwargs):
verb = verb.upper()
request_kwargs = {}
- if method == 'GET':
+ if verb == 'GET':
request_kwargs['params'] = kwargs
else:
request_kwargs['data'] = kwargs |
53d3adce196d38278ccbdf5e8223c3c1d4543ffc | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2018.12.1"
__versionfull__ = __version__
| __version__ = "2018.12.2"
__versionfull__ = __version__
| Bump app version to 2018.12.2 | Bump app version to 2018.12.2
Signed-off-by: Guillaume Tucker <e7e20b7c30f19d4ca6b81319ef81bf200369d137@collabora.com>
| Python | lgpl-2.1 | kernelci/kernelci-backend,kernelci/kernelci-backend | ---
+++
@@ -1,2 +1,2 @@
-__version__ = "2018.12.1"
+__version__ = "2018.12.2"
__versionfull__ = __version__ |
e960bf04d3885228c0df9c182c8d073e800ec122 | dbaas/dashboard/templatetags/menu.py | dbaas/dashboard/templatetags/menu.py | # -*- coding: utf-8 -*-
from django import template
from physical.models import EngineType, Environment, Plan
register = template.Library()
@register.inclusion_tag('dashboard/menu.html')
def render_menu():
data_engines = []
for engine_type in EngineType.objects.all():
data_engine = {
'n... | # -*- coding: utf-8 -*-
from django import template
from physical.models import EngineType, Environment, Plan
register = template.Library()
@register.inclusion_tag('dashboard/menu.html')
def render_menu():
data_engines = []
for engine_type in EngineType.objects.all():
data_engine = {
'n... | Fix change on raleted name (Plan x Environment) | Fix change on raleted name (Plan x Environment)
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | ---
+++
@@ -16,7 +16,7 @@
'environments': [],
}
- for environment in Environment.objects.filter(plan__in=Plan.objects.filter(engine__engine_type=engine_type)).distinct():
+ for environment in Environment.objects.filter(plans__in=Plan.objects.filter(engine__engine_type=engine_type... |
a03f3ae483e7cdacbd50ad0646273b7e0c18b10f | manage.py | manage.py | import functools
import os
from flask.ext.debugtoolbar import DebugToolbarExtension
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from flask_app.app import app
from flask_app.models import db
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', Mi... | import functools
import os
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from flask_app.app import app
from flask_app.models import db
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)
_FROM_HERE = functools.partial(os.path.joi... | Fix DebugToolbar requirement in non-debug envs | Fix DebugToolbar requirement in non-debug envs
| Python | mit | getslash/mailboxer,getslash/mailboxer,vmalloc/mailboxer,getslash/mailboxer,Infinidat/lanister,Infinidat/lanister,vmalloc/mailboxer,vmalloc/mailboxer | ---
+++
@@ -1,7 +1,6 @@
import functools
import os
-from flask.ext.debugtoolbar import DebugToolbarExtension
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
@@ -18,10 +17,12 @@
@manager.command
def testserver():
+ from flask.ext.debugtoolbar import DebugToolba... |
cb9b7dcd01495999fac0671acd9e4bf138bd71ea | scripts/spotify-current.py | scripts/spotify-current.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import dbus
session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object('org.mpris.MediaPlayer2.spotify', '/org/mpris/MediaPlayer2')
spotify_properties = dbus.Interface(spotify_bus, 'org.freedesktop.DBus.Properties')
metadata = spotify_properties.Get('org.mpris.Media... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import dbus
session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object('org.mpris.MediaPlayer2.spotify', '/org/mpris/MediaPlayer2')
spotify_properties = dbus.Interface(spotify_bus, 'org.freedesktop.DBus.Properties')
metadata = spotify_properties.Get('org.mpris.Media... | Truncate spotify current song if it is too long | Truncate spotify current song if it is too long
| Python | mit | EllisV/dotfiles,EllisV/dotfiles | ---
+++
@@ -8,4 +8,7 @@
spotify_properties = dbus.Interface(spotify_bus, 'org.freedesktop.DBus.Properties')
metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata')
-print '♫', metadata['xesam:artist'][0], '-', metadata['xesam:title']
+title = metadata['xesam:artist'][0] + ' - ' + metadata['... |
26de8a5b63d6da42bbafaa3d520fe0fbbb3a7d54 | cms/utils/encoder.py | cms/utils/encoder.py | # -*- coding: utf-8 -*-
from django.utils.html import conditional_escape
from django.core.serializers.json import DjangoJSONEncoder
class SafeJSONEncoder(DjangoJSONEncoder):
def _recursive_escape(self, o, esc=conditional_escape):
if isinstance(o, dict):
return type(o)((esc(k), self._recursive_... | # -*- coding: utf-8 -*-
from django.utils.html import conditional_escape
from django.core.serializers.json import DjangoJSONEncoder
class SafeJSONEncoder(DjangoJSONEncoder):
def _recursive_escape(self, o, esc=conditional_escape):
if isinstance(o, dict):
return type(o)((esc(k), self._recursive_... | Fix copy page when permission is disabled | Fix copy page when permission is disabled
| Python | bsd-3-clause | frnhr/django-cms,andyzsf/django-cms,jeffreylu9/django-cms,timgraham/django-cms,qnub/django-cms,leture/django-cms,mkoistinen/django-cms,chmberl/django-cms,saintbird/django-cms,datakortet/django-cms,keimlink/django-cms,josjevv/django-cms,youprofit/django-cms,Livefyre/django-cms,takeshineshiro/django-cms,chkir/django-cms,... | ---
+++
@@ -9,6 +9,8 @@
return type(o)((esc(k), self._recursive_escape(v)) for (k, v) in o.iteritems())
if isinstance(o, (list, tuple)):
return type(o)(self._recursive_escape(v) for v in o)
+ if type(o) is bool:
+ return o
try:
return type(o)(... |
ad2ec120cb890de622d54f61104353c9427c788a | src/sentry/rules/__init__.py | src/sentry/rules/__init__.py | """
sentry.rules
~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .base import * # NOQA
from .registry import RuleRegistry # NOQA
def init_registry():
from sentry.constants imp... | """
sentry.rules
~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .base import * # NOQA
from .registry import RuleRegistry # NOQA
def init_registry():
from sentry.constants imp... | Correct rules registry addition via plugin (refs GH-2404) | Correct rules registry addition via plugin (refs GH-2404)
| Python | bsd-3-clause | JamesMura/sentry,looker/sentry,jean/sentry,fotinakis/sentry,ifduyue/sentry,alexm92/sentry,fotinakis/sentry,mvaled/sentry,gencer/sentry,gencer/sentry,zenefits/sentry,ifduyue/sentry,BuildingLink/sentry,gencer/sentry,beeftornado/sentry,ifduyue/sentry,jean/sentry,BuildingLink/sentry,fotinakis/sentry,daevaorn/sentry,JamesMu... | ---
+++
@@ -24,7 +24,7 @@
registry.add(cls)
for plugin in plugins.all(version=2):
for cls in (safe_execute(plugin.get_rules) or ()):
- register.add(cls)
+ registry.add(cls)
return registry
|
f74f46e4a3222fe0f6e10e38c204d2e3108bbf18 | git_reviewers/reviewers.py | git_reviewers/reviewers.py | #!/usr/bin/env python3
try:
import configparser
except ImportError:
raise ImportError("Must be using Python 3")
import argparse
import os
import subprocess
UBER=True
def extract_username(shortlog):
shortlog = shortlog.strip()
email = shortlog[shortlog.rfind("<")+1:]
email = email[:email.find("... | Add basic script to get most common committers | Add basic script to get most common committers
| Python | mit | albertyw/git-reviewers,albertyw/git-reviewers | ---
+++
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+
+try:
+ import configparser
+except ImportError:
+ raise ImportError("Must be using Python 3")
+
+import argparse
+import os
+import subprocess
+
+
+UBER=True
+
+
+def extract_username(shortlog):
+ shortlog = shortlog.strip()
+ email = shortlog[shortlog.r... | |
ce25be4609f6206343cdcb34b5342843f09f557b | server.py | server.py | from flask import Flask
from SPARQLWrapper import SPARQLWrapper, JSON
from flask import request, jsonify
from flask.ext.cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
def hello_world():
auth = request.authorization
query = request.args.get('query')
if not auth is None and not query is N... | from flask import Flask
from SPARQLWrapper import SPARQLWrapper, JSON
from flask import request, jsonify
from flask.ext.cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
def hello_world():
return 'hello world'
@app.route('/sparql')
def do_sparql():
auth = request.authorization
query = requ... | Add test route for heroku | Add test route for heroku
| Python | apache-2.0 | jvdzwaan/visun-flask | ---
+++
@@ -8,6 +8,10 @@
@app.route('/')
def hello_world():
+ return 'hello world'
+
+@app.route('/sparql')
+def do_sparql():
auth = request.authorization
query = request.args.get('query')
|
99be36b77741a9b2e3d330eb89e0e381b3a3081f | api.py | api.py | import json
from os import environ
from eve import Eve
from eve.io.mongo import Validator
from settings import API_NAME, URL_PREFIX
class KeySchemaValidator(Validator):
def _validate_keyschema(self, schema, field, dct):
"Validate all keys of dictionary `dct` against schema `schema`."
for key, va... | import json
from os import environ
from eve import Eve
from eve.io.mongo import Validator
from settings import API_NAME, URL_PREFIX
class KeySchemaValidator(Validator):
def _validate_keyschema(self, schema, field, dct):
"Validate all keys of dictionary `dct` against schema `schema`."
for key, va... | Add utility method to delete all documents of given resource | Add utility method to delete all documents of given resource
| Python | apache-2.0 | gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa | ---
+++
@@ -22,6 +22,11 @@
data=json.dumps(document),
content_type='application/json')
+
+def delete_resource(resource):
+ "Delete all documents of the given resource."
+ return api.test_client().delete('/' + URL_PREFIX + '/' + resource)
+
... |
6be8e85b17d390abea25897bd7a2703fb3300261 | app.py | app.py | import logging
import os
import tornado.ioloop
import tornado.log
import tornado.web
def configure_tornado_logging():
fh = logging.handlers.RotatingFileHandler(
'/var/log/ipborg/tornado.log', maxBytes=2**29, backupCount=10)
fmt = logging.Formatter('%(asctime)s:%(levelname)s:%(name)s:%(message)s')
... | import logging
import os
import tornado.ioloop
import tornado.log
import tornado.options
import tornado.web
tornado.options.define('tornado_log_file',
default='/var/log/ipborg/torando.log',
type=str)
tornado.options.define('app_log_file',
default='... | Add Tornado settings and log location command line options. | Add Tornado settings and log location command line options.
| Python | mit | jiffyclub/ipythonblocks.org,jiffyclub/ipythonblocks.org | ---
+++
@@ -3,12 +3,23 @@
import tornado.ioloop
import tornado.log
+import tornado.options
import tornado.web
+
+
+tornado.options.define('tornado_log_file',
+ default='/var/log/ipborg/torando.log',
+ type=str)
+tornado.options.define('app_log_file',
+ ... |
fea4ef7bc124da42c00989d8e4d69ff463854f02 | bot.py | bot.py | #! /usr/bin/env python
from time import gmtime, strftime
from foaas import foaas
from diaspy_client import Client
import re
import urllib2
client = Client()
notify = client.notifications()
for n in notify:
if not n.unread: continue
idm = re.search('href=\\"/posts/(\d+?)\\"', n._data['note_html'])
if hasattr(i... | #! /usr/bin/env python
from time import gmtime, strftime
from foaas import foaas
from diaspy_client import Client
import re
import urllib2
client = Client()
notify = client.notifications()
for n in notify:
if not n.unread: continue
idm = re.search('href=\\"/posts/(\d+?)\\"', n._data['note_html'])
if hasattr(i... | Add helper on not-well-formed commands | Add helper on not-well-formed commands
| Python | mit | Zauberstuhl/foaasBot | ---
+++
@@ -23,6 +23,11 @@
client.post(foaas(command))
except urllib2.URLError:
client.comment(post_id, "Fuck this! Something went wrong :\\")
+ else:
+ client.comment(post_id,
+ "Fuck this! Your command is not well-formed.\n"
+ "Check my profile description or "
+ ... |
b8aaaeb454f933b642bcd3a5a5931ca0286addd2 | api.py | api.py | import simplejson as json
import os
import sys
import urllib2
from pprint import pprint
from collections import defaultdict
from flask import Flask, render_template, request, jsonify, redirect
import time
api = Flask(__name__)
@api.route("/api")
def index():
return "API stats"
@api.route("/api/comment/ipsum/twit... | from flask import Flask, render_template, request, jsonify, redirect
import reddit
api = Flask(__name__)
@api.route("/api")
def index():
return "API stats"
@api.route("/api/comment/ipsum/twitter/<source>")
def ipsum_from_twitter():
pass
@api.route("/api/comment/reddit", methods=["POST"])
def ipsum_from_redd... | Add reddit endpoint to API | Add reddit endpoint to API
| Python | mit | captainsafia/dont-read-the-ipsum,captainsafia/dont-read-the-ipsum,captainsafia/dont-read-the-ipsum | ---
+++
@@ -1,11 +1,5 @@
-import simplejson as json
-import os
-import sys
-import urllib2
-from pprint import pprint
-from collections import defaultdict
from flask import Flask, render_template, request, jsonify, redirect
-import time
+import reddit
api = Flask(__name__)
@@ -17,9 +11,20 @@
def ipsum_from_twi... |
4c2c0e9da70459063c6f1f682a181e4d350e853c | do_the_tests.py | do_the_tests.py | # pop the current directory from search path
# python interpreter adds this to a top level script
# but we will likely have a name conflict (runtests.py .vs runtests package)
import sys; sys.path.pop(0)
from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(s... | from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| Remove now not needed path munging | Remove now not needed path munging
| Python | mit | sbird/fake_spectra,sbird/fake_spectra,sbird/fake_spectra | ---
+++
@@ -1,7 +1,3 @@
-# pop the current directory from search path
-# python interpreter adds this to a top level script
-# but we will likely have a name conflict (runtests.py .vs runtests package)
-import sys; sys.path.pop(0)
from runtests import Tester
import os.path
|
eb8862c6048dea7612bdb808156b42792669d61a | apps/bplan/models.py | apps/bplan/models.py | from django.contrib.auth.models import AnonymousUser
from django.db import models
from adhocracy4.models.base import TimeStampedModel
from adhocracy4.modules import models as module_models
from apps.extprojects.models import ExternalProject
class Bplan(ExternalProject):
office_worker_email = models.EmailField()
... | from django.contrib.auth.models import AnonymousUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
from adhocracy4.models.base import TimeStampedModel
from adhocracy4.modules import models as module_models
from apps.extprojects.models import ExternalProject
class Bplan(External... | Add bplan model field verbose names | Add bplan model field verbose names
| Python | agpl-3.0 | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | ---
+++
@@ -1,5 +1,6 @@
from django.contrib.auth.models import AnonymousUser
from django.db import models
+from django.utils.translation import ugettext_lazy as _
from adhocracy4.models.base import TimeStampedModel
from adhocracy4.modules import models as module_models
@@ -31,9 +32,14 @@
class Statement(Anon... |
563eb0c209a0cc75742d8acbae5dd6053e60636c | apps/welcome/urls.py | apps/welcome/urls.py | from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
# Smrtr
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
url(r'^2$', 'network.view... | from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
# Smrtr
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
#url(r'^2$', 'network.vie... | Remove networks from welcome activation, replace with challenges | Remove networks from welcome activation, replace with challenges
| Python | bsd-3-clause | mfitzp/smrtr,mfitzp/smrtr | ---
+++
@@ -10,8 +10,8 @@
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
- url(r'^2$', 'network.views.search', {'next': '/'}, name='welcome-2' ),
+ #url(r'^2$', 'network.views.search', {'next': '/'}, name='welcome-2' ),
# Skip this so user gets the welcome messa... |
0c5165bdddbce057cc4777d91cb1e4fc661b5925 | zuora/transport.py | zuora/transport.py | """
Transport for Zuora SOAP API
"""
import httplib2
from suds.transport import Reply
from suds.transport.http import HttpTransport
from suds.transport.http import HttpAuthenticated
class HttpTransportWithKeepAlive(HttpAuthenticated, object):
def __init__(self):
super(HttpTransportWithKeepAlive, self)._... | """
Transport for Zuora SOAP API
"""
import httplib2
from suds.transport import Reply
from suds.transport.http import HttpTransport
from suds.transport.http import HttpAuthenticated
class HttpTransportWithKeepAlive(HttpAuthenticated, object):
def __init__(self):
super(HttpTransportWithKeepAlive, self)._... | Set timeout to 20 seconds | Set timeout to 20 seconds
| Python | bsd-3-clause | liberation/zuora-client | ---
+++
@@ -12,7 +12,7 @@
def __init__(self):
super(HttpTransportWithKeepAlive, self).__init__()
- self.http = httplib2.Http(timeout=5)
+ self.http = httplib2.Http(timeout=20)
def open(self, request):
return HttpTransport.open(self, request) |
11f7c1ecadbbc68aa0a7d87570d25b24efb71fe6 | tests/run/ass2global.py | tests/run/ass2global.py | """
>>> getg()
5
>>> setg(42)
>>> getg()
42
"""
g = 5
def setg(a):
global g
g = a
def getg():
return g
class Test(object):
"""
>>> global_in_class
9
>>> Test.global_in_class
Traceback (most recent call last):
AttributeError: type object 'Test' has no attrib... | # mode: run
# tag: pyglobal
"""
>>> getg()
5
>>> getg()
5
>>> getg()
5
>>> setg(42)
>>> getg()
42
>>> getg()
42
>>> getg()
42
"""
g = 5
def setg(a):
global g
g = a
def getg():
return g
class Test(object):
"""
>>> global_in_class
9
>>> Test.global_in_class
Traceback (most recent c... | Extend test to see if global name caching actually works. | Extend test to see if global name caching actually works.
| Python | apache-2.0 | cython/cython,cython/cython,da-woods/cython,da-woods/cython,da-woods/cython,cython/cython,cython/cython,scoder/cython,scoder/cython,da-woods/cython,scoder/cython,scoder/cython | ---
+++
@@ -1,9 +1,20 @@
+# mode: run
+# tag: pyglobal
+
"""
- >>> getg()
- 5
- >>> setg(42)
- >>> getg()
- 42
+>>> getg()
+5
+>>> getg()
+5
+>>> getg()
+5
+>>> setg(42)
+>>> getg()
+42
+>>> getg()
+42
+>>> getg()
+42
"""
g = 5 |
fbc4154aeabd644390b9abca1a2382c0cc4298e0 | app.py | app.py | from flask import Flask
from flask import render_template
from queries import get_filenames, get_metadata
app = Flask(__name__)
@app.route("/")
@app.route("/<item>")
def index(item="002341336"):
files = get_filenames(item)
metadata = get_metadata(item)
return render_template("landing.html", file_id=item, files=f... | from flask import Flask
from flask import render_template
from queries import get_filenames, get_metadata
app = Flask(__name__)
@app.route("/")
@app.route("/<item>")
def index(item="002341336"):
files = sorted(get_filenames(item))
print files
metadata = get_metadata(item)
return render_template("landing.html", ... | Sort file names so they are displayed in alpha order | Sort file names so they are displayed in alpha order
| Python | mit | MITLibraries/ebooks,MITLibraries/ebooks | ---
+++
@@ -8,7 +8,8 @@
@app.route("/")
@app.route("/<item>")
def index(item="002341336"):
- files = get_filenames(item)
+ files = sorted(get_filenames(item))
+ print files
metadata = get_metadata(item)
return render_template("landing.html", file_id=item, files=files, metadata=metadata) |
c9ba5f2e402b46036f0b9a86bf34ac94db51edfb | server.py | server.py | from flask import Flask
from flask import render_template
import argparse
import games
import json
GAMES_COUNT = 100
app = Flask(__name__)
@app.route("/")
def index():
return render_template('games_list.html')
@app.route("/api/")
def games_api():
return json.dumps(game_list)
if __name__ == "__main__"... | from flask import Flask
from flask import render_template
from flask import request
import argparse
import games
import json
GAMES_COUNT = 100
app = Flask(__name__)
@app.route("/")
def index():
return render_template('games_list.html')
@app.route("/api/")
def games_api():
limit = request.args.get('limi... | Use query parameters to limit results | Use query parameters to limit results
| Python | bsd-3-clause | siggame/ng-games,siggame/ng-games,siggame/ng-games | ---
+++
@@ -1,5 +1,6 @@
from flask import Flask
from flask import render_template
+from flask import request
import argparse
import games
@@ -19,7 +20,9 @@
@app.route("/api/")
def games_api():
- return json.dumps(game_list)
+ limit = request.args.get('limit') or GAMES_COUNT
+ skip = request.args.ge... |
98550946e8bc0da9a1ecdec8f0e53490f8fd5e91 | conftest.py | conftest.py | import shutil
import pytest
try:
import six
except ImportError:
from django.utils import six
from django.conf import settings
def teardown_assets_directory():
# Removing the temporary TEMP_DIR. Ensure we pass in unicode
# so that it will successfully remove temp trees containing
# non-ASCII filen... | import shutil
import pytest
try:
import six
except ImportError:
from django.utils import six
from django.conf import settings
def teardown_assets_directory():
# Removing the temporary TEMP_DIR. Ensure we pass in unicode
# so that it will successfully remove temp trees containing
# non-ASCII filen... | Make pytest autodiscover tests depending on the INSTALLED_APPS | Make pytest autodiscover tests depending on the INSTALLED_APPS
| Python | apache-2.0 | j00bar/django-widgy,j00bar/django-widgy,j00bar/django-widgy | ---
+++
@@ -19,3 +19,22 @@
@pytest.fixture(scope="session", autouse=True)
def assets_directory(request):
request.addfinalizer(teardown_assets_directory)
+
+
+def get_collect_ignore():
+ mapping = {
+ 'widgy.contrib.widgy_mezzanine': ['widgy/contrib/widgy_mezzanine/'],
+ 'widgy.contrib.form_bui... |
e6c91c06005c131805edeaf6b4980ff7f73b87b6 | conftest.py | conftest.py | '''py.test standard config file.'''
import sys
# pylint: disable=invalid-name
collect_ignore = ('setup.py',)
# pylint: enable=invalid-name
def pytest_cmdline_preparse(args):
is_pylint_compatible = (2, 7) <= sys.version_info < (3, 5)
if not is_pylint_compatible:
args.remove('--pylint')
| '''py.test standard config file.'''
import sys
# pylint: disable=invalid-name
collect_ignore = ('setup.py',)
# pylint: enable=invalid-name
def pytest_cmdline_preparse(args):
is_pylint_compatible = (2, 7) <= sys.version_info < (3, 6)
if not is_pylint_compatible:
args.remove('--pylint')
| Raise supported Python version for currently pinned pylint | Raise supported Python version for currently pinned pylint
| Python | bsd-3-clause | jvanasco/tldextract,john-kurkowski/tldextract | ---
+++
@@ -9,6 +9,6 @@
# pylint: enable=invalid-name
def pytest_cmdline_preparse(args):
- is_pylint_compatible = (2, 7) <= sys.version_info < (3, 5)
+ is_pylint_compatible = (2, 7) <= sys.version_info < (3, 6)
if not is_pylint_compatible:
args.remove('--pylint') |
7de22e999bb63cd83f8af6065638a97eeb3ba2d6 | bongo/settings/travis.py | bongo/settings/travis.py | from prod import *
# The same settings as production, but no database password.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bongo_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '5432',
},
}
IN... | from prod import *
# The same settings as production, but no database password.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bongo_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '5432',
},
}
IN... | Throw this Raven DSN from the docs at Travis to make it shut up | Throw this Raven DSN from the docs at Travis to make it shut up
| Python | mit | BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo | ---
+++
@@ -22,3 +22,7 @@
NOSE_ARGS = ['--with-fixture-bundling', '--nologcapture']
NOSE_TESTMATCH = '(?:^|[b_./-])[Tt]ests'
+
+RAVEN_CONFIG = {
+ "dsn": "http://dd2c825ff9b1417d88a99573903ebf80:91631495b10b45f8a1cdbc492088da6a@localhost:9000/1",
+} |
9b4f83ec89c76d8a5b5d0502e2903e2821078271 | logger.py | logger.py | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
while True:
line = ser.readline()
outfile.w... | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
while True:
line = ser.readline()
print(lin... | Print lines that are logged | Print lines that are logged
| Python | mit | wapcaplet/ardiff | ---
+++
@@ -12,6 +12,7 @@
outfile = open(filename, 'w')
while True:
line = ser.readline()
+ print(line)
outfile.write(line)
if __name__ == '__main__': |
723efad0416dbc16a3a7f94a62236673e60dc5a3 | goodtablesio/utils/frontend.py | goodtablesio/utils/frontend.py | from flask import render_template
from flask_login import current_user
from goodtablesio import settings
# Module API
def render_component(component, props=None):
"""Render frontend component within html layout.
Args:
component (str): component name
props (dict): component props
Return... | from flask import render_template
from flask_login import current_user
from goodtablesio import settings
# Module API
def render_component(component, props=None):
"""Render frontend component within html layout.
Args:
component (str): component name
props (dict): component props
Return... | Handle users with no name | Handle users with no name
| Python | agpl-3.0 | frictionlessdata/goodtables.io,frictionlessdata/goodtables.io,frictionlessdata/goodtables.io,frictionlessdata/goodtables.io | ---
+++
@@ -26,9 +26,9 @@
# Common props
if props == {} or (props and 'userName' not in props):
- user_name = getattr(current_user, 'display_name')
+ user_name = getattr(current_user, 'display_name', None)
if not user_name:
- user_name = getattr(current_user, 'name')
+ ... |
5238fed5b5557b8a282a9120380eee01abb49bc5 | fuzzers/038-cfg/add_constant_bits.py | fuzzers/038-cfg/add_constant_bits.py | import sys
constant_bits = {
"CFG_CENTER_MID.ALWAYS_ON_PROP1": "26_2206",
"CFG_CENTER_MID.ALWAYS_ON_PROP2": "26_2207",
"CFG_CENTER_MID.ALWAYS_ON_PROP3": "27_2205"
}
with open(sys.argv[1], "a") as f:
for bit_name, bit_value in constant_bits.items():
f.write(bit_name + " " + bit_value + "\n")
| """
Add bits that are considered always on to the db file.
This script is Zynq specific.
There are three bits that are present in all Zynq bitstreams.
The investigation that was done to reach this conclusion is captured on GH
(https://github.com/SymbiFlow/prjxray/issues/746)
In brief, these bits seem to be bitstream ... | Add background to script's purpose | Add background to script's purpose
Signed-off-by: Tomasz Michalak <a2fdaa543b4cc5e3d6cd8672ec412c0eb393b86e@antmicro.com>
| Python | isc | SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray | ---
+++
@@ -1,3 +1,17 @@
+"""
+Add bits that are considered always on to the db file.
+
+This script is Zynq specific.
+
+There are three bits that are present in all Zynq bitstreams.
+The investigation that was done to reach this conclusion is captured on GH
+(https://github.com/SymbiFlow/prjxray/issues/746)
+In bri... |
9e67babf85a46128b96dd6818fa860447b4052e7 | tests/integration/ssh/test_mine.py | tests/integration/ssh/test_mine.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf
# Import Salt Libs
import salt.utils
@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
class SSHMineTest(SS... | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import os
import shutil
# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf
# Import Salt Libs
import salt.utils
@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Window... | Add teardown to remove ssh dir | Add teardown to remove ssh dir
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -2,6 +2,8 @@
# Import Python libs
from __future__ import absolute_import
+import os
+import shutil
# Import Salt Testing Libs
from tests.support.case import SSHCase
@@ -22,3 +24,11 @@
'''
ret = self.run_function('mine.get', ['localhost test.arg'], wipe=False)
self.assertE... |
13e4d867e724f408b5d2dd21888b2f8a28d8fbc6 | fabfile.py | fabfile.py | # -*- coding: utf-8 -*
"""
Simple fabric file to test oinspect output
"""
from __future__ import print_function
import webbrowser
import oinspect.sphinxify as oi
def test_basic():
"""Test with an empty context"""
docstring = 'A test'
content = oi.sphinxify(docstring, oi.generate_context())
page_nam... | # -*- coding: utf-8 -*
"""
Simple fabric file to test oinspect output
"""
from __future__ import print_function
import webbrowser
import oinspect.sphinxify as oi
def _show_page(content, fname):
with open(fname, 'w') as f:
f.write(content)
webbrowser.open_new_tab(fname)
def test_basic():
"""Tes... | Add a test for math | Add a test for math
| Python | bsd-3-clause | techtonik/docrepr,spyder-ide/docrepr,techtonik/docrepr,techtonik/docrepr,spyder-ide/docrepr,spyder-ide/docrepr | ---
+++
@@ -10,14 +10,22 @@
import oinspect.sphinxify as oi
+def _show_page(content, fname):
+ with open(fname, 'w') as f:
+ f.write(content)
+ webbrowser.open_new_tab(fname)
+
def test_basic():
"""Test with an empty context"""
docstring = 'A test'
content = oi.sphinxify(docstring, o... |
c7ee6f0094535aa0ea37becfc4e9403a3d511304 | tests/src/core/views/test_index.py | tests/src/core/views/test_index.py | #/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | #/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | Add tests for core.views.index.py. The tests presently test only if the corresponding urls can be accessed. | Add tests for core.views.index.py. The tests presently test only if the corresponding urls can be accessed.
| Python | apache-2.0 | cidadania/e-cidadania,cidadania/e-cidadania | ---
+++
@@ -18,11 +18,12 @@
# You should have received a copy of the GNU General Public License
# along with e-cidadania. If not, see <http://www.gnu.org/licenses/>.
+from e_cidadania import url_names
from tests.test_utils import ECDTestCase
-class IndexTestCase(ECDTestCase):
+class IndexTestCase(ECDTestCa... |
f9eeb75292f9a3f134f4b33849ee2d6a51bc4e4e | jasylibrary.py | jasylibrary.py | #import os, json
#from jasy.core.Util import executeCommand
#import jasy.core.Console as Console
#import urllib.parse
# Little helper to allow python modules in current jasylibrarys path
import sys, os.path, inspect
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath... | #import os, json
#from jasy.core.Util import executeCommand
#import jasy.core.Console as Console
#import urllib.parse
# Little helper to allow python modules in current jasylibrarys path
import sys, os.path, inspect
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath... | Add part loading command on profile instead of session | Add part loading command on profile instead of session
| Python | mit | fastner/konstrukteur,fastner/konstrukteur,fastner/konstrukteur | ---
+++
@@ -25,7 +25,7 @@
filename = profile.expandFileName("%s/%s-{{id}}.%s" % (outputPath, part, type))
return filename
- session.addCommand("part.url", getPartUrl, "url")
+ profile.addCommand("part.url", getPartUrl, "url")
for permutation in profile.permutate():
konstrukteur.Konstrukteur.build(regen... |
a04a5a80057e86af2c5df0e87a7d2c3c221123ae | rpc_server/CouchDBViewDefinitions.py | rpc_server/CouchDBViewDefinitions.py | definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
... | definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
... | Add view to get project jobs. | Add view to get project jobs.
| Python | apache-2.0 | anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46 | ---
+++
@@ -21,5 +21,15 @@
}
}
"""
+ },
+ {
+ "doc": "manage", "view": "jobs",
+ "map": """
+ function(doc) {
+ if (doc.type === 'job'){
+ emit(doc.name, doc._id);
+ }
+ }
+ """
}
,) |
b7ce3042c67c17a203590dd78014590626abbc48 | fragdev/urls.py | fragdev/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Blog URLs
url(r'^blog/(?P<path>.*)', include('wiblog.urls', namespace='wiblog')),
# Handl... | from django.conf import settings
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Blog URLs
#url(r'^blog/(?P<path>.*)', include('wiblog.urls', namespace='wiblog')),
# Hand... | Remove Debugging Paths, Comment Out Unfinished Portions | Remove Debugging Paths, Comment Out Unfinished Portions
| Python | agpl-3.0 | lo-windigo/fragdev,lo-windigo/fragdev | ---
+++
@@ -7,7 +7,7 @@
urlpatterns = patterns('',
# Blog URLs
- url(r'^blog/(?P<path>.*)', include('wiblog.urls', namespace='wiblog')),
+ #url(r'^blog/(?P<path>.*)', include('wiblog.urls', namespace='wiblog')),
# Handle all of the "static" pages
url(r'^$', 'fragdev.views.home', name='home'),
@@ -... |
e2a7e7c80ef4d9c82b0a57908398f43f24234c63 | setup.py | setup.py | import setuptools
setuptools.setup(
name="inidiff",
version="0.1.0",
url="https://github.com/kragniz/inidiff",
author="Louis Taylor",
author_email="louis@kragniz.eu",
description="Find the differences between two ini config files",
long_description=open('README.rst').read(),
packages... | import setuptools
setuptools.setup(
name="inidiff",
version="0.1.0",
url="https://github.com/kragniz/inidiff",
author="Louis Taylor",
author_email="louis@kragniz.eu",
description="Find the differences between two ini config files",
long_description=open('README.rst').read(),
packages... | Set python classifiers to py34 | Set python classifiers to py34
| Python | mit | kragniz/inidiff | ---
+++
@@ -28,6 +28,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
],
) |
bbba98884aff75e2b0d6af81150a3596a7c76038 | setup.py | setup.py | import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
NAME = "pinax-blog"
DESCRIPTION = "a Django blog app"
AUTHOR = "Pinax Team"
AUTHO... | import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
NAME = "pinax-blog"
DESCRIPTION = "a Django blog app"
AUTHOR = "Pinax Team"
AUTHO... | Use more recent packages as minimum requirements | Use more recent packages as minimum requirements
| Python | mit | swilcox/pinax-blog,cdvv7788/pinax-blog,miurahr/pinax-blog,salamer/pinax-blog,pinax/pinax-blog,swilcox/pinax-blog,miurahr/pinax-blog,easton402/pinax-blog,easton402/pinax-blog,pinax/pinax-blog,pinax/pinax-blog | ---
+++
@@ -33,8 +33,8 @@
install_requires=[
"django-appconf>=1.0.1",
"Pillow>=2.0",
- "Markdown>=2.4",
- "Pygments>=1.6"
+ "Markdown>=2.6",
+ "Pygments>=2.0.2"
],
test_suite="runtests.runtests",
classifiers=[ |
11e89d42949ff49890cc380f72061aac0e6b02e0 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
with open('README.rst') as f:
long_description = f.read()
setup(
name='pylint-venv',
version='2.0.0.dev0',
description='pylint-venv provides a Pylint init-hook to use the same '
'Pylint installation with different virtual environments.',
... | #!/usr/bin/env python
from distutils.core import setup
with open('README.rst') as f:
long_description = f.read()
setup(
name='pylint-venv',
version='1.1.0',
description='pylint-venv provides a Pylint init-hook to use the same '
'Pylint installation with different virtual environments.',
long... | Revert major version, bump minor version 1.1.0 | Revert major version, bump minor version 1.1.0 | Python | mit | jgosmann/pylint-venv | ---
+++
@@ -8,7 +8,7 @@
setup(
name='pylint-venv',
- version='2.0.0.dev0',
+ version='1.1.0',
description='pylint-venv provides a Pylint init-hook to use the same '
'Pylint installation with different virtual environments.',
long_description=long_description, |
7f226d265c65cca2d74988695502d2edff3aa6a3 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
from setuputils import find_version, read
setup(
name='astor',
version=find_version('astor/__init__.py'),
description='Read/rewrite/write Python ASTs',
long_description=read('README.rst'),
author='Patrick Maupin',
author_email='pmaupin@gmail... | #!/usr/bin/env python
from setuptools import setup
from setuputils import find_version, read
setup(
name='astor',
version=find_version('astor/__init__.py'),
description='Read/rewrite/write Python ASTs',
long_description=read('README.rst'),
author='Patrick Maupin',
author_email='pmaupin@gmail... | Set development status to stable. | Set development status to stable. | Python | bsd-3-clause | berkerpeksag/astor,zackmdavis/astor | ---
+++
@@ -18,7 +18,7 @@
py_modules=['setuputils'],
license="BSD",
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD L... |
539c8cbb91465fe1aabc25452bce7067c7474da5 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='8.0.1',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='8.0.2',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | Update the PyPI version to 8.0.2. | Update the PyPI version to 8.0.2.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='8.0.1',
+ version='8.0.2',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
1cb261bce94e7eb5bccccd282f938074e758f5bc | setup.py | setup.py | #!/usr/bin/env python
# Copyright Least Authority Enterprises.
# See LICENSE for details.
import setuptools
_metadata = {}
with open("src/txkube/_metadata.py") as f:
exec(f.read(), _metadata)
setuptools.setup(
name="txkube",
version=_metadata["version_string"],
description="A Twisted-based Kubernete... | #!/usr/bin/env python
# Copyright Least Authority Enterprises.
# See LICENSE for details.
import setuptools
_metadata = {}
with open("src/txkube/_metadata.py") as f:
exec(f.read(), _metadata)
with open("README.rst") as f:
_metadata["description"] = f.read()
setuptools.setup(
name="txkube",
version=_... | Add the README as the long description. | Add the README as the long description.
| Python | mit | LeastAuthority/txkube | ---
+++
@@ -8,11 +8,14 @@
_metadata = {}
with open("src/txkube/_metadata.py") as f:
exec(f.read(), _metadata)
+with open("README.rst") as f:
+ _metadata["description"] = f.read()
setuptools.setup(
name="txkube",
version=_metadata["version_string"],
description="A Twisted-based Kubernetes c... |
b1a92e41e31e18d2a273c476414e702daf1c1847 | setup.py | setup.py | """Defines the setup for the declxml library"""
from setuptools import setup
setup(
name='declxml',
description='Declarative XML processing library',
version='0.11.0',
url='http://declxml.readthedocs.io/',
author='Greg Atkin',
author_email='greg.scott.atkin@gmail.com',
license='MIT',
py... | """Defines the setup for the declxml library"""
from io import open
import os.path
from setuptools import setup
readme_path = os.path.join(os.path.dirname(__file__), 'README.md')
with open(readme_path, encoding='utf-8') as readme:
long_description = readme.read()
setup(
name='declxml',
description='Decl... | Bump version for PyPi release | Bump version for PyPi release
| Python | mit | gatkin/declxml | ---
+++
@@ -1,11 +1,26 @@
"""Defines the setup for the declxml library"""
+from io import open
+import os.path
from setuptools import setup
+
+
+readme_path = os.path.join(os.path.dirname(__file__), 'README.md')
+with open(readme_path, encoding='utf-8') as readme:
+ long_description = readme.read()
+
setup(
... |
c89157c748bedb65d74f4109a7398cafc7e58f9d | neuroimaging/algorithms/tests/test_onesample.py | neuroimaging/algorithms/tests/test_onesample.py | from neuroimaging.testing import *
from neuroimaging.algorithms.onesample import ImageOneSample
from neuroimaging.core.api import load_image
from neuroimaging.utils.tests.data import repository
class test_OneSample(TestCase):
@dec.slow
@dec.data
def test_onesample1(self):
im1 = load_image('FIAC/fi... | from neuroimaging.testing import *
from neuroimaging.algorithms.onesample import ImageOneSample
from neuroimaging.core.api import load_image
from neuroimaging.utils.tests.data import repository
class test_OneSample(TestCase):
@dec.skipknownfailure
@dec.slow
@dec.data
def test_onesample1(self):
... | Update data file references. Skip known test failure to undefined image iterator. | Update data file references. Skip known test failure to undefined image iterator. | Python | bsd-3-clause | alexis-roche/nireg,arokem/nipy,arokem/nipy,alexis-roche/nipy,bthirion/nipy,nipy/nipy-labs,alexis-roche/nipy,bthirion/nipy,alexis-roche/register,alexis-roche/register,alexis-roche/nireg,bthirion/nipy,nipy/nireg,alexis-roche/register,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/niseg,arokem/nipy,arokem/nipy,alexis-roche... | ---
+++
@@ -5,14 +5,29 @@
from neuroimaging.utils.tests.data import repository
class test_OneSample(TestCase):
+ @dec.skipknownfailure
@dec.slow
@dec.data
def test_onesample1(self):
- im1 = load_image('FIAC/fiac3/fonc3/fsl/fmristat_run/contrasts/speaker/effect.nii.gz',
- reposi... |
3d04bb1774e286df4cda3695b938251e0a6266ae | grip/patcher.py | grip/patcher.py | import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled=""> \1\2')
COMPLETE_TASK_RE = re.compile(r'<li>\[x\] (.*?)(<... | import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled=""> \1\2')
COMPLETE_TASK_RE = re.compile(r'<li>\[x\] (.*?)(<... | Patch the GitHub API response to work around the header bug | Patch the GitHub API response to work around the header bug
| Python | mit | joeyespo/grip,joeyespo/grip | ---
+++
@@ -11,6 +11,11 @@
r'checked="" disabled=""> \1\2')
+HEADER_PATCH_RE = re.compile(r'<span>{:"aria-hidden"=>"true", :class=>'
+ r'"octicon octicon-link"}</span>', re.DOTALL)
+HEADER_PATCH_SUB = r'<span class="octicon octicon-link"></span>'
+
+
def pa... |
d5094e3b9ea2ff62483093e3415dee1044fd9974 | setup.py | setup.py | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name... | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name... | Add Python 3.8 to supported versions | Add Python 3.8 to supported versions
| Python | mit | Kankroc/pdf2image,Belval/pdf2image | ---
+++
@@ -12,7 +12,7 @@
setup(
name="pdf2image",
- version="1.9.0",
+ version="1.9.1",
description="A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list.",
long_description=long_description,
long_description_content_type="text/markdown",
@@ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.