commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
9d66600518ec05dae2be62da0bbe2c15ddccce9d
spicedham/__init__.py
spicedham/__init__.py
from pkg_resources import iter_entry_points from spicedham.config import load_config _plugins = None def load_plugins(): """ If not already loaded, load plugins. """ global _plugins if _plugins == None: load_config() _plugins = [] for plugin in iter_entry_points(group='spi...
from pkg_resources import iter_entry_points from spicedham.config import load_config from spicedham.backend import load_backend _plugins = None def load_plugins(): """ If not already loaded, load plugins. """ global _plugins if _plugins == None: # In order to use the plugins config and ba...
Make sure to load_backend as part of load_plugins
Make sure to load_backend as part of load_plugins
Python
mpl-2.0
mozilla/spicedham,mozilla/spicedham
d66f4a429a0e584b1ce45ca652a27ecd6c372e8c
climate_data/migrations/0024_auto_20170623_0308.py
climate_data/migrations/0024_auto_20170623_0308.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-23 03:08 from __future__ import unicode_literals from django.db import migrations # noinspection PyUnusedLocal def add_station_sensor_link_to_reading(apps, schema_editor): # noinspection PyPep8Naming Reading = apps.get_model('climate_data', 'Rea...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-23 03:08 from __future__ import unicode_literals from django.db import migrations # noinspection PyUnusedLocal def add_station_sensor_link_to_reading(apps, schema_editor): # noinspection PyPep8Naming Reading = apps.get_model('climate_data', 'Rea...
Improve station-sensor link field addition to reading model migration using a paging system to prevent the migration being killed automatically.
Improve station-sensor link field addition to reading model migration using a paging system to prevent the migration being killed automatically.
Python
apache-2.0
qubs/data-centre,qubs/climate-data-api,qubs/climate-data-api,qubs/data-centre
6fa2d67e27fcbd0cc8ff5858e4038e14a0ab8ae1
bika/lims/skins/bika/guard_receive_transition.py
bika/lims/skins/bika/guard_receive_transition.py
## Script (Python) "guard_receive_transition" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## from DateTime import DateTime workflow = context.portal_workflow # False if object is cancelled if workflow.getInfoFor(contex...
## Script (Python) "guard_receive_transition" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## from DateTime import DateTime workflow = context.portal_workflow # False if object is cancelled if workflow.getInfoFor(contex...
Allow receive of future-dated samples
Allow receive of future-dated samples
Python
agpl-3.0
veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,veroc/Bika-LIMS,anneline/Bika-LIMS,labsanmartin/Bika-LIMS,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,rockfruit/bika.lims,rockfruit/bika.lims
b0c4a58f3002f2f0971c6b254af443773b965d4e
InvenTree/company/urls.py
InvenTree/company/urls.py
""" URL lookup for Company app """ from django.conf.urls import url, include from . import views company_detail_urls = [ url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'), # Any other URL url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai...
""" URL lookup for Company app """ from django.conf.urls import url, include from . import views company_detail_urls = [ url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'), # Any other URL url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai...
Fix URL patterns for ManufacturerPart and SupplierPart
Fix URL patterns for ManufacturerPart and SupplierPart
Python
mit
SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree
96b3911faadc22a07176c9338420ac8cd9fb06e5
tests/test_vector2_scale.py
tests/test_vector2_scale.py
import pytest # type: ignore from hypothesis import assume, given from hypothesis.strategies import floats from math import isclose from utils import vectors from ppb_vector import Vector2 @given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75)) def test_scale_to_length(x: Vector2, l: float)...
import pytest # type: ignore from hypothesis import assume, given from hypothesis.strategies import floats from math import isclose from utils import angle_isclose, vectors from ppb_vector import Vector2 @given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75)) def test_scale_to_length(x: Vec...
Test that scaling doesn't rotate vectors
Test that scaling doesn't rotate vectors
Python
artistic-2.0
ppb/ppb-vector,ppb/ppb-vector
d3caf80485da78c8eb050ff4d9e33a2ee6c8feda
tests/rietveld/test_event_handler.py
tests/rietveld/test_event_handler.py
from __future__ import absolute_import, print_function import unittest from qtpy.QtWidgets import QApplication from addie.rietveld import event_handler class RietveldEventHandlerTests(unittest.TestCase): def setUp(self): self.main_window = QApplication([]) ''' def tearDown(self): self.mai...
from __future__ import absolute_import, print_function import pytest from addie.rietveld import event_handler @pytest.fixture def rietveld_event_handler(qtbot): return event_handler def test_evt_change_gss_mode_exception(qtbot, rietveld_event_handler): """Test we can extract a bank id from bank workspace na...
Refactor rietveld.event_handler test to use pytest-qt
Refactor rietveld.event_handler test to use pytest-qt
Python
mit
neutrons/FastGR,neutrons/FastGR,neutrons/FastGR
4e2fd123b77572bdf74938d08f3e84ccfa15af36
pycargr/cli.py
pycargr/cli.py
import csv from argparse import ArgumentParser from json import dumps from pycargr.model import to_dict from pycargr.parser import parse_car_page parser = ArgumentParser() parser.add_argument('car_ids', nargs='+') parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout') def main(): a...
import csv from argparse import ArgumentParser from json import dumps from pycargr.model import to_dict from pycargr.parser import parse_car_page parser = ArgumentParser() parser.add_argument('car_ids', nargs='+') parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout') def main(): a...
Support both json and stdout the same
Support both json and stdout the same
Python
mit
Florents-Tselai/PyCarGr
e9a0d9a2d64b00328f99d526db9cc67cad478760
src/mmmblog/models.py
src/mmmblog/models.py
from django.db import models FORMAT_CHOICES = ( ('html', 'Raw HTML'), ('markdown', 'Markdown'), ) class Blog(models.Model): date = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=250) content = models.TextField() format = models.CharField(max_length=10, choices=FOR...
from django.db import models from django.db.models import signals from staticgenerator import quick_publish, quick_delete FORMAT_CHOICES = ( ('html', 'Raw HTML'), ('markdown', 'Markdown'), ) class Blog(models.Model): date = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=2...
Add signals to call staticgenerator
Add signals to call staticgenerator
Python
mit
fajran/mmmblog
2cadf26e34a5cfaa59b6ae67065dd257fd45cfe5
students/psbriant/session010/timing_cm.py
students/psbriant/session010/timing_cm.py
#!/usr/bin/env python """ Timing context manager """ class Timer: def __enter__(self): pass
#!/usr/bin/env python """ Timing context manager """ import time class Timer: def __enter__(self): self.start = time.time() def __exit__(self, exc_type, exc_val, exc_tb): print("elapsed time:", time.time() - self.start)
Add enter and exit methods.
Add enter and exit methods.
Python
unlicense
UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016
15621b2d1dc58998f4e9f84ec8f4ef2c50458868
openerp/tests/addons/test_translation_import/models.py
openerp/tests/addons/test_translation_import/models.py
# -*- coding: utf-8 -*- import openerp from openerp.tools.translate import _ class m(openerp.osv.osv.Model): """ A model to provide source strings. """ _name = 'test.translation.import' _columns = { 'name': openerp.osv.fields.char( '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KT...
# -*- coding: utf-8 -*- import openerp from openerp.tools.translate import _ class m(openerp.osv.orm.TransientModel): """ A model to provide source strings. """ _name = 'test.translation.import' _columns = { 'name': openerp.osv.fields.char( '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25...
Use TransientModel for the dummy model used in translation testing
[IMP] Use TransientModel for the dummy model used in translation testing
Python
agpl-3.0
akretion/openerp-server,akretion/openerp-server,akretion/openerp-server
daf9c8e39cd141194f8000cb3b8f4694e96401ed
pep438/core.py
pep438/core.py
"""Core pep438 utility functions""" from __future__ import unicode_literals import requests import xmlrpclib import lxml.html from requirements import parse def valid_package(package_name): """Return bool if package_name is a valid package on PyPI""" response = requests.head('https://pypi.python.org/pypi/%s'...
"""Core pep438 utility functions""" from __future__ import unicode_literals import requests try: import xmlrpclib except: import xmlrpc.client as xmlprclib import lxml.html from requirements import parse def valid_package(package_name): """Return bool if package_name is a valid package on PyPI""" res...
Fix broxen import in Python 3
Fix broxen import in Python 3
Python
mit
treyhunner/pep438
b03e1b75099cb46e40f7dcf85dc61e8718aa292d
slack_log_handler/__init__.py
slack_log_handler/__init__.py
import json import traceback from logging import Handler from slacker import Slacker class SlackLogHandler(Handler): def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None): Handler.__init__(self) self.slack_chat = Slacker(api_key) ...
import json import traceback from logging import Handler, CRITICAL, ERROR, WARNING from slacker import Slacker ERROR_COLOR = 'danger' # color name is built in to Slack API WARNING_COLOR = 'warning' # color name is built in to Slack API INFO_COLOR = '#439FE0' COLORS = { CRITICAL: ERROR_COLOR, ERROR: ERROR_C...
Set attachment color based on log level
Set attachment color based on log level
Python
apache-2.0
mathiasose/slacker_log_handler
d5f650cc6932e585a848cdd9aaa257342c90a983
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = '' RELATIVE_URLS = False FEED_ALL_ATOM = 'fee...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = '' RELATIVE_URLS = False FEED_ALL_ATOM = 'fee...
Switch to GA universal id.
Switch to GA universal id.
Python
mit
donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io
20654d833deb332dbbe683e6d4e38cef1cc58dd3
webcomix/tests/test_comic_availability.py
webcomix/tests/test_comic_availability.py
import pytest from webcomix.comic import Comic from webcomix.supported_comics import supported_comics from webcomix.util import check_first_pages @pytest.mark.slow def test_supported_comics(): for comic_name, comic_info in supported_comics.items(): first_pages = Comic.verify_xpath(*comic_info) ch...
import pytest from webcomix.comic import Comic from webcomix.supported_comics import supported_comics from webcomix.util import check_first_pages @pytest.mark.slow def test_supported_comics(): for comic_name, comic_info in supported_comics.items(): comic = Comic(comic_name, *comic_info) first_pag...
Refactor comic availability test to reflect changes to Comic class
Refactor comic availability test to reflect changes to Comic class
Python
mit
J-CPelletier/WebComicToCBZ,J-CPelletier/webcomix,J-CPelletier/webcomix
38775f06c2285f3d12b9f4a0bc70bded29dce274
hbmqtt/utils.py
hbmqtt/utils.py
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. def not_in_dict_or_none(dict, key): """ Check if a key exists in a map and if it's not None :param dict: map to look for key :param key: key to find :return: true if key is in dict and not None """ if...
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. def not_in_dict_or_none(dict, key): """ Check if a key exists in a map and if it's not None :param dict: map to look for key :param key: key to find :return: true if key is in dict and not None """ if...
Add method for formatting client info (address, port, id)
Add method for formatting client info (address, port, id)
Python
mit
beerfactory/hbmqtt
1307d737a73122d948fd106ca39274b7cf505f89
Lib/test/test_threading.py
Lib/test/test_threading.py
# Very rudimentary test of threading module # Create a bunch of threads, let each do some work, wait until all are done from test_support import verbose import random import threading import time numtasks = 10 # no more than 3 of the 10 can run at once sema = threading.BoundedSemaphore(value=3) mutex = threading.RL...
# Very rudimentary test of threading module # Create a bunch of threads, let each do some work, wait until all are done from test_support import verbose import random import threading import time # This takes about n/3 seconds to run (about n/3 clumps of tasks, times # about 1 second per clump). numtasks = 10 # no ...
Test failed because these was no expected-output file, but always printed to stdout. Repaired by not printing at all except in verbose mode.
Test failed because these was no expected-output file, but always printed to stdout. Repaired by not printing at all except in verbose mode. Made the test about 6x faster -- envelope analysis showed it took time proportional to the square of the # of tasks. Now it's linear.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
91dc57bb07d6bfd17af378fd6fccf353317cb06c
tests/test_scatter_series.py
tests/test_scatter_series.py
from unittest import TestCase from unittest.mock import patch from quickplots.series import ScatterSeries, Series class LineSeriesCreationTests(TestCase): def test_can_create_line_series(self): series = ScatterSeries((1, 1), (2, 4), (3, 9)) self.assertIsInstance(series, Series) @patch("quick...
from unittest import TestCase from unittest.mock import patch from quickplots.series import ScatterSeries, Series class LineSeriesCreationTests(TestCase): def test_can_create_line_series(self): series = ScatterSeries((1, 1), (2, 4), (3, 9)) self.assertIsInstance(series, Series) @patch("quick...
Add check on ScatterSeries repr
Add check on ScatterSeries repr
Python
mit
samirelanduk/quickplots
48fc33be592e27e632958a58de99356494a4e511
test/dbusdef.py
test/dbusdef.py
import dbus bus = dbus.SystemBus() dummy = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.freedesktop.DBus.Introspectable') #print dummy.Introspect() manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager') database = dbus.Interface(bus.get_object('org.bluez', '/or...
import dbus bus = dbus.SystemBus() dummy = dbus.Interface(bus.get_object('org.bluez', '/'), 'org.freedesktop.DBus.Introspectable') #print dummy.Introspect() manager = dbus.Interface(bus.get_object('org.bluez', '/'), 'org.bluez.Manager') try: adapter = dbus.Interface(bus.get_object('org.bluez', manager.DefaultAd...
Remove old 3.x API cruft
Remove old 3.x API cruft
Python
lgpl-2.1
pkarasev3/bluez,mapfau/bluez,silent-snowman/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,pkarasev3/bluez,ComputeCycles/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,mapfau/bluez,silent-snowman/bluez,mapfau/bluez,pkarasev3/blue...
5b3cdb3a1735a02fc10761b96f2d74b2fab8cd61
test_scraper.py
test_scraper.py
from scraper import search_CL def test_search_CL(): test_body, test_encoding = search_CL(minAsk=100) assert "<span class=\"desktop\">craigslist</span>" in test_body assert test_encoding == 'utf-8'
from scraper import search_CL from scraper import read_search_results def test_search_CL(): test_body, test_encoding = search_CL(minAsk=100) assert "<span class=\"desktop\">craigslist</span>" in test_body assert test_encoding == 'utf-8' def test_read_search_result(): test_body, test_encoding = read_...
Add test_read_search_result() to test reading data from a local .html
Add test_read_search_result() to test reading data from a local .html
Python
mit
jefrailey/basic-scraper
01ef56e5ef825897648de792d1734a336499fb0b
ynr/apps/candidates/views/version_data.py
ynr/apps/candidates/views/version_data.py
import sys from datetime import datetime from random import randint def get_client_ip(request): x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR") if x_forwarded_for: ip = x_forwarded_for.split(",")[-1].strip() else: ip = request.META.get("REMOTE_ADDR") return ip def create_v...
import sys from datetime import datetime from random import randint def get_client_ip(request): x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR") if x_forwarded_for: ip = x_forwarded_for.split(",")[-1].strip() else: ip = request.META.get("REMOTE_ADDR") return ip def create_v...
Allow passing User directly to get_change_metadata
Allow passing User directly to get_change_metadata
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
be75e40136bcba9e3c02a811beedf9a800381062
changeling/api.py
changeling/api.py
import changeling.models class ChangeAPI(object): def __init__(self, config, storage): self.config = config self.storage = storage def list(self): for change_data in self.storage.list_changes(): yield changeling.models.Change.from_dict(change_data) def save(self, chan...
import changeling.models class ChangeAPI(object): def __init__(self, storage): self.storage = storage def list(self): for change_data in self.storage.list_changes(): yield changeling.models.Change.from_dict(change_data) def save(self, change): data = change.to_dict() ...
Drop config argument from ChangeAPI
Drop config argument from ChangeAPI
Python
apache-2.0
bcwaldon/changeling,bcwaldon/changeling
2b372d479f8c022d72954396be9a4a045596f497
tests/test52.py
tests/test52.py
import judicious judicious.seed("cc722bf6-e319-cf63-a671-cbae64dfdb0f") # 1 (complete): 3799aa89-ccae-c268-d0e8-cc4e9ddddee4 # 2 (timeout) : 4d30601d-dfe3-ee53-8594-7fc0aa8e68ec # 3 (complete): fe07a885-53c3-9a22-c93e-91436e5d8f0c # 1 (complete): 4f4d13ed-7d1c-cbee-638d-6aee5188c929 # 2 (timeout) : 720ebe41-5987-b9...
import judicious # judicious.register("https://imprudent.herokuapp.com") # judicious.seed("cc722bf6-e319-cf63-a671-cbae64dfd40f") def experiment(): with judicious.Person(lifetime=60) as person: if not person.consent(): return None j1 = person.joke() j2 = person.joke() ...
Update context manager test script
Update context manager test script
Python
mit
suchow/judicious,suchow/judicious,suchow/judicious
ea18ab430e49c5deb5a0c19fbda66cbaca8256c7
esipy/__init__.py
esipy/__init__.py
# -*- encoding: utf-8 -*- from __future__ import absolute_import from .client import EsiClient # noqa from .security import EsiSecurity # noqa try: from pyswagger import App # noqa except Exception: # pragma: no cover # Not installed or in install (not yet installed) so ignore pass __ve...
# -*- encoding: utf-8 -*- from __future__ import absolute_import try: from .client import EsiClient # noqa from .security import EsiSecurity # noqa from pyswagger import App # noqa except Exception: # pragma: no cover # Not installed or in install (not yet installed) so ignore pass ...
Move import in try except (forgot the others)
Move import in try except (forgot the others)
Python
bsd-3-clause
a-tal/EsiPy,Kyria/EsiPy
6319303c93af973718c5e26c4d6b1d47310ff804
install_deps.py
install_deps.py
#!/usr/bin/env python """ Install the packages you have listed in the requirements file you input as first argument. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import fileinput import subprocess from pip.req import parse_requirements ...
#!/usr/bin/env python """ Install the packages you have listed in the requirements file you input as first argument. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import fileinput import subprocess from pip.req import parse_requirements ...
Correct for None appearing in requirements list
Correct for None appearing in requirements list
Python
bsd-3-clause
Neurita/galton
1c60cf7082672335279d5b96e83f3cb2eb57424f
purchase_supplier_minimum_order/models/__init__.py
purchase_supplier_minimum_order/models/__init__.py
# -*- coding: utf-8 -*- ############################################################################## # # Set minimum order on suppliers # Copyright (C) 2016 OpusVL (<http://opusvl.com/>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
# -*- coding: utf-8 -*- ############################################################################## # # Set minimum order on suppliers # Copyright (C) 2016 OpusVL (<http://opusvl.com/>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
Enforce minimum PO value for supplier.
Enforce minimum PO value for supplier.
Python
agpl-3.0
OpusVL/odoo-purchase-min-order
f0fad3a710e6c9ec9475fa379521ba1e8e369c02
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
djc/fixlib
485bfd97d1b305ad0944192d4ea8c77a479936ad
util/log.py
util/log.py
import sys from colors import Colors class Log: @classmethod def print_msg(cls, title, msg, color, new_line = True): Log.raw("{0}{1}{2}: {3}".format(color, title, Colors.NORMAL, msg), new_line) @classmethod def msg(cls, msg, new_line = True): Log.print_msg("Message", msg, Colors.MAGENTA_FG, new_line)...
import sys from colors import Colors class Log: @classmethod def print_msg(cls, title, msg, color, new_line = True): Log.raw("{0}{1}{2}: {3}".format(color, title, Colors.NORMAL, msg), new_line) @classmethod def msg(cls, msg, new_line = True): Log.print_msg("Message", msg, Colors.MAGENTA_FG, new_line)...
Add note and fatal to Log
Add note and fatal to Log
Python
mit
JBarberU/strawberry_py
aa370f5eb39b587d71e511cb618951875896e75a
ckanext/ckanext-apicatalog_scheming/ckanext/apicatalog_scheming/tests/test_plugin.py
ckanext/ckanext-apicatalog_scheming/ckanext/apicatalog_scheming/tests/test_plugin.py
import pytest from ckan.tests.factories import User, Dataset, Organization from ckan.plugins.toolkit import get_action @pytest.mark.usefixtures('with_plugins', 'clean_db', 'clean_index') def test_allowed_organization_user_should_see_subsystem(): organization1 = Organization() user2 = User() org2_users = ...
import pytest from ckan.tests.factories import User, Dataset, Organization from ckan.plugins.toolkit import get_action @pytest.mark.usefixtures('with_plugins', 'clean_db', 'clean_index') def test_allowed_organization_user_should_see_subsystem(): organization1 = Organization() user2 = User() org2_users = ...
Add not allowed organization test
LIKA-410: Add not allowed organization test
Python
mit
vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog
0ee42ac3b80893557691d722eda207733289c97c
micropsi_core/world/minecraft/spockplugin.py
micropsi_core/world/minecraft/spockplugin.py
import logging from spock.mcp import mcdata, mcpacket from spock.mcmap import smpmap from micropsi_core.world.minecraft.psidispatcher import PsiDispatcher from spock.utils import pl_announce @pl_announce('Micropsi') class MicropsiPlugin(object): def __init__(self, ploader, settings): self.worldadapter = ...
import logging from spock.mcp import mcdata, mcpacket from spock.mcmap import smpmap from micropsi_core.world.minecraft.psidispatcher import PsiDispatcher from spock.utils import pl_announce @pl_announce('Micropsi') class MicropsiPlugin(object): def __init__(self, ploader, settings): self.worldadapter = ...
Move now sets the client position and allows the movement plugin do its thing
Move now sets the client position and allows the movement plugin do its thing
Python
mit
ianupright/micropsi2,ianupright/micropsi2,printedheart/micropsi2,ianupright/micropsi2,printedheart/micropsi2,printedheart/micropsi2
90d1ff207cce93585b52e5d107efe7221ed37175
test_project/djmercadopago_test_app_settings.SAMPLE.py
test_project/djmercadopago_test_app_settings.SAMPLE.py
DJMERCADOPAGO_CLIENT_ID = 'your-mp-client-id' DJMERCADOPAGO_CLIENTE_SECRET = 'your-mp-secret' DJMERCADOPAGO_SANDBOX_MODE = True DJMERCADOPAGO_CHECKOUT_PREFERENCE_BUILDER = \ 'full.path.to.checkout.builder.implementation.function'
DJMERCADOPAGO_CLIENT_ID = 'your-mp-client-id' DJMERCADOPAGO_CLIENTE_SECRET = 'your-mp-secret' DJMERCADOPAGO_SANDBOX_MODE = True DJMERCADOPAGO_CHECKOUT_PREFERENCE_UPDATER_FUNCTION = \ 'full.path.to.checkout.builder.implementation.function'
Test project: update settings names
Test project: update settings names
Python
bsd-3-clause
data-tsunami/django-mercadopago,data-tsunami/django-mercadopago
9185d882dc5fc7131b90d3b93dff8b6603538a3d
app/cogs/twitch_emotes.py
app/cogs/twitch_emotes.py
from io import BytesIO import requests from discord.ext import commands from discord.ext.commands import Bot TWITCH_EMOTES_API = 'https://twitchemotes.com/api_cache/v2/global.json' class TwitchEmotes: def __init__(self, bot: Bot): self.bot = bot r = requests.get(TWITCH_EMOTES_API) emot...
from io import BytesIO import logging import requests from discord.ext import commands from discord.ext.commands import Bot TWITCH_EMOTES_API = 'https://twitchemotes.com/api_cache/v2/global.json' logger = logging.getLogger(__name__) class TwitchEmotes: def __init__(self, bot: Bot): self.bot = bot ...
Add logging to Twitch emotes module
Add logging to Twitch emotes module
Python
mit
andrewlin16/duckbot,andrewlin16/duckbot
79d2e089eff2f6bcfd150d3ac6e165bfefa475cb
modeltranslation/__init__.py
modeltranslation/__init__.py
from pathlib import Path __version__ = (Path(__file__).parent / "VERSION").open().read().strip() default_app_config = 'modeltranslation.apps.ModeltranslationConfig'
from pathlib import Path from django import VERSION as _django_version __version__ = (Path(__file__).parent / "VERSION").open().read().strip() if _django_version < (3, 2): default_app_config = 'modeltranslation.apps.ModeltranslationConfig'
Add django version check for default_app_config
fix: Add django version check for default_app_config
Python
bsd-3-clause
deschler/django-modeltranslation,deschler/django-modeltranslation
ac5c03cef0f0b3676b22e66e89f74ec33f69e9c6
tests/python/utils.py
tests/python/utils.py
from pyroute2 import NSPopen from distutils.spawn import find_executable class NSPopenWithCheck(NSPopen): """ A wrapper for NSPopen that additionally checks if the program to be executed is available from the system path or not. If found, it proceeds with the usual NSPopen() call. Otherwise, it rai...
from pyroute2 import NSPopen from distutils.spawn import find_executable def has_executable(name): path = find_executable(name) if path is None: raise Exception(name + ": command not found") return path class NSPopenWithCheck(NSPopen): """ A wrapper for NSPopen that additionally checks if ...
Add a generic utility to check any binary availability
Add a generic utility to check any binary availability In order to run, some test programs depend on the availability of binaries in locations that are part of PATH. So, we add a generic utility to simplify this. Signed-off-by: Sandipan Das <ae8113f64d9c72812e097938d25a8975da69c074@linux.vnet.ibm.com>
Python
apache-2.0
mcaleavya/bcc,brendangregg/bcc,iovisor/bcc,brendangregg/bcc,tuxology/bcc,mcaleavya/bcc,brendangregg/bcc,iovisor/bcc,iovisor/bcc,tuxology/bcc,tuxology/bcc,iovisor/bcc,brendangregg/bcc,brendangregg/bcc,mcaleavya/bcc,mcaleavya/bcc,iovisor/bcc,mcaleavya/bcc,tuxology/bcc,tuxology/bcc
3024a35626118e5fcf504bde9785992aa7e3eea5
apps/members/models.py
apps/members/models.py
from django.db import models from bluebottle.bb_accounts.models import BlueBottleBaseUser from bluebottle.utils.models import Address from djchoices.choices import DjangoChoices, ChoiceItem from django.conf import settings from django.utils.translation import ugettext as _ class Member(BlueBottleBaseUser): pass ...
from django.db import models from bluebottle.bb_accounts.models import BlueBottleBaseUser from bluebottle.utils.models import Address from djchoices.choices import DjangoChoices, ChoiceItem from django.conf import settings from django.utils.translation import ugettext as _ class Member(BlueBottleBaseUser): # Cre...
Create an address if none exists for a user
Create an address if none exists for a user
Python
bsd-3-clause
onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site
88e7441314fa1f9cc1d23d2d7eac2a10429a2624
masters/master.chromium.git/master_source_cfg.py
masters/master.chromium.git/master_source_cfg.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from master.chromium_git_poller_bb8 import ChromiumGitPoller def Update(config, active_master, c): poller = ChromiumGitPoller( repourl='http://g...
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from master.chromium_git_poller_bb8 import ChromiumGitPoller def Update(config, active_master, c): poller = ChromiumGitPoller( repourl='https://...
Switch polling URL to git-on-borg.
Switch polling URL to git-on-borg. TBR=mmoss@chromium.org,cmp@chromium.org Review URL: https://codereview.chromium.org/12152002 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@179999 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
eunchong/build,eunchong/build,eunchong/build,eunchong/build
cdc43f6f6ee2d040675f10028af6372b0bf42a08
msmbuilder/tests/__init__.py
msmbuilder/tests/__init__.py
import sys import warnings from warnings import warn as orig_warn def my_warn(message, category=None, stacklevel=1): # taken from warnings module # Get context information try: caller = sys._getframe(stacklevel) except ValueError: globals = sys.__dict__ lineno = 1 else: ...
import sys import warnings from warnings import warn as orig_warn def my_warn(message, category=None, stacklevel=1): # taken from warnings module # Get context information try: caller = sys._getframe(stacklevel) except ValueError: globals = sys.__dict__ lineno = 1 else: ...
Fix for my nefarious `warn` replacement
Fix for my nefarious `warn` replacement
Python
lgpl-2.1
dr-nate/msmbuilder,brookehus/msmbuilder,cxhernandez/msmbuilder,msmbuilder/msmbuilder,dr-nate/msmbuilder,rafwiewiora/msmbuilder,Eigenstate/msmbuilder,rafwiewiora/msmbuilder,rafwiewiora/msmbuilder,msultan/msmbuilder,cxhernandez/msmbuilder,dr-nate/msmbuilder,msultan/msmbuilder,msmbuilder/msmbuilder,stephenliu1989/msmbuild...
44345a82380541e14c1fe099e6ab4ee7dfcd243a
massa/domain.py
massa/domain.py
# -*- coding: utf-8 -*- from sqlalchemy import ( Column, Date, Integer, MetaData, Numeric, String, Table, ) def define_tables(metadata): Table('measurement', metadata, Column('id', Integer, primary_key=True), Column('weight', Numeric(4, 1), nullable=False), Col...
# -*- coding: utf-8 -*- from sqlalchemy import ( Column, Date, Integer, MetaData, Numeric, String, Table, ) def define_tables(metadata): Table('measurement', metadata, Column('id', Integer, primary_key=True), Column('weight', Numeric(4, 1), nullable=False), Col...
Add a method to create a measurement.
Add a method to create a measurement.
Python
mit
jaapverloop/massa
4f497d86f7fedfb19ec910d5f0978f72d260b935
begotemp/views/geo_zone.py
begotemp/views/geo_zone.py
# -*- coding: utf-8 -*- """ Tools for geographical zones management.""" import logging from pyramid.view import view_config from webhelpers import paginate from anuket.models import DBSession from begotemp.models.zone import Zone log = logging.getLogger(__name__) def includeme(config): config.add_route('geo....
# -*- coding: utf-8 -*- """ Tools for geographical zones management.""" import logging from pyramid.view import view_config from webhelpers import paginate from anuket.models import DBSession from begotemp.models.zone import Zone log = logging.getLogger(__name__) def includeme(config): config.add_route('geo....
Add a flash message for empty zone list
Add a flash message for empty zone list
Python
mit
miniwark/begotemp
42e5db7e254ce46e562993a8abded7e8e3c7102b
contrib/migrateticketmodel.py
contrib/migrateticketmodel.py
#!/usr/bin/env python # # This script completely migrates a <= 0.8.x Trac environment to use the new # default ticket model introduced in Trac 0.9. # # In particular, this means that the severity field is removed (or rather # disabled by removing all possible values), and the priority values are # changed to the more...
#!/usr/bin/env python # # This script completely migrates a <= 0.8.x Trac environment to use the new # default ticket model introduced in Trac 0.9. # # In particular, this means that the severity field is removed (or rather # disabled by removing all possible values), and the priority values are # changed to the more...
Fix missing import in contrib script added in [2630].
Fix missing import in contrib script added in [2630]. git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@2631 af82e41b-90c4-0310-8c96-b1721e28e2e2
Python
bsd-3-clause
dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,dafrito/trac-mirror,moreati/trac-gitsvn,dafrito/trac-mirror,exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,moreati/trac-gitsvn,dafrito/trac-mirror,dokipen/trac,exocad/exotrac,dafrito/trac-mirror,exocad/exotrac
d9226d778a831d6d9f9f8d7645869245d0757754
tests/integration/test_cli.py
tests/integration/test_cli.py
import os import subprocess import pytest from chalice.utils import OSUtils CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_DIR = os.path.join(CURRENT_DIR, 'testapp') @pytest.fixture def local_app(tmpdir): temp_dir_path = str(tmpdir) OSUtils().copytree(PROJECT_DIR, temp_dir_path) old_di...
import os import subprocess import pytest from chalice.utils import OSUtils CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_DIR = os.path.join(CURRENT_DIR, 'testapp') @pytest.fixture def local_app(tmpdir): temp_dir_path = str(tmpdir) OSUtils().copytree(PROJECT_DIR, temp_dir_path) old_di...
Disable autoreload in integration tests
Disable autoreload in integration tests
Python
apache-2.0
awslabs/chalice
ecd5aaa396c5d8ee82cabbb5d95c5c0b6c150270
irrigator_pro/irrigator_pro/wsgi.py
irrigator_pro/irrigator_pro/wsgi.py
""" WSGI config for irrigator_pro project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os, os.path, site, sys, socket # Add django root dir to python path PROJECT_ROOT ...
""" WSGI config for irrigator_pro project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os, os.path, site, sys, socket # Add django root dir to python path PROJECT_ROOT ...
Change host test to check for 'irrigatorpro' instead of my laptop's name, since the latter changes depending on the (wireless) network.
Change host test to check for 'irrigatorpro' instead of my laptop's name, since the latter changes depending on the (wireless) network.
Python
mit
warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro
6cd2f4f1f2f4a4dca74fcfd6484278cc90e6f77a
tests/test_security_object.py
tests/test_security_object.py
from unittest import TestCase from zipline.assets._securities import Security class TestSecurityRichCmp(TestCase): def test_lt(self): self.assertTrue(Security(3) < Security(4)) self.assertFalse(Security(4) < Security(4)) self.assertFalse(Security(5) < Security(4)) def test_le(self): ...
import sys from unittest import TestCase from zipline.assets._securities import Security class TestSecurityRichCmp(TestCase): def test_lt(self): self.assertTrue(Security(3) < Security(4)) self.assertFalse(Security(4) < Security(4)) self.assertFalse(Security(5) < Security(4)) def test_...
Update Security class unit tests for Python3 compatibility
TEST: Update Security class unit tests for Python3 compatibility
Python
apache-2.0
sketchytechky/zipline,stkubr/zipline,wubr2000/zipline,michaeljohnbennett/zipline,jimgoo/zipline-fork,kmather73/zipline,morrisonwudi/zipline,cmorgan/zipline,keir-rex/zipline,grundgruen/zipline,umuzungu/zipline,zhoulingjun/zipline,jordancheah/zipline,florentchandelier/zipline,nborggren/zipline,joequant/zipline,ronalcc/zi...
e1d527d0676fd0b3a7a1f7b5e9b98ddc23a41cd6
storage_service/locations/tests/test_fixity_log.py
storage_service/locations/tests/test_fixity_log.py
from django.test import TestCase from locations import models class TestFixityLog(TestCase): fixtures = ['base.json', 'fixity_log.json'] def setUp(self): self.fl_object = models.FixityLog.objects.all()[0] #self.auth = requests.auth.HTTPBasicAuth(self.ds_object.user, self.ds_object.password)...
from django.test import TestCase from locations import models class TestFixityLog(TestCase): fixtures = ['base.json', 'package.json', 'fixity_log.json'] def setUp(self): self.fl_object = models.FixityLog.objects.all()[0] #self.auth = requests.auth.HTTPBasicAuth(self.ds_object.user, self.ds_...
Fix to storage service test.
Fix to storage service test.
Python
agpl-3.0
artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service
707a6016a3023fe423ede53db707c55273b0f6d0
oauth2_provider/backends.py
oauth2_provider/backends.py
from django.contrib.auth import get_user_model from .oauth2_backends import get_oauthlib_core UserModel = get_user_model() OAuthLibCore = get_oauthlib_core() class OAuth2Backend(object): """ Authenticate against an OAuth2 access token """ def authenticate(self, **credentials): request = cr...
from django.contrib.auth import get_user_model from .oauth2_backends import get_oauthlib_core UserModel = get_user_model() OAuthLibCore = get_oauthlib_core() class OAuth2Backend(object): """ Authenticate against an OAuth2 access token """ def authenticate(self, **credentials): request = cr...
Use the OAuthLibCore object defined at the module level.
Use the OAuthLibCore object defined at the module level.
Python
bsd-2-clause
bleib1dj/django-oauth-toolkit,StepicOrg/django-oauth-toolkit,JensTimmerman/django-oauth-toolkit,JensTimmerman/django-oauth-toolkit,StepicOrg/django-oauth-toolkit,DeskConnect/django-oauth-toolkit,bleib1dj/django-oauth-toolkit,DeskConnect/django-oauth-toolkit
51533420b6422515ea10fb323cb318c104a99650
pypi/models.py
pypi/models.py
from django.db import models class Package(models.Model): name = models.CharField(max_length=100) version = models.CharField(max_length=100) released_at = models.DateTimeField() class Meta: get_latest_by = 'released_at' unique_together = ('name', 'version') def __unicode__(self):...
from django.db import models class Package(models.Model): name = models.CharField(max_length=100) version = models.CharField(max_length=100) released_at = models.DateTimeField() class Meta: get_latest_by = 'released_at' ordering = ('-version',) unique_together = ('name', 'vers...
Order by version instead, it should mostly be what we want.
Order by version instead, it should mostly be what we want.
Python
mit
kitsunde/django-pypi
7b6125c0af688ec1b6b4e0baf667e71064dbb0cf
test/unit/Algorithms/OrdinaryPercolationTest.py
test/unit/Algorithms/OrdinaryPercolationTest.py
import OpenPNM mgr = OpenPNM.Base.Workspace() mgr.loglevel = 60 class OrdinaryPercolationTest: def setup_test(self): self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5]) self.geo = OpenPNM.Geometry.Toray090(network=self.net, pores=self.net.Ps, ...
import OpenPNM as op import scipy as sp mgr = op.Base.Workspace() mgr.loglevel = 60 class OrdinaryPercolationTest: def setup_test(self): self.net = op.Network.Cubic(shape=[5, 5, 5]) self.geo = op.Geometry.Toray090(network=self.net, pores=self.net.Ps, ...
Add unit test for late pore filling
Add unit test for late pore filling
Python
mit
TomTranter/OpenPNM,PMEAL/OpenPNM
fdf33278f66028a932dbecb999f66445ab0a3cd1
shuup/admin/modules/product_types/views/edit.py
shuup/admin/modules/product_types/views/edit.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django import forms from shu...
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from shuup.admin.forms.fields impo...
Use Select2 in attribute selection
Use Select2 in attribute selection With large amounts of attributes product type creation was really slow Refs SH-73
Python
agpl-3.0
shawnadelic/shuup,suutari-ai/shoop,shoopio/shoop,suutari-ai/shoop,shawnadelic/shuup,hrayr-artunyan/shuup,suutari/shoop,suutari/shoop,hrayr-artunyan/shuup,suutari/shoop,suutari-ai/shoop,hrayr-artunyan/shuup,shoopio/shoop,shawnadelic/shuup,shoopio/shoop
6d6709b0df05cccfd44bd68cea9fb30c4b6bd41f
asymmetric_jwt_auth/models.py
asymmetric_jwt_auth/models.py
from django.conf import settings from django.db import models from django.contrib.auth.models import User class PublicKey(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='public_keys') key = models.TextField(help_text="The user's RSA public key") comment = models.CharField(m...
from django.conf import settings from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError from cryptography.hazmat.primitives.serialization import load_ssh_public_key from cryptography.hazmat.backends import default_backend def validate_public_key(val...
Validate a public key before saving it
Validate a public key before saving it
Python
isc
crgwbr/asymmetric_jwt_auth,crgwbr/asymmetric_jwt_auth
eab3b3417f649e06c5d3f09b6c3369ef92da2e7d
users/admin.py
users/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import AdminPasswordChangeForm from tastypie.admin import ApiKeyInline from tastypie.models import ApiKey from .forms import UserCreationForm, UserChangeForm from .models import User, Membe...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import AdminPasswordChangeForm from tastypie.admin import ApiKeyInline from tastypie.models import ApiKey from .forms import UserCreationForm, UserChangeForm from .models import User, Membe...
Add a filter for membership_type.
Add a filter for membership_type.
Python
apache-2.0
malemburg/pythondotorg,Mariatta/pythondotorg,lebronhkh/pythondotorg,lebronhkh/pythondotorg,fe11x/pythondotorg,lepture/pythondotorg,proevo/pythondotorg,willingc/pythondotorg,ahua/pythondotorg,SujaySKumar/pythondotorg,ahua/pythondotorg,berkerpeksag/pythondotorg,python/pythondotorg,SujaySKumar/pythondotorg,fe11x/pythondot...
5657fb5cb8d5abbc8f6ab8cf59208a97e8104f34
utils/graph.py
utils/graph.py
""" This module serves as an interface to matplotlib. """ from utils import config OFFSET = 2 # offset = max_x/stepsize * OFFSET def init(output): import matplotlib config.mpl(matplotlib, bool(output)) from matplotlib import pyplot globals()['plt'] = pyplot def line_plot(xs, ys, color='red'): plt.p...
""" This module serves as an interface to matplotlib. """ from utils import config OFFSET = 2 # offset = max_x/stepsize * OFFSET def init(output): import matplotlib config.mpl(matplotlib, bool(output)) from matplotlib import pyplot globals()['plt'] = pyplot def line_plot(xs, ys, color='red'): plt.p...
Remove unused `--output stdout` option
Remove unused `--output stdout` option
Python
mit
wei2912/bce-simulation,wei2912/bce-simulation,wei2912/bce-simulation,wei2912/bce-simulation
0e301d3ee54366187b2e12fa5c6927f27e907347
tools/python/frame_processor/frame_processor.py
tools/python/frame_processor/frame_processor.py
from frame_receiver.ipc_channel import IpcChannel, IpcChannelException from frame_receiver.ipc_message import IpcMessage, IpcMessageException from frame_processor_config import FrameProcessorConfig import time class FrameProcessor(object): def __init__(self): # Instantiate a configuration container ...
from frame_receiver.ipc_channel import IpcChannel, IpcChannelException from frame_receiver.ipc_message import IpcMessage, IpcMessageException from frame_processor_config import FrameProcessorConfig import time class FrameProcessor(object): def __init__(self): # Instantiate a configuration container ...
Update python frame processor test harness to send IPC JSON messages to frame receiver for testing of control path and channel multiplexing
Update python frame processor test harness to send IPC JSON messages to frame receiver for testing of control path and channel multiplexing
Python
apache-2.0
odin-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,odin-det...
90506789edab1afb58ecebb90218f2654498a754
regserver/regserver/urls.py
regserver/regserver/urls.py
from django.conf.urls import patterns, include, url urlpatterns = patterns( '', url(r'', include('regulations.urls')), url(r'^eregulations/', include('regulations.urls')), )
from django.conf.urls import patterns, include, url urlpatterns = patterns( '', url(r'', include('regulations.urls')), )
Remove eregulations url as reversing is not consistent
Remove eregulations url as reversing is not consistent
Python
cc0-1.0
18F/regulations-site,adderall/regulations-site,eregs/regulations-site,EricSchles/regulations-site,grapesmoker/regulations-site,tadhg-ohiggins/regulations-site,ascott1/regulations-site,jeremiak/regulations-site,ascott1/regulations-site,willbarton/regulations-site,EricSchles/regulations-site,jeremiak/regulations-site,gra...
c4dc76587a5021de30e8811332869fa4cc6f9ed0
bucketeer/test/test_commit.py
bucketeer/test/test_commit.py
import unittest, boto, os from bucketeer import commit class BuckeeterTest(unittest.TestCase): global existing_bucket, test_dir existing_bucket = 'bucket.exists' test_dir = 'bucketeer_test_dir' def setUp(self): # Create a bucket to test on existing bucket connection = boto.connect_s3() bucket = c...
import unittest, boto, os from bucketeer import commit class BuckeeterTest(unittest.TestCase): global existing_bucket, test_dir, test_file existing_bucket = 'bucket.exists' test_dir = 'bucketeer_test_dir' test_file = 'bucketeer_test_file' def setUp(self): # Create a bucket to test on existing bucket ...
Add create and remove file for setUp and tearDown
Add create and remove file for setUp and tearDown
Python
mit
mgarbacz/bucketeer
236f10e790757db0cc563f5f19ca5863877b1e7f
busstops/management/tests/test_import_singapore.py
busstops/management/tests/test_import_singapore.py
import os import vcr from django.test import TestCase, override_settings from django.core.management import call_command from ...models import StopPoint, Service, Place FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures') class ImportSingaporeTest(TestCase): @classmethod def s...
import os import vcr from django.test import TestCase from django.core.management import call_command from ...models import StopPoint, Service, Place FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures') class ImportSingaporeTest(TestCase): @classmethod def setUpTestData(cls): ...
Remove unused import to fix flake8
Remove unused import to fix flake8
Python
mpl-2.0
jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk
34ab7f1090d878bf8328f25f0fa4be4e575e7f43
numba/sigutils.py
numba/sigutils.py
from __future__ import print_function, division, absolute_import from numba import types, typing def is_signature(sig): """ Return whether *sig* is a potentially valid signature specification (for user-facing APIs). """ return isinstance(sig, (str, tuple, typing.Signature)) def _parse_signature...
from __future__ import print_function, division, absolute_import from numba import types, typing def is_signature(sig): """ Return whether *sig* is a potentially valid signature specification (for user-facing APIs). """ return isinstance(sig, (str, tuple, typing.Signature)) def _parse_signature...
Update return value order in normalize_signature docstring
Update return value order in normalize_signature docstring [skip ci]
Python
bsd-2-clause
IntelLabs/numba,gmarkall/numba,jriehl/numba,jriehl/numba,seibert/numba,numba/numba,IntelLabs/numba,stonebig/numba,stonebig/numba,stonebig/numba,stonebig/numba,sklam/numba,stuartarchibald/numba,seibert/numba,stuartarchibald/numba,jriehl/numba,seibert/numba,cpcloud/numba,cpcloud/numba,cpcloud/numba,numba/numba,IntelLabs/...
b1d889dc4207af08e8c1ee3f75006fa6b4051376
vitrage/rpc.py
vitrage/rpc.py
# Copyright 2015 - Alcatel-Lucent # Copyright 2016 - Nokia # # 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 applicabl...
# Copyright 2015 - Alcatel-Lucent # Copyright 2016 - Nokia # # 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 applicabl...
Set access_policy for messaging's dispatcher
Set access_policy for messaging's dispatcher oslo.messaging allow dispatcher to restrict endpoint methods since 5.11.0 in d3a8f280ebd6fd12865fd20c4d772774e39aefa2, set with DefaultRPCAccessPolicy to fix FutureWarning like: "The access_policy argument is changing its default value to <class 'oslo_messaging.rpc.dispatc...
Python
apache-2.0
openstack/vitrage,openstack/vitrage,openstack/vitrage
b521c3a23d2802419fa2e15839aaceb27794ab64
nikola/md.py
nikola/md.py
"""Implementation of compile_html based on markdown.""" __all__ = ['compile_html'] import codecs from markdown import markdown def compile_html(source, dest): with codecs.open(source, "r", "utf8") as in_file: data = in_file.read() output = markdown(data) with codecs.open(dest, "w+", "utf8")...
"""Implementation of compile_html based on markdown.""" __all__ = ['compile_html'] import codecs import re from markdown import markdown def compile_html(source, dest): with codecs.open(source, "r", "utf8") as in_file: data = in_file.read() output = markdown(data, ['fenced_code', 'codehilite']) ...
Make python-markdown play well with pygments.
Make python-markdown play well with pygments. Use the codehilite and fenced_code extensions, and add a regexp substitution to make the codehilite extension match pygments' css "api".
Python
mit
damianavila/nikola,x1101/nikola,wcmckee/nikola,jjconti/nikola,knowsuchagency/nikola,TyberiusPrime/nikola,pluser/nikola,yamila-moreno/nikola,getnikola/nikola,immanetize/nikola,Proteus-tech/nikola,okin/nikola,lucacerone/nikola,techdragon/nikola,TyberiusPrime/nikola,Proteus-tech/nikola,xuhdev/nikola,schettino72/nikola,tec...
bcd7f8f3d7313538ab1c04da9c42e774350ccdfe
ui/widgets/histogram/TrackingHistogramWidget.py
ui/widgets/histogram/TrackingHistogramWidget.py
""" TrackingHistogramWidget :Authors: Berend Klein Haneveld """ from PySide.QtGui import * from PySide.QtCore import * from HistogramWidget import HistogramWidget from TrackingNodeItem import TrackingNodeItem class TrackingHistogramWidget(HistogramWidget): """ TrackingHistogramWidget """ updatePosition = Signal...
""" TrackingHistogramWidget :Authors: Berend Klein Haneveld """ from PySide.QtGui import * from PySide.QtCore import * from HistogramWidget import HistogramWidget from TrackingNodeItem import TrackingNodeItem from ui.widgets import Style class TrackingHistogramWidget(HistogramWidget): """ TrackingHistogramWidget ...
Fix background color on OS X for histogram widget of ray.
Fix background color on OS X for histogram widget of ray.
Python
mit
berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop
7c7319590e5deaed36365f91fb0aebdf93407f07
__init__.py
__init__.py
from ._jute import Interface, Dynamic __all__ = [ 'Interface', 'Dynamic', ]
from ._jute import Interface, Dynamic, InterfaceConformanceError __all__ = [ 'Interface', 'Dynamic', 'InterfaceConformanceError', ]
Add InterfaceConformanceError to exported names.
Add InterfaceConformanceError to exported names.
Python
mit
jongiddy/jute,jongiddy/jute
87cd4025aed62d76e3c64ba939f5241307b4478f
CascadeCount.py
CascadeCount.py
from __future__ import division import gzip try: from BytesIO import BytesIO except ImportError: from io import BytesIO try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import hdfs import pandas as pd from mrjob.job import MRJob from mrjob.protocol import JSON...
from __future__ import division import gzip try: from BytesIO import BytesIO except ImportError: from io import BytesIO try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import hdfs import pandas as pd from mrjob.job import MRJob from mrjob.protocol import JSON...
Load from the pre processed data
Load from the pre processed data
Python
mit
danjamker/DiffusionSimulation
caab96114964a1c9154df67d97c66c701cede8d9
waterbutler/core/__init__.py
waterbutler/core/__init__.py
from waterbutler.core.utils import async_retry from waterbutler.core.utils import backgrounded __all__ = [ 'backgrounded', 'async_retry' ]
from waterbutler.core.utils import async_retry from waterbutler.core.utils import make_provider __all__ = [ 'async_retry', 'make_provider', ]
Allow make_provider to be imported from waterbutler core
Allow make_provider to be imported from waterbutler core
Python
apache-2.0
chrisseto/waterbutler,Johnetordoff/waterbutler,rafaeldelucena/waterbutler,cosenal/waterbutler,CenterForOpenScience/waterbutler,rdhyee/waterbutler,Ghalko/waterbutler,kwierman/waterbutler,icereval/waterbutler,felliott/waterbutler,hmoco/waterbutler,TomBaxter/waterbutler,RCOSDP/waterbutler
44f92d7c96b074054b11876d208494da1acef7e7
Lib/tempfile.py
Lib/tempfile.py
# Temporary file name allocation import posix import path # Changeable parameters (by clients!)... # XXX Should the environment variable $TMPDIR override tempdir? tempdir = '/usr/tmp' template = '@' # Kludge to hold mutable state class Struct: pass G = Struct() G.i = 0 # User-callable function # XXX Should thi...
# Temporary file name allocation import posix import path # Changeable parameters (by clients!)... # XXX Should the environment variable $TMPDIR override tempdir? tempdir = '/usr/tmp' template = '@' # Counter for generating unique names counter = 0 # User-callable function # XXX Should this have a parameter, l...
Use 'global' instead of struct kludge.
Use 'global' instead of struct kludge.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
70323d2cc7c568fecda66adb0e8ace1922b15b8f
recipes/graphviz/run_test.py
recipes/graphviz/run_test.py
#!/usr/bin/env python import os # This is failing for now on Windows. We need to submit # a patch to the graphviz package to fix it if not os.name == 'nt': # Install graphviz Python package import pip pip.main(['install', 'graphviz']) # Dask test import dask.array as da x = da.ones(4, chunks=...
#!/usr/bin/env python import os # This is failing for now on Windows. We need to submit # a patch to the graphviz package to fix it if not os.name == 'nt': # Install graphviz Python package import pip pip.main(['install', 'graphviz']) # Dask test import dask.array as da x = da.ones(4, chunks=...
Add tests for svg and pdf on Windows
Add tests for svg and pdf on Windows
Python
bsd-3-clause
cpaulik/staged-recipes,jerowe/staged-recipes,cpaulik/staged-recipes,asmeurer/staged-recipes,hajapy/staged-recipes,guillochon/staged-recipes,richardotis/staged-recipes,glemaitre/staged-recipes,kwilcox/staged-recipes,patricksnape/staged-recipes,pstjohn/staged-recipes,johannesring/staged-recipes,caspervdw/staged-recipes,p...
18550958c5c6d3a2d56074d53aa4f0b73e510163
AT0206/Analysis/signal_mask.py
AT0206/Analysis/signal_mask.py
''' Make a mask of the emission ''' cube = SpectralCube.read("M33_206_b_c_HI.fits") cube = cube.with_mask(cube != 0*u.Jy) noise_cube = Noise(cube) new_noise = noise_cube.scale cube = cube.with_mask(cube > new_noise*u.Jy) # Load in the broad clean mask used clean_mask = fits.getdata("../../../Arecibo/M33_newmask.f...
''' Make a mask of the emission ''' from astropy.io import fits from spectral_cube import SpectralCube, BooleanArrayMask from signal_id import RadioMask, Noise from astropy import units as u make_mask = True save_mask = False cube = SpectralCube.read("M33_206_b_c_HI.fits") cube = cube.with_mask(cube != 0*u.Jy) if...
Choose whether to make new mask
Choose whether to make new mask
Python
mit
e-koch/VLA_Lband,e-koch/VLA_Lband
a03d34cbfd4f9fcf98ba0cb4584a24f0632897cf
Simulator/src/sim_tools/text_box.py
Simulator/src/sim_tools/text_box.py
import pygame class Text_Box(object): '''Text_Box() You never have to initialize this! Just call Text_Box.draw(display, pos, color, text) It draws the same way a pygame primitive would. ''' pygame.font.init() font = pygame.font.SysFont("monospace", 15) @classmethod def draw(self, disp...
import pygame #WRITEN BY JACOB PANIKULAM class Text_Box(object): '''Text_Box() You never have to initialize this! Just call Text_Box.draw(display, pos, color, text) It draws the same way a pygame primitive would. ''' pygame.font.init() font = pygame.font.SysFont("monospace", 15) @classmeth...
Add Jake's name to top of file
Add Jake's name to top of file
Python
mit
ufieeehw/IEEE2016,ufieeehw/IEEE2016,ufieeehw/IEEE2016,ufieeehw/IEEE2016
29fa35d8ff6fa26e676c693ea17faeb03440d116
scripts/3b-show-features.py
scripts/3b-show-features.py
#!/usr/bin/python import sys sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/") import argparse import commands import cv2 import fnmatch import os.path sys.path.append('../lib') import ProjectMgr # for all the images in the project image_dir, detect features using the # specified method an...
#!/usr/bin/python import sys sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/") import argparse import commands import cv2 import fnmatch import os.path sys.path.append('../lib') import ProjectMgr # for all the images in the project image_dir, detect features using the # specified method an...
Support showing features for a single image.
Support showing features for a single image. Former-commit-id: 4143a53dae02b9ece391f65a47c060bbcfd0b7a8
Python
mit
UASLab/ImageAnalysis
0fc7a7962579cef554b30028e56923e2d05903c1
custom/icds_reports/models/manager.py
custom/icds_reports/models/manager.py
from __future__ import absolute_import, unicode_literals import uuid from django.db.models.manager import BaseManager from django.db.models.query import QuerySet from corehq.toggles import ICDS_COMPARE_QUERIES_AGAINST_CITUS, NAMESPACE_OTHER class CitusComparisonQuerySet(QuerySet): def _fetch_all(self): ...
from __future__ import absolute_import, unicode_literals import json import uuid from django.core.serializers.json import DjangoJSONEncoder from django.db.models.manager import BaseManager from django.db.models.query import QuerySet from corehq.toggles import ICDS_COMPARE_QUERIES_AGAINST_CITUS, NAMESPACE_OTHER cla...
Use django json encoder for models manger params
Use django json encoder for models manger params
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
cf550ac3a00531f2f964fbbb7e27c37071983d26
utils/aiohttp_wrap.py
utils/aiohttp_wrap.py
#!/bin/env python import aiohttp async def aio_get(url: str): async with aiohttp.ClientSession() as session: <<<<<<< HEAD async with session.get(url, headers=headers) as r: if r.status == 200: return r.text() else: return None async def aio_get_jso...
#!/bin/env python import aiohttp async def aio_get_text(url, headers=None): async with aiohttp.ClientSession() as session: async with session.get(url, headers=headers) as r: if r.status == 200: return r.text() else: return None async def aio_get_js...
Revert "Revert "progress on DDG cog & aiohttp wrapper""
Revert "Revert "progress on DDG cog & aiohttp wrapper"" This reverts commit 85d3b1203d9861f986356e593a2b79d96c38c1b3.
Python
mit
Naught0/qtbot
6ce6f22837b9e6a1dc8423038b6e2eb3d0a8de89
rxet/helper.py
rxet/helper.py
from struct import unpack def read_uint32(fileobj): return unpack("I", fileobj.read(4))[0]
from struct import unpack def read_uint32(fileobj): return unpack("I", fileobj.read(4))[0] # read int as a big endian number def read_uint32_BE(fileobj): return unpack(">I", fileobj.read(4))[0]
Add big endian integer reading
Add big endian integer reading
Python
mit
RenolY2/battalion-tools
0d33cf650480ea7b71e13ef67b566fc6ec1c93ee
demo/demo/todos/models.py
demo/demo/todos/models.py
from django.db import models class Todo(models.Model): name = models.CharField(max_length=200) complete = models.BooleanField()
from django.db import models class Todo(models.Model): name = models.CharField(max_length=200)
Remove "complete" boolean from demo todo model.
Remove "complete" boolean from demo todo model.
Python
bsd-3-clause
jgerigmeyer/jquery-django-superformset,jgerigmeyer/jquery-django-superformset
4f273d56ece230909094d8851d6f79695fb13d88
diffanalysis/exporters.py
diffanalysis/exporters.py
from django.conf import settings from osmdata.exporters import CSVExporter from .models import ActionReport class AnalyzedCSVExporter(CSVExporter): """ Enhance CSVExporter adding some fields from diffanalysis module """ def get_header_row(self): return super().get_header_row() + ( 'm...
from django.conf import settings from osmdata.exporters import CSVExporter from .models import ActionReport class AnalyzedCSVExporter(CSVExporter): """ Enhance CSVExporter adding some fields from diffanalysis module """ def get_header_row(self): return super().get_header_row() + ( 'm...
Include the version delta field in AnalyzedCSVExporter
Include the version delta field in AnalyzedCSVExporter Fix #11
Python
agpl-3.0
Cartocite/osmada
2b7ea531846b43946afee2c4f1d9ed89c3cd947c
ForgeHg/forgehg/tests/functional/test_controllers.py
ForgeHg/forgehg/tests/functional/test_controllers.py
import os import pkg_resources from pylons import c from ming.orm import ThreadLocalORMSession from pyforge.lib import helpers as h from forgehg.tests import TestController class TestRootController(TestController): def setUp(self): TestController.setUp(self) h.set_context('test', 'src_hg') ...
import os import pkg_resources from pylons import c from ming.orm import ThreadLocalORMSession from pyforge.lib import helpers as h from forgehg.tests import TestController class TestRootController(TestController): def setUp(self): TestController.setUp(self) h.set_context('test', 'src_hg') ...
Update test to reflect changing hg codebase
Update test to reflect changing hg codebase
Python
apache-2.0
lym/allura-git,apache/allura,heiths/allura,lym/allura-git,leotrubach/sourceforge-allura,leotrubach/sourceforge-allura,apache/incubator-allura,Bitergia/allura,lym/allura-git,apache/allura,leotrubach/sourceforge-allura,heiths/allura,apache/allura,Bitergia/allura,apache/allura,lym/allura-git,Bitergia/allura,apache/incubat...
aaaaa995a77110b779d9613d95800af609324edc
falcom/tree/test/test_tree.py
falcom/tree/test/test_tree.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from ..read_only_tree import Tree from ..mutable_tree import MutableTree class GivenNothing (unittest...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from ..read_only_tree import Tree from ..mutable_tree import MutableTree class GivenNothing (unittest...
Replace duplicate code with setUp method
Replace duplicate code with setUp method
Python
bsd-3-clause
mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation
07b6f05d913337619205d6fd82b472e112e2a2c7
src/demo.py
src/demo.py
#!/usr/bin/env python """Brief demo of nonogram solving.""" import sys from rules.nonogram import NonogramPuzzle easy_puzzle = NonogramPuzzle([[1], [1, 1]], [[1], [1], [1]]) ambiguous_puzzle = NonogramPuzzle([[1], [1]], [[1], [1]]) def main(args): ...
#!/usr/bin/env python """Brief demo of nonogram solving.""" import sys from rules.nonogram import NonogramPuzzle easy_puzzle = NonogramPuzzle([[1], [1, 1]], [[1], [1], [1]]) ambiguous_puzzle = NonogramPuzzle([[1], [1]], [[1], [1]]) hard_puzzle = Nonog...
Add a hard puzzle not yet correctly solved
Add a hard puzzle not yet correctly solved
Python
apache-2.0
ggould256/nonogram
6e6fed456ff9c641292933f87c99af8be6823e3f
src/main.py
src/main.py
from rules import ascii_code_rule import utils import pprint import bibtexparser from bibtexparser.bparser import BibTexParser from bibtexparser.customization import homogeneize_latex_encoding DEFAULT = 'default' pp = pprint.PrettyPrinter() def main(file_name, output='default'): with open(file_name) as bibtex_fil...
from rules import ascii_code_rule, no_short_title_rule, enforce_year_rule, no_super_long_title_rule import utils import pprint import bibtexparser from bibtexparser.bparser import BibTexParser from bibtexparser.customization import homogeneize_latex_encoding DEFAULT = 'default' SCHEMAS = { 'ASCII_CODE_RULE': ascii...
Implement filter based on user input
Implement filter based on user input
Python
mit
DanielCMS/bibtex-cleaner
79d8916aecc95919fa77ddd845fdd3e0a7e0c4d9
src/ngin.py
src/ngin.py
import argparse from string import Template """ Subclassing template class """ class NginTemplate(Template): delimiter = '#' """ Reverse Proxy Template """ reverse_proxy_template = """ server { listen 80; server_name #{server_name}; access_log /var/log/nginx/#{server_name}.access.log; error_log...
import argparse from nginx_conf import server, reverse_proxy from nginx_blocks import make_location_block, make_server_block from utils import to_nginx_template, make_indent """ Initiate argparse """ parser = argparse.ArgumentParser() """ Add arguments """ parser.add_argument("-r", "--revproxy", help="reverse proxy",...
Remove old stuff with dynamic config generator
Remove old stuff with dynamic config generator
Python
mit
thesabbir/nginpro
e86bf68cb3454e203b5f077bc302151b30294a9d
opps/articles/templatetags/article_tags.py
opps/articles/templatetags/article_tags.py
# -*- coding: utf-8 -*- from django import template from django.conf import settings from django.utils import timezone from .models import ArticleBox register = template.Library() @register.simple_tag def get_articlebox(slug, channel_slug=None, template_name=None): if channel_slug: slug = "{0}-{1}".for...
# -*- coding: utf-8 -*- from django import template from django.conf import settings from django.utils import timezone from opps.articles.models import ArticleBox register = template.Library() @register.simple_tag def get_articlebox(slug, channel_slug=None, template_name=None): if channel_slug: slug = ...
Fix slug unicode on template tag article get ArticleBox
Fix slug unicode on template tag article get ArticleBox
Python
mit
YACOWS/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,opps/opps,opps/opps
195de4097075c7dd53671242822521e07690391e
databroker/__init__.py
databroker/__init__.py
import warnings import logging logger = logging.getLogger(__name__) try: from .databroker import (DataBroker, DataBroker as db, get_events, get_table, stream, get_fields, restream, process) from .pims_readers import get_images from .handler_regis...
import warnings import logging logger = logging.getLogger(__name__) try: from .databroker import DataBroker except ImportError: warnings.warn("The top-level functions (get_table, get_events, etc.)" "cannot be created because " "the necessary configuration was not found.")...
Isolate import error to DataBroker.
REF: Isolate import error to DataBroker.
Python
bsd-3-clause
ericdill/databroker,ericdill/databroker
31d3202855fc4bb341eaa0bc212d302bd7d0f2f6
keystoneclient/auth/token_endpoint.py
keystoneclient/auth/token_endpoint.py
# 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 writing, software # distributed under t...
# 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 writing, software # distributed under t...
Add endpoint handling to Token/Endpoint auth
Add endpoint handling to Token/Endpoint auth This auth plugin was initially created before get_endpoint was available. Implement the get_endpoint method so that we can use the plugin with relative URLs. Closes-Bug: #1323926 Change-Id: Ic868f509e708ad29faf86ec5ceeab2a9c98a24fc
Python
apache-2.0
jamielennox/keystoneauth,citrix-openstack-build/keystoneauth,sileht/keystoneauth
1329e2e76fbd144594243c12655b58e424d6edcd
stix2/bundle.py
stix2/bundle.py
"""STIX 2 Bundle object""" from .base import _STIXBase from .properties import IDProperty, Property, TypeProperty class Bundle(_STIXBase): _type = 'bundle' _properties = { 'type': TypeProperty(_type), 'id': IDProperty(_type), 'spec_version': Property(fixed="2.0"), 'objects': ...
"""STIX 2 Bundle object""" from collections import OrderedDict from .base import _STIXBase from .properties import IDProperty, Property, TypeProperty class Bundle(_STIXBase): _type = 'bundle' _properties = OrderedDict() _properties = _properties.update([ ('type', TypeProperty(_type)), (...
Apply OrderedDict changes to Bundle.
Apply OrderedDict changes to Bundle.
Python
bsd-3-clause
oasis-open/cti-python-stix2
5deeeb3993925850d3deeaa87aad8b6f524c18fd
tobolist.py
tobolist.py
# -*- coding: utf-8 -*- import csv from difflib import get_close_matches with open('./Zip32_10301.csv') as files: csv_files = csv.reader(files) csv_files = [' '.join(i) for i in csv_files] #print csv_files[5] address = u'高雄市三民區大昌二路' print address for i in get_close_matches(address.encode('utf-8'), csv_fil...
# -*- coding: utf-8 -*- import csv from difflib import get_close_matches from random import choice with open('./Zip32_10301.csv') as files: csv_files = csv.reader(files) csv_files = [' '.join(i) for i in csv_files] print u'測試:', choice(csv_files) address = u'高雄市三民區大昌二路307-1號' print u'查詢:', address print u...
Add full address for test.
Add full address for test.
Python
mit
moskytw/zipcodetw,simonfork/zipcodetw,linpan/zipcodetw,moskytw/zipcodetw,moskytw/zipcodetw,simonfork/zipcodetw,linpan/zipcodetw,linpan/zipcodetw,simonfork/zipcodetw
5f7fcd4a22171315db56dd2c8ed5689b5a07cceb
apps/urls.py
apps/urls.py
# -*- coding: utf-8 -*- #from apps.announcements.feeds import AnnouncementsFeed from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns from apps.rss_creator.feeds import AnnouncementsTeilarFeed #feeds = { # '...
# -*- coding: utf-8 -*- #from apps.announcements.feeds import AnnouncementsFeed from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns #feeds = { # 'announcements': AnnouncementsFeed, #} handler500 = 'apps.l...
Remove reference to deprecated module
Remove reference to deprecated module
Python
agpl-3.0
LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr
8ec1ebb189d9386e4302f86a41d3092eb558d3d4
app/helpers/slugify.py
app/helpers/slugify.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # import re from unidecode import unidecode def slugify(text, delim=u'-'): """Slugifier that handles Asian UTF-8 characters and generates an ASCII-only slug. From: http://flask.pocoo.org/snippets/5/ This snippet by Armin Ronacher can be used freely for anyth...
#!/usr/bin/env python # -*- coding: utf-8 -*- # import re from unidecode import unidecode def slugify(text, delim=u'-'): """Slugifier that handles Asian UTF-8 characters and generates an ASCII-only slug. From: http://flask.pocoo.org/snippets/5/ This snippet by Armin Ronacher can be used freely for anyth...
Remove call to unicode which does not exist on Python 3
Remove call to unicode which does not exist on Python 3
Python
mit
peterhil/ninhursag,peterhil/ninhursag,peterhil/ninhursag,peterhil/ninhursag
2f5e0e330de33376236ba7eef3a9ae20a0a38986
breakpad.py
breakpad.py
# Copyright (c) 2009 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. """Breakpad for Python. Sends a notification when a process stops on an exception.""" import atexit import getpass import urllib import traceback impor...
# Copyright (c) 2009 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. """Breakpad for Python. Sends a notification when a process stops on an exception.""" import atexit import getpass import urllib import traceback impor...
Add a check so non-google employee don't send crash dumps.
Add a check so non-google employee don't send crash dumps. Add a warning message in case the check ever fail. Review URL: http://codereview.chromium.org/460044 git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@33700 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Python
bsd-3-clause
svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools
1d6fb58d0a6c1d1162e10a22ad68b841fdec834d
books/models.py
books/models.py
from django.contrib.auth.models import User from django.db import models from django.db.models import fields from django.utils import timezone class Transaction(models.Model): title = fields.CharField(max_length=255) price = fields.DecimalField(max_digits=10, decimal_places=2) created = fields.DateTimeFie...
from django.contrib.auth.models import User from django.db import models from django.db.models import fields from django.utils import timezone class Transaction(models.Model): CATEGORY_CHOICES = ( (0, 'expense'), (1, 'income'), ) title = fields.CharField(max_length=255) amount = field...
Use amount and category fields instead of price
Use amount and category fields instead of price This is more convenient and more user friendly.. I guess.
Python
mit
trimailov/finance,trimailov/finance,trimailov/finance
c34ebf0da60e1c4542fd69870202f49fe085dd67
BigStash/decorators.py
BigStash/decorators.py
from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException: raise Big...
from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException as e: rais...
Add decorator for empty responses and show error messages
Add decorator for empty responses and show error messages - Add decorator for responses with no content, like delete requests. - Show original error messages for now
Python
apache-2.0
longaccess/bigstash-python,longaccess/bigstash-python
0f753f67c48b02b4ee7fdb67a416a5cc86f66e0b
LennardJones.py
LennardJones.py
from fluid import LJContainer NUM_PARTICLES = 108 TIME_STEP = 0.001 class LennardJones: def __init__(self, density, temperature): #Initialize the container container = LJContainer() #Equilibriate the system #Start measuring while self.t < run_length: ...
#!/usr/bin/env python from fluid import LJContainer PARTICLES = 108.0 TEMPERATURE = 2.0 DENSITY = 1.0 TIME_STEP = 0.001 STEPS = 2000 class LennardJones: _t = 0 def __init__(self): #Initialize the container container = LJContainer(PARTICLES, DENSITY, TEMPERATURE) #Eq...
Modify simulation to use global parameters
Modify simulation to use global parameters
Python
mit
hkaju/LennardJones,hkaju/LennardJones,hkaju/LennardJones
3211e90bf13abb423d23b33a4a9802907e992f4e
eduid_signup/sna_callbacks.py
eduid_signup/sna_callbacks.py
import datetime from pyramid.httpexceptions import HTTPFound from pyramid.security import remember def google_callback(request, user_id, attributes): """pyramid_sna calls this function aftera successfull authentication flow""" # Create or update the user user = request.db.users.find_one({'google_id': use...
import datetime from pyramid.httpexceptions import HTTPFound from pyramid.security import remember def create_or_update(request, provider, provider_user_id, attributes): provider_key = '%s_id' % provider # Create or update the user user = request.db.users.find_one({provider_key: provider_user_id}) if...
Refactor the Google sna callback since the Facebook one is almost the same
Refactor the Google sna callback since the Facebook one is almost the same
Python
bsd-3-clause
SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup
96ac90788adac986531aa854357a6c77b0f171d4
tmlib/errors.py
tmlib/errors.py
class NotSupportedError(Exception): ''' Error class that is raised when a feature is not supported by the program. ''' class MetadataError(Exception): ''' Error class that is raised when a metadata element cannot be retrieved. ''' class SubmissionError(Exception): ''' Error class tha...
class NotSupportedError(Exception): ''' Error class that is raised when a feature is not supported by the program. ''' class MetadataError(Exception): ''' Error class that is raised when a metadata element cannot be retrieved. ''' class SubmissionError(Exception): ''' Error class tha...
Add workflow specific error classes
Add workflow specific error classes
Python
agpl-3.0
TissueMAPS/TmLibrary,TissueMAPS/TmLibrary,TissueMAPS/TmLibrary,TissueMAPS/TmLibrary,TissueMAPS/TmLibrary
9a896de52b353e17a4216fdaf1342275e1ecc30a
autoconf/raw.py
autoconf/raw.py
from _external import * from m import * from gomp import * from lcms import * raw = LibWithHeaderChecker( 'raw', 'libraw/libraw.h', 'c', dependencies = [ m, gomp, lcms, ] )
from _external import * from m import * if not windows: from gomp import * from lcms import * if windows: tmpDep = [ m, lcms, ] else: tmpDep = [ m, gomp, lcms, ] raw = LibWithHeaderChecker( 'raw', 'libraw/libraw.h', 'c', dependencies = tmpDep )
Remove gomp dependency for Raw win build
Remove gomp dependency for Raw win build
Python
mit
tuttleofx/sconsProject
a6a81790d43442f88738e5ae141f6b9c6d0efc74
authentication/urls.py
authentication/urls.py
from django.conf.urls import patterns, url from authentication.views import user_login, user_logout from authentication.views import approve, UnapprovedUsers, CustomAdminIndex from authentication.views import BeneficiaryRegistrationView, DonorRegistrationView urlpatterns = patterns('', url(r'^register/donor$', Do...
from django.conf.urls import patterns, url from .views import user_login, user_logout from .views import approve, UnapprovedUsers, CustomAdminIndex from .views import BeneficiaryRegistrationView, DonorRegistrationView urlpatterns = patterns('', url(r'^register/donor$', DonorRegistrationView.as_view(), name='donor...
Use relative import for files inside the same package
Use relative import for files inside the same package
Python
bsd-3-clause
agiliq/fundraiser,febinstephen/django-fundrasiser-app,agiliq/fundraiser,febinstephen/django-fundrasiser-app,febinstephen/django-fundrasiser-app,agiliq/fundraiser
453497b0755d8bc2d6bd6ccc3830394e50ed9a07
pywikibot/families/outreach_family.py
pywikibot/families/outreach_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # Outreach wiki custom family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() self.name = u'outreach' self.langs = { 'outreach': 'outreach.wikimedia.org', ...
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # Outreach wiki custom family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() self.name = u'outreach' self.langs = { 'outreach': 'outreach.wikimedia.org', ...
Update mw version 1.24wmf11 derived from super class
Update mw version 1.24wmf11 derived from super class Change-Id: If142c57a88179f80e2e652e844c7aadbc2468f7c
Python
mit
trishnaguha/pywikibot-core,Darkdadaah/pywikibot-core,VcamX/pywikibot-core,magul/pywikibot-core,PersianWikipedia/pywikibot-core,magul/pywikibot-core,icyflame/batman,Darkdadaah/pywikibot-core,wikimedia/pywikibot-core,happy5214/pywikibot-core,TridevGuha/pywikibot-core,wikimedia/pywikibot-core,hasteur/g13bot_tools_new,valh...
17627ac4677f49e805f14acb4ba768b74d43298a
py3-test/tests.py
py3-test/tests.py
# -*- coding: utf-8 -*- import nose.tools as nt from asyncio import Future, gather, get_event_loop, sleep from pyee import EventEmitter def test_async_emit(): """Test that event_emitters can handle wrapping coroutines """ loop = get_event_loop() ee = EventEmitter(loop=loop) should_call = Future(...
# -*- coding: utf-8 -*- import nose.tools as nt from asyncio import Future, gather, new_event_loop, sleep from pyee import EventEmitter def test_async_emit(): """Test that event_emitters can handle wrapping coroutines """ loop = new_event_loop() ee = EventEmitter(loop=loop) should_call = Future(...
Use fresh event loop for asyncio test
Use fresh event loop for asyncio test
Python
mit
jfhbrook/pyee
9ae919b1d81ca6e640dd96e6ef7aeaeba2fc2679
schedule/migrations/0011_event_calendar_not_null.py
schedule/migrations/0011_event_calendar_not_null.py
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('schedule', '0010_events_set_missing_calendar'), ] operations = [ migrations.AlterField( model_name='event', name='calendar', ...
import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('schedule', '0010_events_set_missing_calendar'), ] operations = [ migrations.AlterField( model_name='event', name='calendar', ...
Sort imports per isort; fixes failure
Sort imports per isort; fixes failure
Python
bsd-3-clause
llazzaro/django-scheduler,llazzaro/django-scheduler,llazzaro/django-scheduler
5a5ba8bbd484f427260f699101e5e754e4a6c5d1
phy/utils/tests/test_color.py
phy/utils/tests/test_color.py
# -*- coding: utf-8 -*- """Test colors.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ from pytest import mark from .._color import _random_color, _is_bright, _random_bright_color from ..tes...
# -*- coding: utf-8 -*- """Test colors.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ from pytest import mark from .._color import (_random_color, _is_bright, _random_bright_color, ...
Increase coverage in color module
Increase coverage in color module
Python
bsd-3-clause
rossant/phy,rossant/phy,rossant/phy,kwikteam/phy,kwikteam/phy,kwikteam/phy
cbaa1c3a74c9046b1571ba67ef85ee70d51812f5
chef/tests/__init__.py
chef/tests/__init__.py
import os import random from unittest2 import TestCase, skipUnless from chef.api import ChefAPI from chef.exceptions import ChefError TEST_ROOT = os.path.dirname(os.path.abspath(__file__)) def skipSlowTest(): return skipUnless(os.environ.get('PYCHEF_SLOW_TESTS'), 'slow tests skipped, set $PYCHEF_SLOW_TESTS=1 to...
import os import random from unittest2 import TestCase, skipUnless from chef.api import ChefAPI from chef.exceptions import ChefError TEST_ROOT = os.path.dirname(os.path.abspath(__file__)) def skipSlowTest(): return skipUnless(os.environ.get('PYCHEF_SLOW_TESTS'), 'slow tests skipped, set $PYCHEF_SLOW_TESTS=1 to...
Allow passing extra options to the test API object.
Allow passing extra options to the test API object. The only one of interest is version, but yay generic code.
Python
apache-2.0
cread/pychef,coderanger/pychef,coderanger/pychef,Scalr/pychef,dipakvwarade/pychef,cread/pychef,jarosser06/pychef,Scalr/pychef,dipakvwarade/pychef,jarosser06/pychef
9de1ce1def7915bf4587dbb0a4d9f396c77bc3b7
django_lightweight_queue/backends/synchronous.py
django_lightweight_queue/backends/synchronous.py
import time class SynchronousBackend(object): def enqueue(self, job, queue): job.run() def dequeue(self, queue, timeout): # Cannot dequeue from the synchronous backend but we can emulate by # never returning anything time.sleep(timeout)
import time class SynchronousBackend(object): def enqueue(self, job, queue): job.run() def dequeue(self, queue, timeout): # Cannot dequeue from the synchronous backend but we can emulate by # never returning anything time.sleep(timeout) def length(self, queue): # T...
Add length for the SynchronousBackend
Add length for the SynchronousBackend
Python
bsd-3-clause
thread/django-lightweight-queue,thread/django-lightweight-queue
7ed960ca90b76e8d256a6b94beb0e027ddaad809
users/views.py
users/views.py
from django.shortcuts import redirect from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing and editing users.""" query...
from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing and editing users.""" queryset = User.objects.all() permissio...
Fix /users/me for anonymous users
Fix /users/me for anonymous users
Python
bsd-3-clause
FreeMusicNinja/api.freemusic.ninja
1655edcd359e810b10f7836dc2cbb3f99014d8f6
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup, Extension packages=['qutepart', 'qutepart/syntax'] package_data={'qutepart/syntax' : ['data/*.xml', 'data/syntax_db.json'] } extension = Extension('qutepart.syntax.cParser', sources = ['qute...
#!/usr/bin/env python import sys from distutils.core import setup, Extension import distutils.ccompiler packages=['qutepart', 'qutepart/syntax'] package_data={'qutepart/syntax' : ['data/*.xml', 'data/syntax_db.json'] } extension = Extension('qutepart.syntax.cParser',...
Check for pcre when building
Check for pcre when building
Python
lgpl-2.1
Aldenis2112/qutepart,Aldenis2112/qutepart,andreikop/qutepart,hlamer/qutepart,hlamer/qutepart,andreikop/qutepart,andreikop/qutepart,Aldenis2112/qutepart,hlamer/qutepart,hlamer/qutepart,Aldenis2112/qutepart,Aldenis2112/qutepart,hlamer/qutepart,andreikop/qutepart,hlamer/qutepart,andreikop/qutepart,Aldenis2112/qutepart,and...
c0a479ad3bbfd0f2f77c628ee10fd01675a942b9
main.py
main.py
import optparse from bounty import * from peers import * from settings import * def main(): parser = optparse.OptionParser() parser.add_option('-c', '--charity', dest='charity', default=None, action="store_true", ...
from bounty import * from peers import * import settings def main(): settings.setup() print "settings are:" print settings.config if __name__ == "__main__": main()
Move configs to settings module
Move configs to settings module
Python
mit
gappleto97/Senior-Project