commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
61b96e4f925831e64e80d0253428dbd1b2c8a6a4
app/grandchallenge/annotations/validators.py
app/grandchallenge/annotations/validators.py
from rest_framework import serializers from django.conf import settings def validate_grader_is_current_retina_user(grader, context): """ This method checks if the passed grader equals the request.user that is passed in the context. Only applies to users that are in the retina_graders group. """ re...
from rest_framework import serializers from django.conf import settings def validate_grader_is_current_retina_user(grader, context): """ This method checks if the passed grader equals the request.user that is passed in the context. Only applies to users that are in the retina_graders group. BEWARE! Va...
Add comment to clarify validation method usage
Add comment to clarify validation method usage
Python
apache-2.0
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
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
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
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
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
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
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
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
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
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
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
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
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...
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
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
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
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
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
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
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...
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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...
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
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,...
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
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
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
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
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
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...
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
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
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
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
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
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
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
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
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
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...
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...
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...
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
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
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...
1e931e9aac18f393de786894d9e26ecccc251135
server/models/_generate_superpixels.py
server/models/_generate_superpixels.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
Fix girder_work script bug: PEP 263 is not compatible with exec
Fix girder_work script bug: PEP 263 is not compatible with exec
Python
apache-2.0
ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive
a79a3f7c42c858ae42c618479654cd7589de05b9
zeeko/utils/tests/test_hmap.py
zeeko/utils/tests/test_hmap.py
# -*- coding: utf-8 -*- import pytest from ..hmap import HashMap @pytest.fixture(params=[0,1,5,9]) def n(request): """Number of items""" return request.param @pytest.fixture def items(n): """A list of strings.""" return ["item{0:d}".format(i) for i in range(n)] @pytest.mark.skip def test_hmap(items)...
# -*- coding: utf-8 -*- import pytest from ..hmap import HashMap @pytest.fixture(params=[0,1,5,9]) def n(request): """Number of items""" return request.param @pytest.fixture def items(n): """A list of strings.""" return ["item{0:d}".format(i) for i in range(n)]
Remove unused tests for hash map
Remove unused tests for hash map
Python
bsd-3-clause
alexrudy/Zeeko,alexrudy/Zeeko
311a858ecbe7d34f9f68a18a3735db9da8b0e692
tests/utils.py
tests/utils.py
import atexit import tempfile import sys import mock from selenium import webdriver import os def build_mock_mapping(name): mock_driver = mock.Mock() browser_mapping = {name: mock_driver} mock_driver.return_value.name = name return browser_mapping test_driver = None def get_driver(): global te...
import atexit import tempfile import sys import mock from selenium import webdriver import os def build_mock_mapping(name): mock_driver = mock.Mock() browser_mapping = {name: mock_driver} mock_driver.return_value.name = name return browser_mapping test_driver = None def get_driver(): global te...
Fix global test driver initialization
Fix global test driver initialization
Python
mit
alisaifee/holmium.core,alisaifee/holmium.core,alisaifee/holmium.core,alisaifee/holmium.core
e8da41193238a7c677ec7ff8339095ec3e71be3b
track_count.py
track_count.py
from report import * def show_track_count(S): print "Track Count\t\tSubmission Count" for (track, count) in S.track_count().items(): if track: print "%s\t\t%s" % (track.ljust(20), count) if __name__ == "__main__": # S = ALL.standard().vote_cutoff(4.0) S = ALL.standard().filter(...
from report import * def show_track_count(S): print "Track Count".ljust(40) + "\t\tSubmission Count" items = S.track_count().items() total = sum([count for (track, count) in items]) for (track, count) in sorted(items, cmp=lambda (a_track, a_count), (b_track, b_count): cmp(b_count, a_count)): ...
Fix formatting, show total and sort
Fix formatting, show total and sort
Python
epl-1.0
tracymiranda/pc-scripts,tracymiranda/pc-scripts
17015ecf48ec37909de6de2c299454fc89b592e9
tests/test_gmaps.py
tests/test_gmaps.py
# -*- coding: UTF-8 -*- from base import TestCase from jinja2_maps.gmaps import gmaps_url class TestGmaps(TestCase): def test_url_dict(self): url = "https://www.google.com/maps/place/12.34,56.78/@12.34,56.78,42z" self.assertEquals(url, gmaps_url(dict(latitude=12.34, longitude=56....
# -*- coding: UTF-8 -*- from base import TestCase from jinja2_maps.gmaps import gmaps_url class TestGmaps(TestCase): def test_url_dict(self): url = "https://www.google.com/maps/place/12.34,56.78/@12.34,56.78,42z" self.assertEquals(url, gmaps_url(dict(latitude=12.34, longitude=56....
Add failing test for URL without zoom
Add failing test for URL without zoom
Python
mit
bfontaine/jinja2_maps
73673598e1998252b16b48d31b800ab0fb441392
pml/cs.py
pml/cs.py
""" Template module to define control systems. """ class ControlSystem(object): """ Define a control system to be used with a device It uses channel access to comunicate over the network with the hardware. """ def __init__(self): raise NotImplementedError() def get(self, pv): ...
""" Template module to define control systems. """ class ControlSystem(object): """ Define a control system to be used with a device. It uses channel access to comunicate over the network with the hardware. """ def __init__(self): raise NotImplementedError() def get(self, pv): ...
Add documentation for the control system
Add documentation for the control system
Python
apache-2.0
willrogers/pml,willrogers/pml
3c735d18bdcff28bbdd765b131649ba57fb612b0
hy/models/string.py
hy/models/string.py
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modif...
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modif...
Revert "Revert "Remove useless code""
Revert "Revert "Remove useless code"" This reverts commit 262da59c7790cdadd60ea9612bc9e3c1616863fd. Conflicts: hy/models/string.py
Python
mit
ALSchwalm/hy,aisk/hy,paultag/hy,tianon/hy,hcarvalhoalves/hy,Foxboron/hy,Tritlo/hy,mtmiller/hy,michel-slm/hy,farhaven/hy,freezas/hy,zackmdavis/hy,tianon/hy,gilch/hy,aisk/hy,larme/hy,tuturto/hy,timmartin/hy,farhaven/hy,kirbyfan64/hy,farhaven/hy,algernon/hy,Foxboron/hy,hcarvalhoalves/hy,kirbyfan64/hy,adamfeuer/hy,jakirkha...
60870a3e471637d44da32f3aac74064e4ca60208
pyplot.py
pyplot.py
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Module to bundle plotting scripts `activate-global-python-argcomplete` must be run to enable auto completion """ import argparse import argcomplete import plotter def parse_arguments(): """Argument Parser, providing available scripts""" parser = argparse.Argum...
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Module to bundle plotting scripts `activate-global-python-argcomplete` must be run to enable auto completion """ import argparse import argcomplete import plotter def parse_arguments(): """Argument Parser, providing available scripts""" parser = argparse.Argum...
Use `set_defaults` of subparser to launch scripts
Use `set_defaults` of subparser to launch scripts
Python
mit
DerWeh/pyplot
aac598d64fc0fa50cc068fc50173068e5d89b3fd
segpy/ext/numpyext.py
segpy/ext/numpyext.py
"""Optional interoperability with Numpy.""" import numpy NUMPY_DTYPES = {'ibm': numpy.dtype('f4'), 'l': numpy.dtype('i4'), 'h': numpy.dtype('i2'), 'f': numpy.dtype('f4'), 'b': numpy.dtype('i1')} def make_dtype(data_sample_format): """Conver...
"""Optional interoperability with Numpy.""" import numpy NUMPY_DTYPES = {'ibm': numpy.dtype('f4'), 'int32': numpy.dtype('i4'), 'int16': numpy.dtype('i2'), 'float32': numpy.dtype('f4'), 'int8': numpy.dtype('i1')} def make_dtype(data_sample_fo...
Update numpy dtypes extension for correct type codes.
Update numpy dtypes extension for correct type codes.
Python
agpl-3.0
hohogpb/segpy,stevejpurves/segpy,abingham/segpy,asbjorn/segpy,kjellkongsvik/segpy,Kramer477/segpy,kwinkunks/segpy
2ba28c83de33ebc75f386d127d0c55e17248a94b
mapclientplugins/meshgeneratorstep/__init__.py
mapclientplugins/meshgeneratorstep/__init__.py
""" MAP Client Plugin """ __version__ = '0.2.0' __author__ = 'Richard Christie' __stepname__ = 'Mesh Generator' __location__ = '' # import class that derives itself from the step mountpoint. from mapclientplugins.meshgeneratorstep import step # Import the resource file when the module is loaded, # this enables the ...
""" MAP Client Plugin """ __version__ = '0.2.0' __author__ = 'Richard Christie' __stepname__ = 'Mesh Generator' __location__ = 'https://github.com/ABI-Software/mapclientplugins.meshgeneratorstep' # import class that derives itself from the step mountpoint. from mapclientplugins.meshgeneratorstep import step # Impor...
Add location to step metadata.
Add location to step metadata.
Python
apache-2.0
rchristie/mapclientplugins.meshgeneratorstep
fb8c2fb065449a436dd8ffa11b469bb2f22a9ad1
spider.py
spider.py
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import Selector class DatasetSpider(CrawlSpider): name = 'dataset' allowed_domains = ['data.gc.ca/data/en'] start_urls = ['http://data.gc.ca/data/en/dataset?page=1']
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import Selector class DatasetSpider(CrawlSpider): name = 'dataset' allowed_domains = ['data.gc.ca/data/en'] start_urls = ['http://data.gc.ca/data/en/dataset?page=1'] ...
Add web crawling rule and dataset url regex exp
Add web crawling rule and dataset url regex exp
Python
mit
MaxLikelihood/CODE
a8283f5d2c1d970b7b676d491ad8c9472abfe667
boardinghouse/tests/test_template_tag.py
boardinghouse/tests/test_template_tag.py
from django.test import TestCase from .models import AwareModel, NaiveModel from ..templatetags.boardinghouse import * class TestTemplateTags(TestCase): def test_is_schema_aware_filter(self): self.assertTrue(is_schema_aware(AwareModel())) self.assertFalse(is_schema_aware(NaiveModel())) de...
from django.test import TestCase from .models import AwareModel, NaiveModel from ..templatetags.boardinghouse import schema_name, is_schema_aware, is_shared_model from ..models import Schema class TestTemplateTags(TestCase): def test_is_schema_aware_filter(self): self.assertTrue(is_schema_aware(AwareModel...
Fix tests since we changed imports.
Fix tests since we changed imports. --HG-- branch : schema-invitations
Python
bsd-3-clause
schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse
0f49230309ac115ff78eddd36bcd153d7f3b75ea
data_aggregator/threads.py
data_aggregator/threads.py
import queue import threading from multiprocessing import Queue class ThreadPool(): def __init__(self, processes=20): self.processes = processes self.threads = [Thread() for _ in range(0, processes)] self.mp_queue = Queue() def yield_dead_threads(self): for thread in self.thr...
import queue import threading from multiprocessing import Queue class ThreadPool(): def __init__(self, processes=20): self.processes = processes self.threads = [Thread() for _ in range(0, processes)] self.mp_queue = Queue() def yield_dead_threads(self): for thread in self.thr...
Remove reference to "job" from ThreadPool
Remove reference to "job" from ThreadPool
Python
apache-2.0
uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics
de962f504db139500573457264a3dd1e257e8cc0
wagtail_mvc/decorators.py
wagtail_mvc/decorators.py
# -*- coding: utf-8 -*- """ wagtail_mvc decorators """ from __future__ import unicode_literals def wagtail_mvc_url(func): """ Decorates an existing method responsible for generating a url prepends the parent url to the generated url to account for :param func: The method to decorate :return: Full...
# -*- coding: utf-8 -*- """ wagtail_mvc decorators """ from __future__ import unicode_literals def wagtail_mvc_url(*decorator_args, **decorator_kwargs): """ Decorates an existing method responsible for generating a url prepends the parent url to the generated url to account for :param func: The metho...
Allow decorator to be called with optional args
Allow decorator to be called with optional args
Python
mit
fatboystring/Wagtail-MVC,fatboystring/Wagtail-MVC
fe676a041b793f55d33bfd27eb2b4fdfe7d93bb6
twilio/rest/resources/pricing/__init__.py
twilio/rest/resources/pricing/__init__.py
from .voice import ( Voice, VoiceCountry, VoiceCountries, VoiceNumber, VoiceNumbers, ) from .phone_numbers import ( PhoneNumberCountries, PhoneNumberCountry, PhoneNumbers, )
from twilio.rest.pricing.voice import ( Voice, VoiceCountry, VoiceCountries, VoiceNumber, VoiceNumbers, ) from twilio.rest.pricing.phone_number import ( PhoneNumberCountries, PhoneNumberCountry, PhoneNumber, )
Change import path for pricing
Change import path for pricing
Python
mit
tysonholub/twilio-python,twilio/twilio-python
0e779581be648ca80eea6b97f9963606d85659b9
opensfm/commands/__init__.py
opensfm/commands/__init__.py
import extract_metadata import detect_features import match_features import create_tracks import reconstruct import mesh import undistort import compute_depthmaps import export_ply import export_openmvs opensfm_commands = [ extract_metadata, detect_features, match_features, create_tracks, reconstr...
import extract_metadata import detect_features import match_features import create_tracks import reconstruct import mesh import undistort import compute_depthmaps import export_ply import export_openmvs import export_visualsfm opensfm_commands = [ extract_metadata, detect_features, match_features, cre...
Add exporter to VisualSfM format
Add exporter to VisualSfM format
Python
bsd-2-clause
BrookRoberts/OpenSfM,mapillary/OpenSfM,sunbingfengPI/OpenSFM_Test,BrookRoberts/OpenSfM,sunbingfengPI/OpenSFM_Test,sunbingfengPI/OpenSFM_Test,sunbingfengPI/OpenSFM_Test,oscarlorentzon/OpenSfM,BrookRoberts/OpenSfM,oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,mapillary/OpenSfM,mapillary/OpenSfM,Bro...
416575ca3cc684925be0391b43b98a9fa1d9f909
ObjectTracking/testTrack.py
ObjectTracking/testTrack.py
from SimpleCV import ColorSegmentation, Image, Camera, VirtualCamera, Display # Open reference video cam=VirtualCamera('/media/bat/DATA/Baptiste/Nautilab/kite_project/zenith-wind-power-read-only/KiteControl-Qt/videos/kiteFlying.avi','video') # Select reference image img=cam.getFrame(50) modelImage = img.crop(255, 180...
from SimpleCV import ColorSegmentation, Image, Camera, VirtualCamera, Display, Color # Open reference video cam=VirtualCamera('/media/bat/DATA/Baptiste/Nautilab/kite_project/zenith-wind-power-read-only/KiteControl-Qt/videos/kiteFlying.avi','video') # Select reference image img=cam.getFrame(50) modelImage = img.crop(2...
Save the image of the selection (to be able to reinitialise later)
Save the image of the selection (to be able to reinitialise later)
Python
mit
baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite
a0ac251bec891a6c511ea1c0b11faa6525b81545
bfg9000/languages.py
bfg9000/languages.py
ext2lang = { '.cpp': 'c++', '.c': 'c', }
ext2lang = { '.c' : 'c', '.cpp': 'c++', '.cc' : 'c++', '.cp' : 'c++', '.cxx': 'c++', '.CPP': 'c++', '.c++': 'c++', '.C' : 'c++', }
Support more C++ extensions by default
Support more C++ extensions by default
Python
bsd-3-clause
jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000
0788aaf316a2b200c5283fe9f5f902a8da701403
calexicon/internal/tests/test_julian.py
calexicon/internal/tests/test_julian.py
import unittest from calexicon.internal.julian import distant_julian_to_gregorian class TestJulian(unittest.TestCase): def test_distant_julian_to_gregorian(self): self.assertEqual(distant_julian_to_gregorian(9999, 12, 1), (10000, 2, 12))
import unittest from calexicon.internal.julian import distant_julian_to_gregorian, julian_to_gregorian class TestJulian(unittest.TestCase): def test_distant_julian_to_gregorian(self): self.assertEqual(distant_julian_to_gregorian(9999, 12, 1), (10000, 2, 12)) def test_julian_to_gregorian(self): ...
Add a test for julian_to_gregorian.
Add a test for julian_to_gregorian.
Python
apache-2.0
jwg4/qual,jwg4/calexicon
7f1542bc52438e6c9796e776603553d7f5a9df7f
pySpatialTools/utils/util_classes/__init__.py
pySpatialTools/utils/util_classes/__init__.py
""" Util classes ------------ Classes which represent data types useful for the package pySpatialTools. """ from spdesc_mapper import Sp_DescriptorMapper from spatialelements import SpatialElementsCollection, Locations from Membership import Membership from general_mapper import General1_1Mapper from mapper_vals_i i...
""" Util classes ------------ Classes which represent data types useful for the package pySpatialTools. """ from spdesc_mapper import Sp_DescriptorMapper from spatialelements import SpatialElementsCollection, Locations from Membership import Membership from mapper_vals_i import Map_Vals_i, create_mapper_vals_i
Debug in importing deleted module.
Debug in importing deleted module.
Python
mit
tgquintela/pySpatialTools,tgquintela/pySpatialTools
62a76827ecf7c148101b62925dea04f63709012a
sublime/User/update_user_settings.py
sublime/User/update_user_settings.py
import json import urllib2 import sublime import sublime_plugin GIST_URL = u'https://raw.githubusercontent.com/RomuloOliveira/dot-files/master/sublime/User/Preferences.sublime-settings' # noqa class UpdateUserSettingsCommand(sublime_plugin.TextCommand): def run(self, edit): gist_settings = self._g...
import json import urllib import sublime import sublime_plugin GIST_URL = 'https://raw.githubusercontent.com/RomuloOliveira/dot-files/master/sublime/User/Preferences.sublime-settings' # noqa class UpdateUserSettingsCommand(sublime_plugin.TextCommand): def run(self, edit): gist_settings = self._get_set...
Update command to work with sublime 3
Update command to work with sublime 3
Python
apache-2.0
RomuloOliveira/dot-files,RomuloOliveira/unix-files,RomuloOliveira/dot-files
0ba9fa847a8b605363b298ecad40cb2fc5870cbb
build_modules.py
build_modules.py
import os, sys, subprocess, shutil def check_for_module_builder(): if os.path.exists("voxel_native/scripts/"): return print("Downloading P3DModuleBuilder...") cmd = [sys.executable, "-B", "voxel_native/download_P3DModuleBuilder.py"] try: output = subprocess.check_output(cmd, stderr=sy...
import os, sys, subprocess, shutil def check_for_module_builder(): if os.path.exists("voxel_native/scripts/"): return print("Downloading P3DModuleBuilder...") cmd = [sys.executable, "-B", "voxel_native/download_P3DModuleBuilder.py"] try: output = subprocess.check_output(cmd, stderr=sy...
Update build script to work correctly on macOS and linux.
Update build script to work correctly on macOS and linux.
Python
mit
treamology/panda3d-voxels,treamology/panda3d-voxels,treamology/panda3d-voxels
115a71995f2ceae667c05114da8e8ba21c25c402
syncplay/__init__.py
syncplay/__init__.py
version = '1.6.5' revision = ' release' milestone = 'Yoitsu' release_number = '86' projectURL = 'https://syncplay.pl/'
version = '1.6.6' revision = ' development' milestone = 'Yoitsu' release_number = '87' projectURL = 'https://syncplay.pl/'
Move to 1.6.6 dev for further development
Move to 1.6.6 dev for further development
Python
apache-2.0
alby128/syncplay,alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay
d6b1f7c03ec2b32823fe2c4214e6521e8074cd9f
commands/join.py
commands/join.py
from CommandTemplate import CommandTemplate from IrcMessage import IrcMessage class Command(CommandTemplate): triggers = ['join'] helptext = "Makes me join another channel, if I'm allowed to at least" def execute(self, message): """ :type message: IrcMessage """ replytext = u"" if message.messageParts...
from CommandTemplate import CommandTemplate from IrcMessage import IrcMessage class Command(CommandTemplate): triggers = ['join'] helptext = "Makes me join another channel, if I'm allowed to at least" def execute(self, message): """ :type message: IrcMessage """ replytext = u"" if message.messageParts...
Make sure the 'channel' argument is not Unicode when we send it, because Twisted doesn't like that
[Join] Make sure the 'channel' argument is not Unicode when we send it, because Twisted doesn't like that
Python
mit
Didero/DideRobot
521e24fa115e69bca39d7cca89ce42e8efa3b077
tools/perf_expectations/PRESUBMIT.py
tools/perf_expectations/PRESUBMIT.py
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for perf_expectations. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on ...
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for perf_expectations. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on ...
Use full pathname to perf_expectations in test.
Use full pathname to perf_expectations in test. BUG=none TEST=none Review URL: http://codereview.chromium.org/266055 git-svn-id: http://src.chromium.org/svn/trunk/src@28770 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: f9d8e0a8dae19e482d3c435a76b4e38403e646b5
Python
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u...
b326d43a94058390a559c4c9f55e9cd88dcac747
adhocracy4/emails/mixins.py
adhocracy4/emails/mixins.py
from email.mime.image import MIMEImage from django.contrib.staticfiles import finders from .base import EmailBase class PlatformEmailMixin: """ Attaches the static file images/logo.png so it can be used in an html email. """ def get_attachments(self): attachments = super().get_attachments...
from email.mime.image import MIMEImage from django.contrib.staticfiles import finders from .base import EmailBase class PlatformEmailMixin: """ Attaches the static file images/logo.png so it can be used in an html email. """ def get_attachments(self): attachments = super().get_attachments...
Set propper mimetype for image attachment
Set propper mimetype for image attachment
Python
agpl-3.0
liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4
12cf7d220408971509b57cb3a60f2d87b4a37477
facebook_auth/models.py
facebook_auth/models.py
from uuid import uuid1 from django.conf import settings from django.contrib.auth import models as auth_models from django.db import models import facepy import simplejson from facebook_auth import utils class FacebookUser(auth_models.User): user_id = models.BigIntegerField(unique=True) access_token = models....
from django.contrib.auth import models as auth_models from django.db import models import facepy import simplejson from facebook_auth import utils class FacebookUser(auth_models.User): user_id = models.BigIntegerField(unique=True) access_token = models.TextField(blank=True, null=True) app_friends = models...
Revert "Add support for server side authentication."
Revert "Add support for server side authentication." This reverts commit 10ae930f6f14c2840d0b87cbec17054b4cc318d2. Change-Id: Ied52c31f6f28ad635a6e5dae2171df22dc91e42c Reviewed-on: http://review.pozytywnie.pl:8080/5153 Reviewed-by: Tomasz Wysocki <f17c2dc043305c950a029074ababd304e0373387@gmail.com> Tested-by: Tomasz ...
Python
mit
jgoclawski/django-facebook-auth,pozytywnie/django-facebook-auth,pozytywnie/django-facebook-auth,jgoclawski/django-facebook-auth
4378aef47a7e2b80a4a22af2bbe69ce4b780ab6d
pokr/views/login.py
pokr/views/login.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- from flask import g, render_template, redirect, request, url_for from flask.ext.login import current_user, login_required, logout_user from social.apps.flask_app.template_filters import backends def register(app): @login_required @app.route('/done/') def ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from flask import g, render_template, redirect, request, url_for from flask.ext.login import current_user, login_required, logout_user from social.apps.flask_app.template_filters import backends def register(app): @login_required @app.route('/done/') def ...
Fix due to Flask-Login version up
Fix due to Flask-Login version up
Python
apache-2.0
teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr
f935eb48517627df679605aaee834165380d74db
django_db_geventpool/backends/postgresql_psycopg2/creation.py
django_db_geventpool/backends/postgresql_psycopg2/creation.py
# coding=utf-8 import django from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation as OriginalDatabaseCreation class DatabaseCreationMixin16(object): def _create_test_db(self, verbosity, autoclobber): self.connection.closeall() return super(DatabaseCreationMixin16, self)._c...
# coding=utf-8 import django from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation as OriginalDatabaseCreation class DatabaseCreationMixin16(object): def _create_test_db(self, verbosity, autoclobber): self.connection.closeall() return super(DatabaseCreationMixin16, self)._c...
Fix DatabaseCreation from django 1.7
Fix DatabaseCreation from django 1.7
Python
apache-2.0
jneight/django-db-geventpool,PreppyLLC-opensource/django-db-geventpool
385655debed235fcb32e70a3f506a6885f3e4e67
c2cgeoportal/views/echo.py
c2cgeoportal/views/echo.py
from base64 import b64encode import os.path import re from pyramid.httpexceptions import HTTPBadRequest from pyramid.response import Response from pyramid.view import view_config def json_base64_encode_chunks(file, chunk_size=65536): """ Generate a JSON-wrapped base64-encoded string. See http://en.wikipe...
from base64 import b64encode import os.path import re from pyramid.httpexceptions import HTTPBadRequest from pyramid.response import Response from pyramid.view import view_config def json_base64_encode_chunks(file, chunk_size=65536): """ Generate a JSON-wrapped base64-encoded string. See http://en.wikipe...
Add success=true to satisfy Ext
Add success=true to satisfy Ext
Python
bsd-2-clause
tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal
c1d889f637d6d2a931f81332a9eef3974dfa18e0
code/marv/marv/__init__.py
code/marv/marv/__init__.py
# Copyright 2016 - 2018 Ternaris. # SPDX-License-Identifier: AGPL-3.0-only import sys from pkg_resources import iter_entry_points from marv_node.io import Abort from marv_node.io import create_group from marv_node.io import create_stream from marv_node.io import fork from marv_node.io import get_logger from marv_no...
# Copyright 2016 - 2018 Ternaris. # SPDX-License-Identifier: AGPL-3.0-only from marv_node.io import Abort from marv_node.io import create_group from marv_node.io import create_stream from marv_node.io import fork from marv_node.io import get_logger from marv_node.io import get_requested from marv_node.io import get_s...
Drop unused support to add decorators via entry points
Drop unused support to add decorators via entry points
Python
agpl-3.0
ternaris/marv-robotics,ternaris/marv-robotics
4c52b8f63fea11278536ec6800305b01d9bd02a8
blazar/plugins/dummy_vm_plugin.py
blazar/plugins/dummy_vm_plugin.py
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Add update_reservation to dummy plugin
Add update_reservation to dummy plugin update_reservation is now an abstract method. It needs to be added to all plugins. Change-Id: I921878bd5233613b804b17813af1aac5bdfed9e7 (cherry picked from commit 1dbc30202bddfd4f03bdc9a8005de3c363d2ac1d)
Python
apache-2.0
ChameleonCloud/blazar,ChameleonCloud/blazar
157197b330360ccfeaa0bbf54453702ee17d0106
Code/Python/Kamaelia/Kamaelia/Device/__init__.py
Code/Python/Kamaelia/Kamaelia/Device/__init__.py
# Needed to allow import # # Copyright (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser Gener...
# -*- coding: utf-8 -*- # Needed to allow import # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache Lice...
Change license to Apache 2
Change license to Apache 2
Python
apache-2.0
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
6f60f6257cbcd0328fcdb0873d88d55772731ba4
api/app.py
api/app.py
from flask import Flask from flask import request from flask import jsonify from y_text_recommender_system.recommender import recommend app = Flask(__name__) class InvalidUsage(Exception): status_code = 400 def __init__(self, message, payload=None): Exception.__init__(self) self.message = m...
from flask import Flask from flask import request from flask import jsonify from y_text_recommender_system.recommender import recommend app = Flask(__name__) class InvalidUsage(Exception): status_code = 400 def __init__(self, message, payload=None): Exception.__init__(self) self.message = m...
Refactor to separate the function to clean the data
Refactor to separate the function to clean the data
Python
mit
joaojunior/y_text_recommender_system
7785d3129d089ce99aee340b3a72fd78d7e8f556
send.py
send.py
import os sender = str(raw_input("Your Username: ")) target = str(raw_input("Target's Username: ")) message = str(raw_input("Message: ")) #Messages are encoded like so "senderProgramVx.x##target##sender##message" #Example: "linuxV1.8##person87##NickGeek##Hey mate! What do you think of this WiN thing?" formattedMessag...
import os if os.path.exists("account.conf") is False: sender = str(raw_input("Your Username: ")) accountFile = open('account.conf', 'w+') accountFile.write(sender) accountFile.close() else: accountFile = open('account.conf', 'r') sender = accountFile.read() accountFile.close() target = str(raw_input("Target's ...
Store your username in a file
Store your username in a file
Python
mit
NickGeek/WiN,NickGeek/WiN,NickGeek/WiN
42e4f42901872433f90dd84d5acf04fec76ab7f3
curious/commands/exc.py
curious/commands/exc.py
class CommandsError(Exception): pass class CheckFailureError(Exception): def __init__(self, ctx, check): self.ctx = ctx self.check = check def __repr__(self): if isinstance(self.check, list): return "The checks for {.name} failed.".format(self.ctx) return "The ...
class CommandsError(Exception): pass class CheckFailureError(Exception): def __init__(self, ctx, check): self.ctx = ctx self.check = check def __repr__(self): if isinstance(self.check, list): return "The checks for `{.name}` failed.".format(self.ctx) return "Th...
Add better __repr__s for commands errors.
Add better __repr__s for commands errors.
Python
mit
SunDwarf/curious
d8179c0006fb5b9983898e4cd93ffacfe3fdd54f
caminae/mapentity/templatetags/convert_tags.py
caminae/mapentity/templatetags/convert_tags.py
import urllib from django import template from django.conf import settings register = template.Library() @register.simple_tag def convert_url(request, sourceurl, format='pdf'): fullurl = request.build_absolute_uri(sourceurl) conversion_url = "%s?url=%s&to=%s" % (settings.CONVERSION_SERVER, ...
import urllib from mimetypes import types_map from django import template from django.conf import settings register = template.Library() @register.simple_tag def convert_url(request, sourceurl, format='pdf'): if '/' not in format: extension = '.' + format if not format.startswith('.') else format ...
Support conversion format as extension, instead of mimetype
Support conversion format as extension, instead of mimetype
Python
bsd-2-clause
makinacorpus/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,johan--/Geotrek,camillemonchicourt/Geotrek,johan--/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,camillemo...
e853e0137e59314f5101c178c74fd626984c34ac
pygraphc/similarity/LogTextSimilarity.py
pygraphc/similarity/LogTextSimilarity.py
from pygraphc.preprocess.PreprocessLog import PreprocessLog from pygraphc.similarity.StringSimilarity import StringSimilarity from itertools import combinations class LogTextSimilarity(object): """A class for calculating cosine similarity between a log pair. This class is intended for non-graph based clust...
from pygraphc.preprocess.PreprocessLog import PreprocessLog from pygraphc.similarity.StringSimilarity import StringSimilarity from itertools import combinations class LogTextSimilarity(object): """A class for calculating cosine similarity between a log pair. This class is intended for non-graph based clust...
Change input from previous processing not from a file
Change input from previous processing not from a file
Python
mit
studiawan/pygraphc