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 |
|---|---|---|---|---|---|---|---|---|---|---|
723f59d43cce9d7a09386447389e8df33b5d323e | tests/base/base.py | tests/base/base.py | import steel
import unittest
class NameAwareOrderedDictTests(unittest.TestCase):
def setUp(self):
self.d = steel.NameAwareOrderedDict()
def test_ignore_object(self):
# Objects without a set_name() method should be ignored
self.d['example'] = object()
self.assertFalse(hasattr(s... | import steel
import unittest
class NameAwareOrderedDictTests(unittest.TestCase):
def setUp(self):
self.d = steel.NameAwareOrderedDict()
def test_ignore_object(self):
# Objects without a set_name() method should be ignored
self.d['example'] = object()
self.assertFalse(hasattr(s... | Add a simple test for calculating the size of a structure | Add a simple test for calculating the size of a structure
| Python | bsd-3-clause | gulopine/steel-experiment | ---
+++
@@ -29,3 +29,12 @@
with self.assertRaises(TypeError):
self.d['example'] = ErrorObject()
+
+
+class SizeTests(unittest.TestCase):
+ def test_explicit_sizes(self):
+ class Test(steel.Structure):
+ field1 = steel.Bytes(size=2)
+ field2 = steel.Bytes(size=4)... |
73af60749ea7b031473bc5f0c3ddd60d39ec6fa6 | docs/examples/customer_fetch/get_customer.py | docs/examples/customer_fetch/get_customer.py | from sharpy.product import CheddarProduct
# Get a product instance to work with
product = CheddarProduct(
username = CHEDDAR_USERNAME,
password = CHEDDAR_PASSWORD,
product_code = CHEDDAR_PRODUCT,
)
# Get the customer from Cheddar Getter
customer = product.get_customer(code='1BDI') | from sharpy.product import CheddarProduct
from sharpy import exceptions
# Get a product instance to work with
product = CheddarProduct(
username = CHEDDAR_USERNAME,
password = CHEDDAR_PASSWORD,
product_code = CHEDDAR_PRODUCT,
)
try:
# Get the customer from Cheddar Getter
customer = product.get_cus... | Add a bit to the get customer to show handling not-found and testing for canceled status | Add a bit to the get customer to show handling not-found and testing for canceled status
| Python | bsd-3-clause | SeanOC/sharpy,smartfile/sharpy | ---
+++
@@ -1,4 +1,5 @@
from sharpy.product import CheddarProduct
+from sharpy import exceptions
# Get a product instance to work with
product = CheddarProduct(
@@ -7,5 +8,17 @@
product_code = CHEDDAR_PRODUCT,
)
-# Get the customer from Cheddar Getter
-customer = product.get_customer(code='1BDI')
+try:
+... |
7f9ea07f2ee55ff36009bc67068c36bc1180c909 | tests/test_credentials.py | tests/test_credentials.py | import json
import keyring
from pyutrack import Credentials
from tests import PyutrackTest
class CredentialsTests(PyutrackTest):
def test_empty(self):
c = Credentials('root')
self.assertIsNone(c.password)
self.assertIsNone(c.cookies)
def test_persistence(self):
c = Credentia... | import json
import keyring
from pyutrack import Credentials
from tests import PyutrackTest
class CredentialsTests(PyutrackTest):
def test_empty(self):
c = Credentials('root')
self.assertIsNone(c.password)
self.assertIsNone(c.cookies)
def test_persistence(self):
c = Credentia... | Add test for credentials reload | Add test for credentials reload
| Python | mit | alisaifee/pyutrack,alisaifee/pyutrack | ---
+++
@@ -24,4 +24,15 @@
)
+ def test_reload(self):
+ Credentials('root', 'passwd', {"key": "value"}).persist()
+ c = Credentials('root')
+ self.assertEqual(
+ keyring.get_password(Credentials.KEYRING_PASSWORD, 'root'), 'passwd'
+ )
+ self.assertEqual(
+... |
82b7e46ebdeb154963520fec1d41cc624ceb806d | tests/test_vendcrawler.py | tests/test_vendcrawler.py | import unittest
from vendcrawler.scripts.vendcrawler import VendCrawler
class TestVendCrawlerMethods(unittest.TestCase):
def test_get_links(self):
links = VendCrawler().get_links(2)
self.assertEqual(links,
['https://sarahserver.net/?module=vendor&p=1',
... | import unittest
from vendcrawler.scripts.vendcrawler import VendCrawler
class TestVendCrawlerMethods(unittest.TestCase):
def test_get_links(self):
links = VendCrawler('a', 'b', 'c').get_links(2)
self.assertEqual(links,
['https://sarahserver.net/?module=vendor&p=1',
... | Fix test by passing placeholder variables. | Fix test by passing placeholder variables.
| Python | mit | josetaas/vendcrawler,josetaas/vendcrawler,josetaas/vendcrawler | ---
+++
@@ -5,7 +5,7 @@
class TestVendCrawlerMethods(unittest.TestCase):
def test_get_links(self):
- links = VendCrawler().get_links(2)
+ links = VendCrawler('a', 'b', 'c').get_links(2)
self.assertEqual(links,
['https://sarahserver.net/?module=vendor&p=1',
... |
154d7c17228cf9196ea4ee6b5e13a5268cc69407 | script/release/release/pypi.py | script/release/release/pypi.py | from __future__ import absolute_import
from __future__ import unicode_literals
from configparser import Error
from requests.exceptions import HTTPError
from twine.commands.upload import main as twine_upload
from twine.utils import get_config
from .utils import ScriptError
def pypi_upload(args):
print('Uploading... | from __future__ import absolute_import
from __future__ import unicode_literals
from configparser import Error
from requests.exceptions import HTTPError
from twine.commands.upload import main as twine_upload
from twine.utils import get_config
from .utils import ScriptError
def pypi_upload(args):
print('Uploading... | Fix script for release file already present case | Fix script for release file already present case
This avoids a:
"AttributeError: 'HTTPError' object has no attribute 'message'"
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com>
| Python | apache-2.0 | thaJeztah/compose,thaJeztah/compose,vdemeester/compose,vdemeester/compose | ---
+++
@@ -18,7 +18,7 @@
'dist/docker-compose-{}*.tar.gz'.format(rel)
])
except HTTPError as e:
- if e.response.status_code == 400 and 'File already exists' in e.message:
+ if e.response.status_code == 400 and 'File already exists' in str(e):
if not args.finalize... |
f8c6876f6a1567fb0967c12365ae061d44d6f3db | mmipylint/main.py | mmipylint/main.py | import logging
import mothermayi.errors
import mothermayi.files
import subprocess
LOGGER = logging.getLogger(__name__)
def plugin():
return {
'name' : 'pylint',
'pre-commit' : pre_commit,
}
def pre_commit(config, staged):
pylint = config.get('pylint', {})
args = pylint.g... | import logging
import mothermayi.errors
import mothermayi.files
import subprocess
LOGGER = logging.getLogger(__name__)
def plugin():
return {
'name' : 'pylint',
'pre-commit' : pre_commit,
}
def pre_commit(config, staged):
pylint = config.get('pylint', {})
args = pylint.g... | Handle the fact that to_check is a set | Handle the fact that to_check is a set
| Python | mit | EliRibble/mothermayi-pylint | ---
+++
@@ -18,7 +18,7 @@
to_check = mothermayi.files.python_source(staged)
if not to_check:
return
- command = ['pylint'] + args + to_check
+ command = ['pylint'] + args + list(to_check)
LOGGER.debug("Executing %s", " ".join(command))
try:
output = subprocess.check_output(... |
56fca00d992c84e46e60fa8b9ea66eb9eadc7508 | mgsv_names.py | mgsv_names.py | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_uncommon_select = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirname(__f... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | Rename the SQL module vars for consistency. | Rename the SQL module vars for consistency.
| Python | unlicense | rotated8/mgsv_names | ---
+++
@@ -1,18 +1,18 @@
from __future__ import unicode_literals, print_function
import sqlite3, os, random
-_select = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
-_uncommon_select = 'select value from uncommons where key=?;'
+_select_random = 'select {0} from {1} limit 1 o... |
c26fc5da048bb1751bb6401dbdb8839f89d82c1e | nova/policies/server_diagnostics.py | nova/policies/server_diagnostics.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Introduce scope_types in server diagnostics | Introduce scope_types in server diagnostics
oslo.policy introduced the scope_type feature which can
control the access level at system-level and project-level.
- https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope
- http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/sys... | Python | apache-2.0 | mahak/nova,klmitch/nova,openstack/nova,klmitch/nova,klmitch/nova,mahak/nova,mahak/nova,klmitch/nova,openstack/nova,openstack/nova | ---
+++
@@ -23,15 +23,16 @@
server_diagnostics_policies = [
policy.DocumentedRuleDefault(
- BASE_POLICY_NAME,
- base.RULE_ADMIN_API,
- "Show the usage data for a server",
- [
+ name=BASE_POLICY_NAME,
+ check_str=base.RULE_ADMIN_API,
+ description="Show the usag... |
0cd8be8ce3b11fe9c2591591c12cad5b688e6d0e | test/platform/TestPlatformCommand.py | test/platform/TestPlatformCommand.py | """
Test some lldb platform commands.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class PlatformCommandTestCase(TestBase):
mydir = "platform"
def test_help_platform(self):
self.runCmd("help platform")
def test_list(self):
self.expect("platform list",
... | """
Test some lldb platform commands.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class PlatformCommandTestCase(TestBase):
mydir = "platform"
def test_help_platform(self):
self.runCmd("help platform")
def test_list(self):
self.expect("platform list",
... | Modify test_process_list()'s expect sub-strings to be up-to-date. | Modify test_process_list()'s expect sub-strings to be up-to-date.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@128697 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb | ---
+++
@@ -20,7 +20,7 @@
def test_process_list(self):
self.expect("platform process list",
- substrs = ['PID', 'TRIPLE', 'NAME'])
+ substrs = ['PID', 'ARCH', 'NAME'])
def test_status(self):
self.expect("platform status", |
f25dde13d04e9c6eda28ac76444682e53accbdb3 | src/webapp/tasks.py | src/webapp/tasks.py | import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
try:
from uwsgidecorators import spool
except ImportError as e:
def spool(fn):
def nufun(*args, **kwargs):
raise e
return nufun
@spool
def get_aqua_dist... | import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from cfg import config
try:
from uwsgidecorators import spool
except ImportError as e:
def spool(fn):
def nufun(*args, **kwargs):
raise e
return nufun
@... | Read center point from config | Read center point from config
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>
| Python | bsd-3-clause | eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | ---
+++
@@ -2,6 +2,7 @@
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
+from cfg import config
try:
from uwsgidecorators import spool
@@ -20,7 +21,6 @@
return
target = MapPoint.from_team(team)
- #aqua = MapPoint(51.04485, 13.740... |
c9762cb5362a7fdba6050f5044db00d34eae6edb | confluent/main.py | confluent/main.py | # Copyright 2013 IBM Corporation
# All rights reserved
# This is the main application.
# It should check for existing UDP socket to negotiate socket listen takeover
# It will have three paths into it:
# -Unix domain socket
# -TLS socket
# -WSGI
# Additionally, it will be able to receive particular UDP packets to... | # Copyright 2013 IBM Corporation
# All rights reserved
# This is the main application.
# It should check for existing UDP socket to negotiate socket listen takeover
# It will have three paths into it:
# -Unix domain socket
# -TLS socket
# -WSGI
# Additionally, it will be able to receive particular UDP packets to... | Rework commented out code a tad | Rework commented out code a tad
| Python | apache-2.0 | chenglch/confluent,jufm/confluent,chenglch/confluent,whowutwut/confluent,xcat2/confluent,jjohnson42/confluent,michaelfardu/thinkconfluent,jjohnson42/confluent,xcat2/confluent,chenglch/confluent,jjohnson42/confluent,jufm/confluent,whowutwut/confluent,michaelfardu/thinkconfluent,jufm/confluent,xcat2/confluent,chenglch/co... | ---
+++
@@ -24,8 +24,10 @@
def run():
pluginapi.load_plugins()
- #TODO: eventlet has a bug about unix domain sockets, this code works with bugs fixed
- #dbgsock = eventlet.listen("/var/run/confluent/dbg.sock", family=socket.AF_UNIX)
+ #TODO(jbjohnso): eventlet has a bug about unix domain sockets, thi... |
638f52f59135d151a3c7ed4f84fc0716c6c0d69d | mcbench/xpath.py | mcbench/xpath.py | import sys
import lxml.etree
class XPathError(Exception):
pass
def parse_xml_filename(filename):
return lxml.etree.parse(filename)
def compile_xpath(query):
try:
return lxml.etree.XPath(query)
except lxml.etree.XPathSyntaxError as e:
raise XPathError(e.msg), None, sys.exc_info()[2... | import sys
import lxml.etree
class XPathError(Exception):
pass
def parse_xml_filename(filename):
return lxml.etree.parse(filename)
def compile_xpath(query):
try:
return lxml.etree.XPath(query)
except lxml.etree.XPathSyntaxError as e:
raise XPathError(e.msg), None, sys.exc_info()[2... | Make is_call handle multiple arguments. | Make is_call handle multiple arguments.
Can now be called with a sequence, as in
is_call(ancestor::Function/@name)
or just several literals, as in is_call('eval', 'feval').
In both cases, it does an or.
| Python | mit | isbadawi/mcbench,isbadawi/mcbench | ---
+++
@@ -20,11 +20,24 @@
def register_extensions():
ns = lxml.etree.FunctionNamespace(None)
- ns['is_call'] = lambda c, n: is_call(c.context_node, n)
+ ns['is_call'] = is_call
-def is_call(node, name):
- return (node.tag == 'ParameterizedExpr' and
- node[0].tag == 'NameExpr' and
- ... |
b482eb5c8ff7dc346a3c7037c2218a4b2f2d61c4 | setup/create_player_seasons.py | setup/create_player_seasons.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import concurrent.futures
from db.common import session_scope
from db.player import Player
from utils.player_data_retriever import PlayerDataRetriever
def create_player_seasons(simulation=False):
data_retriever = PlayerDataRetriever()
with session_scope() as s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import concurrent.futures
from db.common import session_scope
from db.player import Player
from utils.player_data_retriever import PlayerDataRetriever
logger = logging.getLogger(__name__)
def create_player_seasons(simulation=False):
data_retriever =... | Add logging to player season creation script | Add logging to player season creation script
| Python | mit | leaffan/pynhldb | ---
+++
@@ -1,16 +1,21 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import logging
import concurrent.futures
from db.common import session_scope
from db.player import Player
from utils.player_data_retriever import PlayerDataRetriever
+logger = logging.getLogger(__name__)
+
def create_player_season... |
36cc1ecc2b64d5c31ea590dddbf9e12c71542c7d | sphinxcontrib/openstreetmap.py | sphinxcontrib/openstreetmap.py | # -*- coding: utf-8 -*-
"""
sphinxcontrib.openstreetmap
===========================
Embed OpenStreetMap on your documentation.
:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com>
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from docutils.parsers.rst import directives
from sphi... | # -*- coding: utf-8 -*-
"""
sphinxcontrib.openstreetmap
===========================
Embed OpenStreetMap on your documentation.
:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com>
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from docutils.parsers.rst import directives
from sphi... | Remove marker from option spec | Remove marker from option spec
| Python | bsd-2-clause | kenhys/sphinxcontrib-openstreetmap,kenhys/sphinxcontrib-openstreetmap | ---
+++
@@ -21,7 +21,6 @@
option_spec = {
'id': directives.unchanged,
'label': directives.unchanged,
- 'marker': directives.unchanged,
}
def run(self): |
8ce1def3020570c8a3e370261fc9c7f027202bdf | owapi/util.py | owapi/util.py | """
Useful utilities.
"""
import json
from kyokai import Request
from kyokai.context import HTTPRequestContext
def jsonify(func):
"""
JSON-ify the response from a function.
"""
async def res(ctx: HTTPRequestContext):
result = await func(ctx)
assert isinstance(ctx.request, Request)
... | """
Useful utilities.
"""
import json
import aioredis
from kyokai import Request
from kyokai.context import HTTPRequestContext
async def with_cache(ctx: HTTPRequestContext, func, *args, expires=300):
"""
Run a coroutine with cache.
Stores the result in redis.
"""
assert isinstance(ctx.redis, aio... | Add with_cache function for storing cached data | Add with_cache function for storing cached data
| Python | mit | azah/OWAPI,SunDwarf/OWAPI | ---
+++
@@ -3,8 +3,31 @@
"""
import json
+import aioredis
from kyokai import Request
from kyokai.context import HTTPRequestContext
+
+
+async def with_cache(ctx: HTTPRequestContext, func, *args, expires=300):
+ """
+ Run a coroutine with cache.
+
+ Stores the result in redis.
+ """
+ assert isins... |
106ea580471387a3645877f52018ff2880db34f3 | live_studio/config/forms.py | live_studio/config/forms.py | from django import forms
from .models import Config
class ConfigForm(forms.ModelForm):
class Meta:
model = Config
exclude = ('created', 'user')
PAGES = (
('base',),
('distribution',),
('media_type',),
('architecture',),
('installer',),
('locale', 'keyboard_layout'),
)
WIZ... | from django import forms
from .models import Config
class ConfigForm(forms.ModelForm):
class Meta:
model = Config
exclude = ('created', 'user')
PAGES = (
('base',),
('distribution',),
('media_type',),
('architecture',),
('installer',),
('locale', 'keyboard_layout'),
)
WIZ... | Use radio buttons for most of the interface. | Use radio buttons for most of the interface.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
| Python | agpl-3.0 | lamby/live-studio,lamby/live-studio,lamby/live-studio,debian-live/live-studio,debian-live/live-studio,debian-live/live-studio | ---
+++
@@ -21,6 +21,13 @@
meta = type('Meta', (), {
'model': Config,
'fields': fields,
+ 'widgets': {
+ 'base': forms.RadioSelect(),
+ 'distribution': forms.RadioSelect(),
+ 'media_type': forms.RadioSelect(),
+ 'architecture': forms.RadioSelec... |
6b01cdc18fce9277991fc5628f1d6c904ad47ee6 | BuildAndRun.py | BuildAndRun.py | import os
import subprocess
name = "gobuildmaster"
current_hash = ""
if os.path.isfile('hash'):
current_hash = open('hash').readlines()[0]
new_hash = os.popen('git rev-parse HEAD').readlines()[0]
open('hash','w').write(new_hash)
# Move the old version over
for line in os.popen('cp ' + name + ' old' + name).r... | import os
import subprocess
name = "gobuildmaster"
current_hash = ""
if os.path.isfile('hash'):
current_hash = open('hash').readlines()[0]
new_hash = os.popen('git rev-parse HEAD').readlines()[0]
open('hash','w').write(new_hash)
# Move the old version over
for line in os.popen('cp ' + name + ' old' + name).r... | Fix running detection for master | Fix running detection for master
| Python | apache-2.0 | brotherlogic/gobuildmaster,brotherlogic/gobuildmaster,brotherlogic/gobuildmaster | ---
+++
@@ -20,7 +20,11 @@
size_1 = os.path.getsize('./old' + name)
size_2 = os.path.getsize('./' + name)
-running = len(os.popen('ps -ef | grep ' + name).readlines()) > 3
+lines = os.popen('ps -ef | grep ' + name).readlines()
+running = False
+for line in lines:
+ if "./" + name in line:
+ running = Tr... |
ea453e4c050771ee96bd99f15e4f42449f28c7f2 | tests/TestAssignmentRegex.py | tests/TestAssignmentRegex.py | import unittest
import src
import resources.Constants as const
class TestAssignments(unittest.TestCase):
string_file = ''
int_file = ''
@classmethod
def setUpClass(cls):
cls.string_file = src.main("../resources/BasicStringAssignment.txt")
cls.int_file = src.main("../resources/BasicIn... | import unittest
import src
import resources.Constants as const
class TestAssignments(unittest.TestCase):
string_file = ''
int_file = ''
@classmethod
def setUpClass(cls):
cls.string_file = src.main("./resources/BasicStringAssignment.txt")
cls.int_file = src.main("./resources/BasicInte... | Test changing file path for nosetests | Test changing file path for nosetests
| Python | bsd-3-clause | sky-uk/bslint | ---
+++
@@ -10,8 +10,8 @@
@classmethod
def setUpClass(cls):
- cls.string_file = src.main("../resources/BasicStringAssignment.txt")
- cls.int_file = src.main("../resources/BasicIntegerAssignment.txt")
+ cls.string_file = src.main("./resources/BasicStringAssignment.txt")
+ cls.in... |
3ca46f1407d8984ca5cbd1eb0581765386533d71 | observatory/rcos/tests/test_rcos.py | observatory/rcos/tests/test_rcos.py | import pytest
from django.core.urlresolvers import reverse
@pytest.mark.django_db
def test_homepage(client):
for url in (
"/donor",
"/students",
"/courses",
"/talks",
"/programming-competition",
"/achievements",
"/urp-application"... | import pytest
from django.core.urlresolvers import reverse
@pytest.mark.django_db
def test_homepage(client):
for url in (
"/",
"/donor",
"/students",
"/courses",
"/talks",
"/programming-competition",
"/achievements",
"... | Add / to rcos tests | rcos: Add / to rcos tests
| Python | isc | rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory | ---
+++
@@ -5,6 +5,7 @@
def test_homepage(client):
for url in (
+ "/",
"/donor",
"/students",
"/courses", |
5e3c6d6ab892a87ca27c05c01b39646bd339b3f2 | tests/test_event.py | tests/test_event.py | import unittest
from event import Event
class EventTest(unittest.TestCase):
def test_a_listener_is_notified_when_event_is_raised(self):
called = False
def listener():
nonlocal called
called = True
event = Event()
event.connect(listener)
event.fire(... | import unittest
from event import Event
class Mock:
def __init__(self):
self.called = False
self.params = ()
def __call__(self, *args, **kwargs):
self.called = True
self.params = (args, kwargs)
class EventTest(unittest.TestCase):
def test_a_listener_is_notified_when_even... | Refactor a lightweight Mock class. | Refactor a lightweight Mock class.
| Python | mit | bsmukasa/stock_alerter | ---
+++
@@ -2,27 +2,27 @@
from event import Event
+class Mock:
+ def __init__(self):
+ self.called = False
+ self.params = ()
+
+ def __call__(self, *args, **kwargs):
+ self.called = True
+ self.params = (args, kwargs)
+
+
class EventTest(unittest.TestCase):
def test_a_lis... |
291923f4ad1fc0041284a73d6edad43e6047fafc | workspace/commands/status.py | workspace/commands/status.py | from __future__ import absolute_import
import os
import logging
from workspace.commands import AbstractCommand
from workspace.commands.helpers import ProductPager
from workspace.scm import stat_repo, repos, product_name, all_branches, is_repo
log = logging.getLogger(__name__)
class Status(AbstractCommand):
""" ... | from __future__ import absolute_import
import os
import logging
from workspace.commands import AbstractCommand
from workspace.commands.helpers import ProductPager
from workspace.scm import stat_repo, repos, product_name, all_branches, is_repo
log = logging.getLogger(__name__)
class Status(AbstractCommand):
""" ... | Fix bug to display all branches when there is only 1 repo | Fix bug to display all branches when there is only 1 repo
| Python | mit | maxzheng/workspace-tools | ---
+++
@@ -29,7 +29,7 @@
branches = all_branches(repo)
child_branches = [b for b in branches if '@' in b]
- if len(child_branches) > 1:
+ if len(child_branches) > 1 or len(scm_repos) == 1:
if nothing_to_commit:
... |
d0ad6a4310e37a3d6dc853d2930640053f89ae05 | tests/benchmarks/__init__.py | tests/benchmarks/__init__.py | """Benchmarks for graphql
Benchmarks are disabled (only executed as tests) by default in setup.cfg.
You can enable them with --benchmark-enable if your want to execute them.
E.g. in order to execute all the benchmarks with tox using Python 3.7::
tox -e py37 -- -k benchmarks --benchmark-enable
"""
| Add docstring explaining how to run benchmarks | Add docstring explaining how to run benchmarks
| Python | mit | graphql-python/graphql-core | ---
+++
@@ -0,0 +1,9 @@
+"""Benchmarks for graphql
+
+Benchmarks are disabled (only executed as tests) by default in setup.cfg.
+You can enable them with --benchmark-enable if your want to execute them.
+
+E.g. in order to execute all the benchmarks with tox using Python 3.7::
+
+ tox -e py37 -- -k benchmarks --be... | |
b18bdf11141cf47319eed9ba2b861ebc287cf5ff | pyqs/utils.py | pyqs/utils.py | import base64
import json
import pickle
def decode_message(message):
message_body = message.get_body()
json_body = json.loads(message_body)
if 'task' in message_body:
return json_body
else:
# Fallback to processing celery messages
return decode_celery_message(json_body)
def d... | import base64
import json
import pickle
def decode_message(message):
message_body = message.get_body()
json_body = json.loads(message_body)
if 'task' in message_body:
return json_body
else:
# Fallback to processing celery messages
return decode_celery_message(json_body)
def d... | Add fallback for loading json encoded celery messages | Add fallback for loading json encoded celery messages
| Python | mit | spulec/PyQS | ---
+++
@@ -15,6 +15,10 @@
def decode_celery_message(json_task):
message = base64.decodestring(json_task['body'])
+ try:
+ return json.loads(message)
+ except ValueError:
+ pass
return pickle.loads(message)
|
a163d7970edbd4a483ddf7d8e20a7c0ab682e0c7 | package/setup.py | package/setup.py | #!/usr/bin/env python
import os
import sys
import {{ project.repo_name }}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst', 'rt').read()
history = open... | #!/usr/bin/env python
import os
import sys
import {{ project.repo_name }}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst', 'rt').read()
history = open... | Add package_dir which uses project.repo_url. | Add package_dir which uses project.repo_url.
| Python | bsd-2-clause | rockymeza/cookiecutter-djangoapp,aeroaks/cookiecutter-pyqt4,rockymeza/cookiecutter-djangoapp | ---
+++
@@ -28,6 +28,7 @@
packages=[
'{{ project.repo_name }}',
],
+ package_dir={'{{ project.repo_name }}': '{{ project.repo_name }}'},
include_package_data=True,
install_requires=[
], |
77b87f5657583a5418d57f712b52bbcd6e9421aa | puzzle.py | puzzle.py | #!/usr/bin/python3
class Puzzle:
def get_all_exits(self, graph):
exits = []
for key, value in graph.items():
for item in value:
if 'Exit' in item:
exits += item
return exits
def find_all_paths(self, graph, start, end, path=None):
... | #!/usr/bin/python3
class Puzzle:
def get_all_exits(self, graph):
exits = []
for root_node, connected_nodes in graph.items():
for node in connected_nodes:
if 'Exit' in node:
exits += node
return exits
def find_all_paths(self, graph, start... | Rename vars in get_all_exits to make it more clear | Rename vars in get_all_exits to make it more clear
| Python | mit | aaronshaver/graph-unique-paths | ---
+++
@@ -4,10 +4,10 @@
class Puzzle:
def get_all_exits(self, graph):
exits = []
- for key, value in graph.items():
- for item in value:
- if 'Exit' in item:
- exits += item
+ for root_node, connected_nodes in graph.items():
+ for ... |
0418027b186f146ff75170ecf5c8e63c3dab3cc1 | treeherder/client/setup.py | treeherder/client/setup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
version = '1.1'
setup(name='treeherder-client',
version=version,
description=... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
version = '1.1'
setup(name='treeherder-client',
version=version,
description=... | Add various classifications for pypi | Add various classifications for pypi
| Python | mpl-2.0 | rail/treeherder,glenn124f/treeherder,parkouss/treeherder,tojon/treeherder,adusca/treeherder,akhileshpillai/treeherder,glenn124f/treeherder,adusca/treeherder,avih/treeherder,wlach/treeherder,moijes12/treeherder,akhileshpillai/treeherder,avih/treeherder,vaishalitekale/treeherder,vaishalitekale/treeherder,rail/treeherder,... | ---
+++
@@ -11,7 +11,15 @@
description="Python library to submit data to treeherder-service",
long_description="""\
""",
- classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ 'Environment :: Console',
+ 'Intended Audien... |
f7e2bcf941e2a15a3bc28ebf3f15244df6f0d758 | posts/versatileimagefield.py | posts/versatileimagefield.py | from django.conf import settings
from versatileimagefield.datastructures.filteredimage import FilteredImage
from versatileimagefield.registry import versatileimagefield_registry
from PIL import Image, ImageDraw, ImageFont
from io import BytesIO
class Watermark(FilteredImage):
def process_image(self, image, image_... | import os.path
from django.conf import settings
from versatileimagefield.datastructures.filteredimage import FilteredImage
from versatileimagefield.registry import versatileimagefield_registry
from PIL import Image, ImageDraw, ImageFont
from io import BytesIO
class Watermark(FilteredImage):
def process_image(self... | Use custom font for watermark | Use custom font for watermark
Signed-off-by: Michal Čihař <a2df1e659c9fd2578de0a26565357cb273292eeb@cihar.com>
| Python | agpl-3.0 | nijel/photoblog,nijel/photoblog | ---
+++
@@ -1,3 +1,4 @@
+import os.path
from django.conf import settings
from versatileimagefield.datastructures.filteredimage import FilteredImage
from versatileimagefield.registry import versatileimagefield_registry
@@ -15,11 +16,15 @@
txt = Image.new('RGBA', image.size, (255,255,255,0))
+ he... |
01e62119750d0737e396358dbf45727dcbb5732f | tests/__init__.py | tests/__init__.py | import sys
import unittest
def main():
if sys.version_info[0] >= 3:
from unittest.main import main
main(module=None)
else:
unittest.main()
if __name__ == '__main__':
main()
| from unittest.main import main
if __name__ == '__main__':
main(module=None, verbosity=2)
| Drop Python 2 support in tests | Drop Python 2 support in tests
| Python | bsd-3-clause | retext-project/pymarkups,mitya57/pymarkups | ---
+++
@@ -1,12 +1,4 @@
-import sys
-import unittest
-
-def main():
- if sys.version_info[0] >= 3:
- from unittest.main import main
- main(module=None)
- else:
- unittest.main()
+from unittest.main import main
if __name__ == '__main__':
- main()
+ main(module=None, verbosity=2) |
7241801672c9ff40526b558366ba8869ba86cf36 | project/circleci_settings.py | project/circleci_settings.py | # -*- coding: utf-8 -*-
DEBUG = True
LOCAL_DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'circle_test',
'USER': 'circleci',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
}
LOCALLY_INSTALLED_APPS = [
]
ENABLE_EMAILS = Fa... | # -*- coding: utf-8 -*-
DEBUG = True
LOCAL_DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'circle_test',
'USER': 'circleci',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
}
LOCALLY_INSTALLED_APPS = [
]
ENABLE_EMAILS = Fa... | Add missing secret key to circle ci settings | Add missing secret key to circle ci settings
| Python | mit | magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3 | ---
+++
@@ -22,3 +22,5 @@
]
ADMINS = []
+
+SECRET_KEY = 'CHANGE ME' |
2b74c8714b659ccf5faa615e9b5c4c4559f8d9c8 | artbot_website/views.py | artbot_website/views.py | from django.shortcuts import render
from datetime import date, datetime, timedelta
from .models import Event
def index(request):
if date.today().isoweekday() in [5,6,7]:
weekend_start = date.today()
else:
weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) ... | from django.shortcuts import render
from datetime import date, datetime, timedelta
from .models import Event
def index(request):
if date.today().isoweekday() in [5,6,7]:
weekend_start = date.today()
else:
weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) ... | Index now only displays published articles. | Index now only displays published articles.
| Python | mit | coreymcdermott/artbot,coreymcdermott/artbot | ---
+++
@@ -8,5 +8,5 @@
else:
weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) % 7 )
- events = Event.objects.filter(start__lte = weekend_start, end__gte = weekend_start).order_by('-start')
+ events = Event.objects.filter(start__lte = weekend_start, end__gte = weekend_sta... |
285eeb1c7565f8fa9fb6ba38ed843601f81cdf4e | tmc/models/document_topic.py | tmc/models/document_topic.py | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class DocumentTopic(models.Model):
_name = 'tmc.document_topic'
_description = 'document_topic'
_inherit = 'tmc.category'
first_parent_id = fields.Many2one(
comodel_name='tmc.document_topic',
compute='_compute_first_parent... | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class DocumentTopic(models.Model):
_name = 'tmc.document_topic'
_description = 'document_topic'
_inherit = 'tmc.category'
_order = 'name'
first_parent_id = fields.Many2one(
comodel_name='tmc.document_topic',
compute='_... | Order document topics by name | [IMP] Order document topics by name
| Python | agpl-3.0 | tmcrosario/odoo-tmc | ---
+++
@@ -8,6 +8,7 @@
_name = 'tmc.document_topic'
_description = 'document_topic'
_inherit = 'tmc.category'
+ _order = 'name'
first_parent_id = fields.Many2one(
comodel_name='tmc.document_topic', |
ee9f1058107f675f7f12f822ead3feb78ec10d9b | wagtail/utils/urlpatterns.py | wagtail/utils/urlpatterns.py | from __future__ import absolute_import, unicode_literals
from functools import update_wrapper
def decorate_urlpatterns(urlpatterns, decorator):
for pattern in urlpatterns:
if hasattr(pattern, 'url_patterns'):
decorate_urlpatterns(pattern.url_patterns, decorator)
if hasattr(pattern, '... | from __future__ import absolute_import, unicode_literals
from functools import update_wrapper
from django import VERSION as DJANGO_VERSION
def decorate_urlpatterns(urlpatterns, decorator):
"""Decorate all the views in the passed urlpatterns list with the given decorator"""
for pattern in urlpatterns:
... | Test for RegexURLPattern.callback on Django 1.10 | Test for RegexURLPattern.callback on Django 1.10
Thanks Paul J Stevens for the initial patch, Tim Graham for review
and Matt Westcott for tweak of initial patch
| Python | bsd-3-clause | nealtodd/wagtail,torchbox/wagtail,nutztherookie/wagtail,nealtodd/wagtail,kurtw/wagtail,mixxorz/wagtail,rsalmaso/wagtail,kurtw/wagtail,jnns/wagtail,kurtw/wagtail,nutztherookie/wagtail,wagtail/wagtail,Toshakins/wagtail,mixxorz/wagtail,gasman/wagtail,iansprice/wagtail,rsalmaso/wagtail,thenewguy/wagtail,kaedroho/wagtail,th... | ---
+++
@@ -1,14 +1,35 @@
from __future__ import absolute_import, unicode_literals
-
from functools import update_wrapper
+from django import VERSION as DJANGO_VERSION
def decorate_urlpatterns(urlpatterns, decorator):
+ """Decorate all the views in the passed urlpatterns list with the given decorator"""
... |
558a25b6f3b77d6a1b087819dc40f1aa7584e7fb | sky/tools/release_packages.py | sky/tools/release_packages.py | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# See https://github.com/domokit/sky_engine/wiki/Release-process
import os
import subprocess
import sys
def main():
engine_root ... | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# See https://github.com/domokit/sky_engine/wiki/Release-process
import os
import subprocess
import sys
def main():
engine_root ... | Add FLX to the release train | Add FLX to the release train
| Python | bsd-3-clause | krisgiesing/sky_engine,devoncarew/engine,abarth/sky_engine,tvolkert/engine,Hixie/sky_engine,devoncarew/engine,mpcomplete/flutter_engine,mpcomplete/engine,devoncarew/sky_engine,chinmaygarde/sky_engine,jamesr/sky_engine,flutter/engine,chinmaygarde/sky_engine,mpcomplete/engine,lyceel/engine,devoncarew/engine,Hixie/sky_eng... | ---
+++
@@ -20,6 +20,7 @@
if args.publish:
subprocess.check_call([pub_path, 'publish', '--force'], cwd=os.path.join(engine_root, 'sky/packages/sky'))
+ subprocess.check_call([pub_path, 'publish', '--force'], cwd=os.path.join(engine_root, 'sky/packages/flx'))
subprocess.check_call([pub_... |
ef81c3eb8b54baeac5ef22843de736345c4d5523 | snapboard/middleware/cache.py | snapboard/middleware/cache.py | from django.conf import settings
from django.core.cache import cache
from django.template import Template
from django.template.context import RequestContext
from snapboard.utils import get_response_cache_key, get_prefix_cache_key
class CachedTemplateMiddleware(object):
def process_view(self, request, view_func, ... | from django.conf import settings
from django.core.cache import cache
from django.template import Template
from django.template.context import RequestContext
from snapboard.utils import get_response_cache_key, get_prefix_cache_key
class CachedTemplateMiddleware(object):
def process_view(self, request, view_func, ... | Comment about a possible attack vector. | Comment about a possible attack vector. | Python | bsd-3-clause | johnboxall/snapboard,johnboxall/snapboard | ---
+++
@@ -12,6 +12,8 @@
if settings.DEBUG and "." in request.path:
return
+
+ # TODO: I can imagine a problem with this where a user writes {% in his post %} ... which would then be rendered on the second pass.
response = None
if request.method == "GE... |
d2c2208b39c5715deebf8d24d5fa9096a945bdcd | script.py | script.py | import ast
import click
from parsing.parser import FileVisitor
@click.command()
@click.argument('code', type=click.File('rb'))
@click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file')
def cli(code, printed):
"""
Parses a file.
codegrapher [fi... | import ast
import click
from parsing.parser import FileVisitor
@click.command()
@click.argument('code', type=click.File('rb'))
@click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file')
@click.option('--remove-builtins', default=False, is_flag=True, help='... | Add builtin removal as an option to cli | Add builtin removal as an option to cli
| Python | mit | LaurEars/codegrapher | ---
+++
@@ -8,7 +8,8 @@
@click.command()
@click.argument('code', type=click.File('rb'))
@click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file')
-def cli(code, printed):
+@click.option('--remove-builtins', default=False, is_flag=True, help='Removes buil... |
1e8ecd09ce6dc44c4955f8bb2f81aa65232ad9a0 | multi_schema/management/commands/loaddata.py | multi_schema/management/commands/loaddata.py | from django.core.management.commands import loaddata
from django.core.management.base import CommandError
from django.db import DatabaseError
from optparse import make_option
from ...models import Schema, template_schema
class Command(loaddata.Command):
option_list = loaddata.Command.option_list + (
make... | from django.core.management.commands import loaddata
from django.core.management.base import CommandError
from django.db import DatabaseError
from optparse import make_option
from ...models import Schema, template_schema
class Command(loaddata.Command):
option_list = loaddata.Command.option_list + (
make... | Fix indenting. Create any schemas that were just loaded. | Fix indenting.
Create any schemas that were just loaded.
| Python | bsd-3-clause | luzfcb/django-boardinghouse,luzfcb/django-boardinghouse,luzfcb/django-boardinghouse | ---
+++
@@ -29,7 +29,11 @@
schema.activate()
- super(Command, self).handle(*app_labels, **options)
+ super(Command, self).handle(*app_labels, **options)
if schema:
schema.deactivate()
+
+
+ for schema in Schema.objects.... |
c5d22fd143f952ce5e0c86b9e8bce4a06fe47063 | bigsi/storage/__init__.py | bigsi/storage/__init__.py | from bigsi.storage.berkeleydb import BerkeleyDBStorage
from bigsi.storage.redis import RedisStorage
from bigsi.storage.rocksdb import RocksDBStorage
def get_storage(config):
return {
"rocksdb": RocksDBStorage,
"berkeleydb": BerkeleyDBStorage,
"redis": RedisStorage,
}[config["storage-en... | from bigsi.storage.redis import RedisStorage
try:
from bigsi.storage.berkeleydb import BerkeleyDBStorage
except ModuleNotFoundError:
pass
try:
from bigsi.storage.rocksdb import RocksDBStorage
except ModuleNotFoundError:
pass
def get_storage(config):
return {
"rocksdb": RocksDBStorage,
... | Allow import without optional requirements | Allow import without optional requirements
| Python | mit | Phelimb/cbg,Phelimb/cbg,Phelimb/cbg,Phelimb/cbg | ---
+++
@@ -1,6 +1,13 @@
-from bigsi.storage.berkeleydb import BerkeleyDBStorage
from bigsi.storage.redis import RedisStorage
-from bigsi.storage.rocksdb import RocksDBStorage
+
+try:
+ from bigsi.storage.berkeleydb import BerkeleyDBStorage
+except ModuleNotFoundError:
+ pass
+try:
+ from bigsi.storage.rock... |
33505f9b4dfeead0b01ee1b8cf3f8f228476e866 | openpassword/crypt_utils.py | openpassword/crypt_utils.py | from Crypto.Cipher import AES
def decrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
print(data)
cipher = AES.new(key, AES.MODE_CBC, iv)
return cipher.decrypt(data)
def encrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
cipher = AES.new(key, AES.MODE_CBC, iv)
retu... | from Crypto.Cipher import AES
def decrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
cipher = AES.new(key, AES.MODE_CBC, iv)
return cipher.decrypt(data)
def encrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
cipher = AES.new(key, AES.MODE_CBC, iv)
return cipher.encryp... | Remove print statement from crypto utils... | Remove print statement from crypto utils...
| Python | mit | openpassword/blimey,openpassword/blimey | ---
+++
@@ -4,7 +4,6 @@
def decrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
- print(data)
cipher = AES.new(key, AES.MODE_CBC, iv)
return cipher.decrypt(data)
|
f2fc7f1015fc24fdbb69069ac74a21437e94657b | xmantissa/plugins/sineoff.py | xmantissa/plugins/sineoff.py | from axiom import iaxiom, userbase
from xmantissa import website, offering, provisioning
from sine import sipserver, sinetheme
sineproxy = provisioning.BenefactorFactory(
name = u'sineproxy',
description = u'Sine SIP Proxy',
benefactorClass = sipserver.SineBenefactor)
plugin = offering.Offering(
nam... | from axiom import iaxiom, userbase
from xmantissa import website, offering, provisioning
from sine import sipserver, sinetheme
sineproxy = provisioning.BenefactorFactory(
name = u'sineproxy',
description = u'Sine SIP Proxy',
benefactorClass = sipserver.SineBenefactor)
plugin = offering.Offering(
nam... | Revert 5505 - introduced numerous regressions into the test suite | Revert 5505 - introduced numerous regressions into the test suite | Python | mit | habnabit/divmod-sine,twisted/sine | ---
+++
@@ -25,7 +25,7 @@
),
benefactorFactories = (sineproxy,),
- loginInterfaces=(),
+
themes = (sinetheme.XHTMLDirectoryTheme('base'),)
)
|
b2c8acb79ea267f9777f1f370b588a1d93b28d86 | src/blockdiag_sphinxhelper.py | src/blockdiag_sphinxhelper.py | # -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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 applica... | # -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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 applica... | Update interface for sphinxcontrib module | Update interface for sphinxcontrib module
| Python | apache-2.0 | aboyett/blockdiag,aboyett/blockdiag | ---
+++
@@ -13,6 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import blockdiag.parser
+import blockdiag.builder
+import blockdiag.drawer
+core = blockdiag
+
+import blockdiag.utils.bootstrap
+import blockdiag.utils.collections
+import blockdia... |
8bfd49c7aef03f6d2ad541f466e9661b6acc5262 | staticassets/compilers/sass.py | staticassets/compilers/sass.py | from .base import CommandCompiler
class SassCompiler(CommandCompiler):
content_type = 'text/css'
options = {'compass': True}
command = 'sass'
params = ['--trace']
def compile(self, asset):
if self.compass:
self.params.append('--compass')
if '.scss' in asset.attributes.... | from .base import CommandCompiler
class SassCompiler(CommandCompiler):
content_type = 'text/css'
options = {'compass': True, 'scss': False}
command = 'sass'
params = ['--trace']
def get_args(self):
args = super(SassCompiler, self).get_args()
if self.compass:
args.appen... | Fix args being appended continuously to SassCompiler | Fix args being appended continuously to SassCompiler
| Python | mit | davidelias/django-staticassets,davidelias/django-staticassets,davidelias/django-staticassets | ---
+++
@@ -3,13 +3,14 @@
class SassCompiler(CommandCompiler):
content_type = 'text/css'
- options = {'compass': True}
+ options = {'compass': True, 'scss': False}
command = 'sass'
params = ['--trace']
- def compile(self, asset):
+ def get_args(self):
+ args = super(SassCompiler... |
ed23b1a44263de0e0a3b34ead22cd149116c063a | src/ggrc/models/exceptions.py | src/ggrc/models/exceptions.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: vraj@reciprocitylabs.com
# Maintained By: vraj@reciprocitylabs.com
import re
from sqlalchemy.exc import IntegrityError
def translate_message(excep... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: vraj@reciprocitylabs.com
# Maintained By: vraj@reciprocitylabs.com
import re
from sqlalchemy.exc import IntegrityError
def field_lookup(field_stri... | Make uniqueness error message recognize email duplicates. | Make uniqueness error message recognize email duplicates.
| Python | apache-2.0 | j0gurt/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,kr41/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,uskudnik/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,uskudnik/ggrc-core,jmako... | ---
+++
@@ -5,6 +5,17 @@
import re
from sqlalchemy.exc import IntegrityError
+
+def field_lookup(field_string):
+ """Attempts to find relevant error field for uniqueness constraint error, given SQL error message; broken off from translate_message logic
+ """
+ output_format = "{0}; {0}"
+ bad_field = ... |
f522a464e3f58a9f2ed235b48382c9db15f66029 | eva/layers/residual_block.py | eva/layers/residual_block.py | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from keras.engine.topology import merge
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = Convolution2D(filters//2, 1, 1)(model)
block = PReL... | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from keras.engine.topology import merge
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = Convolution2D(filters//2, 1, 1)(model)
block = PReL... | Use the functional merge; just for formatting | Use the functional merge; just for formatting
| Python | apache-2.0 | israelg99/eva | ---
+++
@@ -16,7 +16,7 @@
# h -> 2h
block = Convolution2D(filters, 1, 1)(block)
- return PReLU()(Merge(mode='sum')([model, block]))
+ return PReLU()(merge([model, block], mode='sum'))
def ResidualBlockList(model, filters, length):
for _ in range(length): |
8a7a8c3589b1e3bd3a4d8b0dc832178be26117d3 | mozaik_membership/wizards/base_partner_merge_automatic_wizard.py | mozaik_membership/wizards/base_partner_merge_automatic_wizard.py | # Copyright 2022 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_checks=True):
... | # Copyright 2022 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_checks=True):
... | Fix the security for the merge after closing memberships | Fix the security for the merge after closing memberships
| Python | agpl-3.0 | mozaik-association/mozaik,mozaik-association/mozaik | ---
+++
@@ -16,10 +16,21 @@
src_partners = partners - dst_partner
else:
ordered_partners = self._get_ordered_partner(partners.ids)
+ dst_partner = ordered_partners[-1]
src_partners = ordered_partners[:-1]
+
+ # since we close the membership we need to ... |
16fe23b18f69e475858a975f3a2e3f743f4b4c57 | zipline/__init__.py | zipline/__init__.py | """
Zipline
"""
# This is *not* a place to dump arbitrary classes/modules for convenience,
# it is a place to expose the public interfaces.
__version__ = "0.5.11.dev"
from . import data
from . import finance
from . import gens
from . import utils
from . algorithm import TradingAlgorithm
__all__ = [
'data',
... | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Add license to module init file. | REL: Add license to module init file.
| Python | apache-2.0 | iamkingmaker/zipline,ChinaQuants/zipline,chrjxj/zipline,michaeljohnbennett/zipline,ronalcc/zipline,nborggren/zipline,sketchytechky/zipline,joequant/zipline,grundgruen/zipline,zhoulingjun/zipline,alphaBenj/zipline,CDSFinance/zipline,alphaBenj/zipline,umuzungu/zipline,dhruvparamhans/zipline,cmorgan/zipline,otmaneJai/Zipl... | ---
+++
@@ -1,3 +1,18 @@
+#
+# Copyright 2013 Quantopian, Inc.
+#
+# 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... |
0e36a49d6a53f87cbe71fd5ec9dce524dd638122 | fireplace/deck.py | fireplace/deck.py | import logging
import random
from .card import Card
from .enums import GameTag, Zone
from .utils import CardList
class Deck(CardList):
MAX_CARDS = 30
MAX_UNIQUE_CARDS = 2
MAX_UNIQUE_LEGENDARIES = 1
@classmethod
def fromList(cls, cards, hero):
return cls([Card(card) for card in cards], Card(hero))
def __init... | import logging
import random
from .card import Card
from .enums import GameTag, Zone
from .utils import CardList
class Deck(CardList):
MAX_CARDS = 30
MAX_UNIQUE_CARDS = 2
MAX_UNIQUE_LEGENDARIES = 1
@classmethod
def fromList(cls, cards, hero):
return cls([Card(card) for card in cards], Card(hero))
def __init... | Drop support for naming Deck objects | Drop support for naming Deck objects
| Python | agpl-3.0 | smallnamespace/fireplace,Meerkov/fireplace,amw2104/fireplace,Ragowit/fireplace,beheh/fireplace,butozerca/fireplace,Ragowit/fireplace,amw2104/fireplace,liujimj/fireplace,smallnamespace/fireplace,jleclanche/fireplace,oftc-ftw/fireplace,oftc-ftw/fireplace,butozerca/fireplace,NightKev/fireplace,Meerkov/fireplace,liujimj/fi... | ---
+++
@@ -14,21 +14,15 @@
def fromList(cls, cards, hero):
return cls([Card(card) for card in cards], Card(hero))
- def __init__(self, cards, hero, name=None):
+ def __init__(self, cards, hero):
super().__init__(cards)
self.hero = hero
- if name is None:
- name = "Custom %s" % (hero)
- self.name = n... |
d6a6fc478d9aaea69ff6c1f5be3ebe0c1b34f180 | fixlib/channel.py | fixlib/channel.py | import asyncore
import util
try:
import simplejson as json
except ImportError:
import json
class ChannelServer(asyncore.dispatcher):
def __init__(self, sock, dest):
asyncore.dispatcher.__init__(self, sock)
self.dest = dest
dest.register('close', self.closehook)
def handle_accept(self):
client = self.... | import asyncore
import util
try:
import simplejson as json
except ImportError:
import json
class ChannelServer(asyncore.dispatcher):
def __init__(self, sock, dest):
asyncore.dispatcher.__init__(self, sock)
self.dest = dest
dest.register('close', lambda x, y: self.close())
def handle_accept(self):
clie... | Use a lambda as a proxy. | Use a lambda as a proxy.
| Python | bsd-3-clause | jvirtanen/fixlib | ---
+++
@@ -6,21 +6,16 @@
except ImportError:
import json
-
class ChannelServer(asyncore.dispatcher):
def __init__(self, sock, dest):
asyncore.dispatcher.__init__(self, sock)
self.dest = dest
- dest.register('close', self.closehook)
+ dest.register('close', lambda x, y: self.close())
def handl... |
82756e5314c2768bb3acf03cf542929d23b73f82 | bot/logger/message_sender/synchronized.py | bot/logger/message_sender/synchronized.py | import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
on... | import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
on... | Use reentrant lock on SynchronizedMessageSender | Use reentrant lock on SynchronizedMessageSender
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | ---
+++
@@ -13,7 +13,12 @@
def __init__(self, sender: MessageSender):
super().__init__(sender)
- self.lock = threading.Lock()
+ # Using a reentrant lock to play safe in case the send function somewhat invokes this send function again
+ # maybe because a send triggers another send ... |
721703801654af88e8b5064d1bc65569ce1555cf | thumbnails/engines/__init__.py | thumbnails/engines/__init__.py | # -*- coding: utf-8 -*-
def get_current_engine():
return None
| # -*- coding: utf-8 -*-
from thumbnails.engines.pillow import PillowEngine
def get_current_engine():
return PillowEngine()
| Set pillow engine as default | Set pillow engine as default
| Python | mit | python-thumbnails/python-thumbnails,relekang/python-thumbnails | ---
+++
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+from thumbnails.engines.pillow import PillowEngine
def get_current_engine():
- return None
+ return PillowEngine() |
4c1b96865f3e5e6660fc41f9170939a02f9b7735 | fabfile.py | fabfile.py | from fabric.api import *
from fabric.contrib.console import confirm
cfg = dict(
appengine_dir='appengine-web/src',
goldquest_dir='src',
appengine_token='',
)
def update():
# update to latest code from repo
local('git pull')
def test():
local("nosetests -m 'Test|test_' -w %(goldquest_dir)s" %... | from fabric.api import *
from fabric.contrib.console import confirm
import simplejson
cfg = dict(
appengine_dir='appengine-web/src',
goldquest_dir='src',
oauth_cfg_path='/Users/olle/.appcfg_oauth2_tokens',
appengine_refresh_token='',
)
def read_appcfg_oauth():
fp = open(cfg['oauth_cfg_path'])
... | Read appengine refresh_token from oauth file automatically. | NEW: Read appengine refresh_token from oauth file automatically.
| Python | mit | ollej/GoldQuest,ollej/GoldQuest,ollej/GoldQuest,ollej/GoldQuest | ---
+++
@@ -1,11 +1,19 @@
from fabric.api import *
from fabric.contrib.console import confirm
+
+import simplejson
cfg = dict(
appengine_dir='appengine-web/src',
goldquest_dir='src',
- appengine_token='',
+ oauth_cfg_path='/Users/olle/.appcfg_oauth2_tokens',
+ appengine_refresh_token='',
)
+
... |
670227590ceaf6eb52d56809f8bcc1b1f6ae6f7f | prettyplotlib/_eventplot.py | prettyplotlib/_eventplot.py | __author__ = 'jgosmann'
from matplotlib.cbook import iterable
from prettyplotlib.utils import remove_chartjunk, maybe_get_ax
from prettyplotlib.colors import set2
def eventplot(*args, **kwargs):
ax, args, kwargs = maybe_get_ax(*args, **kwargs)
show_ticks = kwargs.pop('show_ticks', False)
if len(args) >... | __author__ = 'jgosmann'
from matplotlib.cbook import iterable
from prettyplotlib.utils import remove_chartjunk, maybe_get_ax
from prettyplotlib.colors import set2
def eventplot(*args, **kwargs):
ax, args, kwargs = maybe_get_ax(*args, **kwargs)
show_ticks = kwargs.pop('show_ticks', False)
alpha = kwargs.... | Add alpha argument to eventplot(). | Add alpha argument to eventplot().
| Python | mit | olgabot/prettyplotlib,olgabot/prettyplotlib | ---
+++
@@ -9,6 +9,7 @@
def eventplot(*args, **kwargs):
ax, args, kwargs = maybe_get_ax(*args, **kwargs)
show_ticks = kwargs.pop('show_ticks', False)
+ alpha = kwargs.pop('alpha', 1.0)
if len(args) > 0:
positions = args[0]
@@ -20,7 +21,7 @@
else:
size = 1
- kwargs.setd... |
c814fe264c93dfa09276474960aa83cdb26e7754 | polyaxon/api/searches/serializers.py | polyaxon/api/searches/serializers.py | from rest_framework import serializers
from db.models.searches import Search
class SearchSerializer(serializers.ModelSerializer):
class Meta:
model = Search
fields = ['id', 'name', 'query', 'meta']
| from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from api.utils.serializers.names import NamesMixin
from db.models.searches import Search
class SearchSerializer(serializers.ModelSerializer, NamesMixin):
class Meta:
model = Search
fields = ['id', 'name',... | Add graceful handling for creating search with similar names | Add graceful handling for creating search with similar names
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -1,10 +1,20 @@
from rest_framework import serializers
+from rest_framework.exceptions import ValidationError
+from api.utils.serializers.names import NamesMixin
from db.models.searches import Search
-class SearchSerializer(serializers.ModelSerializer):
-
+class SearchSerializer(serializers.ModelSer... |
e459a42af1c260986c7333047efd40294dbd23d3 | akaudit/clidriver.py | akaudit/clidriver.py | #!/usr/bin/env python
# Copyright 2015 Chris Fordham
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | #!/usr/bin/env python
# Copyright 2015 Chris Fordham
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Use __description__ with parser instantiation. | Use __description__ with parser instantiation.
| Python | apache-2.0 | flaccid/akaudit | ---
+++
@@ -20,7 +20,7 @@
from akaudit.audit import Auditer
def main(argv = sys.argv, log = sys.stderr):
- parser = argparse.ArgumentParser(description='Audit who has access to your homes.', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser = argparse.ArgumentParser(description=akaudit.__descriptio... |
d90f249e0865dab0cc9a224f413ea90df8a648ed | srsly/util.py | srsly/util.py | from pathlib import Path
from typing import Union, Dict, Any, List, Tuple
from collections import OrderedDict
# fmt: off
FilePath = Union[str, Path]
# Superficial JSON input/output types
# https://github.com/python/typing/issues/182#issuecomment-186684288
JSONOutput = Union[str, int, float, bool, None, Dict[str, Any]... | from pathlib import Path
from typing import Union, Dict, Any, List, Tuple
from collections import OrderedDict
# fmt: off
FilePath = Union[str, Path]
# Superficial JSON input/output types
# https://github.com/python/typing/issues/182#issuecomment-186684288
JSONOutput = Union[str, int, float, bool, None, Dict[str, Any]... | Fix typing for JSONInput and JSONInputBin. | Fix typing for JSONInput and JSONInputBin.
| Python | mit | explosion/srsly,explosion/srsly,explosion/srsly,explosion/srsly | ---
+++
@@ -10,8 +10,8 @@
JSONOutput = Union[str, int, float, bool, None, Dict[str, Any], List[Any]]
JSONOutputBin = Union[bytes, str, int, float, bool, None, Dict[str, Any], List[Any]]
# For input, we also accept tuples, ordered dicts etc.
-JSONInput = Union[str, int, float, bool, None, Dict[str, Any], List[Any],... |
20e096ac5261cb7fd4197f6cdeb8b171753c82a7 | landlab/values/tests/conftest.py | landlab/values/tests/conftest.py | import pytest
from landlab import NetworkModelGrid, RasterModelGrid
@pytest.fixture
def four_by_four_raster():
mg = RasterModelGrid((4, 4))
return mg
@pytest.fixture
def simple_network():
y_of_node = (0, 1, 2, 2)
x_of_node = (0, 0, -1, 1)
nodes_at_link = ((1, 0), (2, 1), (3, 1))
mg = Networ... | import pytest
from landlab import NetworkModelGrid, RasterModelGrid
from landlab.values.synthetic import _STATUS
@pytest.fixture
def four_by_four_raster():
mg = RasterModelGrid((4, 4))
return mg
@pytest.fixture
def simple_network():
y_of_node = (0, 1, 2, 2)
x_of_node = (0, 0, -1, 1)
nodes_at_li... | Add parametrized fixture for at, node_bc, link_bc. | Add parametrized fixture for at, node_bc, link_bc.
| Python | mit | landlab/landlab,cmshobe/landlab,landlab/landlab,cmshobe/landlab,amandersillinois/landlab,landlab/landlab,amandersillinois/landlab,cmshobe/landlab | ---
+++
@@ -1,6 +1,7 @@
import pytest
from landlab import NetworkModelGrid, RasterModelGrid
+from landlab.values.synthetic import _STATUS
@pytest.fixture
@@ -16,3 +17,12 @@
nodes_at_link = ((1, 0), (2, 1), (3, 1))
mg = NetworkModelGrid((y_of_node, x_of_node), nodes_at_link)
return mg
+
+
+def ... |
bcde8104bd77f18d7061f7f4d4831ad49644a913 | common/management/commands/build_index.py | common/management/commands/build_index.py | from django.core.management import BaseCommand
from django.db.models import get_app, get_models
from django.conf import settings
from common.utilities.search_utils import index_instance
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--test',
acti... | from django.core.management import BaseCommand
from django.db.models import get_app, get_models
from django.conf import settings
from common.utilities.search_utils import index_instance
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--test',
acti... | Check the model beig indexed | Check the model beig indexed
| Python | mit | urandu/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,urandu/mfl_api | ---
+++
@@ -21,11 +21,16 @@
for app_name in apps_lists:
app = get_app(app_name)
for model in get_models(app):
- all_instances = model.objects.all()[0:3] \
- if options.get('test') else model.objects.all()
- [index_instance(obj) for ob... |
ccb1759a205a4cdc8f5eb2c28adcf49503221135 | ecpy/tasks/api.py | ecpy/tasks/api.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015 by Ecpy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------------... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015 by Ecpy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------------... | Add tasks/build_from_config to the public API. | Add tasks/build_from_config to the public API.
| Python | bsd-3-clause | Ecpy/ecpy,Ecpy/ecpy | ---
+++
@@ -26,6 +26,8 @@
from .manager.configs.base_configs import BaseTaskConfig
+from .manager.utils.building import build_task_from_config
+
with enaml.imports():
from .manager.configs.base_config_views import BaseConfigView
from .base_views import BaseTaskView
@@ -35,4 +37,5 @@
'Inter... |
e8bc2048f5b89b5540219b24921e596f11b34466 | crypto_enigma/_version.py | crypto_enigma/_version.py | #!/usr/bin/env python
# encoding: utf8
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
__pre_release__ =... | #!/usr/bin/env python
# encoding: utf8
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
__pre_release__ =... | Update test version following release | Update test version following release
| Python | bsd-3-clause | orome/crypto-enigma-py | ---
+++
@@ -9,8 +9,8 @@
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
-__pre_release__ = 'b2' # aN | bN | cN |
-__suffix__ = ''#'.dev5' # .devN | | .postN
+__pre_release__ = 'b3' # aN | bN | cN |
+__suffix__ = '.dev1' # .devN | | .postN
__version__ = __re... |
d8573d7d2d1825253dab6998fc70dd829399c406 | src/config.py | src/config.py | # -*- coding: utf-8 -*-
#DEBUG = True
SECRET_KEY = "change secret key in production"
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
#PERMANENT_SESSION_LIFETIME = timedelta(minutes=10)
| # -*- coding: utf-8 -*-
import os
#DEBUG = True
SECRET_KEY = "change secret key in production"
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
#PERMANENT_SESSION_LIFETIME = timedelta(minutes=10)
UNITTEST_USERNAME = os.environ.get('USERNAME', '')
UNITTEST_PASSWORD = os.environ.get('PASSWORD', '')
| Add unittest account and password | Add unittest account and password
| Python | mit | JohnSounder/AP-API,kuastw/AP-API,JohnSounder/AP-API,kuastw/AP-API | ---
+++
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
-
+import os
#DEBUG = True
SECRET_KEY = "change secret key in production"
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
#PERMANENT_SESSION_LIFETIME = timedelta(minutes=10)
+
+UNITTEST_USERNAME = os.environ.get('USERNAME', '')
+UNITTEST_PASSWORD = os... |
7e15896c14cbbab36862c8000b0c25c6a48fedcd | cref/structure/__init__.py | cref/structure/__init__.py | # import porter_paleale
def write_pdb(aa_sequence, fragment_angles, gap_length, filepath):
"""
Generate pdb file with results
:param aa_sequence: Amino acid sequence
:param fragment_angles: Backbone torsion angles
:param gap_length: Length of the gap at the sequence start and end
:param fil... | from peptide import PeptideBuilder
import Bio.PDB
def write_pdb(aa_sequence, fragment_angles, gap_length, filepath):
"""
Generate pdb file with results
:param aa_sequence: Amino acid sequence
:param fragment_angles: Backbone torsion angles
:param gap_length: Length of the gap at the sequence star... | Write pdb result to disk | Write pdb result to disk
| Python | mit | mchelem/cref2,mchelem/cref2,mchelem/cref2 | ---
+++
@@ -1,6 +1,5 @@
-# import porter_paleale
-
-
+from peptide import PeptideBuilder
+import Bio.PDB
def write_pdb(aa_sequence, fragment_angles, gap_length, filepath):
@@ -12,4 +11,8 @@
:param gap_length: Length of the gap at the sequence start and end
:param filepath: Path to the file to save the ... |
cfe18afa4954980380dc02338d434dc968bb898a | test/test_random_scheduler.py | test/test_random_scheduler.py | import json
import random
from mock import patch
from pybossa.model.task import Task
from pybossa.model.project import Project
from pybossa.model.user import User
from pybossa.model.task_run import TaskRun
from pybossa.model.category import Category
import pybossa
import sys
import os
sys.path.append(os.path.abspath... | import json
import random
from mock import patch
from pybossa.model.task import Task
from pybossa.model.project import Project
from pybossa.model.user import User
from pybossa.model.task_run import TaskRun
from pybossa.model.category import Category
import pybossa
import sys
import os
sys.path.append(os.path.abspath... | Fix path to pybossa tests | Fix path to pybossa tests
| Python | agpl-3.0 | PyBossa/random-scheduler | ---
+++
@@ -12,7 +12,7 @@
import sys
import os
-sys.path.append(os.path.abspath("../pybossa/test"))
+sys.path.append(os.path.abspath("./pybossa/test"))
from helper import sched
from default import Test, db, with_context
|
810a43c859264e3d5e1af8b43888bf89c06bee1d | ipybind/stream.py | ipybind/stream.py | # -*- coding: utf-8 -*-
import contextlib
import sys
try:
import fcntl
except ImportError:
fcntl = None
from ipybind.common import is_kernel
from ipybind.ext.wurlitzer import Wurlitzer
_fwd = None
class Forwarder(Wurlitzer):
def __init__(self, handler=None):
self._data_handler = handler if han... | # -*- coding: utf-8 -*-
import contextlib
import sys
try:
import fcntl
except ImportError:
fcntl = None
from ipybind.common import is_kernel
from ipybind.ext.wurlitzer import Wurlitzer
_fwd = None
class Forwarder(Wurlitzer):
def __init__(self, handler=None):
self._data_handler = handler if han... | Remove suppress() as it's no longer required | Remove suppress() as it's no longer required
| Python | mit | aldanor/ipybind,aldanor/ipybind,aldanor/ipybind | ---
+++
@@ -32,15 +32,6 @@
@contextlib.contextmanager
-def suppress():
- if fcntl:
- with Forwarder(handler=lambda _: None):
- yield
- else:
- yield
-
-
-@contextlib.contextmanager
def forward(handler=None):
global _fwd
if _fwd is None and is_kernel() and fcntl: |
db19dfa17261c3d04de0202b2809ba8abb70326b | tests/unit/test_moxstubout.py | tests/unit/test_moxstubout.py | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | Fix build break with Fixtures 1.3 | Fix build break with Fixtures 1.3
Our explicit call to cleanUp messes things up in latest
fixture, so we need to call _clear_cleanups to stop
the test from breaking
Change-Id: I8ce2309a94736b47fb347f37ab4027857e19c8a8
| Python | apache-2.0 | openstack/oslotest,openstack/oslotest | ---
+++
@@ -30,3 +30,4 @@
f.cleanUp()
after2 = TestMoxStubout._stubable
self.assertEqual(before, after2)
+ f._clear_cleanups() |
5ac84c4e9d8d68b7e89ebf344d2c93a5f7ef4c4c | notebooks/galapagos_to_pandas.py | notebooks/galapagos_to_pandas.py | # coding: utf-8
def galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',
out_filename=None):
"""Convert a GALAPAGOS multi-band catalogue to a pandas-compatible HDF5 file"""
from astropy.io import fits
import pandas as pd
import re
... | # coding: utf-8
def galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',
out_filename=None, bands='RUGIZYJHK'):
"""Convert a GALAPAGOS multi-band catalogue to a pandas-compatible HDF5 file"""
from astropy.io import fits
import pandas as pd... | Allow specification of GALAPAGOS bands | Allow specification of GALAPAGOS bands
| Python | mit | MegaMorph/megamorph-analysis | ---
+++
@@ -1,7 +1,7 @@
# coding: utf-8
def galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',
- out_filename=None):
+ out_filename=None, bands='RUGIZYJHK'):
"""Convert a GALAPAGOS multi-band catalogue to a pandas-com... |
3136f7e37b339252d4c1f5642974e180070c452d | kirppu/signals.py | kirppu/signals.py | # -*- coding: utf-8 -*-
from django.db.models.signals import pre_save, pre_delete
from django.dispatch import receiver
@receiver(pre_save)
def save_handler(sender, instance, using, **kwargs):
# noinspection PyProtectedMember
if instance._meta.app_label in ("kirppu", "kirppuauth") and using != "default":
... | # -*- coding: utf-8 -*-
from django.db.models.signals import pre_migrate, post_migrate
from django.dispatch import receiver
ENABLE_CHECK = True
@receiver(pre_migrate)
def pre_migrate_handler(*args, **kwargs):
global ENABLE_CHECK
ENABLE_CHECK = False
@receiver(post_migrate)
def post_migrate_handler(*args, ... | Allow migrations to be run on extra databases. | Allow migrations to be run on extra databases.
- Remove duplicate registration of save and delete signals. Already
registered in apps.
| Python | mit | jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu | ---
+++
@@ -1,18 +1,30 @@
# -*- coding: utf-8 -*-
-from django.db.models.signals import pre_save, pre_delete
+from django.db.models.signals import pre_migrate, post_migrate
from django.dispatch import receiver
+ENABLE_CHECK = True
-@receiver(pre_save)
+
+@receiver(pre_migrate)
+def pre_migrate_handler(*args, ... |
89508d6ea3e89ce87f327a88571c892d4bfcbec5 | setup.py | setup.py | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.te... | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.te... | Increment minor version after ArcGIS fix and improved tests and docs | Increment minor version after ArcGIS fix and improved tests and docs | Python | bsd-3-clause | consbio/gis-metadata-parser | ---
+++
@@ -28,7 +28,7 @@
long_description=long_description,
long_description_content_type='text/markdown',
keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser',
- version='1.2.3',
+ version='1.2.4',
packages=[
'gis_metadata', 'gis_... |
1dd3333a433bac0ee2a155fd33987fa542e968a4 | setup.py | setup.py | # -*- coding: utf-8 -*-
from pypandoc import convert
from setuptools import setup
setup(
name='mws',
version='0.7',
maintainer="James Hiew",
maintainer_email="james@hiew.net",
url="http://github.com/jameshiew/mws",
description='Python library for interacting with the Amazon MWS API',
long_d... | # -*- coding: utf-8 -*-
short_description = 'Python library for interacting with the Amazon MWS API'
try:
from pypandoc import convert
except (ImportError, OSError): # either pypandoc or pandoc isn't installed
long_description = "See README.md"
else:
long_description = convert("README.md", 'rst')
from set... | Fix pip install errors when (py)pandoc is missing | Fix pip install errors when (py)pandoc is missing
| Python | unlicense | Bobspadger/python-amazon-mws,GriceTurrble/python-amazon-mws,bpipat/mws,jameshiew/mws | ---
+++
@@ -1,5 +1,12 @@
# -*- coding: utf-8 -*-
-from pypandoc import convert
+short_description = 'Python library for interacting with the Amazon MWS API'
+try:
+ from pypandoc import convert
+except (ImportError, OSError): # either pypandoc or pandoc isn't installed
+ long_description = "See README.md"
+el... |
46f080487790cdbc430adc8b3b4f0ea7a1e4cdb6 | setup.py | setup.py | import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
... | import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
... | Support a range of redis client versions | Support a range of redis client versions
| Python | mit | eventbrite/curator | ---
+++
@@ -41,7 +41,7 @@
'unittest2==0.5.1',
],
install_requires=[
- 'redis==2.10.1',
+ 'redis >= 2.8.0, <= 2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'], |
8be5530e1fca59aff42b404b64324b68235bfd87 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import chagallpy
setup(
name='chagallpy',
version=chagallpy.__version__,
packages=find_packages(),
license='MIT',
description='CHArming GALLEry in PYthon',
long_description=open('README.md').read(),
author='Jan Pipek',
au... | #!/usr/bin/env python
from setuptools import setup, find_packages
import chagallpy
setup(
name='chagallpy',
version=chagallpy.__version__,
packages=find_packages(),
license='MIT',
description='CHArming GALLEry in PYthon',
long_description=open('README.md').read(),
author='Jan Pipek',
au... | Fix email address to be able to upload to pypi | Fix email address to be able to upload to pypi
| Python | mit | janpipek/chagallpy,janpipek/chagallpy,janpipek/chagallpy | ---
+++
@@ -10,7 +10,7 @@
description='CHArming GALLEry in PYthon',
long_description=open('README.md').read(),
author='Jan Pipek',
- author_email='jan DOT pipek AT gmail COM',
+ author_email='jan.pipek@gmail.com',
url='https://github.com/janpipek/chagallpy',
install_requires = [ 'wowp',... |
8c7b048ff02439573a0ad399e5e11ea6f9bfd3a0 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
dev_requires = [
'Sphinx==1.2.2',
]
install_requires = [
'nodeconductor>=0.95.0',
]
setup(
name='oracle-paas',
version='0.1.0',
author='OpenNode Team',
author_email='info@opennodecloud.com',
url='http://nodeconductor.com... | #!/usr/bin/env python
from setuptools import setup, find_packages
dev_requires = [
'Sphinx==1.2.2',
]
install_requires = [
'nodeconductor>=0.95.0',
]
setup(
name='nodeconductor-paas-oracle',
version='0.1.0',
author='OpenNode Team',
author_email='info@opennodecloud.com',
url='http://nod... | Rename package oracle-paas -> nodeconductor-paas-oracle | Rename package oracle-paas -> nodeconductor-paas-oracle
| Python | mit | opennode/nodeconductor-paas-oracle | ---
+++
@@ -13,7 +13,7 @@
setup(
- name='oracle-paas',
+ name='nodeconductor-paas-oracle',
version='0.1.0',
author='OpenNode Team',
author_email='info@opennodecloud.com', |
9bebb444525f57558114623c2d2b69013b26a703 | setup.py | setup.py | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7dev',
author='oemof developer group',
url='https://oem... | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7dev',
author='oemof developer group',
url='https://oem... | Allow pandas 1.1 as dependency | Allow pandas 1.1 as dependency | Python | mit | oemof/demandlib | ---
+++
@@ -21,7 +21,7 @@
long_description=read('README.rst'),
packages=find_packages(),
install_requires=['numpy >= 1.7.0, < 1.17',
- 'pandas >= 0.18.0, < 0.25'],
+ 'pandas >= 0.18.0, < 1.2'],
package_data={
'demandlib': [os.path.jo... |
7044fa0005f5f056ee5d6bc4e421fb81454317f6 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
version_tuple = __import__('pymysql').VERSION
if version_tuple[3] is not None:
version = "%d.%d.%d_%s" % version_tuple
else:
version = "%d.%d.%d" % version_tuple[:3]
setup(
name="PyMySQL",
version=version,
url='https://github.com/P... | #!/usr/bin/env python
from setuptools import setup, find_packages
version_tuple = __import__('pymysql').VERSION
if version_tuple[3] is not None:
version = "%d.%d.%d_%s" % version_tuple
else:
version = "%d.%d.%d" % version_tuple[:3]
setup(
name="PyMySQL",
version=version,
url='https://github.com/P... | Remove not working download URI | Remove not working download URI
| Python | mit | pymysql/pymysql,PyMySQL/PyMySQL,MartinThoma/PyMySQL,methane/PyMySQL,wraziens/PyMySQL,wraziens/PyMySQL | ---
+++
@@ -12,7 +12,6 @@
name="PyMySQL",
version=version,
url='https://github.com/PyMySQL/PyMySQL/',
- download_url = 'https://github.com/PyMySQL/PyMySQL/tarball/pymysql-%s' % version,
author='yutaka.matsubara',
author_email='yutaka.matsubara@gmail.com',
maintainer='INADA Naoki', |
270afd4d11ebc3888873cd6ffe89b988593c3e41 | setup.py | setup.py | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Maintain alphabetical order in `install_requires` | Maintain alphabetical order in `install_requires`
PiperOrigin-RevId: 395092683
Change-Id: I87f23eafcb8a3cdafd36b8fd700f8a1f24f9fa6e
GitOrigin-RevId: a0819922a706dec7b8c2a17181c56a6900288e67
| Python | apache-2.0 | deepmind/xmanager,deepmind/xmanager | ---
+++
@@ -30,13 +30,13 @@
'async_generator',
'attrs',
'docker',
- 'immutabledict',
'google-api-core',
'google-api-python-client',
'google-cloud-aiplatform>=1.4.0',
'google-auth',
'google-cloud-storage',
'humanize',
+ 'imm... |
add426252ad864860f1188b446d05ad6bcf11df2 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='lightstep',
version='3.0.11',
description='LightStep Python OpenTracing Implementation',
long_description='',
author='LightStep',
license='',
install_requires=['thrift==0.10.0',
'jsonpickle',
... | from setuptools import setup, find_packages
setup(
name='lightstep',
version='3.0.11',
description='LightStep Python OpenTracing Implementation',
long_description='',
author='LightStep',
license='',
install_requires=['thrift==0.10.0',
'jsonpickle',
... | Make requests dependency version more flexible | LS-5226: Make requests dependency version more flexible
| Python | mit | lightstephq/lightstep-tracer-python | ---
+++
@@ -12,7 +12,7 @@
'six',
'basictracer>=2.2,<2.3',
'googleapis-common-protos==1.5.3',
- 'requests==2.19.1'],
+ 'requests>=2.19,<3.0'],
tests_require=['pytest',
'sphinx',
... |
c08460faaccf75acb43f8bab6e3248666ff811c6 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-admin-extend',
version='0.0.1',
description=('Provides functionality for extending'
'ModelAdmin classes that have already'
'been registered by other apps'),
author='Ioan Alexandru Cu... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-admin-extend',
version='0.0.2',
description=('Provides functionality for extending'
'ModelAdmin classes that have already'
'been registered by other apps'),
author='Ioan Alexandru Cu... | Fix download url and bump version | Fix download url and bump version
| Python | mit | kux/django-admin-extend | ---
+++
@@ -4,14 +4,14 @@
setup(
name='django-admin-extend',
- version='0.0.1',
+ version='0.0.2',
description=('Provides functionality for extending'
'ModelAdmin classes that have already'
'been registered by other apps'),
author='Ioan Alexandru Cucu',
... |
a5baa5f333625244c1e0935745dadedb7df444c3 | setup.py | setup.py | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.0',
description='Utility for installing binaries from source with a single command',
long_description=read("README... | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.0',
description='Utility for installing binaries from source with a single command',
long_description=read("README... | Update install_requires to be more accurate | Update install_requires to be more accurate
| Python | bsd-2-clause | mwilliamson/whack | ---
+++
@@ -15,5 +15,5 @@
url='http://github.com/mwilliamson/whack',
scripts=["scripts/whack"],
packages=['whack'],
- install_requires=['blah>=0.1.10,<0.2', 'requests', "catchy==0.1.0"],
+ install_requires=['blah>=0.1.10,<0.2', 'requests>=1,<2', "catchy>=0.1.0,<0.2"],
) |
036bbfb768de845b3495b99d212fffbf98ba5571 | setup.py | setup.py | import os
try:
from setuptools import setup, Extension
except ImportError:
# Use distutils.core as a fallback.
# We won't be able to build the Wheel file on Windows.
from distutils.core import setup, Extension
extensions = []
if os.name == 'nt':
ext = Extension(
'asyncio._overlapped', ['ove... | import os
try:
from setuptools import setup, Extension
except ImportError:
# Use distutils.core as a fallback.
# We won't be able to build the Wheel file on Windows.
from distutils.core import setup, Extension
extensions = []
if os.name == 'nt':
ext = Extension(
'asyncio._overlapped', ['ove... | Set version to 0.2.1. Ready for PyPI. | Set version to 0.2.1. Ready for PyPI.
| Python | apache-2.0 | jashandeep-sohi/asyncio,gsb-eng/asyncio,gsb-eng/asyncio,ajdavis/asyncio,ajdavis/asyncio,fallen/asyncio,1st1/asyncio,Martiusweb/asyncio,Martiusweb/asyncio,fallen/asyncio,jashandeep-sohi/asyncio,manipopopo/asyncio,jashandeep-sohi/asyncio,gvanrossum/asyncio,ajdavis/asyncio,haypo/trollius,haypo/trollius,Martiusweb/asyncio,... | ---
+++
@@ -15,7 +15,7 @@
setup(
name="asyncio",
- version="0.1.1",
+ version="0.2.1",
description="reference implementation of PEP 3156",
long_description=open("README").read(), |
dc460d02b489a5cbca34f5525fa9f0ac0a67cb61 | setup.py | setup.py | from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name = "open511",
version = "0.1",
url='',
license = "",
packages = [
'open511',
],
install_requires = [
'lxml',
'webob',
'python-dateutil>=1.5,<2.0',
'r... | from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name = "open511",
version = "0.1",
url='',
license = "",
packages = [
'open511',
],
install_requires = [
'lxml>=2.3',
'WebOb>=1.2,<2',
'python-dateutil>=1.5,<2.0... | Make dependency versions more explicit | Make dependency versions more explicit
| Python | mit | Open511/open511-server,Open511/open511-server,Open511/open511-server | ---
+++
@@ -12,12 +12,13 @@
'open511',
],
install_requires = [
- 'lxml',
- 'webob',
+ 'lxml>=2.3',
+ 'WebOb>=1.2,<2',
'python-dateutil>=1.5,<2.0',
- 'requests',
- 'pytz',
+ 'requests>=1.2,<2',
+ 'pytz>=2013b',
'django-appconf... |
e848239bedb6dca579e24a23bc04a7ce4f2d1a80 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup,find_packages
METADATA = dict(
name='django-allauth',
version='0.0.1',
author='Raymond Penners',
author_email='raymond.penners@intenct.nl',
description='Integrated set of Django applications addressing authentication, registration, account manageme... | #!/usr/bin/env python
from setuptools import setup,find_packages
METADATA = dict(
name='django-allauth',
version='0.0.1',
author='Raymond Penners',
author_email='raymond.penners@intenct.nl',
description='Integrated set of Django applications addressing authentication, registration, account manageme... | Change development status to beta | Change development status to beta
| Python | mit | pztrick/django-allauth,jwhitlock/django-allauth,grue/django-allauth,hanasoo/django-allauth,sih4sing5hong5/django-allauth,tigeraniya/django-allauth,kingofsystem/django-allauth,JoshLabs/django-allauth,rsalmaso/django-allauth,MickaelBergem/django-allauth,wli/django-allauth,knowsis/django-allauth,rawjam/django-allauth,penn... | ---
+++
@@ -17,7 +17,7 @@
'django-uni-form'],
include_package_data=True,
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modu... |
6aa81b7f97b39e32f6c5148a26366cf72c46d1e9 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="vumi_twilio_api",
version="0.0.1a",
url="https://github.com/praekelt/vumi-twilio-api",
license="BSD",
description="Provides a REST API to Vumi that emulates the Twilio API",
long_description=open("README.rst", "r").read(),
author="Pra... | from setuptools import setup, find_packages
setup(
name="vxtwinio",
version="0.0.1a",
url="https://github.com/praekelt/vumi-twilio-api",
license="BSD",
description="Provides a REST API to Vumi that emulates the Twilio API",
long_description=open("README.rst", "r").read(),
author="Praekelt F... | Change package name to vxtwinio | Change package name to vxtwinio
| Python | bsd-3-clause | praekelt/vumi-twilio-api | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(
- name="vumi_twilio_api",
+ name="vxtwinio",
version="0.0.1a",
url="https://github.com/praekelt/vumi-twilio-api",
license="BSD", |
00e2abb375c25bd8507c575e9b5b2567aa029061 | setup.py | setup.py | from setuptools import setup
with open("README.rst") as readme_file:
readme = readme_file.read()
setup(
name='pytest-describe',
version='1.0.0',
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/ro... | from setuptools import setup
with open("README.rst") as readme_file:
readme = readme_file.read()
setup(
name='pytest-describe',
version='1.0.0',
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/py... | Update URL since repository has moved to pytest-dev | Update URL since repository has moved to pytest-dev
| Python | mit | ropez/pytest-describe | ---
+++
@@ -11,7 +11,7 @@
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
- url='https://github.com/ropez/pytest-describe',
+ url='https://github.com/pytest-dev/pytest-describe',
author='Robin Pedersen',
author_email='... |
b0a2ef5f0acdcd987045737d1b7cc953b09fae28 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as rdm:
README = rdm.read()
setup(
name='stagpy',
use_scm_version=True,
description='Tool for StagYY output files processing',
long_description=README,
url='https://github.com/StagPython/StagPy',
author='Marti... | # -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as rdm:
README = rdm.read()
setup(
name='stagpy',
use_scm_version=True,
description='Tool for StagYY output files processing',
long_description=README,
url='https://github.com/StagPython/StagPy',
author='Marti... | Decrease scipy version to 0.17 (for RTD) | Decrease scipy version to 0.17 (for RTD)
| Python | apache-2.0 | StagPython/StagPy | ---
+++
@@ -35,7 +35,7 @@
setup_requires=['setuptools_scm'],
install_requires = [
'numpy>=1.12',
- 'scipy>=0.19',
+ 'scipy>=0.17',
'f90nml>=0.21',
'pandas>=0.20',
'matplotlib>=2.0', |
2c5dd9086681422b21d0bfac0906db5ccdf22b0c | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.3.0",
packages = find_packages(),
requires = ['Python (>=2.7)'],
install_requires = [
'beautifulsoup4>=4.4',
'coverage>=4',
'jupyter>=1.0.0',
'matplotlib',
'numpy>=1.10',
... | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.3.0",
packages = find_packages(),
requires = ['Python (>=2.7)'],
install_requires = [
'beautifulsoup4>=4.4',
'coverage>=4',
'jupyter>=1.0.0',
'matplotlib',
'numpy>=1.10',
... | Add 'scripts/woa_calibration.py' to scripts list | Add 'scripts/woa_calibration.py' to scripts list
| Python | mit | biofloat/biofloat,biofloat/biofloat,MBARIMike/biofloat,MBARIMike/biofloat | ---
+++
@@ -18,7 +18,8 @@
'simpletable>=0.2',
'xray>=0.6'
],
- scripts = ['scripts/load_biofloat_cache.py'],
+ scripts = ['scripts/load_biofloat_cache.py',
+ 'scripts/woa_calibration.py'],
# metadata for upload to PyPI
author = "Mike McCann", |
5b24a22fa148f4ae4e8d4403824ad7881b27e644 | setup.py | setup.py | """
trafficserver_exporter
----------------------
An Apache Traffic Server metrics exporter for Prometheus. Uses the
stats_over_http plugin to translate JSON data into Prometheus format.
"""
from setuptools import setup
setup(
name='trafficserver_exporter',
version='0.0.2',
author='Greg Dallavalle',
... | """
trafficserver_exporter
----------------------
An Apache Traffic Server metrics exporter for Prometheus. Uses the
stats_over_http plugin to translate JSON data into Prometheus format.
"""
from setuptools import setup
setup(
name='trafficserver_exporter',
version='0.0.3',
author='Greg Dallavalle',
... | Add bumpversion, sync package version | Add bumpversion, sync package version
| Python | apache-2.0 | gdvalle/trafficserver_exporter | ---
+++
@@ -11,7 +11,7 @@
setup(
name='trafficserver_exporter',
- version='0.0.2',
+ version='0.0.3',
author='Greg Dallavalle',
description='Traffic Server metrics exporter for Prometheus',
long_description=__doc__, |
fc6042cf57752ca139c52889ec5e00c02b618d0d | setup.py | setup.py | from distutils.core import setup, Command
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
... | from distutils.core import setup, Command
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
... | Add api and model to packages | Add api and model to packages
| Python | mit | yamaneko1212/webpay-python | ---
+++
@@ -22,7 +22,7 @@
setup(
name='webpay',
- packages=['webpay'],
+ packages=['webpay', 'webpay.api', 'webpay.model'],
version='0.1.0',
author='webpay',
author_email='administrators@webpay.jp', |
8b25ce43c2d99876080d84674485ebad07ca4bc0 | setup.py | setup.py | #!/usr/bin/env python2
import os
from setuptools import setup, find_packages
from plugins import __version__
repo_directory = os.path.dirname(__file__)
try:
long_description = open(os.path.join(repo_directory, 'README.rst')).read()
except:
long_description = None
setup(
name='gds-nagios-plugins',
ve... | #!/usr/bin/env python2
import os
from setuptools import setup, find_packages
from plugins import __version__
repo_directory = os.path.dirname(__file__)
try:
long_description = open(os.path.join(repo_directory, 'README.rst')).read()
except:
long_description = None
setup(
name='gds-nagios-plugins',
ve... | Allow looser version of nose | Allow looser version of nose
TravisCI provides `nose` already installed:
- http://docs.travis-ci.com/user/languages/python/#Pre-installed-packages
However it's now at a later version and causes our tests to fail:
pkg_resources.VersionConflict: (nose 1.3.4 (/home/travis/virtualenv/python2.7.8/lib/python2.7/site-... | Python | mit | alphagov/nagios-plugins | ---
+++
@@ -31,7 +31,7 @@
"nagioscheck==0.1.6"
],
tests_require=[
- "nose==1.3.1",
+ "nose >=1.3, <1.4",
"freezegun==0.1.11"
],
|
e3d23b47b01deebb25652512be551a128db9c36e | alg_dijkstra_shortest_path.py | alg_dijkstra_shortest_path.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from ds_binary_heap_tuple import BinaryHeap
def dijkstra(weighted_graph_d, start_vertex):
inf = float('inf')
shortest_path_d = {
vertex: inf for vertex in weighted_graph_d
}
shortest_p... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from ds_binary_heap_tuple import BinaryHeap
def dijkstra(weighted_graph_d, start_vertex):
shortest_path_d = {
vertex: float('inf') for vertex in weighted_graph_d
}
shortest_path_d[start_ver... | Move inf to shortest_path_d for clarity | Move inf to shortest_path_d for clarity
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -5,10 +5,8 @@
from ds_binary_heap_tuple import BinaryHeap
def dijkstra(weighted_graph_d, start_vertex):
- inf = float('inf')
-
shortest_path_d = {
- vertex: inf for vertex in weighted_graph_d
+ vertex: float('inf') for vertex in weighted_graph_d
}
shortest_path_d[start_v... |
a4cacaba81dda523fb6e24f8a4382a334cc549a8 | textinator.py | textinator.py | from PIL import Image
from os import get_terminal_size
default_palette = list('░▒▓█')
print(get_terminal_size())
def scale(val, src, dst):
"""
Scale the given value from the scale of src to the scale of dst.
"""
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
def value_to_char(... | import click
from PIL import Image
def scale(val, src, dst):
"""
Scale the given value from the scale of src to the scale of dst.
"""
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
def value_to_char(value, palette, value_range=(0, 256)):
palette_range = (0, len(palette))
... | Add commandline interface with Click. | Add commandline interface with Click.
| Python | mit | ijks/textinator | ---
+++
@@ -1,9 +1,5 @@
+import click
from PIL import Image
-from os import get_terminal_size
-
-default_palette = list('░▒▓█')
-
-print(get_terminal_size())
def scale(val, src, dst):
"""
@@ -12,18 +8,34 @@
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
-def value_to_char(value... |
9f2141bad575e1718fe36a597e5af5b5c795da54 | troposphere/openstack/heat.py | troposphere/openstack/heat.py | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# Copyright (c) 2014, Andy Botting <andy.botting@theguardian.com>
# All rights reserved.
#
# See LICENSE file for full license.
from troposphere import AWSObject
from troposphere.validators import integer
# Due to the strange nature of the OpenStack compatability ... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# Copyright (c) 2014, Andy Botting <andy.botting@theguardian.com>
# All rights reserved.
#
# See LICENSE file for full license.
from troposphere import AWSObject
from troposphere.validators import integer
# Due to the strange nature of the OpenStack compatability ... | Rename the OpenStack AWS resource to avoid name clash with native | Rename the OpenStack AWS resource to avoid name clash with native
OpenStack ships a native ASG resource type with the same name. We
rename this to AWSAutoScalingGroup to avoid the clash and make way
to the native type to come.
| Python | bsd-2-clause | alonsodomin/troposphere,horacio3/troposphere,amosshapira/troposphere,pas256/troposphere,mannytoledo/troposphere,johnctitus/troposphere,Yipit/troposphere,dmm92/troposphere,wangqiang8511/troposphere,jdc0589/troposphere,xxxVxxx/troposphere,ccortezb/troposphere,WeAreCloudar/troposphere,Hons/troposphere,LouTheBrew/troposphe... | ---
+++
@@ -12,7 +12,7 @@
# that should be integers fail to validate and need to be represented as
# strings. For this reason, we duplicate the AWS::AutoScaling::AutoScalingGroup
# and change these types.
-class AutoScalingGroup(AWSObject):
+class AWSAutoScalingGroup(AWSObject):
type = "AWS::AutoScaling::Auto... |
1e68f5f1fd565a812ef3fdf10c4c40649e3ef398 | foundation/organisation/search_indexes.py | foundation/organisation/search_indexes.py | from haystack import indexes
from .models import Person, Project, WorkingGroup, NetworkGroup
class PersonIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
twitter = indexes.CharField(model_attr='twitter')
url = indexes.CharField(model_attr='url')
... | from haystack import indexes
from .models import Person, Project, WorkingGroup, NetworkGroup
class PersonIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
twitter = indexes.CharField(model_attr='twitter')
url = indexes.CharField(model_attr='url')
... | Fix references to old model fields | organisation: Fix references to old model fields
| Python | mit | okfn/foundation,okfn/foundation,okfn/foundation,okfn/website,MjAbuz/foundation,okfn/website,okfn/foundation,okfn/website,okfn/website,MjAbuz/foundation,MjAbuz/foundation,MjAbuz/foundation | ---
+++
@@ -32,9 +32,9 @@
class NetworkGroupIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
- mailinglist = indexes.CharField(model_attr='mailinglist')
- homepage = indexes.CharField(model_attr='homepage')
twitter = indexes.CharField(model_a... |
82239a844462e721c7034ec42cb4905662f4efb4 | bin/mergeSegToCtm.py | bin/mergeSegToCtm.py | #!/usr/bin/python
# vim : set fileencoding=utf-8 :
#
# mergeSegToCtm.py
#
# Enhance the Bck file by adding extra fields with the diarisation
# information
#
import sys
with open(sys.argv[1], 'r', encoding='iso-8859-1') as seg:
with open(sys.argv[2], 'r', encoding='iso-8859-1') as ctm:
# For each frame, ... | #!/usr/bin/python
# vim : set fileencoding=utf-8 :
#
# mergeSegToCtm.py
#
# Enhance the CTM file by adding extra fields with the diarisation
# information
#
# First argument is the seg file
# Second argument is the ctm file
#
import sys
with open(sys.argv[1], 'r', encoding='iso-8859-1') as seg:
with open(sys.arg... | Fix typo in the script | Fix typo in the script
| Python | mit | SG-LIUM/SGL-SpeechWeb-Demo,SG-LIUM/SGL-SpeechWeb-Demo,bsalimi/speech-recognition-api,SG-LIUM/SGL-SpeechWeb-Demo,bsalimi/speech-recognition-api,bsalimi/speech-recognition-api,bsalimi/speech-recognition-api | ---
+++
@@ -4,8 +4,11 @@
#
# mergeSegToCtm.py
#
-# Enhance the Bck file by adding extra fields with the diarisation
+# Enhance the CTM file by adding extra fields with the diarisation
# information
+#
+# First argument is the seg file
+# Second argument is the ctm file
#
import sys
|
0ee59d04cb2cbe93a3f4f87a34725fbcd1a66fc0 | core/Reader.py | core/Reader.py | # coding: utf8
from io import StringIO
from collections import deque
class StreamReader:
def __init__(self, *args, stream_class=StringIO, **kwargs):
self.streamClass = stream_class
self.args = args
self.kwargs = kwargs
def read(self, parsing_pipeline):
parsing_pipeline.reset(... | # coding: utf8
from io import StringIO
from collections import deque
class StreamReader:
def __init__(self, *args, stream_class=StringIO, **kwargs):
self.streamClass = stream_class
self.args = args
self.kwargs = kwargs
def read(self, parsing_pipeline):
parsing_pipeline.reset(... | Add not enough characters condition | Add not enough characters condition
| Python | mit | JCH222/matriochkas | ---
+++
@@ -12,25 +12,28 @@
def read(self, parsing_pipeline):
parsing_pipeline.reset()
- stream = self.streamClass(*self.args, **self.kwargs)
min_position = parsing_pipeline.get_min_position()
max_position = parsing_pipeline.get_max_position()
length = max_position - ... |
e9188fdce548106cd8729c2b62a58ba387255f82 | feder/virus_scan/signer.py | feder/virus_scan/signer.py | from django.core.signing import TimestampSigner
class TokenSigner:
signer = TimestampSigner()
def unsign(self, value):
return self.signer.unsign(value=value, max_age=60 * 60 * 24)
def sign(self, value):
return self.signer.sign(value)
| from django.core.signing import TimestampSigner
class TokenSigner:
signer = TimestampSigner()
def unsign(self, value):
return self.signer.unsign(value=value, max_age=60 * 60 * 24 * 7)
def sign(self, value):
return self.signer.sign(value)
| Increase valid period for token | virus_scan: Increase valid period for token | Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | ---
+++
@@ -5,7 +5,7 @@
signer = TimestampSigner()
def unsign(self, value):
- return self.signer.unsign(value=value, max_age=60 * 60 * 24)
+ return self.signer.unsign(value=value, max_age=60 * 60 * 24 * 7)
def sign(self, value):
return self.signer.sign(value) |
6d32f609379febe2fdad690adc75a90e26b8d416 | backend/backend/serializers.py | backend/backend/serializers.py | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender',
'active', 'own', 'father', 'mother')
def validate_father(self, father):
if (father... | Add validator that selected father is male and mother is female. Validate that the animal is younger than it's parents. | Add validator that selected father is male and mother is female.
Validate that the animal is younger than it's parents.
| Python | apache-2.0 | mmlado/animal_pairing,mmlado/animal_pairing | ---
+++
@@ -4,4 +4,26 @@
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
- fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')
+ fields = ('id', 'name', 'dob', 'gender',
+ 'active', 'own', 'father', 'mother')
+
+ ... |
f2cd1d531a1cefdc5da4b418c866be0d76aa349b | basil_common/str_support.py | basil_common/str_support.py |
def as_int(value):
try:
return int(value)
except ValueError:
return None
|
def as_int(value):
try:
return int(value)
except ValueError:
return None
def urljoin(*parts):
url = parts[0]
for p in parts[1:]:
if url[-1] != '/':
url += '/'
url += p
return url
| Add url join which serves our needs | Add url join which serves our needs
Existing functions in common libraries add extra slashes.
| Python | apache-2.0 | eve-basil/common | ---
+++
@@ -5,3 +5,12 @@
return int(value)
except ValueError:
return None
+
+
+def urljoin(*parts):
+ url = parts[0]
+ for p in parts[1:]:
+ if url[-1] != '/':
+ url += '/'
+ url += p
+ return url |
a40c617ea605bd667a9906f6c9400fc9562d7c0a | salt/daemons/flo/reactor.py | salt/daemons/flo/reactor.py | # -*- coding: utf-8 -*-
'''
Start the reactor!
'''
# Import salt libs
import salt.utils.reactor
# Import ioflo libs
import ioflo.base.deeding
@ioflo.base.deeding.deedify(
'SaltRaetReactorFork',
ioinit={
'opts': '.salt.opts',
'proc_mgr': '.salt.usr.proc_mgr'})
def reactor_fork(s... | # -*- coding: utf-8 -*-
'''
Start the reactor!
'''
# Import salt libs
import salt.utils.reactor
import salt.utils.event
# Import ioflo libs
import ioflo.base.deeding
@ioflo.base.deeding.deedify(
'SaltRaetReactorFork',
ioinit={
'opts': '.salt.opts',
'proc_mgr': '.salt.usr.proc_m... | Add event return fork behavior | Add event return fork behavior
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -4,6 +4,7 @@
'''
# Import salt libs
import salt.utils.reactor
+import salt.utils.event
# Import ioflo libs
import ioflo.base.deeding
@@ -20,3 +21,17 @@
self.proc_mgr.add_process(
salt.utils.reactor.Reactor,
args=(self.opts.value,))
+
+
+@ioflo.base.deeding.deedify(
+ ... |
14e9bda5de10ef5a1c6dd96692d083f4e0f16025 | python/ql/test/experimental/library-tests/frameworks/yaml/Decoding.py | python/ql/test/experimental/library-tests/frameworks/yaml/Decoding.py | import yaml
from yaml import SafeLoader
yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML
yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutp... | import yaml
# Unsafe:
yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.load(payload, yaml.Loader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.unsafe_load(payload) # $ decodeInput=payload decodeOutput=Attri... | Refactor PyYAML tests a bit | Python: Refactor PyYAML tests a bit
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | ---
+++
@@ -1,15 +1,18 @@
import yaml
-from yaml import SafeLoader
+# Unsafe:
yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
-yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML
-yaml.load(payload, Loader=S... |
0997055c591d7bd4ad4334874292f8977ba778bf | cashew/exceptions.py | cashew/exceptions.py | class CashewException(Exception):
pass
class InternalCashewException(CashewException):
pass
class UserFeedback(CashewException):
pass
class InactivePlugin(UserFeedback):
def __init__(self, plugin_instance_or_alias):
if isinstance(plugin_instance_or_alias, basestring):
self.message... | class CashewException(Exception):
pass
class InternalCashewException(CashewException):
pass
class UserFeedback(CashewException):
pass
class InactivePlugin(UserFeedback):
def __init__(self, plugin_instance_or_alias):
if isinstance(plugin_instance_or_alias, basestring):
self.alias =... | Improve error message when alias not available. | Improve error message when alias not available.
| Python | mit | dexy/cashew | ---
+++
@@ -10,9 +10,12 @@
class InactivePlugin(UserFeedback):
def __init__(self, plugin_instance_or_alias):
if isinstance(plugin_instance_or_alias, basestring):
- self.message = plugin_instance_or_alias
+ self.alias = plugin_instance_or_alias
else:
- self.mess... |
2d82280460c50d50f6be8d8c8405506b4706cd8a | securethenews/blog/tests.py | securethenews/blog/tests.py | from django.test import TestCase
# Create your tests here.
| import datetime
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from .models import BlogIndexPage, BlogPost
class BlogTest(TestCase):
def setUp(self):
home_page = Page.objects.get(slug='home')
blog_index_page = BlogIndexPage(
title='Blog',
s... | Add unit test to verify that blog posts are ordered by most recent | Add unit test to verify that blog posts are ordered by most recent
Verifies that blog posts are ordered by most recent first even if
the blog posts are posted on the same day.
| Python | agpl-3.0 | freedomofpress/securethenews,freedomofpress/securethenews,freedomofpress/securethenews,freedomofpress/securethenews | ---
+++
@@ -1,3 +1,42 @@
+import datetime
+
from django.test import TestCase
-# Create your tests here.
+from wagtail.wagtailcore.models import Page
+
+from .models import BlogIndexPage, BlogPost
+
+
+class BlogTest(TestCase):
+ def setUp(self):
+ home_page = Page.objects.get(slug='home')
+
+ blog... |
59e15749671009047ec62cae315a07719d583ac7 | build/fbcode_builder_config.py | build/fbcode_builder_config.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
'fbcode_builder steps to build & test Bistro'
import specs.fbthrift as fbthrift
import specs.folly as folly
import specs.proxygen as proxygen
from ... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
'fbcode_builder steps to build & test Bistro'
import specs.fbthrift as fbthrift
import specs.folly as folly
import specs.proxygen as proxygen
from ... | Fix overquoting of thrift paths | oss: Fix overquoting of thrift paths
Summary: This overquotes the paths in travis builds. This will fix the opensource broken builds
Reviewed By: snarkmaster
Differential Revision: D5923131
fbshipit-source-id: 1ff3e864107b0074fc85e8a45a37455430cf4ba3
| Python | mit | facebook/bistro,facebook/bistro,facebook/bistro,facebook/bistro,facebook/bistro,facebook/bistro | ---
+++
@@ -22,8 +22,8 @@
builder.step('Build bistro', [
# Future: should this share some code with `cmake_install()`?
builder.run(ShellQuoted(
- 'PATH="$PATH:{p}/bin" '
- 'TEMPLATES_PATH="{p}/include/thrift/templates" '
+ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.