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
8dc822cf3577663cf817cd5d1ab537df3605752c
art_archive_api/models.py
art_archive_api/models.py
from application import db class Artist(db.Model): __tablename__ = 'artists' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45)) birth_year = db.Column(db.Integer) death_year = db.Column(db.Integer) country = db.Column(db.String(45)) genre = db.Column(db.String(45...
from application import db class Artist(db.Model): __tablename__ = 'artists' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45)) birth_year = db.Column(db.Integer) death_year = db.Column(db.Integer) country = db.Column(db.String(45)) genre = db.Column(db.String(45...
UPDATE serialize method for json data
UPDATE serialize method for json data
Python
mit
EunJung-Seo/art_archive
--- +++ @@ -15,6 +15,27 @@ backref='artist', ) + def serialize(self): + return { + 'id': self.id, + 'name': self.name, + 'birth_year': self.birth_year, + 'death_year': self.death_year, + 'country': self.country, + 'genre': sel...
26672e83ab1bd1a932d275dfd244fe20749e3b1e
tripleo_common/utils/safe_import.py
tripleo_common/utils/safe_import.py
# Copyright 2019 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# Copyright 2019 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Make gitpython and eventlet work with eventlet 0.25.1
Make gitpython and eventlet work with eventlet 0.25.1 Version 0.25 is having a bad interaction with python git. that is due to the way that eventlet unloads some modules now. Changed to use the inject method that supports what we need intead of the imported_patched that was having the problem Change-Id: I79894d4f711c...
Python
apache-2.0
openstack/tripleo-common,openstack/tripleo-common
--- +++ @@ -14,15 +14,15 @@ # under the License. -import eventlet from eventlet.green import subprocess +import eventlet.patcher as patcher # Due to an eventlet issue subprocess is not being correctly patched -# on git module so it has to be done manually +# on git.refs +patcher.inject('git.refs', None, ('su...
4ae3b77847eeefd07d83f863c6ec71d7fdf750cb
turbustat/tests/test_rfft_to_fft.py
turbustat/tests/test_rfft_to_fft.py
from turbustat.statistics.rfft_to_fft import rfft_to_fft from ._testing_data import dataset1 import numpy as np import numpy.testing as npt from unittest import TestCase class testRFFT(TestCase): """docstring for testRFFT""" def __init__(self): self.dataset1 = dataset1 self.comp_rfft = rff...
import pytest from ..statistics.rfft_to_fft import rfft_to_fft from ._testing_data import dataset1 import numpy as np import numpy.testing as npt def test_rfft_to_rfft(): comp_rfft = rfft_to_fft(dataset1['moment0'][0]) test_rfft = np.abs(np.fft.rfftn(dataset1['moment0'][0])) shape2 = test_rfft.shap...
Fix and update the rfft tests
Fix and update the rfft tests
Python
mit
e-koch/TurbuStat,Astroua/TurbuStat
--- +++ @@ -1,28 +1,28 @@ -from turbustat.statistics.rfft_to_fft import rfft_to_fft +import pytest + +from ..statistics.rfft_to_fft import rfft_to_fft from ._testing_data import dataset1 import numpy as np import numpy.testing as npt -from unittest import TestCase -class testRFFT(TestCase): - """docst...
2d36b6fee7905e32aded8da7ffba68a5ec3c5d34
dwitter/user/forms.py
dwitter/user/forms.py
from django.contrib.auth import get_user_model from django.forms import ModelForm class UserSettingsForm(ModelForm): class Meta: model = get_user_model() fields = ('first_name', 'last_name', 'email',)
from django.contrib.auth import get_user_model from django.forms import ModelForm class UserSettingsForm(ModelForm): class Meta: model = get_user_model() fields = ('email',)
Remove first_name and last_name from user settings
Remove first_name and last_name from user settings
Python
apache-2.0
lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter
--- +++ @@ -5,6 +5,4 @@ class UserSettingsForm(ModelForm): class Meta: model = get_user_model() - fields = ('first_name', - 'last_name', - 'email',) + fields = ('email',)
7d9265cd3cb29606e37b296dde5af07099098228
axes/tests/test_checks.py
axes/tests/test_checks.py
from django.core.checks import run_checks, Error from django.test import override_settings from axes.checks import Messages, Hints, Codes from axes.conf import settings from axes.tests.base import AxesTestCase @override_settings(AXES_HANDLER='axes.handlers.cache.AxesCacheHandler') class CacheCheckTestCase(AxesTestCa...
from django.core.checks import run_checks, Error from django.test import override_settings from axes.checks import Messages, Hints, Codes from axes.conf import settings from axes.tests.base import AxesTestCase class CacheCheckTestCase(AxesTestCase): @override_settings( AXES_HANDLER='axes.handlers.cache.A...
Add check test for missing case branch
Add check test for missing case branch Signed-off-by: Aleksi Häkli <44cb6a94c0d20644d531e2be44779b52833cdcd2@iki.fi>
Python
mit
jazzband/django-axes,django-pci/django-axes
--- +++ @@ -6,14 +6,19 @@ from axes.tests.base import AxesTestCase -@override_settings(AXES_HANDLER='axes.handlers.cache.AxesCacheHandler') class CacheCheckTestCase(AxesTestCase): - @override_settings(CACHES={'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'}}) + @override_setti...
41368a5d45aa9568d8495a98399cb92398eeaa32
eva/models/pixelcnn.py
eva/models/pixelcnn.py
from keras.models import Model from keras.layers import Input, Convolution2D, Activation, Flatten, Dense from keras.layers.advanced_activations import PReLU from keras.optimizers import Nadam from eva.layers.residual_block import ResidualBlockList from eva.layers.masked_convolution2d import MaskedConvolution2D def Pi...
from keras.models import Model from keras.layers import Input, Convolution2D, Activation, Flatten, Dense from keras.layers.advanced_activations import PReLU from keras.optimizers import Nadam from eva.layers.residual_block import ResidualBlockList from eva.layers.masked_convolution2d import MaskedConvolution2D def Pi...
Add gradient clipping value and norm
Add gradient clipping value and norm
Python
apache-2.0
israelg99/eva
--- +++ @@ -30,7 +30,7 @@ if build: model = Model(input=input_map, output=model) model.compile(loss='binary_crossentropy', - optimizer=Nadam(), + optimizer=Nadam(clipnorm=1., clipvalue=1.), metrics=['accuracy', 'fbeta_score', 'mat...
e8dc3b169d308e644efdebc25bcdc485aeb909ac
engines/empy_engine.py
engines/empy_engine.py
#!/usr/bin/env python """Provide the empy templating engine.""" from __future__ import print_function import os.path import em from . import Engine class SubsystemWrapper(em.Subsystem): """Wrap EmPy's Subsystem class. Allows to open files relative to a base directory. """ def __init__(self, bas...
#!/usr/bin/env python """Provide the empy templating engine.""" from __future__ import print_function import os.path import em try: from StringIO import StringIO except ImportError: from io import StringIO from . import Engine class SubsystemWrapper(em.Subsystem): """Wrap EmPy's Subsystem class. ...
Change empy engine to use Interpreter class.
Change empy engine to use Interpreter class.
Python
mit
blubberdiblub/eztemplate
--- +++ @@ -6,6 +6,11 @@ import os.path import em + +try: + from StringIO import StringIO +except ImportError: + from io import StringIO from . import Engine @@ -46,8 +51,12 @@ # Blame EmPy. em.theSubsystem = SubsystemWrapper(basedir=dirname) + self.output = StringIO(...
e3a07917ddda0bd9eb3254145342a3938c8e24a0
cptm/experiment_calculate_perspective_jsd.py
cptm/experiment_calculate_perspective_jsd.py
import logging import argparse import numpy as np from utils.experiment import load_config, get_corpus from utils.controversialissues import perspective_jsd_matrix logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.DEBUG) logger = logging.getLogger(__name__) parser = argparse.ArgumentParser() pa...
import logging import argparse import numpy as np from utils.experiment import load_config, get_corpus from utils.controversialissues import perspective_jsd_matrix logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.DEBUG) logger = logging.getLogger(__name__) parser = argparse.ArgumentParser() pa...
Add nTopics to persp. jsd calculation file name
Add nTopics to persp. jsd calculation file name
Python
apache-2.0
NLeSC/cptm,NLeSC/cptm
--- +++ @@ -24,4 +24,5 @@ print perspective_jsd print perspective_jsd.sum(axis=(2, 1)) -np.save(config.get('outDir').format('perspective_jsd.npy'), perspective_jsd) +np.save(config.get('outDir').format('perspective_jsd_{}.npy'.format(nTopics)), + perspective_jsd)
85d1fa8a390e715f38ddf9f680acb4337a469a66
cura/Settings/QualityAndUserProfilesModel.py
cura/Settings/QualityAndUserProfilesModel.py
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Application import Application from UM.Settings.ContainerRegistry import ContainerRegistry from cura.QualityManager import QualityManager from cura.Settings.ProfilesModel import ProfilesModel ## QML Model ...
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Application import Application from UM.Settings.ContainerRegistry import ContainerRegistry from cura.QualityManager import QualityManager from cura.Settings.ProfilesModel import ProfilesModel ## QML Model ...
Fix error on profiles page when there is no active machine
Fix error on profiles page when there is no active machine
Python
agpl-3.0
hmflash/Cura,Curahelper/Cura,Curahelper/Cura,fieldOfView/Cura,ynotstartups/Wanhao,hmflash/Cura,ynotstartups/Wanhao,fieldOfView/Cura
--- +++ @@ -16,14 +16,17 @@ # # See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers(). def _fetchInstanceContainers(self): + global_container_stack = Application.getInstance().getGlobalContainerStack() + if not global_container_stack: + return [] + ...
5b819746a7cc768a461320c2e5de506bb477a641
gitfs/mount.py
gitfs/mount.py
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from router import Router from views import IndexView, CurrentView, HistoryIndexView, HistoryView mount_path = '/tmp/gitfs/mnt' router = Router(remote_url='/home/zalman/dev/presslabs/test-repo.git', rep...
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from router import Router from views import IndexView, CurrentView, HistoryIndexView, HistoryView mount_path = '/tmp/gitfs/mnt' router = Router(remote_url='/home/zalman/dev/presslabs/test-repo.git', rep...
Add regex for timestamp and sha.
Add regex for timestamp and sha.
Python
apache-2.0
ksmaheshkumar/gitfs,PressLabs/gitfs,bussiere/gitfs,rowhit/gitfs,PressLabs/gitfs
--- +++ @@ -13,7 +13,8 @@ # TODO: replace regex with the strict one for the Historyview # -> r'^/history/(?<date>(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01]))/', -router.register(r'^/history/(?P<date>\d{4}-\d{1,2}-\d{1,2})', HistoryView) +router.register(r'^/history/(?P<date>\d{4}-\d{1,2}-\d{1,2})/(?P...
5d7806179d455073e020bdc6e6d0e7492f4e1d9e
test/unit/Algorithms/OrdinaryPercolationTest.py
test/unit/Algorithms/OrdinaryPercolationTest.py
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, ...
import OpenPNM as op import scipy as sp mgr = op.Base.Workspace() mgr.loglevel = 60 class OrdinaryPercolationTest: def setup_class(self): self.net = op.Network.Cubic(shape=[5, 5, 5]) self.geo = op.Geometry.Toray090(network=self.net, pores=self.net.Ps, ...
Put a test on site percolation - probably needs some better tests on percolation thresholds maybe
Put a test on site percolation - probably needs some better tests on percolation thresholds maybe
Python
mit
TomTranter/OpenPNM,PMEAL/OpenPNM
--- +++ @@ -5,19 +5,31 @@ class OrdinaryPercolationTest: - def setup_test(self): + + def setup_class(self): self.net = op.Network.Cubic(shape=[5, 5, 5]) self.geo = op.Geometry.Toray090(network=self.net, pores=self.net.Ps, ...
b722fe0d5b84eeb5c9e7279679826ff5097bfd91
contentdensity/textifai/urls.py
contentdensity/textifai/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^textinput', views.textinput, name='textinput'), url(r'^featureoutput', views.featureoutput, name='featureoutput'), url(r'^account', views.account, name='account'), ]
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^textinput', views.textinput, name='textinput'), url(r'^featureoutput', views.featureoutput, name='featureoutput'), url(r'^account', views.account, name='account'), url(r'^general-insig...
Add URL mapping for general-insights page
Add URL mapping for general-insights page
Python
mit
CS326-important/space-deer,CS326-important/space-deer
--- +++ @@ -1,11 +1,12 @@ -from django.conf.urls import url -from . import views +from django.conf.urls import url +from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^textinput', views.textinput, name='textinput'), url(r'^featureoutput', views.featureoutput, name='fe...
a85beb35d7296b0a8bd5a385b44fa13fb9f178ed
imgur-clean.py
imgur-clean.py
#!/usr/bin/env python3 """ "imgur-album-downloader" is great, but it seems to download albums twice, and appends their stupid ID to the end. This script fixes both. """ import hashlib import re import os import sys IMGUR_FILENAME_REGEX = re.compile(r'([0-9]+)(?:-\w+)?\.([A-Za-z0-9]+)') def get_hash(fn): with op...
#!/usr/bin/env python3 """ "imgur-album-downloader" is great, but it seems to download albums twice, and appends their stupid ID to the end. This script fixes both. """ import re import os import sys IMGUR_FILENAME_REGEX = re.compile(r'([0-9]+)-(\w+)\.([A-Za-z0-9]+)') if __name__ == '__main__': if len(sys.argv)...
Remove imgur duplicates based on ID.
Remove imgur duplicates based on ID.
Python
mit
ammongit/scripts,ammongit/scripts,ammongit/scripts,ammongit/scripts
--- +++ @@ -6,45 +6,40 @@ This script fixes both. """ -import hashlib import re import os import sys -IMGUR_FILENAME_REGEX = re.compile(r'([0-9]+)(?:-\w+)?\.([A-Za-z0-9]+)') - -def get_hash(fn): - with open(fn, 'rb') as fh: - hashsum = hashlib.md5(fh.read()).digest() - return hashsum +IMGUR_FILE...
6144ac22f7b07cb1bd322bb05391a530f128768f
tests/integration/fileserver/fileclient_test.py
tests/integration/fileserver/fileclient_test.py
# -*- coding: utf-8 -*- ''' :codauthor: :email:`Mike Place <mp@saltstack.com>` ''' # Import Salt Testing libs from salttesting.helpers import (ensure_in_syspath, destructiveTest) from salttesting.mock import MagicMock, patch ensure_in_syspath('../') # Import salt libs import integration from salt import fileclien...
# -*- coding: utf-8 -*- ''' :codauthor: :email:`Mike Place <mp@saltstack.com>` ''' # Import Salt Testing libs from salttesting.unit import skipIf from salttesting.helpers import ensure_in_syspath from salttesting.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON ensure_in_syspath('../') # Import salt libs imp...
Remove unused imports & Skip if no mock available
Remove unused imports & Skip if no mock available
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
--- +++ @@ -4,18 +4,17 @@ ''' # Import Salt Testing libs -from salttesting.helpers import (ensure_in_syspath, destructiveTest) -from salttesting.mock import MagicMock, patch +from salttesting.unit import skipIf +from salttesting.helpers import ensure_in_syspath +from salttesting.mock import MagicMock, patch, NO_M...
98bdb678a9092c5c19bc2b379cca74a2ed33c457
libqtile/layout/subverttile.py
libqtile/layout/subverttile.py
from base import SubLayout, Rect from sublayouts import HorizontalStack from subtile import SubTile class SubVertTile(SubTile): arrangements = ["top", "bottom"] def _init_sublayouts(self): ratio = self.ratio expand = self.expand master_windows = self.master_windows arrangem...
from base import SubLayout, Rect from sublayouts import HorizontalStack from subtile import SubTile class SubVertTile(SubTile): arrangements = ["top", "bottom"] def _init_sublayouts(self): class MasterWindows(HorizontalStack): def filter(self, client): return self.index...
Refactor SubVertTile - make sublayout use the parents' variables
Refactor SubVertTile - make sublayout use the parents' variables
Python
mit
rxcomm/qtile,de-vri-es/qtile,EndPointCorp/qtile,zordsdavini/qtile,bavardage/qtile,nxnfufunezn/qtile,encukou/qtile,andrewyoung1991/qtile,ramnes/qtile,himaaaatti/qtile,de-vri-es/qtile,frostidaho/qtile,encukou/qtile,andrewyoung1991/qtile,w1ndy/qtile,frostidaho/qtile,nxnfufunezn/qtile,StephenBarnes/qtile,farebord/qtile,kop...
--- +++ @@ -6,28 +6,23 @@ arrangements = ["top", "bottom"] def _init_sublayouts(self): - ratio = self.ratio - expand = self.expand - master_windows = self.master_windows - arrangement = self.arrangement - class MasterWindows(HorizontalStack): def filte...
224abf5e0e8d5e7bad7a86c622b711e997e8ae10
pyconcz_2016/team/models.py
pyconcz_2016/team/models.py
from django.db import models class Organizer(models.Model): full_name = models.CharField(max_length=200) email = models.EmailField( default='', blank=True, help_text="This is private") twitter = models.CharField(max_length=255, blank=True) github = models.CharField(max_length=255, blan...
from django.db import models class Organizer(models.Model): full_name = models.CharField(max_length=200) email = models.EmailField( default='', blank=True, help_text="This is private") twitter = models.CharField(max_length=255, blank=True) github = models.CharField(max_length=255, blan...
Add string representation of organizer object
Add string representation of organizer object
Python
mit
pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016
--- +++ @@ -11,3 +11,6 @@ photo = models.ImageField(upload_to='team/pyconcz2016/') published = models.BooleanField(default=False) + + def __str__(self): + return self.full_name
260291135a43e7bf6e34a600f4291da9ab5d870e
tendrl/commons/flows/import_cluster/__init__.py
tendrl/commons/flows/import_cluster/__init__.py
import json import etcd from tendrl.commons import flows from tendrl.commons.flows.exceptions import FlowExecutionFailedError class ImportCluster(flows.BaseFlow): def __init__(self, *args, **kwargs): super(ImportCluster, self).__init__(*args, **kwargs) def run(self): integration_id = self.p...
import json import etcd from tendrl.commons import flows from tendrl.commons.flows.exceptions import FlowExecutionFailedError class ImportCluster(flows.BaseFlow): def __init__(self, *args, **kwargs): super(ImportCluster, self).__init__(*args, **kwargs) def run(self): integration_id = self.p...
Fix wongly tagged provisioner node
Fix wongly tagged provisioner node tendrl-bug-id: Tendrl/commons/issues#698
Python
lgpl-2.1
Tendrl/commons,r0h4n/commons
--- +++ @@ -24,5 +24,20 @@ "integration_id " "(%s) not found, cannot " "import" % integration_id) + else: + # TODO(shtripat) ceph-installer is auto ...
9a6b06d4a69bf5a7fb59d93000dc2aba02035957
tests/test_helpers.py
tests/test_helpers.py
import unittest from contextlib import redirect_stdout from conllu import print_tree from conllu.tree_helpers import TreeNode from io import StringIO class TestPrintTree(unittest.TestCase): def test_print_empty_list(self): result = self._capture_print(print_tree, []) self.assertEqual(result, "") ...
import unittest from conllu import print_tree from conllu.tree_helpers import TreeNode from io import StringIO try: from contextlib import redirect_stdout except ImportError: import sys import contextlib @contextlib.contextmanager def redirect_stdout(target): original = sys.stdout ...
Fix redirect_stdout not available in python2.
Fix redirect_stdout not available in python2.
Python
mit
EmilStenstrom/conllu
--- +++ @@ -1,10 +1,21 @@ import unittest -from contextlib import redirect_stdout from conllu import print_tree from conllu.tree_helpers import TreeNode from io import StringIO +try: + from contextlib import redirect_stdout +except ImportError: + import sys + import contextlib + + @contextlib.cont...
8b0302544bfb09d8abf9630db9a1dcc7e47add39
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...
Make measurements exposable before returning.
Make measurements exposable before returning.
Python
mit
jaapverloop/massa
--- +++ @@ -43,8 +43,20 @@ def find_all(self): s = self._table.select() - return s.execute() + + items = [] + for item in s.execute(): + items.append(self.make_exposable(item)) + + return items def create(self, **kwargs): i = self._table.insert() ...
43e8dc72304c7647dae9323cbce73e7bc78ecf7d
src/idea/tests/smoke_tests.py
src/idea/tests/smoke_tests.py
import os from django.utils import timezone from django_webtest import WebTest from exam.decorators import fixture from exam.cases import Exam from django.core.urlresolvers import reverse class SmokeTest(Exam, WebTest): csrf_checks = False fixtures = ['state'] @fixture def user(self): try: ...
import os from django.utils import timezone from django_webtest import WebTest from exam.decorators import fixture from exam.cases import Exam from django.core.urlresolvers import reverse from django.contrib.auth.models import User class SmokeTest(Exam, WebTest): csrf_checks = False fixtures = ['state', 'core...
Use fixtures for smoke tests
Use fixtures for smoke tests
Python
cc0-1.0
cfpb/idea-box,cfpb/idea-box,cfpb/idea-box
--- +++ @@ -4,32 +4,17 @@ from exam.decorators import fixture from exam.cases import Exam from django.core.urlresolvers import reverse +from django.contrib.auth.models import User class SmokeTest(Exam, WebTest): csrf_checks = False - fixtures = ['state'] + fixtures = ['state', 'core-test-fixtures']...
9e7ab78fd1cea466a4811b9244b096a87d34c100
django_assets/__init__.py
django_assets/__init__.py
# Make a couple frequently used things available right here. from webassets.bundle import Bundle from django_assets.env import register __all__ = ('Bundle', 'register') __version__ = (0, 11) __webassets_version__ = ('0.11',) from django_assets import filter
# Make a couple frequently used things available right here. from webassets.bundle import Bundle from django_assets.env import register __all__ = ('Bundle', 'register') __version__ = (0, 11) __webassets_version__ = ('>=0.11',) from django_assets import filter
Define webassets dependency as minimum version.
Define webassets dependency as minimum version. Close #58.
Python
bsd-2-clause
ridfrustum/django-assets,adamchainz/django-assets,jaddison/django-assets,mcfletch/django-assets
--- +++ @@ -6,7 +6,7 @@ __all__ = ('Bundle', 'register') __version__ = (0, 11) -__webassets_version__ = ('0.11',) +__webassets_version__ = ('>=0.11',) from django_assets import filter
76fa14f61811cd38f2c91851a648fa88f6142b15
django_evolution/utils.py
django_evolution/utils.py
from django_evolution.db import evolver def write_sql(sql): "Output a list of SQL statements, unrolling parameters as required" for statement in sql: if isinstance(statement, tuple): print unicode(statement[0] % tuple(evolver.quote_sql_param(s) for s in statement[1])) else: ...
from django_evolution.db import evolver def write_sql(sql): "Output a list of SQL statements, unrolling parameters as required" for statement in sql: if isinstance(statement, tuple): print unicode(statement[0] % tuple(evolver.quote_sql_param(s) for s in statement[1])) else: ...
Revert a debugging change that slipped in.
Revert a debugging change that slipped in. git-svn-id: 48f3d5eb0141859d8d7d81547b6bd7b3dde885f8@186 8655a95f-0638-0410-abc2-2f1ed958ef3d
Python
bsd-3-clause
clones/django-evolution
--- +++ @@ -19,9 +19,4 @@ cursor.execute(*statement) else: if not statement.startswith('--'): - try: - cursor.execute(statement) - except: - print statement - print sql - ra...
afddc5aeb2c9a28a4bf7314ee50ca8775494268a
misc/decode-mirax-stitching.py
misc/decode-mirax-stitching.py
#!/usr/bin/python import struct, sys, os f = open(sys.argv[1]) HEADER_OFFSET = 296 f.seek(HEADER_OFFSET) while True: x1 = struct.unpack("<h", f.read(2))[0] x2 = struct.unpack("<h", f.read(2))[0] y1 = struct.unpack("<h", f.read(2))[0] y2 = struct.unpack("<h", f.read(2))[0] zz = f.read(1) pr...
#!/usr/bin/python import struct, sys, os f = open(sys.argv[1]) HEADER_OFFSET = 296 f.seek(HEADER_OFFSET) while True: x = struct.unpack("<i", f.read(4))[0] y = struct.unpack("<i", f.read(4))[0] zz = f.read(1) print '%10s %10s' % (x, y)
Update stitching script to ints again
Update stitching script to ints again
Python
lgpl-2.1
openslide/openslide,openslide/openslide,openslide/openslide,openslide/openslide
--- +++ @@ -9,10 +9,8 @@ f.seek(HEADER_OFFSET) while True: - x1 = struct.unpack("<h", f.read(2))[0] - x2 = struct.unpack("<h", f.read(2))[0] - y1 = struct.unpack("<h", f.read(2))[0] - y2 = struct.unpack("<h", f.read(2))[0] + x = struct.unpack("<i", f.read(4))[0] + y = struct.unpack("<i", f.read(...
621ae7f7ff7d4b81af192ded1beec193748cfd90
rest_framework_ember/renderers.py
rest_framework_ember/renderers.py
import copy from rest_framework import renderers from rest_framework_ember.utils import get_resource_name class JSONRenderer(renderers.JSONRenderer): """ Render a JSON response the way Ember Data wants it. Such as: { "company": { "id": 1, "name": "nGen Works", ...
import copy from rest_framework import renderers from rest_framework_ember.utils import get_resource_name class JSONRenderer(renderers.JSONRenderer): """ Render a JSON response the way Ember Data wants it. Such as: { "company": { "id": 1, "name": "nGen Works", ...
Return data when ``resource_name`` == False
Return data when ``resource_name`` == False
Python
bsd-2-clause
django-json-api/django-rest-framework-json-api,aquavitae/django-rest-framework-json-api,hnakamur/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api,schtibe/django-rest-framework-json-api,coUrbanize/rest_framework_ember,abdulhaq-e/django-rest-framework-json-api,pattisdr/django-rest-framework-j...
--- +++ @@ -21,6 +21,10 @@ resource_name = get_resource_name(view) + if resource_name == False: + return super(JSONRenderer, self).render( + data, accepted_media_type, renderer_context) + try: data_copy = copy.copy(data) content = data_c...
5b2451ee653873b8fb166d291954c72a165af368
moderate/overlapping_rectangles/over_rect.py
moderate/overlapping_rectangles/over_rect.py
import sys def over_rect(line): line = line.rstrip() if line: line = line.split(',') rect_a = [int(item) for item in line[:4]] rect_b = [int(item) for item in line[4:]] return (rect_a[0] <= rect_b[0] <= rect_a[2] and (rect_a[3] <= rect_b[1] <= rect_a[1] or ...
import sys def over_rect(line): line = line.rstrip() if line: xula, yula, xlra, ylra, xulb, yulb, xlrb, ylrb = (int(i) for i in line.split(',')) h_overlap = True v_overlap = True if xlrb < xula or xulb > xlra: ...
Complete solution for overlapping rectangles
Complete solution for overlapping rectangles
Python
mit
MikeDelaney/CodeEval
--- +++ @@ -4,15 +4,15 @@ def over_rect(line): line = line.rstrip() if line: - line = line.split(',') - rect_a = [int(item) for item in line[:4]] - rect_b = [int(item) for item in line[4:]] - return (rect_a[0] <= rect_b[0] <= rect_a[2] and - (rect_a[3] <= rect_b[1...
2a5cc23be491fa3f42fe039b421ad436a94d59c2
corehq/messaging/smsbackends/smsgh/views.py
corehq/messaging/smsbackends/smsgh/views.py
from corehq.apps.sms.api import incoming from corehq.apps.sms.views import IncomingBackendView from corehq.messaging.smsbackends.smsgh.models import SQLSMSGHBackend from django.http import HttpResponse, HttpResponseBadRequest class SMSGHIncomingView(IncomingBackendView): urlname = 'smsgh_sms_in' def get(self...
from corehq.apps.sms.api import incoming from corehq.apps.sms.views import NewIncomingBackendView from corehq.messaging.smsbackends.smsgh.models import SQLSMSGHBackend from django.http import HttpResponse, HttpResponseBadRequest class SMSGHIncomingView(NewIncomingBackendView): urlname = 'smsgh_sms_in' @prope...
Update SMSGH Backend view to be NewIncomingBackendView
Update SMSGH Backend view to be NewIncomingBackendView
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
--- +++ @@ -1,11 +1,15 @@ from corehq.apps.sms.api import incoming -from corehq.apps.sms.views import IncomingBackendView +from corehq.apps.sms.views import NewIncomingBackendView from corehq.messaging.smsbackends.smsgh.models import SQLSMSGHBackend from django.http import HttpResponse, HttpResponseBadRequest ...
1779970872afd457336334231bef3c8629dcd375
gem/tests/test_profiles.py
gem/tests/test_profiles.py
from molo.core.tests.base import MoloTestCaseMixin from django.test import TestCase, Client from django.contrib.auth.models import User from django.core.urlresolvers import reverse class GemRegistrationViewTest(TestCase, MoloTestCaseMixin): def setUp(self): self.client = Client() self.mk_main() ...
from molo.core.tests.base import MoloTestCaseMixin from django.test import TestCase, Client from django.contrib.auth.models import User from django.core.urlresolvers import reverse class GemRegistrationViewTest(TestCase, MoloTestCaseMixin): def setUp(self): self.client = Client() self.mk_main() ...
Update tests and fix the failing test
Update tests and fix the failing test
Python
bsd-2-clause
praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem
--- +++ @@ -14,11 +14,14 @@ username='tester', email='tester@example.com', password='tester') - self.user.profile.gender = 'female' - self.user.profile.alias = 'useralias' - self.user.profile.save() self.client.login(username='tester', password='tes...
2880e0b8c38af68cfb17bbcc112f1a40b6a03a11
cinder/db/sqlalchemy/migrate_repo/versions/088_add_replication_info_to_cluster.py
cinder/db/sqlalchemy/migrate_repo/versions/088_add_replication_info_to_cluster.py
# Copyright (c) 2016 Red Hat, Inc. # 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 require...
# Copyright (c) 2016 Red Hat, Inc. # 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 require...
Fix cannot add a column with non-constant default
Fix cannot add a column with non-constant default With newer versions of sqlite tests are failing on sqlite3.OperationalError : Cannot add a column with non-constant default. In SQL queries is boolean without apostrophes which causes sqlite3 error. This fix is solving this issue by replacing text('false') to expressio...
Python
apache-2.0
openstack/cinder,mahak/cinder,mahak/cinder,openstack/cinder
--- +++ @@ -13,7 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from sqlalchemy import Boolean, Column, MetaData, String, Table, text +from sqlalchemy import Boolean, Column, MetaData, String, Table +from sqlalchemy.sql import expression def upg...
7173d3cf67bfd9a3b01f42c0832ce299c090f1d6
opendebates/tests/test_context_processors.py
opendebates/tests/test_context_processors.py
from django.core.cache import cache from django.test import TestCase from opendebates.context_processors import global_vars from opendebates.models import NUMBER_OF_VOTES_CACHE_ENTRY class NumberOfVotesTest(TestCase): def test_number_of_votes(self): cache.set(NUMBER_OF_VOTES_CACHE_ENTRY, 2) conte...
from django.test import TestCase from mock import patch from opendebates.context_processors import global_vars class NumberOfVotesTest(TestCase): def test_number_of_votes(self): with patch('opendebates.utils.cache') as mock_cache: mock_cache.get.return_value = 2 context = global_v...
Fix new test to work without cache
Fix new test to work without cache
Python
apache-2.0
ejucovy/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,ejucovy/django-opendebates,ejucovy/django-opendebates,caktus/django-opendebates,ejucovy/django-opendebates,caktus/django-opendebates
--- +++ @@ -1,12 +1,12 @@ -from django.core.cache import cache from django.test import TestCase +from mock import patch from opendebates.context_processors import global_vars -from opendebates.models import NUMBER_OF_VOTES_CACHE_ENTRY class NumberOfVotesTest(TestCase): def test_number_of_votes(self): - ...
3bddeade05ca5ddc799733baa1545aa2b8b68060
hoomd/tune/custom_tuner.py
hoomd/tune/custom_tuner.py
from hoomd import _hoomd from hoomd.custom import ( _CustomOperation, _InternalCustomOperation, Action) from hoomd.operation import _Tuner class _TunerProperty: @property def updater(self): return self._action @updater.setter def updater(self, updater): if isinstance(updater, Acti...
from hoomd import _hoomd from hoomd.operation import _Operation from hoomd.custom import ( _CustomOperation, _InternalCustomOperation, Action) from hoomd.operation import _Tuner class _TunerProperty: @property def tuner(self): return self._action @tuner.setter def tuner(self, tuner): ...
Fix attaching on custom tuners
Fix attaching on custom tuners
Python
bsd-3-clause
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
--- +++ @@ -1,4 +1,5 @@ from hoomd import _hoomd +from hoomd.operation import _Operation from hoomd.custom import ( _CustomOperation, _InternalCustomOperation, Action) from hoomd.operation import _Tuner @@ -6,13 +7,13 @@ class _TunerProperty: @property - def updater(self): + def tuner(self): ...
074c83285bba8a8805bf35dec9893771220b1715
foodsaving/users/stats.py
foodsaving/users/stats.py
from django.contrib.auth import get_user_model from django.db.models import Count from foodsaving.groups.models import GroupMembership from foodsaving.webhooks.models import EmailEvent def get_users_stats(): User = get_user_model() active_users = User.objects.filter(groupmembership__in=GroupMembership.objec...
from django.contrib.auth import get_user_model from foodsaving.groups.models import GroupMembership from foodsaving.webhooks.models import EmailEvent def get_users_stats(): User = get_user_model() active_users = User.objects.filter(groupmembership__in=GroupMembership.objects.active(), deleted=False).distinc...
Use slightly better approach to count users without groups
Use slightly better approach to count users without groups
Python
agpl-3.0
yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core,yunity/yunity-core
--- +++ @@ -1,5 +1,4 @@ from django.contrib.auth import get_user_model -from django.db.models import Count from foodsaving.groups.models import GroupMembership from foodsaving.webhooks.models import EmailEvent @@ -13,26 +12,16 @@ active_users_count = active_users.count() fields = { - 'active_c...
48ab9fa0e54103a08fec54d8a4d4870dc701d918
genes/systemd/commands.py
genes/systemd/commands.py
#!/usr/bin/env python from subprocess import Popen from typing import List def systemctl(*args: List[str]): Popen(['systemctl'] + list(args)) def start(service: str): systemctl('start', service) def stop(service: str): systemctl('stop', service) def restart(service: str): systemctl('restart', se...
#!/usr/bin/env python from subprocess import Popen from typing import Tuple def systemctl(*args: Tuple[str, ...]) -> None: Popen(['systemctl'] + list(args)) def disable(*services: Tuple[str, ...]) -> None: return systemctl('disable', *services) def enable(*services: Tuple[str, ...]) -> None: return sy...
Add more functions, improve type checking
Add more functions, improve type checking
Python
mit
hatchery/genepool,hatchery/Genepool2
--- +++ @@ -1,23 +1,31 @@ #!/usr/bin/env python from subprocess import Popen -from typing import List +from typing import Tuple -def systemctl(*args: List[str]): +def systemctl(*args: Tuple[str, ...]) -> None: Popen(['systemctl'] + list(args)) -def start(service: str): - systemctl('start', service) ...
7355a5cb7014d6494e40322736a2887369d47262
bin/trigger_upload.py
bin/trigger_upload.py
#!/bin/env python # -*- coding: utf8 -*- """ Triggers an upload process with the specified raw.xz URL. """ import argparse import logging import logging.config import multiprocessing.pool import fedmsg.config import fedimg.uploader logging.config.dictConfig(fedmsg.config.load_config()['logging']) log = logging.getLo...
#!/bin/env python # -*- coding: utf8 -*- """ Triggers an upload process with the specified raw.xz URL. """ import argparse import logging import logging.config import multiprocessing.pool import fedmsg.config import fedimg.uploader logging.config.dictConfig(fedmsg.config.load_config()['logging']) log = logging.getLo...
Add the missing push_notifications args
services.ec2: Add the missing push_notifications args Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com>
Python
agpl-3.0
fedora-infra/fedimg,fedora-infra/fedimg
--- +++ @@ -17,7 +17,8 @@ def trigger_upload(compose_id, url, push_notifications): upload_pool = multiprocessing.pool.ThreadPool(processes=4) compose_meta = {'compose_id': compose_id} - fedimg.uploader.upload(upload_pool, [url], compose_meta=compose_meta) + fedimg.uploader.upload(upload_pool, [url], ...
a5f3c2c027588a72a9861a72cfa975d2f3e24bea
acme/acmelab/acmelab.py
acme/acmelab/acmelab.py
""" The Acme Lab application. """ # Standard library imports. from logging import DEBUG # Enthought library imports. from enthought.envisage.ui.workbench.api import WorkbenchApplication from enthought.pyface.api import AboutDialog, ImageResource, SplashScreen class Acmelab(WorkbenchApplication): """ The Acme L...
""" The Acme Lab application. """ # Standard library imports. from logging import DEBUG # Enthought library imports. from enthought.envisage.ui.workbench.api import WorkbenchApplication from enthought.pyface.api import AboutDialog, ImageResource, SplashScreen class Acmelab(WorkbenchApplication): """ The Acme L...
Rename it to Hermes2D GUI
Rename it to Hermes2D GUI
Python
bsd-3-clause
certik/hermes-gui
--- +++ @@ -25,7 +25,7 @@ icon = ImageResource('acmelab.ico') # The name of the application (also used on window title bars etc). - name = 'Acme Lab' + name = 'Hermes2D GUI' ########################################################################### # 'WorkbenchApplication' inter...
2c006d4fd1a823eba2cec933671a43182f0c10f5
src/dynmen/__init__.py
src/dynmen/__init__.py
# -*- coding: utf-8 -*- """ dynmen - A simple python interface to dynamic menus like dmenu or rofi import dynmen menu = dynmen.Menu(['dmenu', '-fn', 'Sans-30']) output = menu({'a': 1, 'b': 2, 'c': 3}) You can make the menu non-blocking by setting: menu.process_mode = 'futures' Please see the repository for more e...
# -*- coding: utf-8 -*- """ dynmen - A simple python interface to dynamic menus like dmenu or rofi import dynmen menu = dynmen.Menu(['dmenu', '-fn', 'Sans-30']) output = menu({'a': 1, 'b': 2, 'c': 3}) You can make the menu non-blocking by setting: menu.process_mode = 'futures' Please see the repository for more e...
Add MenuResult to the top-level namespace
Add MenuResult to the top-level namespace
Python
mit
frostidaho/dynmen
--- +++ @@ -12,7 +12,7 @@ Please see the repository for more examples: https://github.com/frostidaho/dynmen """ -from .menu import Menu, MenuError +from .menu import Menu, MenuError, MenuResult del menu
95b03703e82aecf0c7e942551c0dc37f1f74936c
src/tenyksscripts/scripts/urbandictionary.py
src/tenyksscripts/scripts/urbandictionary.py
import requests from HTMLParser import HTMLParser from BeautifulSoup import BeautifulSoup def run(data, settings): if data['payload'] == 'urban dictionary me': r = requests.get('http://www.urbandictionary.com/random.php') soup = BeautifulSoup(r.text, convertEntities=BeautifulSoup.HTML_...
import requests from HTMLParser import HTMLParser from BeautifulSoup import BeautifulSoup def run(data, settings): if data['payload'] == 'urban dictionary me': req = requests.get('http://www.urbandictionary.com/random.php') soup = BeautifulSoup(req.text, convertEntities=BeautifulSoup.H...
Fix single char variable name
Fix single char variable name
Python
mit
kyleterry/tenyks-contrib,cblgh/tenyks-contrib,colby/tenyks-contrib
--- +++ @@ -4,9 +4,9 @@ def run(data, settings): if data['payload'] == 'urban dictionary me': - r = requests.get('http://www.urbandictionary.com/random.php') + req = requests.get('http://www.urbandictionary.com/random.php') - soup = BeautifulSoup(r.text, + soup = BeautifulSoup(re...
1dc1be8c5f705ff97d6b83171327fa5d1c59a385
src/utils/management/commands/run_upgrade.py
src/utils/management/commands/run_upgrade.py
from importlib import import_module from django.core.management.base import BaseCommand from django.utils import translation class Command(BaseCommand): """ Upgrades Janeway """ help = "Upgrades an install from one version to another." def add_arguments(self, parser): """Adds arguments ...
import os from importlib import import_module from django.core.management.base import BaseCommand from django.utils import translation from django.conf import settings def get_modules(): path = os.path.join(settings.BASE_DIR, 'utils', 'upgrade') root, dirs, files = next(os.walk(path)) return files clas...
Upgrade path is now not required, help text is output if no path supp.
Upgrade path is now not required, help text is output if no path supp.
Python
agpl-3.0
BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway
--- +++ @@ -1,7 +1,15 @@ +import os from importlib import import_module from django.core.management.base import BaseCommand from django.utils import translation +from django.conf import settings + + +def get_modules(): + path = os.path.join(settings.BASE_DIR, 'utils', 'upgrade') + root, dirs, files = next(...
c8483dd1cd40db8b9628f19c9ba664165708a8ab
project/urls.py
project/urls.py
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', admin.site.urls), url(r'^publication/', include('project.publications.urls')), #url(r'^google/', include('project.google.urls')), ur...
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', admin.site.urls), url(r'^publication/', include('project.publications.urls')), url(r'^google/', include('djangoogle.urls')), url(r'^...
Make photos and videos accessible
Make photos and videos accessible
Python
bsd-2-clause
anjos/website,anjos/website
--- +++ @@ -7,7 +7,7 @@ urlpatterns = patterns('', url(r'^admin/', admin.site.urls), url(r'^publication/', include('project.publications.urls')), - #url(r'^google/', include('project.google.urls')), + url(r'^google/', include('djangoogle.urls')), url(r'^project/', include('project.projects.urls'...
78d0fce5f9dd973e288a90bd58040060406cb962
blinkylib/blinkytape.py
blinkylib/blinkytape.py
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 57600, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(s...
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 115200, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(...
Change BlinkyTape baud to 115200
Change BlinkyTape baud to 115200
Python
mit
jonspeicher/blinkyfun
--- +++ @@ -2,7 +2,7 @@ import serial class BlinkyTape(object): - def __init__(self, port, baud_rate = 57600, pixel_count = 60): + def __init__(self, port, baud_rate = 115200, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pi...
11323a28d90ed59f32d1120224c2f63bdbed0564
learning/stock/ethstock.py
learning/stock/ethstock.py
import io import random import numpy as np import pandas as pd import sklearn import requests def gettingData(): url = "https://www.coingecko.com/price_charts/export/279/eur.csv" content = requests.get(url).content data = pd.read_csv(io.StringIO(content.decode('utf-8'))) return data def preprocessing(...
import io import random import numpy as np import pandas as pd import sklearn import requests def gettingData(): url = "https://www.coingecko.com/price_charts/export/279/eur.csv" content = requests.get(url).content data = pd.read_csv(io.StringIO(content.decode('utf-8'))) return data def preprocessing(...
Index is completed if there is no sample for a date
Index is completed if there is no sample for a date
Python
mit
samuxiii/prototypes,samuxiii/prototypes
--- +++ @@ -18,11 +18,34 @@ data.set_index('snapped_at', inplace=True) data.index = pd.to_datetime(data.index) + ''' + In some cases there is no sample for a certain date. + ''' + #Generate all the possible days and use them to reindex + start = data.index[data.index.argmin()] + end = da...
4934d3488321126fb73d236f00f37fe152f05476
rbm2m/config.py
rbm2m/config.py
# -*- coding: utf-8 -*- import os def get_app_env(): return os.environ.get('RBM2M_ENV', 'Production') class Config(object): APP_ENV = get_app_env() DEBUG = False TESTING = False DATABASE_URI = 'mysql://rbm2m:rbm2m@localhost/dbm2m' REDIS_URI = 'redis://@localhost:6379/0' class ProductionCon...
# -*- coding: utf-8 -*- import os def get_app_env(): return os.environ.get('RBM2M_ENV', 'Production') class Config(object): APP_ENV = get_app_env() DEBUG = False TESTING = False # TODO: ?charset=utf8 DATABASE_URI = 'mysql://rbm2m:rbm2m@localhost/rbm2m' REDIS_URI = 'redis://@localhost:637...
Add test database and some notes
Add test database and some notes
Python
apache-2.0
notapresent/rbm2m,notapresent/rbm2m
--- +++ @@ -10,7 +10,8 @@ APP_ENV = get_app_env() DEBUG = False TESTING = False - DATABASE_URI = 'mysql://rbm2m:rbm2m@localhost/dbm2m' + # TODO: ?charset=utf8 + DATABASE_URI = 'mysql://rbm2m:rbm2m@localhost/rbm2m' REDIS_URI = 'redis://@localhost:6379/0' @@ -25,3 +26,4 @@ class Test...
e494e38b28fbafc70a1e5315a780d64e315113b4
more/chameleon/main.py
more/chameleon/main.py
import morepath import chameleon class ChameleonApp(morepath.App): pass @ChameleonApp.setting_section(section='chameleon') def get_setting_section(): return { 'auto_reload': False } @ChameleonApp.template_engine(extension='.pt') def get_chameleon_render(path, original_render, settings): co...
import morepath import chameleon class ChameleonApp(morepath.App): pass @ChameleonApp.setting_section(section='chameleon') def get_setting_section(): return {'auto_reload': False} @ChameleonApp.template_engine(extension='.pt') def get_chameleon_render(path, original_render, settings): config = setting...
Make the way chameleon settings are defined more generic; any Chameleon setting can now be in the chameleon config section.
Make the way chameleon settings are defined more generic; any Chameleon setting can now be in the chameleon config section.
Python
bsd-3-clause
morepath/more.chameleon
--- +++ @@ -8,14 +8,12 @@ @ChameleonApp.setting_section(section='chameleon') def get_setting_section(): - return { - 'auto_reload': False - } + return {'auto_reload': False} @ChameleonApp.template_engine(extension='.pt') def get_chameleon_render(path, original_render, settings): - config ...
b88abd98834529f1342d69e2e91b79efd68e5e8d
backend/uclapi/dashboard/middleware/fake_shibboleth_middleware.py
backend/uclapi/dashboard/middleware/fake_shibboleth_middleware.py
from django.utils.deprecation import MiddlewareMixin class FakeShibbolethMiddleWare(MiddlewareMixin): def process_request(self, request): if request.POST.get("convert-post-headers") == "1": for key in request.POST: request.META[key] = request.POST[key]
from django.utils.deprecation import MiddlewareMixin class FakeShibbolethMiddleWare(MiddlewareMixin): def process_request(self, request): if request.POST.get("convert-post-headers") == "1": for key in request.POST: request.META[key] = request.POST[key] if request.GET.g...
Add get parameter parsing for fakeshibboleth auto mode
Add get parameter parsing for fakeshibboleth auto mode
Python
mit
uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi
--- +++ @@ -6,3 +6,10 @@ if request.POST.get("convert-post-headers") == "1": for key in request.POST: request.META[key] = request.POST[key] + + if request.GET.get("convert-get-headers") == "1": + for key in request.GET: + http_key = key.upper() +...
4752f704596613bbb80a649b275c79ce156b32ec
python/libgdf_cffi/__init__.py
python/libgdf_cffi/__init__.py
from __future__ import absolute_import import os, sys from .wrapper import _libgdf_wrapper from .wrapper import GDFError # re-exported try: from .libgdf_cffi import ffi except ImportError: pass else: def _get_lib_name(): if os.name == 'posix': # TODO this will need to be cha...
from __future__ import absolute_import import os import sys from .wrapper import _libgdf_wrapper from .wrapper import GDFError # re-exported try: from .libgdf_cffi import ffi except ImportError: pass else: def _get_lib_name(): if os.name == 'posix': # TODO this will need to ...
Fix library not found on linux
Fix library not found on linux
Python
apache-2.0
gpuopenanalytics/libgdf,gpuopenanalytics/libgdf,gpuopenanalytics/libgdf,gpuopenanalytics/libgdf
--- +++ @@ -1,6 +1,7 @@ from __future__ import absolute_import -import os, sys +import os +import sys from .wrapper import _libgdf_wrapper from .wrapper import GDFError # re-exported @@ -14,10 +15,17 @@ if os.name == 'posix': # TODO this will need to be changed when packaged for...
88e839144f4a1dac1468e03f5cd506841caadc84
django_schedulermanager/management/commands/schedulejob.py
django_schedulermanager/management/commands/schedulejob.py
from django.core.management.base import BaseCommand from django_schedulermanager.manager import manager class Command(BaseCommand): help = 'Schedules a job' def add_arguments(self, parser): # Positional arguments parser.add_argument('jobs_name', nargs='+') def handle(self, *args, **opti...
from django.core.management.base import BaseCommand from django_schedulermanager.manager import manager class Command(BaseCommand): help = 'Schedules a job' def add_arguments(self, parser): # Positional arguments parser.add_argument('jobs_name', nargs='+') def handle(self, *args, **opti...
Fix typo in 'job not found message' and jobs list output code
Fix typo in 'job not found message' and jobs list output code
Python
mit
marcoacierno/django-schedulermanager
--- +++ @@ -16,7 +16,7 @@ for job in jobs_to_schedule: if job not in manager: self.stdout.write( - 'Unable to find job {}. Avalable jobs: {}'.format(job, ','.join([job for job, _ in manager.jobs.items()])) + 'Unable to find job {}. Available...
2ba9eaba0bcb229055db09147f1cb654190badbf
notebooks/style_helpers.py
notebooks/style_helpers.py
import brewer2mpl import itertools from cycler import cycler cmap = brewer2mpl.get_map('Set1', 'Qualitative', 5, reverse=False) color_cycle = cycler('color', cmap.hex_colors) marker_cycle = cycler('marker', ['s', '^', 'o', 'D', 'v']) markersize_cycle = cycler('markersize', [10, 12, 11, 10, 12]) style_cycle = itertool...
import brewer2mpl from cycler import cycler N = 5 cmap = brewer2mpl.get_map('Set1', 'Qualitative', N, reverse=False) color_cycle = cycler('color', cmap.hex_colors) marker_cycle = cycler('marker', ['s', '^', 'o', 'D', 'v']) markersize_cycle = cycler('markersize', [10, 12, 11, 10, 12]) style_cycle = list(color_cycle + ...
Use a list for the style cycle so that subsequent calls to the plotting functions don't mix up the line styles.
Use a list for the style cycle so that subsequent calls to the plotting functions don't mix up the line styles.
Python
mit
maxalbert/paper-supplement-nanoparticle-sensing
--- +++ @@ -1,13 +1,13 @@ import brewer2mpl -import itertools from cycler import cycler +N = 5 -cmap = brewer2mpl.get_map('Set1', 'Qualitative', 5, reverse=False) +cmap = brewer2mpl.get_map('Set1', 'Qualitative', N, reverse=False) color_cycle = cycler('color', cmap.hex_colors) marker_cycle = cycler('marker', ...
39b8cb70ffd6be60c6d757ecd4703a3a0ca2a415
dbaas/workflow/steps/build_database.py
dbaas/workflow/steps/build_database.py
# -*- coding: utf-8 -*- import logging from base import BaseStep from logical.models import Database LOG = logging.getLogger(__name__) class BuildDatabase(BaseStep): def __unicode__(self): return "Creating logical database..." def do(self, workflow_dict): try: if not workflow_...
# -*- coding: utf-8 -*- import logging from base import BaseStep from logical.models import Database import datetime LOG = logging.getLogger(__name__) class BuildDatabase(BaseStep): def __unicode__(self): return "Creating logical database..." def do(self, workflow_dict): try: ...
Improve logs and change delete pos
Improve logs and change delete pos
Python
bsd-3-clause
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
--- +++ @@ -2,6 +2,7 @@ import logging from base import BaseStep from logical.models import Database +import datetime LOG = logging.getLogger(__name__) @@ -20,14 +21,20 @@ LOG.info("Creating Database...") database = Database.provision(name= workflow_dict['name'], databaseinfra= wor...
099ae768056a4ab160179be89c8750a2bfc06b2c
pyeda/test/test_bdd.py
pyeda/test/test_bdd.py
""" Test binary decision diagrams """
""" Test binary decision diagrams """ from pyeda.bdd import expr2bdd from pyeda.expr import var a, b, c = map(var, 'abc') def test_expr2bdd(): f = a * b + a * c + b * c bdd_f = expr2bdd(f) assert bdd_f.root == a.var assert bdd_f.low.root == b.var assert bdd_f.high.root == b.var assert bdd_f.l...
Implement expr2bdd function and unique table
Implement expr2bdd function and unique table
Python
bsd-2-clause
GtTmy/pyeda,sschnug/pyeda,sschnug/pyeda,karissa/pyeda,sschnug/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,pombredanne/pyeda,GtTmy/pyeda,cjdrake/pyeda,pombredanne/pyeda,cjdrake/pyeda,karissa/pyeda,cjdrake/pyeda
--- +++ @@ -1,3 +1,21 @@ """ Test binary decision diagrams """ + +from pyeda.bdd import expr2bdd +from pyeda.expr import var + +a, b, c = map(var, 'abc') + +def test_expr2bdd(): + f = a * b + a * c + b * c + bdd_f = expr2bdd(f) + assert bdd_f.root == a.var + assert bdd_f.low.root == b.var + assert b...
019d33092226d1ff8fe36897c03d25ddd48e34b1
serve.py
serve.py
""" Flask server app. """ import datetime as dt import sys import flask import sqlalchemy as sa import coils import tables import mapping app = flask.Flask(__name__) # Load configuration file. CONFIG = sys.argv[1] if len(sys.argv)>=2 else 'wabbit.cfg' config = coils.Config(CONFIG) @app.route('/') def index(): "...
""" Flask server app. """ import datetime as dt import sys import flask from flask.ext.sqlalchemy import SQLAlchemy import coils import mapping # Load configuration file. CONFIG = sys.argv[1] if len(sys.argv)>=2 else 'wabbit.cfg' config = coils.Config(CONFIG) # Initialize Flask and SQLAlchemy. app = flask.Flask(__na...
Use SQLAlchemy extension in Flask app.
Use SQLAlchemy extension in Flask app.
Python
mit
vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit
--- +++ @@ -5,16 +5,20 @@ import datetime as dt import sys import flask -import sqlalchemy as sa +from flask.ext.sqlalchemy import SQLAlchemy import coils -import tables import mapping - -app = flask.Flask(__name__) # Load configuration file. CONFIG = sys.argv[1] if len(sys.argv)>=2 else 'wabbit.cfg' config...
d1c93d46f4d9f5a21ca97c0825add06406569fc7
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'django-orderable', version = '1.0.1', description = 'Model ordering for the Django administration site.', author = 'Ted Kaemming', author_email = 'ted@kaemming.com', url = 'http://www.github.com/tkaemming/djan...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'django-orderable', version = '1.0.1', description = 'Model ordering for the Django administration site.', author = 'Ted Kaemming', author_email = 'ted@kaemming.com', url = 'http://www.github.com/tkaemming/djan...
Make sure to ship translations with sdists.
Make sure to ship translations with sdists.
Python
mit
tkaemming/django-orderable,tkaemming/django-orderable,tkaemming/django-orderable
--- +++ @@ -18,6 +18,7 @@ 'templates/orderable/edit_inline/stacked.html', 'templates/orderable/edit_inline/tabular.html', 'templates/orderable/orderable.js', + 'locale/*/LC_MESSAGES/django.*', ] },
877c2e1c453386b3fa4d249f3a76a7e345c97d23
setup.py
setup.py
from setuptools import setup VERSION = '0.2.9' setup( name='jinja2_standalone_compiler', packages=['jinja2_standalone_compiler', ], version=VERSION, author='Filipe Waitman', author_email='filwaitman@gmail.com', install_requires=[x.strip() for x in open('requirements.txt').readlines()], ur...
from setuptools import setup VERSION = '0.3' setup( name='jinja2_standalone_compiler', packages=['jinja2_standalone_compiler', ], version=VERSION, author='Filipe Waitman', author_email='filwaitman@gmail.com', install_requires=[x.strip() for x in open('requirements.txt').readlines()], url=...
Change project maturity level and bump to 0.3
Change project maturity level and bump to 0.3
Python
mit
filwaitman/jinja2-standalone-compiler
--- +++ @@ -1,6 +1,6 @@ from setuptools import setup -VERSION = '0.2.9' +VERSION = '0.3' setup( @@ -15,7 +15,7 @@ test_suite='tests', keywords=['Jinja2', 'Jinja', 'renderer', 'compiler', 'HTML'], classifiers=[ - "Development Status :: 1 - Planning", + "Development Status :: 4 - Be...
4dc8316d1f5378db974437e462df12d697d126ea
setup.py
setup.py
import os from setuptools import setup version = '0.2dev' long_description = '\n\n'.join([ open('README.rst').read(), open('CHANGES.txt').read(), ]) setup( name = "compare", version = version, description = "Alternative syntax for comparing/asserting expressions in Python. Supports pluggable match...
import os from setuptools import setup version = '0.2b' long_description = '\n\n'.join([ open('README.rst').read(), open('CHANGES.txt').read(), ]) setup( name = "compare", version = version, description = "Alternative syntax for comparing/asserting expressions in Python. Supports pluggable matcher...
Mark project as beta release
Mark project as beta release
Python
bsd-3-clause
rudylattae/compare,rudylattae/compare
--- +++ @@ -1,7 +1,7 @@ import os from setuptools import setup -version = '0.2dev' +version = '0.2b' long_description = '\n\n'.join([ open('README.rst').read(), open('CHANGES.txt').read(),
a1ed05089c983f3347b5164fffe4030d75b9453d
setup.py
setup.py
import setuptools import pathlib setuptools.setup( name='crafter', version='0.17.0', description='Open world survival game for reinforcement learning.', url='http://github.com/danijar/crafter', long_description=pathlib.Path('README.md').read_text(), long_description_content_type='text/markdown...
import setuptools import pathlib setuptools.setup( name='crafter', version='0.18.0', description='Open world survival game for reinforcement learning.', url='http://github.com/danijar/crafter', long_description=pathlib.Path('README.md').read_text(), long_description_content_type='text/markdown...
Include data file in package.
Include data file in package.
Python
mit
danijar/crafter
--- +++ @@ -4,13 +4,13 @@ setuptools.setup( name='crafter', - version='0.17.0', + version='0.18.0', description='Open world survival game for reinforcement learning.', url='http://github.com/danijar/crafter', long_description=pathlib.Path('README.md').read_text(), long_description_co...
3e083c4ed6f6ebd6739d10a639939c8a290aebc9
setup.py
setup.py
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010 Sebastian Krysmanski # Copyright (C) 2012 Greg Lavallee # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # from setuptools import setup PACKAGE = 'TicketGuidelinesPl...
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010 Sebastian Krysmanski # Copyright (C) 2012 Greg Lavallee # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # from setuptools import setup PACKAGE = 'TracTicketGuidelin...
Change package name before publishing to PyPI
Change package name before publishing to PyPI
Python
bsd-3-clause
trac-hacks/TicketGuidelinesPlugin
--- +++ @@ -10,7 +10,7 @@ from setuptools import setup -PACKAGE = 'TicketGuidelinesPlugin' +PACKAGE = 'TracTicketGuidelines' VERSION = '1.0.0' setup(
642b2f2782bb57d64f2a5ed3f0e5c99614b8b9eb
setup.py
setup.py
from setuptools import setup, find_packages requirements = [ 'GitPython == 1.0.1', 'docker-py >= 1.7.0', 'requests ==2.7.0' ] setup_requirements = [ 'flake8' ] setup( name='docker-release', version='0.3-SNAPSHOT', description='Tool for releasing docker images.', author='Grzegorz Kokos...
from setuptools import setup, find_packages requirements = [ 'GitPython == 1.0.1', 'docker-py >= 1.7.0', 'requests ==2.7.0' ] setup_requirements = [ 'flake8' ] description = """ Tool for releasing docker images. It is useful when your docker image files are under continuous development and you want t...
Fix project description for pypi
Fix project description for pypi
Python
apache-2.0
kokosing/docker-release,kokosing/docker-release
--- +++ @@ -10,14 +10,27 @@ 'flake8' ] +description = """ +Tool for releasing docker images. It is useful when your docker image files +are under continuous development and you want to have a +convenient way to release (publish) them. + +This utility supports: + + - tagging git repository when a docker image ...
be8c0bf0000e10a8e33581dddd70ea5cec84ddeb
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages with open('README.rst') as readme_file: README = readme_file.read() install_requires = [ 'click==6.2', 'botocore>=1.4.8,<2.0.0', 'virtualenv>=15.0.0,<16.0.0', 'typing==3.5.2.2', ] setup( name='chalice', version='0.5.0', ...
#!/usr/bin/env python from setuptools import setup, find_packages import sys with open('README.rst') as readme_file: README = readme_file.read() install_requires = [ 'click==6.2', 'botocore>=1.4.8,<2.0.0', 'virtualenv>=15.0.0,<16.0.0', 'typing==3.5.2.2', ] if sys.version_info < (3, 0): raise...
Check if runtime is Python2
Check if runtime is Python2
Python
apache-2.0
freaker2k7/chalice,awslabs/chalice
--- +++ @@ -1,6 +1,6 @@ #!/usr/bin/env python from setuptools import setup, find_packages - +import sys with open('README.rst') as readme_file: README = readme_file.read() @@ -13,6 +13,8 @@ 'typing==3.5.2.2', ] +if sys.version_info < (3, 0): + raise RuntimeError("chalice requires only Python 2.7"...
e74e1d9d4dbd50b37d17b4827332cb4256eb7245
setup.py
setup.py
import os from setuptools import setup, find_packages # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path...
import os from setuptools import setup, find_packages # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path...
Change syutil dependency link to point at github.
Change syutil dependency link to point at github.
Python
apache-2.0
matrix-org/synapse,illicitonion/synapse,matrix-org/synapse,howethomas/synapse,iot-factory/synapse,TribeMedia/synapse,rzr/synapse,matrix-org/synapse,TribeMedia/synapse,iot-factory/synapse,illicitonion/synapse,TribeMedia/synapse,matrix-org/synapse,rzr/synapse,rzr/synapse,howethomas/synapse,matrix-org/synapse,howethomas/s...
--- +++ @@ -24,7 +24,7 @@ "py-bcrypt", ], dependency_links=[ - "git+ssh://git@git.openmarket.com/tng/syutil.git#egg=syutil-0.0.1", + "git+ssh://git@github.com:matrix-org/syutil.git#egg=syutil-0.0.1", ], setup_requires=[ "setuptools_trial",
3de79ecba9a9bbef39cf324cc5dc62f703767cc3
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup, find_packages setup( name='django-afip', version='0.8.0', description='AFIP integration for django', author='Hugo Osvaldo Barrera', author_email='hbarrera@z47.io', url='https://gitlab.com/hobarrera/django-afip', license='ISC', packag...
#!/usr/bin/env python3 from setuptools import setup, find_packages setup( name='django-afip', version='0.8.0', description='AFIP integration for django', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/django-afip', license='ISC', packag...
Change author_email to my own email
Change author_email to my own email My personal email is definitely the one that'll keep working in the long run.
Python
isc
hobarrera/django-afip,hobarrera/django-afip
--- +++ @@ -7,7 +7,7 @@ version='0.8.0', description='AFIP integration for django', author='Hugo Osvaldo Barrera', - author_email='hbarrera@z47.io', + author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/django-afip', license='ISC', packages=find_packages(),
16e4e3155733ad8c90312414cc975315ad8566d3
setup.py
setup.py
#!/usr/bin/env python import os import sys from setuptools import setup, find_packages long_description = open( os.path.join( os.path.dirname(__file__), 'README.rst' ) ).read() setup( name='ptpython', author='Jonathan Slenders', version='0.36', url='https://github.com/jonathan...
#!/usr/bin/env python import os import sys from setuptools import setup, find_packages long_description = open( os.path.join( os.path.dirname(__file__), 'README.rst' ) ).read() setup( name='ptpython', author='Jonathan Slenders', version='0.36', url='https://github.com/jonathan...
Remove minor python version in entry point.
Remove minor python version in entry point.
Python
bsd-3-clause
jonathanslenders/ptpython
--- +++ @@ -30,9 +30,7 @@ 'ptpython = ptpython.entry_points.run_ptpython:run', 'ptipython = ptpython.entry_points.run_ptipython:run', 'ptpython%s = ptpython.entry_points.run_ptpython:run' % sys.version_info[0], - 'ptpython%s.%s = ptpython.entry_points.run_ptpython:run...
09e6c915e668c0b41eca75e3105ebac6f8bfcf58
setup.py
setup.py
import os from distutils.core import setup from sphinx.setup_command import BuildDoc import django_assets def find_packages(root): # so we don't depend on setuptools; from the Storm ORM setup.py packages = [] for directory, subdirectories, files in os.walk(root): if '__init__.py' in fi...
import os from distutils.core import setup try: from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} except ImportError: print "Sphinx not installed--needed to build documentation" # default cmdclass to None to avoid cmdclass = {} import django_assets def fi...
Allow the package to be built without Sphinx being required.
Allow the package to be built without Sphinx being required.
Python
bsd-2-clause
glorpen/webassets,glorpen/webassets,0x1997/webassets,rs/webassets,aconrad/webassets,JDeuce/webassets,scorphus/webassets,florianjacob/webassets,heynemann/webassets,aconrad/webassets,wijerasa/webassets,john2x/webassets,aconrad/webassets,heynemann/webassets,0x1997/webassets,glorpen/webassets,john2x/webassets,wijerasa/weba...
--- +++ @@ -1,7 +1,13 @@ import os from distutils.core import setup -from sphinx.setup_command import BuildDoc - +try: + from sphinx.setup_command import BuildDoc + cmdclass = {'build_sphinx': BuildDoc} +except ImportError: + print "Sphinx not installed--needed to build documentation" + # default cmdcla...
797da1bd335c0d8237ff4ee4785fe7aca76f0b84
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name='pusher', version='1.2.0', description='A Python library to interract with the Pusher API', url='https://github.com/pusher/pusher-http-python', author='Pusher', author_email='support@pusher.com', classifiers=[ "License ...
# -*- coding: utf-8 -*- from setuptools import setup setup( name='pusher', version='1.2.0', description='A Python library to interract with the Pusher API', url='https://github.com/pusher/pusher-http-python', author='Pusher', author_email='support@pusher.com', classifiers=[ "License ...
Include cacert.pem as part of the package
Include cacert.pem as part of the package
Python
mit
hkjallbring/pusher-http-python,pusher/pusher-http-python
--- +++ @@ -29,5 +29,9 @@ 'tornado': ['tornado>=4.0.0'] }, + package_data={ + 'pusher': ['cacert.pem'] + }, + test_suite='pusher_tests', )
43a8a83014c2d77b37615f28e695fa861350d0bf
setup.py
setup.py
import re from setuptools import find_packages, setup with open('netsgiro/__init__.py') as fh: metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read())) with open('README.rst') as fh: long_description = fh.read() setup( name='netsgiro', version=metadata['version'], description='File ...
import re from setuptools import find_packages, setup with open('netsgiro/__init__.py') as fh: metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read())) with open('README.rst') as fh: long_description = fh.read() setup( name='netsgiro', version=metadata['version'], description='File ...
Add attrs and typing to deps
Add attrs and typing to deps
Python
apache-2.0
otovo/python-netsgiro
--- +++ @@ -31,6 +31,8 @@ keywords='avtalegiro ocr giro', packages=find_packages(exclude=['tests', 'tests.*']), install_requires=[ + 'attrs', + 'typing', # Needed for Python 3.4 ], extras_require={ 'dev': [
f2d29dc5bf44581dd1850b2be70fc5ae4b5fac35
setup.py
setup.py
# encoding: utf-8 """ setup ~~~~~ :copyright: 2014 by Daniel Neuhäuser :license: BSD, see LICENSE.rst for details """ from setuptools import setup setup( name='oore', description='Object-Oriented Regular Expressions', version='0.1.1', author='Daniel Neuhäuser', author_email='ich@d...
# encoding: utf-8 """ setup ~~~~~ :copyright: 2014 by Daniel Neuhäuser :license: BSD, see LICENSE.rst for details """ from setuptools import setup with open('README.rst', 'r') as readme: long_description = readme.read() setup( name='oore', description='Object-Oriented Regular Expression...
Use README as long_description for PyPI
Use README as long_description for PyPI
Python
bsd-3-clause
DasIch/oore
--- +++ @@ -9,9 +9,14 @@ from setuptools import setup +with open('README.rst', 'r') as readme: + long_description = readme.read() + + setup( name='oore', description='Object-Oriented Regular Expressions', + long_description=long_description, version='0.1.1', author='Daniel Neuhäuser', ...
e3f273509ada5632cc7110f62caebcdb982307da
setup.py
setup.py
from setuptools import setup, find_packages setup( name = "sanitize", version = "0.33", description = "Bringing sanitiy to world of messed-up data", long_description=open('README.md').read(), author = "Aaron Swartz", author_email = "me@aaronsw.com", url='http://www.aaronsw.com/2002/sanitize/', ...
from setuptools import setup, find_packages setup( name = "sanitize", version = "0.33", description = "Bringing sanitiy to world of messed-up data", long_description=open('README.md').read(), author = "Aaron Swartz", author_email = "me@aaronsw.com", maintainer='Alireza Savand', maintainer_email...
Add @Alir3z4 as maintainer info
Add @Alir3z4 as maintainer info
Python
bsd-2-clause
Alir3z4/python-sanitize
--- +++ @@ -7,6 +7,8 @@ long_description=open('README.md').read(), author = "Aaron Swartz", author_email = "me@aaronsw.com", + maintainer='Alireza Savand', + maintainer_email='alireza.savand@gmail.com', url='http://www.aaronsw.com/2002/sanitize/', license=open('LICENCE').read(), classifier...
0b1bcf6305f808f3ed1b862a1673e774dce67879
setup.py
setup.py
from distutils.core import setup setup( name = 'depedit', packages = ['depedit'], version = '2.1.2', description = 'A simple configurable tool for manipulating dependency trees', author = 'Amir Zeldes', author_email = 'amir.zeldes@georgetown.edu', url = 'https://github.com/amir-zeldes/depedit', licens...
from distutils.core import setup setup( name = 'depedit', packages = ['depedit'], version = '2.1.2', description = 'A simple configurable tool for manipulating dependency trees', author = 'Amir Zeldes', author_email = 'amir.zeldes@georgetown.edu', url = 'https://github.com/amir-zeldes/depedit', instal...
Add six as a requirement
Add six as a requirement
Python
apache-2.0
amir-zeldes/DepEdit
--- +++ @@ -8,6 +8,7 @@ author = 'Amir Zeldes', author_email = 'amir.zeldes@georgetown.edu', url = 'https://github.com/amir-zeldes/depedit', + install_requires=["six"], license='Apache License, Version 2.0', download_url = 'https://github.com/amir-zeldes/depedit/releases/tag/2.1.2', keywords = ['N...
5c5e49797358e7020d409adf74209c0647050465
setup.py
setup.py
from distutils.core import setup setup(name='fuzzywuzzy', version='0.2', description='Fuzzy string matching in python', author='Adam Cohen', author_email='adam@seatgeek.com', url='https://github.com/seatgeek/fuzzywuzzy/', packages=['fuzzywuzzy'])
from distutils.core import setup setup(name='fuzzywuzzy', version='0.2', description='Fuzzy string matching in python', author='Adam Cohen', author_email='adam@seatgeek.com', url='https://github.com/seatgeek/fuzzywuzzy/', packages=['fuzzywuzzy'], classifiers=( 'Programming Language ...
Add classifiers for python versions
Add classifiers for python versions
Python
mit
jayhetee/fuzzywuzzy,salilnavgire/fuzzywuzzy,beni55/fuzzywuzzy,beni55/fuzzywuzzy,blakejennings/fuzzywuzzy,shalecraig/fuzzywuzzy,pombredanne/fuzzywuzzy,salilnavgire/fuzzywuzzy,pombredanne/fuzzywuzzy,aeeilllmrx/fuzzywuzzy,medecau/fuzzywuzzy,zhahaoyu/fuzzywuzzy,zhahaoyu/fuzzywuzzy,jayhetee/fuzzywuzzy,shalecraig/fuzzywuzzy,...
--- +++ @@ -6,4 +6,12 @@ author='Adam Cohen', author_email='adam@seatgeek.com', url='https://github.com/seatgeek/fuzzywuzzy/', - packages=['fuzzywuzzy']) + packages=['fuzzywuzzy'], + classifiers=( + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.6', + ...
e5fe2994b05ffbb5abca5641ae75114da315e888
setup.py
setup.py
#!/usr/bin/env python import os import sys from setuptools import setup from lora import VERSION if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() if sys.argv[-1] == 'tag': os.system("git tag -a v{} -m 'tagging v{}'".format(VERSION, VERSION)) os.system('git push && ...
#!/usr/bin/env python import os import sys from setuptools import setup from lora import VERSION package_name = 'python-lora' if sys.argv[-1] == 'publish': os.system('python setup.py sdist') os.system('twine upload -r pypi dist/%s-%s.tar.gz' % (package_name, VERSION)) sys.exit() if sys.argv[-1] == 'ta...
Use twine to upload package
Use twine to upload package
Python
mit
jieter/python-lora
--- +++ @@ -7,8 +7,11 @@ from lora import VERSION +package_name = 'python-lora' + if sys.argv[-1] == 'publish': - os.system('python setup.py sdist upload') + os.system('python setup.py sdist') + os.system('twine upload -r pypi dist/%s-%s.tar.gz' % (package_name, VERSION)) sys.exit() if sys.argv...
2c1caf83f99161ef2f1d17c50a1d3006d9834ecd
hotness/repository.py
hotness/repository.py
import logging import subprocess from hotness.cache import cache log = logging.getLogger('fedmsg') def get_version(package_name, yumconfig): nvr_dict = build_nvr_dict(yumconfig) return nvr_dict[package_name] @cache.cache_on_arguments() def build_nvr_dict(yumconfig): cmdline = ["/usr/bin/repoquery", ...
import logging import subprocess from hotness.cache import cache log = logging.getLogger('fedmsg') def get_version(package_name, yumconfig): nvr_dict = build_nvr_dict(yumconfig) return nvr_dict[package_name] @cache.cache_on_arguments() def build_nvr_dict(yumconfig): cmdline = ["/usr/bin/repoquery", ...
Drop explicit archlist for now.
Drop explicit archlist for now.
Python
lgpl-2.1
fedora-infra/the-new-hotness,fedora-infra/the-new-hotness
--- +++ @@ -15,7 +15,7 @@ cmdline = ["/usr/bin/repoquery", "--config", yumconfig, "--quiet", - "--archlist=src", + #"--archlist=src", "--all", "--qf", "%{name}\t%{version}\t%{release}"]
a34ce610a6f961158e15769f02926aeed6321e58
setup.py
setup.py
#!/usr/bin/env python # # The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008, # derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy # Wardley. All Rights Reserved. # # The file "LICENSE" at the top level of this source distribution describes # the terms under which this file ...
#!/usr/bin/env python # # The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008, # derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy # Wardley. All Rights Reserved. # # The file "LICENSE" at the top level of this source distribution describes # the terms under which this file ...
Bump version to 0.1.post1 to re-release on PyPi correctly packaged
Bump version to 0.1.post1 to re-release on PyPi correctly packaged
Python
artistic-2.0
gsnedders/Template-Python,gsnedders/Template-Python
--- +++ @@ -13,7 +13,7 @@ from distutils.core import setup setup(name = 'Template-Python', - version = '0.1', + version = '0.1.post1', description = 'Python port of the Template Toolkit', author = 'Sean McAfee', author_email = 'eefacm@gmail.com',
8581cf8d2e2d38dcc5ca0bcb8821d9f5c60b00ac
setup.py
setup.py
from distutils.core import setup from Cython.Build import cythonize setup( name="gfspy", packages=["gtfspy"], version="0.1", description="Python package for analyzing public transport timetables", author="Rainer Kujala", author_email="Rainer.Kujala@gmail.com", url="https://github.com/CxAal...
from distutils.core import setup from Cython.Build import cythonize setup( name="gfspy", packages=["gtfspy"], version="0.1", description="Python package for analyzing public transport timetables", author="Rainer Kujala", author_email="Rainer.Kujala@gmail.com", url="https://github.com/CxAal...
Change version back to 0.1
Change version back to 0.1
Python
mit
CxAalto/gtfspy,CxAalto/gtfspy
--- +++ @@ -10,7 +10,7 @@ author="Rainer Kujala", author_email="Rainer.Kujala@gmail.com", url="https://github.com/CxAalto/gtfspy", - download_url="https://github.com/CxAalto/gtfspy/archive/0.1.tar.gz", + download_url="https://github.com/CxAalto/gtfspy/archive/0.2.tar.gz", ext_modules=cythoni...
eb08a3fa792e3ead859358d4038cedbd6b08d8c4
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup version = '' with open('koordinates/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE)...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup import re import os from codecs import open version = '' with open('koordinates/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', ...
Resolve import error introduced in last commit.
Resolve import error introduced in last commit.
Python
bsd-3-clause
koordinates/python-client,koordinates/python-client
--- +++ @@ -5,6 +5,10 @@ from setuptools import setup except ImportError: from distutils.core import setup + +import re +import os +from codecs import open version = '' with open('koordinates/__init__.py', 'r') as fd: @@ -19,9 +23,9 @@ setup( name='koordinates', packages=['koordinates',], - ...
f61d2368998a45dfda99d65d097fed5fb43ad061
setup.py
setup.py
import os from setuptools import setup, find_packages def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='gears-uglifyjs', version='0.1', url='https://github.com/gears/gears-uglifyjs', license='ISC', author='Mike Yumatov', author_email='...
import os from setuptools import setup, find_packages def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='gears-uglifyjs', version='0.1', url='https://github.com/gears/gears-uglifyjs', license='ISC', author='Mike Yumatov', author_email='...
Remove Python 2.5 support, add support for Python 3.2
Remove Python 2.5 support, add support for Python 3.2
Python
isc
gears/gears-uglifyjs,gears/gears-uglifyjs
--- +++ @@ -23,8 +23,8 @@ 'License :: OSI Approved :: ISC License (ISCL)', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: ...
6c89e9a2eb6c429f9faf8f8fdbb7360239b15a61
setup.py
setup.py
from setuptools import setup, find_packages import io # List all of your Python package dependencies in the # requirements.txt file def readfile(filename, split=False): with io.open(filename, encoding="utf-8") as stream: if split: return stream.read().split("\n") return stream.read() ...
from setuptools import setup, find_packages import io # List all of your Python package dependencies in the # requirements.txt file def readfile(filename, split=False): with io.open(filename, encoding="utf-8") as stream: if split: return stream.read().split("\n") return stream.read() ...
Remove namespace_packages argument which works with declare_namespace.
Remove namespace_packages argument which works with declare_namespace.
Python
apache-2.0
OpenCMISS-Bindings/opencmiss.utils
--- +++ @@ -26,7 +26,6 @@ url='', license='APACHE', packages=find_packages(exclude=['ez_setup',]), - namespace_packages=['opencmiss'], include_package_data=True, zip_safe=False, install_requires=requires,
d041ab4a09da6a2181e1b14f3d0f323ed9c29c6f
applications/templatetags/applications_tags.py
applications/templatetags/applications_tags.py
# -*- encoding: utf-8 -*- from django import template from applications.models import Score register = template.Library() @register.filter def scored_by_user(value, arg): try: score = Score.objects.get(application=value, user=arg) return True if score.score else False except Score.DoesNotExi...
# -*- encoding: utf-8 -*- from django import template register = template.Library() @register.filter def scored_by_user(application, user): return application.is_scored_by_user(user) @register.simple_tag def display_sorting_arrow(name, current_order): is_reversed = False if '-{}'.format(name) == curre...
Make scored_by_user filter call model method
Make scored_by_user filter call model method Ref #113
Python
bsd-3-clause
DjangoGirls/djangogirls,patjouk/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls,patjouk/djangogirls,patjouk/djangogirls,patjouk/djangogirls
--- +++ @@ -1,18 +1,13 @@ # -*- encoding: utf-8 -*- from django import template - -from applications.models import Score register = template.Library() + @register.filter -def scored_by_user(value, arg): - try: - score = Score.objects.get(application=value, user=arg) - return True if score.s...
eee5008d5e8f7ae29405491962d3adb1af375e44
setup.py
setup.py
from setuptools import setup, find_packages import unittest import doctest # Read in the version number exec(open('src/nash/version.py', 'r').read()) requirements = ["numpy==1.11.2"] def test_suite(): """Discover all tests in the tests dir""" test_loader = unittest.TestLoader() # Read in unit tests t...
from setuptools import setup, find_packages import unittest import doctest # Read in the version number exec(open('src/nash/version.py', 'r').read()) requirements = ["numpy==1.11.2"] test_requirements = ['hypothesis>=3.6.0'] def test_suite(): """Discover all tests in the tests dir""" test_loader = unittest....
Add hypothesis as test requirement.
Add hypothesis as test requirement.
Python
mit
drvinceknight/Nashpy
--- +++ @@ -6,6 +6,8 @@ exec(open('src/nash/version.py', 'r').read()) requirements = ["numpy==1.11.2"] +test_requirements = ['hypothesis>=3.6.0'] + def test_suite(): """Discover all tests in the tests dir""" @@ -22,6 +24,7 @@ name='nashpy', version=__version__, install_requires=requirements...
efe28fd251a399229156d1a0a1d2abf96dc288fe
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='Scrapper', version='0.9.5', url='https://github.com/Alkemic/scrapper', license='MIT', author='Daniel Alkemic Czuba', author_email='alkemic7@gmail.com', description='Scrapper is small, Python web scraping library', py_modul...
#!/usr/bin/env python from setuptools import setup setup( name='Scrapper', version='0.9.5', url='https://github.com/Alkemic/scrapper', license='MIT', author='Daniel Alkemic Czuba', author_email='alkemic7@gmail.com', description='Scrapper is small, Python web scraping library', py_modul...
Bump requests from 2.5.1 to 2.20.0
Bump requests from 2.5.1 to 2.20.0 Bumps [requests](https://github.com/requests/requests) from 2.5.1 to 2.20.0. - [Release notes](https://github.com/requests/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/requests/requests/compare/v2.5.1...v2.20....
Python
mit
Alkemic/scrapper,Alkemic/scrapper
--- +++ @@ -14,7 +14,7 @@ keywords='scrapper,scraping,webscraping', install_requires=[ 'lxml == 3.6.1', - 'requests == 2.5.1', + 'requests == 2.20.0', ], classifiers=[ 'Development Status :: 4 - Beta',
ad761908537b63c2d262f69a75e7b221f84e8647
ca_on_school_boards_english_public/__init__.py
ca_on_school_boards_english_public/__init__.py
from utils import CanadianJurisdiction from opencivicdata.divisions import Division from pupa.scrape import Organization class OntarioEnglishPublicSchoolBoards(CanadianJurisdiction): classification = 'legislature' # just to avoid clash division_id = 'ocd-division/country:ca/province:on' division_name = '...
from utils import CanadianJurisdiction from opencivicdata.divisions import Division from pupa.scrape import Organization class OntarioEnglishPublicSchoolBoards(CanadianJurisdiction): classification = 'legislature' # just to avoid clash division_id = 'ocd-division/country:ca/province:on' division_name = '...
Add stub for multiple posts in school boards
Add stub for multiple posts in school boards
Python
mit
opencivicdata/scrapers-ca,opencivicdata/scrapers-ca
--- +++ @@ -14,6 +14,7 @@ organization = Organization(self.name, classification=self.classification) for division in Division.get(self.division_id).children('school_district'): - organization.add_post(role='Representative', label=division.name, division_id=division.id) + for ...
4bf218a843c61886c910504a47cbc86c8a4982ae
bulbs/content/management/commands/migrate_to_ia.py
bulbs/content/management/commands/migrate_to_ia.py
from django.core.management.base import BaseCommand from bulbs.content.models import Content, FeatureType from bulbs.content.tasks import post_to_instant_articles_api import timezone class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('feature', nargs="+", type=str) de...
from django.core.management.base import BaseCommand from bulbs.content.models import Content, FeatureType from bulbs.content.tasks import post_to_instant_articles_api import timezone class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('feature', nargs="+", type=str) de...
Fix migrate to ia script
Fix migrate to ia script
Python
mit
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
--- +++ @@ -12,15 +12,13 @@ parser.add_argument('feature', nargs="+", type=str) def handle(self, *args, **options): - feature_types = FeatureType.objects.all() + feature_types = FeatureType.objects.all(instant_article=True) feature = options['feature'][0] if feature: ...
9343dbfa0d822cdf2f00deab8b18cf4d2e809063
services/display_routes.py
services/display_routes.py
# -*- coding: utf-8 -*- from database.database_access import get_dao from gtfslib.model import Route from gtfsplugins import decret_2015_1610 from database.database_access import get_dao def get_routes(agency_id): dao = get_dao(agency_id) parsedRoutes = list() for route in dao.routes(fltr=Route.route_type == Rout...
# -*- coding: utf-8 -*- from database.database_access import get_dao from gtfslib.model import Route from services.check_urban import check_urban_category def get_routes(agency_id): dao = get_dao(agency_id) parsedRoutes = list() for route in dao.routes(fltr=Route.route_type == Route.TYPE_BUS): print(route) pa...
Add id & category to routes list
Add id & category to routes list
Python
mit
LoveXanome/urbanbus-rest,LoveXanome/urbanbus-rest
--- +++ @@ -2,16 +2,18 @@ from database.database_access import get_dao from gtfslib.model import Route -from gtfsplugins import decret_2015_1610 -from database.database_access import get_dao +from services.check_urban import check_urban_category def get_routes(agency_id): dao = get_dao(agency_id) parsedRou...
3b83b8715e03b9096f9ae5611019fec4e52ca937
tests.py
tests.py
from os.path import isdir import pytest from filesystem_tree import FilesystemTree @pytest.yield_fixture def fs(): fs = FilesystemTree() yield fs fs.remove() def test_it_can_be_instantiated(): assert FilesystemTree().__class__.__name__ == 'FilesystemTree' def test_args_go_to_mk_not_root(): fs ...
import os from os.path import isdir import pytest from filesystem_tree import FilesystemTree @pytest.yield_fixture def fs(): fs = FilesystemTree() yield fs fs.remove() def test_it_can_be_instantiated(): assert FilesystemTree().__class__.__name__ == 'FilesystemTree' def test_args_go_to_mk_not_root(...
Add an initial test each for resolve and mk
Add an initial test each for resolve and mk
Python
mit
gratipay/filesystem_tree.py,gratipay/filesystem_tree.py
--- +++ @@ -1,3 +1,4 @@ +import os from os.path import isdir import pytest @@ -21,6 +22,14 @@ def test_it_makes_a_directory(fs): assert isdir(fs.root) +def test_resolve_resolves(fs): + path = fs.resolve('some/dir') + assert path == os.path.realpath(os.sep.join([fs.root, 'some', 'dir'])) + +def test_...
8a75cc4626bd38faeec102aea894d4e7ac08646c
viewer_examples/viewers/collection_viewer.py
viewer_examples/viewers/collection_viewer.py
""" ===================== CollectionViewer demo ===================== Demo of CollectionViewer for viewing collections of images. This demo uses successively darker versions of the same image to fake an image collection. You can scroll through images with the slider, or you can interact with the viewer using your key...
""" ===================== CollectionViewer demo ===================== Demo of CollectionViewer for viewing collections of images. This demo uses the different layers of the gaussian pyramid as image collection. You can scroll through images with the slider, or you can interact with the viewer using your keyboard: le...
Update description of collection viewer example
Update description of collection viewer example
Python
bsd-3-clause
almarklein/scikit-image,juliusbierk/scikit-image,paalge/scikit-image,Hiyorimi/scikit-image,chriscrosscutler/scikit-image,oew1v07/scikit-image,bennlich/scikit-image,paalge/scikit-image,warmspringwinds/scikit-image,chriscrosscutler/scikit-image,bennlich/scikit-image,warmspringwinds/scikit-image,rjeli/scikit-image,vighnes...
--- +++ @@ -4,7 +4,7 @@ ===================== Demo of CollectionViewer for viewing collections of images. This demo uses -successively darker versions of the same image to fake an image collection. +the different layers of the gaussian pyramid as image collection. You can scroll through images with the slider,...
f93fcd5cee878c201dd1be2102a2a9433a63c4b5
scripts/set-artist-streamable.py
scripts/set-artist-streamable.py
#!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") self.cursor = self.conn.cursor() def updateAll(self): """Sets artists streamable ...
#!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") self.cursor = self.conn.cursor() def updateAll(self): """Sets artists streamable ...
Make streamable artist updates as they happen, rather than commiting at the end of all artists
Make streamable artist updates as they happen, rather than commiting at the end of all artists
Python
agpl-3.0
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
--- +++ @@ -19,9 +19,7 @@ name = artist[0] print "marking %s as streamable... " % name self.cursor.execute("UPDATE artist SET streamable = 1 WHERE name = %s", (name,)) - print "Applying changes... ", - self.conn.commit() - print "done." + self.conn.commit() if __name__ == '__main__': sas = SetAr...
564d2eedf6e2b62152869c60bf1f3ba18287d8c0
fullcalendar/templatetags/fullcalendar.py
fullcalendar/templatetags/fullcalendar.py
from django import template from fullcalendar.models import Occurrence register = template.Library() @register.inclusion_tag('events/agenda_tag.html') def show_agenda(*args, **kwargs): qs = Occurrence.objects.upcoming() if 'limit' in kwargs: qs = qs[:int(kwargs['limit'])] return { 'occu...
from django import template from django.utils import timezone from fullcalendar.models import Occurrence register = template.Library() @register.inclusion_tag('events/agenda_tag.html') def show_agenda(*args, **kwargs): qs = Occurrence.objects.upcoming() if 'limit' in kwargs: qs = qs[:int(kwargs['lim...
Add extra tag which displays the occurrence duration in a smart way
Add extra tag which displays the occurrence duration in a smart way
Python
mit
jonge-democraten/mezzanine-fullcalendar
--- +++ @@ -1,4 +1,5 @@ from django import template +from django.utils import timezone from fullcalendar.models import Occurrence @@ -45,3 +46,16 @@ return qs +@register.simple_tag +def occurrence_duration(occurrence): + start = timezone.localtime(occurrence.start_time) + end = timezone.localtime...
74577faa2468a0b944cef3c88c9b8a82a4881ff1
query/views.py
query/views.py
""" Views for the rdap_explorer project, query app. """ import ipwhois from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django.views.decorators.cache import cache_page from json import dumps from .forms import QueryForm def index(request): if...
""" Views for the rdap_explorer project, query app. """ import ipwhois from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django.views.decorators.cache import cache_page from json import dumps from .forms import QueryForm def index(request): if...
Change results page title to include query (or "Error" on error).
Change results page title to include query (or "Error" on error).
Python
mit
cdubz/rdap-explorer,cdubz/rdap-explorer
--- +++ @@ -32,6 +32,7 @@ @cache_page(86400) def results(request, query): + title = 'Results' error = None result = {} @@ -39,10 +40,12 @@ try: ip = ipwhois.IPWhois(query) result = ip.lookup_rdap(retry_count=1, depth=2, inc_raw=True) + title = ip.address_str excep...
27f47ef27654dfa9c68bb90d3b8fae2e3a281396
pitchfork/__init__.py
pitchfork/__init__.py
# Copyright 2014 Dave Kludt # # 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, s...
# Copyright 2014 Dave Kludt # # 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, s...
Move out app setup to setup file to finish cleaning up the init file
Move out app setup to setup file to finish cleaning up the init file
Python
apache-2.0
rackerlabs/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork
--- +++ @@ -12,39 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask import Flask, g -from happymongo import HapPyMongo -from config import config -from adminbp import bp as admin_bp -from manage_globals import bp as manage_bp -from engine i...
63cb8dc1449f6cab87bd7910276d0e06dfd0b228
rasdoor/app.py
rasdoor/app.py
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World' if __name__ == '__main__': app.run(debug=True, host='0.0.0.0')
from flask import Flask, abort, request app = Flask(__name__) VERIFY_TOKEN = 'temp_token_to_replace_with_secret' @app.route('/') def hello_world(): return 'Hello World' @app.route('/webhook/facebook_messenger', methods=['GET', 'POST']) def facebook_webhook(): if request.method == 'POST': body = reque...
Set up basic webhook for Messenger
Set up basic webhook for Messenger
Python
mit
jabagawee/playing-with-kubernetes
--- +++ @@ -1,9 +1,28 @@ -from flask import Flask +from flask import Flask, abort, request app = Flask(__name__) + +VERIFY_TOKEN = 'temp_token_to_replace_with_secret' @app.route('/') def hello_world(): return 'Hello World' +@app.route('/webhook/facebook_messenger', methods=['GET', 'POST']) +def facebook_w...
16d6dd0ba2b5218d211c25e3e197d65fe163b09a
helusers/providers/helsinki_oidc/views.py
helusers/providers/helsinki_oidc/views.py
import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView ) from .provider import HelsinkiOIDCProvider class HelsinkiOIDCOAuth2Adapter(OAuth2Adapter): provider_id = HelsinkiOIDCProvider.id access_token_url = 'https://api.hel.fi/sso-test/...
import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView ) from .provider import HelsinkiOIDCProvider class HelsinkiOIDCOAuth2Adapter(OAuth2Adapter): provider_id = HelsinkiOIDCProvider.id access_token_url = 'https://api.hel.fi/sso/openi...
Fix broken Helsinki OIDC provider links
Fix broken Helsinki OIDC provider links
Python
bsd-2-clause
City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers
--- +++ @@ -8,9 +8,9 @@ class HelsinkiOIDCOAuth2Adapter(OAuth2Adapter): provider_id = HelsinkiOIDCProvider.id - access_token_url = 'https://api.hel.fi/sso-test/openid/token/' - authorize_url = 'https://api.hel.fi/sso-test/openid/authorize/' - profile_url = 'https://api.hel.fi/sso-test/openid/userinfo...
5dc9f2f376b5ac918c1872e1270a782a9ef45ac9
panoptes_aggregation/extractors/workflow_extractor_config.py
panoptes_aggregation/extractors/workflow_extractor_config.py
def workflow_extractor_config(tasks): extractor_config = {} for task_key, task in tasks.items(): if task['type'] == 'drawing': tools_config = {} for tdx, tool in enumerate(task['tools']): if ((tool['type'] == 'polygon') and (len(tool['details'])...
def workflow_extractor_config(tasks): extractor_config = {} for task_key, task in tasks.items(): if task['type'] == 'drawing': tools_config = {} for tdx, tool in enumerate(task['tools']): if ((tool['type'] == 'polygon') and (len(tool['details'])...
Make sure that auto-detected task only has one sub-task
Make sure that auto-detected task only has one sub-task Be more restrictive with the workflow auto detect for the poly-line-text tool.
Python
apache-2.0
CKrawczyk/python-reducers-for-caesar
--- +++ @@ -5,7 +5,7 @@ tools_config = {} for tdx, tool in enumerate(task['tools']): if ((tool['type'] == 'polygon') and - (len(tool['details']) > 0) and + (len(tool['details']) == 1) and (tool['details'][0]['type'] == ...
3e280e64874d1a68b6bc5fc91a8b6b28968b74e3
meinberlin/apps/dashboard2/contents.py
meinberlin/apps/dashboard2/contents.py
class DashboardContents: _registry = {} content = DashboardContents()
class DashboardContents: _registry = {'project': {}, 'module': {}} def __getitem__(self, identifier): component = self._registry['project'].get(identifier, None) if not component: component = self._registry['module'].get(identifier) return component def __contains__(sel...
Store project and module componentes separately
Store project and module componentes separately
Python
agpl-3.0
liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin
--- +++ @@ -1,5 +1,27 @@ class DashboardContents: - _registry = {} + _registry = {'project': {}, 'module': {}} + + def __getitem__(self, identifier): + component = self._registry['project'].get(identifier, None) + if not component: + component = self._registry['module'].get(identifi...
46ee9dad4030c8628d951abb84a667c7398dd834
src/coordinators/models.py
src/coordinators/models.py
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from locations.models import District class Coordinator(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) is_manage...
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from locations.models import District class Coordinator(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) is_manage...
Fix error when multiple objects were returned for coordinators in admin
Fix error when multiple objects were returned for coordinators in admin
Python
mit
mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign
--- +++ @@ -23,4 +23,4 @@ kwargs = { lookup: user.coordinator.district } - return qs.filter(**kwargs) + return qs.filter(**kwargs).distinct()
72796a97a24c512cf43fd9559d6e6b47d2f72e72
preferences/models.py
preferences/models.py
import uuid from django.db import models from django.contrib.auth.models import User from opencivicdata.models.people_orgs import Person from django.contrib.auth.models import User class Preferences(models.Model): user = models.OneToOneField(User, related_name='preferences') address = models.CharField(max_le...
import uuid from django.db import models from django.contrib.auth.models import User from opencivicdata.models.people_orgs import Person class Preferences(models.Model): user = models.OneToOneField(User, related_name='preferences') address = models.CharField(max_length=100, blank=True, null=True) lat = mo...
Allow address to be null
Allow address to be null
Python
mit
jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot
--- +++ @@ -3,12 +3,10 @@ from django.contrib.auth.models import User from opencivicdata.models.people_orgs import Person -from django.contrib.auth.models import User - class Preferences(models.Model): user = models.OneToOneField(User, related_name='preferences') - address = models.CharField(max_length...
d7c41853277c1df53192b2f879f47f75f3c62fd5
server/covmanager/urls.py
server/covmanager/urls.py
from django.conf.urls import patterns, include, url from rest_framework import routers from covmanager import views router = routers.DefaultRouter() router.register(r'collections', views.CollectionViewSet, base_name='collections') router.register(r'repositories', views.RepositoryViewSet, base_name='repositories') ur...
from django.conf.urls import patterns, include, url from rest_framework import routers from covmanager import views router = routers.DefaultRouter() router.register(r'collections', views.CollectionViewSet, base_name='collections') router.register(r'repositories', views.RepositoryViewSet, base_name='repositories') ur...
Add redirect for / to collections
[CovManager] Add redirect for / to collections
Python
mpl-2.0
MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager
--- +++ @@ -9,6 +9,7 @@ urlpatterns = patterns('', url(r'^rest/api-auth/', include('rest_framework.urls', namespace='rest_framework')), + url(r'^$', views.index, name='index'), url(r'^repositories/', views.repositories, name="repositories"), url(r'^collections/$', views.collections, name="collect...
9940a61cd7dbe9b66dcd4c7e07f967e53d2951d4
pybossa/auth/token.py
pybossa/auth/token.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
Change signature to match other resources auth functions
Change signature to match other resources auth functions
Python
agpl-3.0
geotagx/pybossa,jean/pybossa,stefanhahmann/pybossa,harihpr/tweetclickers,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa,OpenNewsLabs/pybossa,PyBossa/pybossa,Scifabric/pybossa,geotagx/pybossa,jean/pybossa,harihpr/tweetclickers,stefanhahmann/pybossa,OpenNewsLabs/pybossa,inteligencia-coletiva-lsd/pybossa,PyBossa/pybo...
--- +++ @@ -27,9 +27,9 @@ return not current_user.is_anonymous() -def update(token=None): +def update(token): return False -def delete(token=None): +def delete(token): return False
6fe48fc7499327d27f69204b7f8ec927fc975177
python/lexPythonMQ.py
python/lexPythonMQ.py
#!/usr/bin/python import tokenize; import zmq; context = zmq.Context() socket = context.socket(zmq.REP) socket.bind("tcp://lo:32132") while True: # Wait for next request from client message = socket.recv()
#!/usr/bin/python import re, sys, tokenize, zmq; from StringIO import StringIO def err(msg): sys.err.write(str(msg) + '\n') class LexPyMQ(object): def __init__(self): self.zctx = zmq.Context() self.socket = self.zctx.socket(zmq.REP) def run(self): self.socket.bind("tcp://lo:32132") while True: msg ...
Implement python lexer ZMQ service.
Implement python lexer ZMQ service.
Python
agpl-3.0
orezpraw/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,abramhindle/UnnaturalCodeFork,orezpraw/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,abramhindle/UnnaturalCodeFork,orezpraw/estimate-charm,naturalness/unnaturalcode,orezpraw/unnat...
--- +++ @@ -1,12 +1,27 @@ #!/usr/bin/python -import tokenize; -import zmq; +import re, sys, tokenize, zmq; +from StringIO import StringIO -context = zmq.Context() -socket = context.socket(zmq.REP) -socket.bind("tcp://lo:32132") +def err(msg): + sys.err.write(str(msg) + '\n') + -while True: - # Wait for nex...
778cb1a9f9fbb7e260d9a17f07d412d4fa12930a
ubigeo/forms.py
ubigeo/forms.py
from django import forms from .models import Department, Province, District class DepartmentForm(forms.Form): department = forms.ModelChoiceField( queryset=Department.objects ) class ProvinceForm(DepartmentForm): province = forms.ModelChoiceField( queryset=Province.objects.none() ) ...
from django import forms from .models import Department, Province, District class DepartmentForm(forms.Form): department = forms.ModelChoiceField( queryset=Department.objects.all() ) class ProvinceForm(DepartmentForm): province = forms.ModelChoiceField( queryset=Province.objects.none() ...
Add "all" to the queryset in DepartmentForm
Add "all" to the queryset in DepartmentForm
Python
mit
snahor/django-ubigeo
--- +++ @@ -4,7 +4,7 @@ class DepartmentForm(forms.Form): department = forms.ModelChoiceField( - queryset=Department.objects + queryset=Department.objects.all() )
15de2fe886c52f0900deeb519f944d22bb5c6db4
mysite/project/views.py
mysite/project/views.py
from mysite.search.models import Project from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 def project(request, project__name = None): p = Project.objects.get(name=project__name) return render...
from mysite.search.models import Project import django.template import mysite.base.decorators from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 @mysite.base.decorators.view def project(request, projec...
Use the @view decorator to ensure that the project page gets user data.
Use the @view decorator to ensure that the project page gets user data.
Python
agpl-3.0
onceuponatimeforever/oh-mainline,vipul-sharma20/oh-mainline,nirmeshk/oh-mainline,onceuponatimeforever/oh-mainline,ehashman/oh-mainline,waseem18/oh-mainline,ehashman/oh-mainline,mzdaniel/oh-mainline,campbe13/openhatch,vipul-sharma20/oh-mainline,eeshangarg/oh-mainline,sudheesh001/oh-mainline,jledbetter/openhatch,jledbett...
--- +++ @@ -1,14 +1,17 @@ from mysite.search.models import Project +import django.template +import mysite.base.decorators from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 +@mysite.base.decorat...
d2a040618a1e816b97f60aa66f5b4c9ab4a3e6b9
refmanage/fs_utils.py
refmanage/fs_utils.py
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*- import os import glob import pathlib2 as pathlib def handle_files_args(paths_args): """ Handle files arguments from command line This method takes a list of strings representing paths passed to the cli. It expands the path arguments and creates a list of pathlib.Path objects which...
Add method to handle files args from cli
Add method to handle files args from cli
Python
mit
jrsmith3/refmanage
--- +++ @@ -1 +1,25 @@ # -*- coding: utf-8 -*- +import os +import glob +import pathlib2 as pathlib + + +def handle_files_args(paths_args): + """ + Handle files arguments from command line + + This method takes a list of strings representing paths passed to the cli. It expands the path arguments and creates ...
fa14c040e6483087f5b2c78bc1a7aeee9ad2274a
Instanssi/kompomaatti/misc/time_formatting.py
Instanssi/kompomaatti/misc/time_formatting.py
# -*- coding: utf-8 -*- import awesometime def compo_times_formatter(compo): compo.compo_time = awesometime.format_single(compo.compo_start) compo.adding_time = awesometime.format_single(compo.adding_end) compo.editing_time = awesometime.format_single(compo.editing_end) compo.voting_time = awesometime...
# -*- coding: utf-8 -*- import awesometime def compo_times_formatter(compo): compo.compo_time = awesometime.format_single(compo.compo_start) compo.adding_time = awesometime.format_single(compo.adding_end) compo.editing_time = awesometime.format_single(compo.editing_end) compo.voting_time = awesometime...
Add time formatter for competitions
kompomaatti: Add time formatter for competitions
Python
mit
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
--- +++ @@ -8,3 +8,8 @@ compo.editing_time = awesometime.format_single(compo.editing_end) compo.voting_time = awesometime.format_between(compo.voting_start, compo.voting_end) return compo + +def competition_times_formatter(competition): + competition.start_time = awesometime.format_single(competitio...
ae78bd758c690e28abaae2c07e8a3890e76044e0
pylearn2/scripts/papers/maxout/tests/test_mnist.py
pylearn2/scripts/papers/maxout/tests/test_mnist.py
import os import numpy as np import pylearn2 from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.termination_criteria import EpochCounter from pylearn2.utils.serial import load_train_file def test_mnist(): """ Test the mnist.yaml file from the dropout paper on random input ...
import os import numpy as np import pylearn2 from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.termination_criteria import EpochCounter from pylearn2.utils.serial import load_train_file def test_mnist(): """ Test the mnist.yaml file from the dropout paper on random input ...
Allow papers/maxout to be tested without MNIST data
Allow papers/maxout to be tested without MNIST data
Python
bsd-3-clause
KennethPierce/pylearnk,KennethPierce/pylearnk,Refefer/pylearn2,JesseLivezey/plankton,goodfeli/pylearn2,theoryno3/pylearn2,alexjc/pylearn2,pkainz/pylearn2,fulmicoton/pylearn2,alexjc/pylearn2,alexjc/pylearn2,kastnerkyle/pylearn2,ddboline/pylearn2,se4u/pylearn2,hantek/pylearn2,jeremyfix/pylearn2,nouiz/pylearn2,abergeron/p...
--- +++ @@ -6,6 +6,7 @@ from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.termination_criteria import EpochCounter from pylearn2.utils.serial import load_train_file + def test_mnist(): """ @@ -17,6 +18,6 @@ random_X = np.random.rand(10, 784) random_y = np.random.ra...
c4809f9f43129d092235738127b90dc62f593fb8
steinie/app.py
steinie/app.py
from werkzeug import routing from werkzeug import serving from werkzeug import wrappers from . import routes class Steinie(routes.Router): def __init__(self, host="127.0.0.1", port=5151, debug=False): self.host = host self.port = port self.debug = debug super(Steinie, self).__init...
from werkzeug import routing from werkzeug import serving from werkzeug import wrappers from . import routes class Steinie(routes.Router): def __init__(self, host="127.0.0.1", port=5151, debug=False): self.host = host self.port = port self.debug = debug super(Steinie, self).__init...
Remove some commented out code
Remove some commented out code
Python
apache-2.0
tswicegood/steinie,tswicegood/steinie
--- +++ @@ -24,8 +24,6 @@ serving.run_simple(self.host, self.port, self, use_debugger=self.debug) def use(self, route, router): - # if not route.endswith('/'): - # route += '/' if route.startswith('/'): route = route[1:] submount = route @@ -35,4 +33,3 ...