commit
stringlengths
40
40
old_file
stringlengths
5
117
new_file
stringlengths
5
117
old_contents
stringlengths
0
1.93k
new_contents
stringlengths
19
3.3k
subject
stringlengths
17
320
message
stringlengths
18
3.28k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
42.4k
completion
stringlengths
19
3.3k
prompt
stringlengths
21
3.65k
67e0d2b943ef467cfef46f71195f205b1be15a0a
cms/__init__.py
cms/__init__.py
# -*- coding: utf-8 -*- __version__ = '2.3.5pbs.19' # patch settings try: from django.conf import settings if 'cms' in settings.INSTALLED_APPS: from conf import patch_settings patch_settings() except ImportError: # pragma: no cover """ This exception means that either the application is...
# -*- coding: utf-8 -*- __version__ = '2.3.5pbs.20' # patch settings try: from django.conf import settings if 'cms' in settings.INSTALLED_APPS: from conf import patch_settings patch_settings() except ImportError: # pragma: no cover """ This exception means that either the application is...
Bump version as instructed by bamboo.
Bump version as instructed by bamboo.
Python
bsd-3-clause
pbs/django-cms,pbs/django-cms,pbs/django-cms,pbs/django-cms
# -*- coding: utf-8 -*- __version__ = '2.3.5pbs.20' # patch settings try: from django.conf import settings if 'cms' in settings.INSTALLED_APPS: from conf import patch_settings patch_settings() except ImportError: # pragma: no cover """ This exception means that either the application is...
Bump version as instructed by bamboo. # -*- coding: utf-8 -*- __version__ = '2.3.5pbs.19' # patch settings try: from django.conf import settings if 'cms' in settings.INSTALLED_APPS: from conf import patch_settings patch_settings() except ImportError: # pragma: no cover """ This exceptio...
81faa7704fb355dd16674d4ed089e0ced34c24c6
rflo/start.py
rflo/start.py
import ioflo.app.run import os class Manager(object): ''' Manage the main ioflo process ''' def __init__(self): self.behaviors = ['rflo.config', 'rflo.roads'] self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo') def start(self): ioflo.app.run.start( ...
import ioflo.app.run import os class Manager(object): ''' Manage the main ioflo process ''' def __init__(self): self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router'] self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo') def start(self): ioflo.app.run...
Add router to the behaviors lookup
Add router to the behaviors lookup
Python
apache-2.0
thatch45/rflo
import ioflo.app.run import os class Manager(object): ''' Manage the main ioflo process ''' def __init__(self): self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router'] self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo') def start(self): ioflo.app.run...
Add router to the behaviors lookup import ioflo.app.run import os class Manager(object): ''' Manage the main ioflo process ''' def __init__(self): self.behaviors = ['rflo.config', 'rflo.roads'] self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo') def start(self): ...
f349753417682960e607b458a009fbfd324de7ab
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup execfile('kronos/version.py') setup( name = 'django-kronos', version = __version__, description = 'Kronos is a Django application that makes it easy to define and schedule tasks with cron.', long_description = open('README.rst').read(), author = ...
#!/usr/bin/env python from setuptools import setup execfile('kronos/version.py') readme = open('README.rst').read() history = open('HISTORY.rst').read() setup( name = 'django-kronos', version = __version__, description = 'Kronos is a Django application that makes it easy to define and schedule tasks wit...
Add history to long description
Add history to long description
Python
mit
jeanbaptistelab/django-kronos,jeanbaptistelab/django-kronos,joshblum/django-kronos,jgorset/django-kronos,jgorset/django-kronos,joshblum/django-kronos
#!/usr/bin/env python from setuptools import setup execfile('kronos/version.py') readme = open('README.rst').read() history = open('HISTORY.rst').read() setup( name = 'django-kronos', version = __version__, description = 'Kronos is a Django application that makes it easy to define and schedule tasks wit...
Add history to long description #!/usr/bin/env python from setuptools import setup execfile('kronos/version.py') setup( name = 'django-kronos', version = __version__, description = 'Kronos is a Django application that makes it easy to define and schedule tasks with cron.', long_description = open('R...
f109f24e8f10d1fd3f8940c0eb54b157aa9ed909
content/test/gpu/gpu_tests/pixel_expectations.py
content/test/gpu/gpu_tests/pixel_expectations.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
Mark pixel tests as failing on all platform
Mark pixel tests as failing on all platform BUG=511580 R=kbr@chromium.org Review URL: https://codereview.chromium.org/1245243003 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340191}
Python
bsd-3-clause
Just-D/chromium-1,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,Pluto-tv/chrom...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
Mark pixel tests as failing on all platform BUG=511580 R=kbr@chromium.org Review URL: https://codereview.chromium.org/1245243003 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340191} # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style lic...
63143c94cef353d7bae13f7b13650801bb901c94
tests/unicode/unicode_pos.py
tests/unicode/unicode_pos.py
# str methods with explicit start/end pos print("Привет".startswith("П")) print("Привет".startswith("р", 1)) print("абвба".find("а", 1)) print("абвба".find("а", 1, -1))
Test for explicit start/end args to str methods for unicode.
tests: Test for explicit start/end args to str methods for unicode.
Python
mit
hiway/micropython,martinribelotta/micropython,tdautc19841202/micropython,supergis/micropython,torwag/micropython,pfalcon/micropython,galenhz/micropython,TDAbboud/micropython,kerneltask/micropython,heisewangluo/micropython,kerneltask/micropython,pozetroninc/micropython,ericsnowcurrently/micropython,ernesto-g/micropython...
# str methods with explicit start/end pos print("Привет".startswith("П")) print("Привет".startswith("р", 1)) print("абвба".find("а", 1)) print("абвба".find("а", 1, -1))
tests: Test for explicit start/end args to str methods for unicode.
3a87b03ed42232f7daa96242142f48872bf26634
readthedocs/gold/models.py
readthedocs/gold/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ LEVEL_CHOICES = ( ('v1-org-5', '$5/mo'), ('v1-org-10', '$10/mo'), ('v1-org-15', '$15/mo'), ('v1-org-20', '$20/mo'), ('v1-org-50', '$50/mo'), ('v1-org-100', '$100/mo'), ) class GoldUser(models.Model): pub_...
from django.db import models from django.utils.translation import ugettext_lazy as _ LEVEL_CHOICES = ( ('v1-org-5', '$5/mo'), ('v1-org-10', '$10/mo'), ('v1-org-15', '$15/mo'), ('v1-org-20', '$20/mo'), ('v1-org-50', '$50/mo'), ('v1-org-100', '$100/mo'), ) class GoldUser(models.Model): pub_...
Add nicer string rep for gold user
Add nicer string rep for gold user
Python
mit
jerel/readthedocs.org,CedarLogic/readthedocs.org,sunnyzwh/readthedocs.org,sils1297/readthedocs.org,rtfd/readthedocs.org,espdev/readthedocs.org,raven47git/readthedocs.org,sunnyzwh/readthedocs.org,safwanrahman/readthedocs.org,takluyver/readthedocs.org,fujita-shintaro/readthedocs.org,sid-kap/readthedocs.org,laplaceliu/rea...
from django.db import models from django.utils.translation import ugettext_lazy as _ LEVEL_CHOICES = ( ('v1-org-5', '$5/mo'), ('v1-org-10', '$10/mo'), ('v1-org-15', '$15/mo'), ('v1-org-20', '$20/mo'), ('v1-org-50', '$50/mo'), ('v1-org-100', '$100/mo'), ) class GoldUser(models.Model): pub_...
Add nicer string rep for gold user from django.db import models from django.utils.translation import ugettext_lazy as _ LEVEL_CHOICES = ( ('v1-org-5', '$5/mo'), ('v1-org-10', '$10/mo'), ('v1-org-15', '$15/mo'), ('v1-org-20', '$20/mo'), ('v1-org-50', '$50/mo'), ('v1-org-100', '$100/mo'), ) cl...
8afb48e23b91efa3432ffad568002a46384eb021
fantasyland.py
fantasyland.py
import numpy as np import random import game as g import hand_optimizer game = g.PineappleGame1() NUM_ITERS = 1000 utilities = [] for iter_num in xrange(NUM_ITERS): print "{:5} / {:5}".format(iter_num, NUM_ITERS), '\r', draw = random.sample(game.cards, 14) utilities += [hand_optimizer.optimize_hand([[], [], [...
import argparse import numpy as np import random import game as g import hand_optimizer parser = argparse.ArgumentParser(description='Simulate fantasyland like situations.') parser.add_argument('--num-games', type=int, default=1000, help='number of games to play') parser.add_argument('--num-cards'...
Add command line interface to vary num-games and num-cards.
Add command line interface to vary num-games and num-cards.
Python
mit
session-id/pineapple-ai
import argparse import numpy as np import random import game as g import hand_optimizer parser = argparse.ArgumentParser(description='Simulate fantasyland like situations.') parser.add_argument('--num-games', type=int, default=1000, help='number of games to play') parser.add_argument('--num-cards'...
Add command line interface to vary num-games and num-cards. import numpy as np import random import game as g import hand_optimizer game = g.PineappleGame1() NUM_ITERS = 1000 utilities = [] for iter_num in xrange(NUM_ITERS): print "{:5} / {:5}".format(iter_num, NUM_ITERS), '\r', draw = random.sample(game.cards...
f755060a8999a1d6ba007f24dda9d00b9bb9d5dd
UI/sunc_menu.py
UI/sunc_menu.py
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui from qt_interfaces.sync_menu_ui import Ui_SyncMenu # Synchronization menu section # class SyncMenuUI(QtGui.QMainWindow): def __init__(self, parent=None,): QtGui.QWidget.__init__(self, parent) self.sync_menu_ui = Ui_SyncMenu() self.sy...
Add sync menu backend init
Add sync menu backend init
Python
mit
lakewik/storj-gui-client
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui from qt_interfaces.sync_menu_ui import Ui_SyncMenu # Synchronization menu section # class SyncMenuUI(QtGui.QMainWindow): def __init__(self, parent=None,): QtGui.QWidget.__init__(self, parent) self.sync_menu_ui = Ui_SyncMenu() self.sy...
Add sync menu backend init
f7d83caae3264d86420ce654f3669175c284a82d
ocradmin/core/decorators.py
ocradmin/core/decorators.py
# Miscellaneos functions relating the projects app import os from datetime import datetime from django.http import HttpResponseRedirect from django.utils.http import urlquote from django.conf import settings def project_required(func): """ Decorator function for other actions that require a project to be ...
# Miscellaneos functions relating the projects app import os from datetime import datetime from django.http import HttpResponseRedirect from django.utils.http import urlquote from django.conf import settings def project_required(func): """ Decorator function for other actions that require a project to be ...
Add project as request attribute to save a little boilerplate
Add project as request attribute to save a little boilerplate
Python
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
# Miscellaneos functions relating the projects app import os from datetime import datetime from django.http import HttpResponseRedirect from django.utils.http import urlquote from django.conf import settings def project_required(func): """ Decorator function for other actions that require a project to be ...
Add project as request attribute to save a little boilerplate # Miscellaneos functions relating the projects app import os from datetime import datetime from django.http import HttpResponseRedirect from django.utils.http import urlquote from django.conf import settings def project_required(func): """ Decorat...
b812843f03fd0da920872c109132aee7fae82b3a
tests/instancing_tests/NonterminalsTest.py
tests/instancing_tests/NonterminalsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
Add test of deleteing child for nonterminal
Add test of deleteing child for nonterminal
Python
mit
PatrikValkovic/grammpy
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
Add test of deleteing child for nonterminal #!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): p...
f50644484f4b05fbb25adfd6430b6207441d8b2e
src/ggrc_basic_permissions/migrations/versions/20131008124800_8f33d9bd2043_fix_system_roles.py
src/ggrc_basic_permissions/migrations/versions/20131008124800_8f33d9bd2043_fix_system_roles.py
""" Revision ID: 8f33d9bd2043 Revises: 758b4012b5f Create Date: 2013-09-20 14:12:32.846302 """ # revision identifiers, used by Alembic. revision = '8f33d9bd2043' down_revision = '758b4012b5f' import json import sqlalchemy as sa from alembic import op from datetime import datetime from sqlalchemy.sql import table, c...
Add migration to fix system roles
Add migration to fix system roles * `ObjectEditor` and `Reader` were missing `ProgramDirective`, `ProgramControl`, and `Person` permissions (CRUD, except `Person`, which is CRU. * `ObjectControl` and `ObjectDocument` were combined due to a missing comma in a previous migration.
Python
apache-2.0
hasanalom/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,hasanalom/ggrc-core,j0gurt/ggrc-core,uskudnik/ggrc-core,uskudnik/ggrc-core,hyperNURb/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-c...
""" Revision ID: 8f33d9bd2043 Revises: 758b4012b5f Create Date: 2013-09-20 14:12:32.846302 """ # revision identifiers, used by Alembic. revision = '8f33d9bd2043' down_revision = '758b4012b5f' import json import sqlalchemy as sa from alembic import op from datetime import datetime from sqlalchemy.sql import table, c...
Add migration to fix system roles * `ObjectEditor` and `Reader` were missing `ProgramDirective`, `ProgramControl`, and `Person` permissions (CRUD, except `Person`, which is CRU. * `ObjectControl` and `ObjectDocument` were combined due to a missing comma in a previous migration.
a1cf304f9941b811b33e1b2d786b6f38bc514546
anafero/templatetags/anafero_tags.py
anafero/templatetags/anafero_tags.py
from django import template from django.contrib.contenttypes.models import ContentType from anafero.models import ReferralResponse, ACTION_DISPLAY register = template.Library() @register.inclusion_tag("anafero/_create_referral_form.html") def create_referral(url, obj=None): if obj: return {"url": url,...
from django import template from django.contrib.contenttypes.models import ContentType from anafero.models import ReferralResponse, ACTION_DISPLAY register = template.Library() @register.inclusion_tag("anafero/_create_referral_form.html", takes_context=True) def create_referral(context, url, obj=None): if obj...
Add full context to the create_referral tag
Add full context to the create_referral tag
Python
mit
pinax/pinax-referrals,pinax/pinax-referrals
from django import template from django.contrib.contenttypes.models import ContentType from anafero.models import ReferralResponse, ACTION_DISPLAY register = template.Library() @register.inclusion_tag("anafero/_create_referral_form.html", takes_context=True) def create_referral(context, url, obj=None): if obj...
Add full context to the create_referral tag from django import template from django.contrib.contenttypes.models import ContentType from anafero.models import ReferralResponse, ACTION_DISPLAY register = template.Library() @register.inclusion_tag("anafero/_create_referral_form.html") def create_referral(url, obj=No...
d54544ecf6469eedce80d6d3180aa826c1fcc19a
cpgintegrate/__init__.py
cpgintegrate/__init__.py
import pandas import traceback import typing def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame: def get_frames(): for file in file_iterator: df = processor(file) yield (df .assign(Source=getattr(file, 'n...
import pandas import typing def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame: def get_frames(): for file in file_iterator: source = getattr(file, 'name', None) subject_id = getattr(file, 'cpgintegrate_subject_id', None) ...
Add file source and subjectID to processing exceptions
Add file source and subjectID to processing exceptions
Python
agpl-3.0
PointyShinyBurning/cpgintegrate
import pandas import typing def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame: def get_frames(): for file in file_iterator: source = getattr(file, 'name', None) subject_id = getattr(file, 'cpgintegrate_subject_id', None) ...
Add file source and subjectID to processing exceptions import pandas import traceback import typing def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame: def get_frames(): for file in file_iterator: df = processor(file) yiel...
8d471b5b7a8f57214afe79783f09afa97c5d2bfc
entropy/__init__.py
entropy/__init__.py
import entropy._entropy as _entropy def entropy(data): """Compute the Shannon entropy of the given string. Returns a floating point value indicating how many bits of entropy there are per octet in the string.""" return _entropy.shannon_entropy(data) if __name__ == '__main__': print entropy('\n'.join(file(__file...
import entropy._entropy as _entropy def entropy(data): """Compute the Shannon entropy of the given string. Returns a floating point value indicating how many bits of entropy there are per octet in the string.""" return _entropy.shannon_entropy(data) def absolute_entropy(data): """Compute the "absolute" entropy ...
Add absolute and relative entropy functions.
Add absolute and relative entropy functions.
Python
bsd-3-clause
chachalaca/py-entropy,billthebrute/py-entropy,chachalaca/py-entropy,billthebrute/py-entropy
import entropy._entropy as _entropy def entropy(data): """Compute the Shannon entropy of the given string. Returns a floating point value indicating how many bits of entropy there are per octet in the string.""" return _entropy.shannon_entropy(data) def absolute_entropy(data): """Compute the "absolute" entropy ...
Add absolute and relative entropy functions. import entropy._entropy as _entropy def entropy(data): """Compute the Shannon entropy of the given string. Returns a floating point value indicating how many bits of entropy there are per octet in the string.""" return _entropy.shannon_entropy(data) if __name__ == '_...
b3a8a187cb6e569229d7e6d2929377035790f7de
virtool/dev/api.py
virtool/dev/api.py
from logging import getLogger from virtool.api.response import no_content from virtool.fake.wrapper import FakerWrapper from virtool.http.routes import Routes from virtool.samples.fake import create_fake_samples from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction from virt...
from logging import getLogger from virtool.api.response import no_content from virtool.fake.wrapper import FakerWrapper from virtool.http.routes import Routes from virtool.samples.fake import create_fake_sample from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction from virto...
Fix handling of create_sample command on dev API endpoint
Fix handling of create_sample command on dev API endpoint This was completely broken.
Python
mit
virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool
from logging import getLogger from virtool.api.response import no_content from virtool.fake.wrapper import FakerWrapper from virtool.http.routes import Routes from virtool.samples.fake import create_fake_sample from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction from virto...
Fix handling of create_sample command on dev API endpoint This was completely broken. from logging import getLogger from virtool.api.response import no_content from virtool.fake.wrapper import FakerWrapper from virtool.http.routes import Routes from virtool.samples.fake import create_fake_samples from virtool.subtrac...
0aa6a648fff39b013f9b644d9a894db39706df43
amplpy/amplpython/__init__.py
amplpy/amplpython/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import ctypes import platform if platform.system() == 'Windows': lib32 = os.path.join(os.path.dirname(__file__), 'lib32') lib64 = os.path.join(os.path.dirname(__file__), 'lib64') from glob import glob try: if ctypes.sizeo...
# -*- coding: utf-8 -*- import os import sys import ctypes import platform if platform.system() == 'Windows': lib32 = os.path.join(os.path.dirname(__file__), 'lib32') lib64 = os.path.join(os.path.dirname(__file__), 'lib64') from glob import glob try: if ctypes.sizeof(ctypes.c_voidp) == 4: ...
Fix 'ModuleNotFoundError: No module named amplpython'
Fix 'ModuleNotFoundError: No module named amplpython'
Python
bsd-3-clause
ampl/amplpy,ampl/amplpy,ampl/amplpy
# -*- coding: utf-8 -*- import os import sys import ctypes import platform if platform.system() == 'Windows': lib32 = os.path.join(os.path.dirname(__file__), 'lib32') lib64 = os.path.join(os.path.dirname(__file__), 'lib64') from glob import glob try: if ctypes.sizeof(ctypes.c_voidp) == 4: ...
Fix 'ModuleNotFoundError: No module named amplpython' # -*- coding: utf-8 -*- from __future__ import absolute_import import os import ctypes import platform if platform.system() == 'Windows': lib32 = os.path.join(os.path.dirname(__file__), 'lib32') lib64 = os.path.join(os.path.dirname(__file__), 'lib64') ...
a329770bdd5fdc6a646d6a0b298f0a67c789f86a
resolwe/flow/migrations/0029_storage_m2m.py
resolwe/flow/migrations/0029_storage_m2m.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-02-26 04:08 from __future__ import unicode_literals from django.db import migrations, models def set_data_relation(apps, schema_editor): Data = apps.get_model('flow', 'Data') Storage = apps.get_model('flow', 'Storage') for data in Data.object...
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-02-26 04:08 from __future__ import unicode_literals from django.db import migrations, models def set_data_relation(apps, schema_editor): Storage = apps.get_model('flow', 'Storage') for storage in Storage.objects.all(): storage.data.add(st...
Fix storage migration to process all storages
Fix storage migration to process all storages
Python
apache-2.0
genialis/resolwe,genialis/resolwe
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-02-26 04:08 from __future__ import unicode_literals from django.db import migrations, models def set_data_relation(apps, schema_editor): Storage = apps.get_model('flow', 'Storage') for storage in Storage.objects.all(): storage.data.add(st...
Fix storage migration to process all storages # -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-02-26 04:08 from __future__ import unicode_literals from django.db import migrations, models def set_data_relation(apps, schema_editor): Data = apps.get_model('flow', 'Data') Storage = apps.get_model(...
77d491ea43fcd00dcfcee1f0b9c2fdb50dc50c8e
tests/test_models.py
tests/test_models.py
import unittest from datetime import datetime from twofa import create_app, db from twofa.models import User class UserTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') db.create_all() def tearDown(self): db.session.remove() db.drop_all() def ...
import unittest from twofa import create_app, db from twofa.models import User from unittest.mock import patch class UserTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.user = User( 'example@example.com', 'fakepassword', 'Ali...
Add some tests for the model
Add some tests for the model
Python
mit
TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask
import unittest from twofa import create_app, db from twofa.models import User from unittest.mock import patch class UserTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.user = User( 'example@example.com', 'fakepassword', 'Ali...
Add some tests for the model import unittest from datetime import datetime from twofa import create_app, db from twofa.models import User class UserTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') db.create_all() def tearDown(self): db.session.remove() ...
8ab1e018319fc7fc3837f1d8d1dd59a0dc3f2eb5
tests/compiler/test_conditional_compilation.py
tests/compiler/test_conditional_compilation.py
from tests.compiler import compile_snippet, STATIC_START, internal_call from thinglang.compiler.opcodes import OpcodePushStatic, OpcodeJumpConditional, OpcodeJump PREFIX = [ OpcodePushStatic(STATIC_START), OpcodePushStatic(STATIC_START + 1), internal_call('text.__equals__'), ] def test_simple_conditional(...
Add test for conditional compilation
Add test for conditional compilation
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
from tests.compiler import compile_snippet, STATIC_START, internal_call from thinglang.compiler.opcodes import OpcodePushStatic, OpcodeJumpConditional, OpcodeJump PREFIX = [ OpcodePushStatic(STATIC_START), OpcodePushStatic(STATIC_START + 1), internal_call('text.__equals__'), ] def test_simple_conditional(...
Add test for conditional compilation
4a7f152e5feb9393ae548f239b2cbf2d8cee3c4e
modules/email.py
modules/email.py
# -*- coding: utf-8 -*- from jinja2 import Template import sender from imapclient import IMAPClient import socket import logging import time class email: def __init__(self, config): self.logger = logging.getLogger('app_logger') self.server = config['host'] self.port = config['port'] ...
# -*- coding: utf-8 -*- from jinja2 import Template import sender from imapclient import IMAPClient import socket import logging import time class email: def __init__(self, config): self.logger = logging.getLogger('app_logger') self.server = config['host'] self.port = config['port'] ...
Fix service name when we failed to send a mail.
Fix service name when we failed to send a mail. This solves issue #3.
Python
apache-2.0
Lex-Persona/SupExt
# -*- coding: utf-8 -*- from jinja2 import Template import sender from imapclient import IMAPClient import socket import logging import time class email: def __init__(self, config): self.logger = logging.getLogger('app_logger') self.server = config['host'] self.port = config['port'] ...
Fix service name when we failed to send a mail. This solves issue #3. # -*- coding: utf-8 -*- from jinja2 import Template import sender from imapclient import IMAPClient import socket import logging import time class email: def __init__(self, config): self.logger = logging.getLogger('app_logger') ...
d4e8839ac02935b86c1634848476a9a8512c376d
delivery_transsmart/models/res_partner.py
delivery_transsmart/models/res_partner.py
# -*- coding: utf-8 -*- ############################################################################## # # Delivery Transsmart Ingegration # © 2016 - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gene...
# -*- coding: utf-8 -*- ############################################################################## # # Delivery Transsmart Ingegration # © 2016 - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gene...
Remove double product field definitions
[DEL] Remove double product field definitions
Python
agpl-3.0
1200wd/1200wd_addons,1200wd/1200wd_addons
# -*- coding: utf-8 -*- ############################################################################## # # Delivery Transsmart Ingegration # © 2016 - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gene...
[DEL] Remove double product field definitions # -*- coding: utf-8 -*- ############################################################################## # # Delivery Transsmart Ingegration # © 2016 - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify...
aff8cebfd168493a4a9dff77cf9722507429d570
contrib/examples/actions/pythonactions/isprime.py
contrib/examples/actions/pythonactions/isprime.py
import math class PrimeChecker(object): def run(self, **kwargs): return self._is_prime(**kwargs) def _is_prime(self, value=0): if math.floor(value) != value: raise ValueError('%s should be an integer.' % value) if value < 2: return False for test in ra...
import math class PrimeChecker(object): def run(self, value=0): if math.floor(value) != value: raise ValueError('%s should be an integer.' % value) if value < 2: return False for test in range(2, int(math.floor(math.sqrt(value)))+1): if value % test == ...
Update pythonaction sample for simpler run.
Update pythonaction sample for simpler run.
Python
apache-2.0
peak6/st2,lakshmi-kannan/st2,pixelrebel/st2,StackStorm/st2,jtopjian/st2,pinterb/st2,Plexxi/st2,punalpatel/st2,armab/st2,grengojbo/st2,grengojbo/st2,punalpatel/st2,pixelrebel/st2,Itxaka/st2,lakshmi-kannan/st2,emedvedev/st2,lakshmi-kannan/st2,pixelrebel/st2,nzlosh/st2,peak6/st2,dennybaa/st2,pinterb/st2,Plexxi/st2,nzlosh/...
import math class PrimeChecker(object): def run(self, value=0): if math.floor(value) != value: raise ValueError('%s should be an integer.' % value) if value < 2: return False for test in range(2, int(math.floor(math.sqrt(value)))+1): if value % test == ...
Update pythonaction sample for simpler run. import math class PrimeChecker(object): def run(self, **kwargs): return self._is_prime(**kwargs) def _is_prime(self, value=0): if math.floor(value) != value: raise ValueError('%s should be an integer.' % value) if value < 2: ...
371df3363677118d59315e66523aefb081c67282
astroML/plotting/settings.py
astroML/plotting/settings.py
def setup_text_plots(fontsize=8, usetex=True): """ This function adjusts matplotlib settings so that all figures in the textbook have a uniform format and look. """ import matplotlib matplotlib.rc('legend', fontsize=fontsize, handlelength=3) matplotlib.rc('axes', titlesize=fontsize) matp...
def setup_text_plots(fontsize=8, usetex=True): """ This function adjusts matplotlib settings so that all figures in the textbook have a uniform format and look. """ import matplotlib from distutils.version import LooseVersion matplotlib.rc('legend', fontsize=fontsize, handlelength=3) mat...
Update the mpl rcparams for mpl 2.0+
Update the mpl rcparams for mpl 2.0+
Python
bsd-2-clause
astroML/astroML
def setup_text_plots(fontsize=8, usetex=True): """ This function adjusts matplotlib settings so that all figures in the textbook have a uniform format and look. """ import matplotlib from distutils.version import LooseVersion matplotlib.rc('legend', fontsize=fontsize, handlelength=3) mat...
Update the mpl rcparams for mpl 2.0+ def setup_text_plots(fontsize=8, usetex=True): """ This function adjusts matplotlib settings so that all figures in the textbook have a uniform format and look. """ import matplotlib matplotlib.rc('legend', fontsize=fontsize, handlelength=3) matplotlib.r...
11be4b77e84c721ef8de583b0dcf1035367d4b25
libtmux/__about__.py
libtmux/__about__.py
__title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.8.0' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tmux-python/libtmux' __license__ = 'MIT' __copyright__ = 'Copyright 2016-2018 Tony Narlock'
__title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.8.0' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tmux-python/libtmux' __pypi__ = 'https://pypi.python.org/pypi/libtmux' __license__ = 'MIT' __copyrigh...
Add __pypi__ url to metadata
Add __pypi__ url to metadata
Python
bsd-3-clause
tony/libtmux
__title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.8.0' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tmux-python/libtmux' __pypi__ = 'https://pypi.python.org/pypi/libtmux' __license__ = 'MIT' __copyrigh...
Add __pypi__ url to metadata __title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.8.0' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tmux-python/libtmux' __license__ = 'MIT' __copyright__ = 'Copyright 201...
6dc47f932b5c7f84918ec730b3ccd03d74070453
app/py/cuda_sort/app_specific.py
app/py/cuda_sort/app_specific.py
import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line(n-1)=='': n-=1 return [ed.get_text_line(i) for ...
import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line(n-1)=='': n-=1 return [ed.get_text_line(i) for ...
Sort plg: fix caret pos after 'delete empty lines'
Sort plg: fix caret pos after 'delete empty lines'
Python
mpl-2.0
Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText
import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line(n-1)=='': n-=1 return [ed.get_text_line(i) for ...
Sort plg: fix caret pos after 'delete empty lines' import os from cudatext import * def get_ini_fn(): return os.path.join(app_path(APP_DIR_SETTINGS), 'cuda_sort.ini') def ed_set_text_all(lines): ed.set_text_all('\n'.join(lines)+'\n') def ed_get_text_all(): n = ed.get_line_count() if ed.get_text_line...
a3053c843a5709d3fd0fe1dc6c93f369dc101d8b
setup.py
setup.py
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ckan-service-provider', version=version, description="A server that can server jobs at services.", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_cla...
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ckanserviceprovider', version=version, description="A server that can server jobs at services.", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_class...
Rename the package so that it does not contain -
Rename the package so that it does not contain -
Python
agpl-3.0
ESRC-CDRC/ckan-service-provider,datawagovau/ckan-service-provider,deniszgonjanin/ckan-service-provider,ckan/ckan-service-provider
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ckanserviceprovider', version=version, description="A server that can server jobs at services.", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_class...
Rename the package so that it does not contain - from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ckan-service-provider', version=version, description="A server that can server jobs at services.", long_description="""\ """, classifiers=[], # Get strings fr...
d130a926c847f37f039dfff7c14140d933b7a6af
django/website/contacts/tests/test_group_permissions.py
django/website/contacts/tests/test_group_permissions.py
import pytest from django.contrib.auth.models import Permission, Group, ContentType from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_m...
import pytest from django.contrib.auth.models import Permission, Group, ContentType from django.core.exceptions import ObjectDoesNotExist from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Grou...
Test can't give group non-exsitent permission
Test can't give group non-exsitent permission
Python
agpl-3.0
aptivate/alfie,daniell/kashana,aptivate/alfie,aptivate/kashana,aptivate/alfie,aptivate/alfie,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/kashana,aptivate/kashana
import pytest from django.contrib.auth.models import Permission, Group, ContentType from django.core.exceptions import ObjectDoesNotExist from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Grou...
Test can't give group non-exsitent permission import pytest from django.contrib.auth.models import Permission, Group, ContentType from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objec...
d72eb62bc0afe1b37c675babed8373bd536de73c
python/challenges/plusMinus.py
python/challenges/plusMinus.py
""" Problem Statement: Given an array of integers, calculate which fraction of the elements are positive, negative, and zeroes, respectively. Print the decimal value of each fraction. Input Format: The first line, N, is the size of the array. The second line contains N space-separated integers describing the array of ...
import unittest """ Problem Statement: Given an array of integers, calculate which fraction of the elements are positive, negative, and zeroes, respectively. Print the decimal value of each fraction. Input Format: The first line, N, is the size of the array. The second line contains N space-separated integers describ...
Create way to compute ratios of each number type
Create way to compute ratios of each number type
Python
mit
markthethomas/algorithms,markthethomas/algorithms,markthethomas/algorithms,markthethomas/algorithms
import unittest """ Problem Statement: Given an array of integers, calculate which fraction of the elements are positive, negative, and zeroes, respectively. Print the decimal value of each fraction. Input Format: The first line, N, is the size of the array. The second line contains N space-separated integers describ...
Create way to compute ratios of each number type """ Problem Statement: Given an array of integers, calculate which fraction of the elements are positive, negative, and zeroes, respectively. Print the decimal value of each fraction. Input Format: The first line, N, is the size of the array. The second line contains N...
7e2440c00ce75dc3ff0eac53e63d629981a9873a
raven/contrib/celery/__init__.py
raven/contrib/celery/__init__.py
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ try: from celery.task import task except ImportError: from celery.decorators import task from celery.signals import task_failure from ra...
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ try: from celery.task import task except ImportError: from celery.decorators import task from celery.signals import task_failure from ra...
Fix celery task_failure signal definition
Fix celery task_failure signal definition
Python
bsd-3-clause
lepture/raven-python,recht/raven-python,lepture/raven-python,beniwohli/apm-agent-python,dbravender/raven-python,patrys/opbeat_python,recht/raven-python,jbarbuto/raven-python,getsentry/raven-python,akalipetis/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,patrys/opbeat_python,ewdurbin/raven-python,nikolas/rav...
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ try: from celery.task import task except ImportError: from celery.decorators import task from celery.signals import task_failure from ra...
Fix celery task_failure signal definition """ raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ try: from celery.task import task except ImportError: from celery.decorators import task from...
1eedac5229e5a9128c4fbc09f7d7b97a3859e9b9
django_sse/views.py
django_sse/views.py
# -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import HttpResponse from django.utils.decorators impo...
# -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import HttpResponse from django.utils.decorators import method_decorator from sse import S...
Remove duplicate import. (Thanks to MechanisM)
Remove duplicate import. (Thanks to MechanisM)
Python
bsd-3-clause
chadmiller/django-sse,niwinz/django-sse,chadmiller/django-sse
# -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import HttpResponse from django.utils.decorators import method_decorator from sse import S...
Remove duplicate import. (Thanks to MechanisM) # -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import...
b635b6f17e8fceba72e48ab074120d3bddd9388d
tools/process_EXO.py
tools/process_EXO.py
# EXO Convesion Script # Using specification v1.01 # J.C. Loach (2013) # Textual replacements remove = {r"\centering":"", r"newline":"", r"tabular":""}; # Main loop through data file with open("exo_data.txt") as f_in: for line in f_in: for i, j in remove.iteritems(): line = line.replace(i,j) line = l...
Add tool for converting EXO data from latex to JSON
Add tool for converting EXO data from latex to JSON
Python
apache-2.0
chrisstanford/persephone-darkside,nepahwin/persephone,nepahwin/persephone,chrisstanford/persephone-darkside
# EXO Convesion Script # Using specification v1.01 # J.C. Loach (2013) # Textual replacements remove = {r"\centering":"", r"newline":"", r"tabular":""}; # Main loop through data file with open("exo_data.txt") as f_in: for line in f_in: for i, j in remove.iteritems(): line = line.replace(i,j) line = l...
Add tool for converting EXO data from latex to JSON
234df393c438fdf729dc050d20084e1fe1a4c2ee
backend/mcapi/mcdir.py
backend/mcapi/mcdir.py
import utils from os import environ import os.path MCDIR = environ.get("MCDIR") or '/mcfs/data' def for_uid(uidstr): pieces = uidstr.split('-') path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4]) utils.mkdirp(path) return path
import utils from os import environ import os.path MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons' def for_uid(uidstr): pieces = uidstr.split('-') path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4]) utils.mkdirp(path) return path
Change directory where data is written to.
Change directory where data is written to.
Python
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
import utils from os import environ import os.path MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons' def for_uid(uidstr): pieces = uidstr.split('-') path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4]) utils.mkdirp(path) return path
Change directory where data is written to. import utils from os import environ import os.path MCDIR = environ.get("MCDIR") or '/mcfs/data' def for_uid(uidstr): pieces = uidstr.split('-') path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4]) utils.mkdirp(path) return path
9502c0e816097cf65fa92c6dd255c3356cf20964
test/api_class_repr_test.py
test/api_class_repr_test.py
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from __future__ import print_function import pytest from .. import jenkins_api from .framework import api_select from .cfg import ApiType @pytest.mark.not_apis(ApiType.MOCK, ApiT...
Test jenkis_api ApiJob and Invocation classes __repr__ methods
Test jenkis_api ApiJob and Invocation classes __repr__ methods
Python
bsd-3-clause
lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lhupfeldt/jenkinsflow
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from __future__ import print_function import pytest from .. import jenkins_api from .framework import api_select from .cfg import ApiType @pytest.mark.not_apis(ApiType.MOCK, ApiT...
Test jenkis_api ApiJob and Invocation classes __repr__ methods
90963666f22bea81d433724d232deaa0f3e2fec1
st2common/st2common/exceptions/db.py
st2common/st2common/exceptions/db.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add a special exception for capturing object conflicts.
Add a special exception for capturing object conflicts.
Python
apache-2.0
jtopjian/st2,StackStorm/st2,StackStorm/st2,emedvedev/st2,dennybaa/st2,StackStorm/st2,alfasin/st2,pixelrebel/st2,nzlosh/st2,Itxaka/st2,StackStorm/st2,dennybaa/st2,punalpatel/st2,Plexxi/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,grengojbo/st2,Itxaka/st2,jtopjian/st2,alfasin/st2,punalpatel/st2,peak6/st2,tonybaloney/st2,pin...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add a special exception for capturing object conflicts. # Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache L...
b0d13f4f6332e18390a1d8e0152e55b8fb2e780e
sdntest/examples/customtopo/triangle.py
sdntest/examples/customtopo/triangle.py
"""Custom topology example s1---s2 | / | / | / s3 Consist of three fixed core switches, and each core switches will connect to m hosts through n switches. """ from mininet.topo import Topo from optparse import OptionParser class MyTopo( Topo ): "Simple topology example." # def __init__( self ): def ...
Add a custom topology example
Add a custom topology example
Python
mit
snlab-freedom/sdntest,snlab-freedom/sdntest
"""Custom topology example s1---s2 | / | / | / s3 Consist of three fixed core switches, and each core switches will connect to m hosts through n switches. """ from mininet.topo import Topo from optparse import OptionParser class MyTopo( Topo ): "Simple topology example." # def __init__( self ): def ...
Add a custom topology example
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
# -*- 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 Ref #113 # -*- 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 Tr...
017d33a8fdcf55272613550c5360a998f201ad3d
services/gunicorn_conf.py
services/gunicorn_conf.py
import multiprocessing preload_app = True workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' keepalive = 60 timeout = 900 max_requests = 600 # defaults to 30 sec, setting to 5 minutes to fight `GreenletExit`s graceful_timeout = 5*60 # cryptically, setting forwarded_allow_ips (to the ip of the hqproxy...
import multiprocessing preload_app = True workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' keepalive = 60 timeout = 900 max_requests = 120 # defaults to 30 sec, setting to 5 minutes to fight `GreenletExit`s graceful_timeout = 5*60 # cryptically, setting forwarded_allow_ips (to the ip of the hqproxy...
Revert "bump gunicorn max_requests to 600"
Revert "bump gunicorn max_requests to 600" This reverts commit ffbfe0d6f2ca83346693a788b14562eb332d0cbd.
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedso...
import multiprocessing preload_app = True workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' keepalive = 60 timeout = 900 max_requests = 120 # defaults to 30 sec, setting to 5 minutes to fight `GreenletExit`s graceful_timeout = 5*60 # cryptically, setting forwarded_allow_ips (to the ip of the hqproxy...
Revert "bump gunicorn max_requests to 600" This reverts commit ffbfe0d6f2ca83346693a788b14562eb332d0cbd. import multiprocessing preload_app = True workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' keepalive = 60 timeout = 900 max_requests = 600 # defaults to 30 sec, setting to 5 minutes to fight `...
2f152c5036d32a780741edd8fb6ce75684728824
singleuser/user-config.py
singleuser/user-config.py
import os mylang = 'test' family = 'wikipedia' # Not defining any extra variables here at all since that causes pywikibot # to issue a warning about potential misspellings if os.path.exists(os.path.expanduser('~/user-config.py')): with open(os.path.expanduser('~/user-config.py'), 'r') as f: exec( ...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) # Things that should be non-easily-overridable usernames['*']['*'] = os.environ['J...
Revert "Do not introduce extra variables"
Revert "Do not introduce extra variables" Since the 'f' is considered an extra variable and introduces a warning anyway :( Let's fix this the right way This reverts commit a03de68fb772d859098327d0e54a219fe4507072.
Python
mit
yuvipanda/paws,yuvipanda/paws
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) # Things that should be non-easily-overridable usernames['*']['*'] = os.environ['J...
Revert "Do not introduce extra variables" Since the 'f' is considered an extra variable and introduces a warning anyway :( Let's fix this the right way This reverts commit a03de68fb772d859098327d0e54a219fe4507072. import os mylang = 'test' family = 'wikipedia' # Not defining any extra variables here at all since ...
1b42dc4d49ccbef9b2ed4bd31e8bb32b597a3575
oscar/agent/scripted/minigame/nicolas_mineralshard.py
oscar/agent/scripted/minigame/nicolas_mineralshard.py
import numpy from pysc2.agents import base_agent from pysc2.lib import actions from pysc2.lib import features _PLAYER_RELATIVE = features.SCREEN_FEATURES.player_relative.index _PLAYER_FRIENDLY = 1 _PLAYER_NEUTRAL = 3 # beacon/minerals _PLAYER_HOSTILE = 4 _NO_OP = actions.FUNCTIONS.no_op.id _MOVE_SCREEN = actions.FUN...
Create a new scripted agent: copy from the deepmind one but do not select the two marins, only one
Create a new scripted agent: copy from the deepmind one but do not select the two marins, only one
Python
apache-2.0
Xaxetrov/OSCAR,Xaxetrov/OSCAR
import numpy from pysc2.agents import base_agent from pysc2.lib import actions from pysc2.lib import features _PLAYER_RELATIVE = features.SCREEN_FEATURES.player_relative.index _PLAYER_FRIENDLY = 1 _PLAYER_NEUTRAL = 3 # beacon/minerals _PLAYER_HOSTILE = 4 _NO_OP = actions.FUNCTIONS.no_op.id _MOVE_SCREEN = actions.FUN...
Create a new scripted agent: copy from the deepmind one but do not select the two marins, only one
511522f2e0d6399191d79e393ed6f14d3a843550
range_ghost_test.py
range_ghost_test.py
from dtest import Tester from tools import * from assertions import * import os, sys, time from ccmlib.cluster import Cluster class TestRangeGhosts(Tester): def ghosts_test(self): """ Check range ghost are correctly removed by the system """ cluster = self.cluster cluster.populate(1).star...
Add test to check range ghost are removed
Add test to check range ghost are removed
Python
apache-2.0
thobbs/cassandra-dtest,snazy/cassandra-dtest,carlyeks/cassandra-dtest,krummas/cassandra-dtest,beobal/cassandra-dtest,thobbs/cassandra-dtest,tjake/cassandra-dtest,pcmanus/cassandra-dtest,spodkowinski/cassandra-dtest,aweisberg/cassandra-dtest,stef1927/cassandra-dtest,pauloricardomg/cassandra-dtest,snazy/cassandra-dtest,m...
from dtest import Tester from tools import * from assertions import * import os, sys, time from ccmlib.cluster import Cluster class TestRangeGhosts(Tester): def ghosts_test(self): """ Check range ghost are correctly removed by the system """ cluster = self.cluster cluster.populate(1).star...
Add test to check range ghost are removed
cd003fa1d57b442d6889442d0b1815fc3312505c
toolbox/replicate_graph.py
toolbox/replicate_graph.py
import sys import commentjson as json import os import argparse import numpy as np import copy sys.path.append('../.') sys.path.append('.') from progressbar import ProgressBar if __name__ == "__main__": parser = argparse.ArgumentParser(description='Replicate nodes, links, divisions and exclusion sets N times, ' \...
Add script to artificially increase the size of graphs by replicating all nodes and their links
Add script to artificially increase the size of graphs by replicating all nodes and their links
Python
mit
chaubold/hytra,chaubold/hytra,chaubold/hytra
import sys import commentjson as json import os import argparse import numpy as np import copy sys.path.append('../.') sys.path.append('.') from progressbar import ProgressBar if __name__ == "__main__": parser = argparse.ArgumentParser(description='Replicate nodes, links, divisions and exclusion sets N times, ' \...
Add script to artificially increase the size of graphs by replicating all nodes and their links
cca106b4cb647e82838deb359cf6f9ef813992a9
dbaas/integrations/credentials/admin/integration_credential.py
dbaas/integrations/credentials/admin/integration_credential.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin class IntegrationCredentialAdmin(admin.ModelAdmin): search_fields = ("endpoint",) list_display = ("user","endpoint",) save_on_top = True
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin class IntegrationCredentialAdmin(admin.ModelAdmin): search_fields = ("endpoint",) list_display = ("endpoint","user",) save_on_top = True
Change field order at integration credential admin index page
Change field order at integration credential admin index page
Python
bsd-3-clause
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin class IntegrationCredentialAdmin(admin.ModelAdmin): search_fields = ("endpoint",) list_display = ("endpoint","user",) save_on_top = True
Change field order at integration credential admin index page # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin class IntegrationCredentialAdmin(admin.ModelAdmin): search_fields = ("endpoint",) list_display = ("user","endpoint",) save_on_top...
d49b23365a972931502329f47a3aa65b9170477e
openstack/common/middleware/catch_errors.py
openstack/common/middleware/catch_errors.py
# Copyright (c) 2013 NEC Corporation # 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 requi...
# Copyright (c) 2013 NEC Corporation # 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 requi...
Update oslo log messages with translation domains
Update oslo log messages with translation domains Update the incubator code to use different domains for log messages at different levels. Update the import exceptions setting for hacking to allow multiple functions to be imported from gettextutils on one line. bp log-messages-translation-domain Change-Id: I6ce0f4a...
Python
apache-2.0
varunarya10/oslo.middleware,openstack/oslo.middleware,chungg/oslo.middleware,JioCloud/oslo.middleware
# Copyright (c) 2013 NEC Corporation # 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 requi...
Update oslo log messages with translation domains Update the incubator code to use different domains for log messages at different levels. Update the import exceptions setting for hacking to allow multiple functions to be imported from gettextutils on one line. bp log-messages-translation-domain Change-Id: I6ce0f4a...
dfdac5764236ce9301e7997443b6de4a7a4b4473
scripts/convert_gml_to_csv.py
scripts/convert_gml_to_csv.py
import sys import os sys.path.append(os.path.abspath(os.path.curdir)) from converter import gml_to_node_edge_list if __name__ == '__main__': in_file = sys.argv[1] res = gml_to_node_edge_list(in_file, routing=True)
import sys import os sys.path.append(os.path.abspath(os.path.curdir)) from converter import gml_to_node_edge_list if __name__ == '__main__': in_file = sys.argv[1] outfile = sys.argv[2] if len(sys.argv) > 2 else None res = gml_to_node_edge_list(in_file, outfile=outfile, routing=True)
Add outfile option to conversion script
Add outfile option to conversion script
Python
mit
gaberosser/geo-network
import sys import os sys.path.append(os.path.abspath(os.path.curdir)) from converter import gml_to_node_edge_list if __name__ == '__main__': in_file = sys.argv[1] outfile = sys.argv[2] if len(sys.argv) > 2 else None res = gml_to_node_edge_list(in_file, outfile=outfile, routing=True)
Add outfile option to conversion script import sys import os sys.path.append(os.path.abspath(os.path.curdir)) from converter import gml_to_node_edge_list if __name__ == '__main__': in_file = sys.argv[1] res = gml_to_node_edge_list(in_file, routing=True)
4a5dd598f689425aa89541ce890ec15aa7592543
dragonfire/tts/__init__.py
dragonfire/tts/__init__.py
import csv class Synthesizer(): def __init__(self): self.word_map = {} filename = "../../dictionaries/VoxForgeDict" for line in csv.reader(open(filename), delimiter=' ', skipinitialspace=True): if len(line) > 2: self.word_map[line[0]] = line[2:] print ...
Add the function for parsing strings to phonemes
Add the function for parsing strings to phonemes
Python
mit
DragonComputer/Dragonfire,DragonComputer/Dragonfire,DragonComputer/Dragonfire,mertyildiran/Dragonfire,mertyildiran/Dragonfire
import csv class Synthesizer(): def __init__(self): self.word_map = {} filename = "../../dictionaries/VoxForgeDict" for line in csv.reader(open(filename), delimiter=' ', skipinitialspace=True): if len(line) > 2: self.word_map[line[0]] = line[2:] print ...
Add the function for parsing strings to phonemes
a2572d38eeaa7c004142a194b18fd6fdfff99f9a
test/test_translate.py
test/test_translate.py
from Bio import SeqIO import logging import unittest from select_taxa import select_genomes_by_ids import translate class Test(unittest.TestCase): def setUp(self): self.longMessage = True logging.root.setLevel(logging.DEBUG) def test_translate_genomes(self): # Select genomes ...
from Bio import SeqIO import logging import unittest from select_taxa import select_genomes_by_ids import translate class Test(unittest.TestCase): def setUp(self): self.longMessage = True logging.root.setLevel(logging.DEBUG) def test_translate_genomes(self): # Select genomes ...
Verify no header appears twice when translating 93125.2
Verify no header appears twice when translating 93125.2
Python
mit
ODoSE/odose.nl
from Bio import SeqIO import logging import unittest from select_taxa import select_genomes_by_ids import translate class Test(unittest.TestCase): def setUp(self): self.longMessage = True logging.root.setLevel(logging.DEBUG) def test_translate_genomes(self): # Select genomes ...
Verify no header appears twice when translating 93125.2 from Bio import SeqIO import logging import unittest from select_taxa import select_genomes_by_ids import translate class Test(unittest.TestCase): def setUp(self): self.longMessage = True logging.root.setLevel(logging.DEBUG) def test_t...
d18919060fde86baaa1bd6fed561872dfe4cc37f
oam_base/urls.py
oam_base/urls.py
from django.conf.urls import patterns, include, url from django.core.urlresolvers import reverse_lazy from MyInfo import views as my_info_views from django_cas import views as cas_views from oam_base import views as base_views # Uncomment the next two lines to enable the admin: from django.contrib import admin admin....
from django.conf.urls import patterns, include, url from django.core.urlresolvers import reverse_lazy from MyInfo import views as my_info_views from django_cas import views as cas_views from oam_base import views as base_views # Uncomment the next two lines to enable the admin: from django.contrib import admin admin....
Make the ratelimited error URL follow established conventions.
Make the ratelimited error URL follow established conventions.
Python
mit
hhauer/myinfo,hhauer/myinfo,hhauer/myinfo,hhauer/myinfo
from django.conf.urls import patterns, include, url from django.core.urlresolvers import reverse_lazy from MyInfo import views as my_info_views from django_cas import views as cas_views from oam_base import views as base_views # Uncomment the next two lines to enable the admin: from django.contrib import admin admin....
Make the ratelimited error URL follow established conventions. from django.conf.urls import patterns, include, url from django.core.urlresolvers import reverse_lazy from MyInfo import views as my_info_views from django_cas import views as cas_views from oam_base import views as base_views # Uncomment the next two li...
0fd68b4ac82bf867365c9cc5e0a129dbb51d8247
teamstats/migrations/0002_auto_20180828_1937.py
teamstats/migrations/0002_auto_20180828_1937.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-28 16:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('teamstats', '0001_initial'), ] operations = [ migrations.AlterField( ...
Add migrations for media files
Add migrations for media files
Python
agpl-3.0
jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-28 16:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('teamstats', '0001_initial'), ] operations = [ migrations.AlterField( ...
Add migrations for media files
38496eddbb214ee856b588e5b1cda62d5e353ab7
system_maintenance/tests/functional/tests.py
system_maintenance/tests/functional/tests.py
from selenium import webdriver import unittest class FunctionalTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_app_home_title(self): self.browser.get('http://loc...
Add simple functional test to test the title of the app's home page
Add simple functional test to test the title of the app's home page
Python
bsd-3-clause
mfcovington/django-system-maintenance,mfcovington/django-system-maintenance,mfcovington/django-system-maintenance
from selenium import webdriver import unittest class FunctionalTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_app_home_title(self): self.browser.get('http://loc...
Add simple functional test to test the title of the app's home page
aec8653089f37d53d13e1526ce2379a05e66604d
Utilities/Maintenance/GeneratePythonDownloadsPage.py
Utilities/Maintenance/GeneratePythonDownloadsPage.py
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # 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 ...
Add script to generate download links used on simpleitk.org
Add script to generate download links used on simpleitk.org
Python
apache-2.0
InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,richardbeare/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,Sim...
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # 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 ...
Add script to generate download links used on simpleitk.org
c22528df06e821936590431db5ba1a424e16f6a0
debug_toolbar/management/commands/debugsqlshell.py
debug_toolbar/management/commands/debugsqlshell.py
from datetime import datetime from django.db.backends import util import sqlparse from debug_toolbar.utils import ms_from_timedelta class PrintQueryWrapper(util.CursorDebugWrapper): def execute(self, sql, params=()): starttime = datetime.now() try: return self.cursor.execute(sql, pa...
from __future__ import print_function from datetime import datetime from django.db.backends import util import sqlparse from debug_toolbar.utils import ms_from_timedelta class PrintQueryWrapper(util.CursorDebugWrapper): def execute(self, sql, params=()): starttime = datetime.now() try: ...
Replace print statement by print function.
Replace print statement by print function.
Python
bsd-3-clause
seperman/django-debug-toolbar,guilhermetavares/django-debug-toolbar,stored/django-debug-toolbar,sidja/django-debug-toolbar,Endika/django-debug-toolbar,guilhermetavares/django-debug-toolbar,megcunningham/django-debug-toolbar,pevzi/django-debug-toolbar,peap/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,C...
from __future__ import print_function from datetime import datetime from django.db.backends import util import sqlparse from debug_toolbar.utils import ms_from_timedelta class PrintQueryWrapper(util.CursorDebugWrapper): def execute(self, sql, params=()): starttime = datetime.now() try: ...
Replace print statement by print function. from datetime import datetime from django.db.backends import util import sqlparse from debug_toolbar.utils import ms_from_timedelta class PrintQueryWrapper(util.CursorDebugWrapper): def execute(self, sql, params=()): starttime = datetime.now() try: ...
dd739126181b29493c9d1d90a7e40eac09c23666
app/models.py
app/models.py
# -*- coding: utf-8 -*- """ app.models ~~~~~~~~~~ Provides the SQLAlchemy models """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import savalidation.validators as val from datetime import datetime as dt from app import db from savalidation...
# -*- coding: utf-8 -*- """ app.models ~~~~~~~~~~ Provides the SQLAlchemy models """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import savalidation.validators as val from datetime import datetime as dt from app import db from savalidation...
Add unique constraint to rid
Add unique constraint to rid
Python
mit
reubano/hdxscraper-hdro,reubano/hdxscraper-hdro,reubano/hdxscraper-hdro
# -*- coding: utf-8 -*- """ app.models ~~~~~~~~~~ Provides the SQLAlchemy models """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import savalidation.validators as val from datetime import datetime as dt from app import db from savalidation...
Add unique constraint to rid # -*- coding: utf-8 -*- """ app.models ~~~~~~~~~~ Provides the SQLAlchemy models """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import savalidation.validators as val from datetime import datetime as dt from ap...
40ae95e87e439645d35376942f8c48ce9e62b2ad
test/test_pluginmount.py
test/test_pluginmount.py
from JsonStats.FetchStats.Plugins import * from . import TestCase import JsonStats.FetchStats.Plugins from JsonStats.FetchStats import Fetcher class TestPluginMount(TestCase): def setUp(self): # Do stuff that has to happen on every test in this instance self.fetcher = Fetcher def test_get_...
from . import TestCase import JsonStats.FetchStats.Plugins from JsonStats.FetchStats import Fetcher class TestPluginMount(TestCase): def setUp(self): # Do stuff that has to happen on every test in this instance self.fetcher = Fetcher class _example_plugin(Fetcher): def __ini...
Fix the plugin mount text. And make it way more intelligent.
Fix the plugin mount text. And make it way more intelligent.
Python
mit
RHInception/jsonstats,pombredanne/jsonstats,pombredanne/jsonstats,RHInception/jsonstats
from . import TestCase import JsonStats.FetchStats.Plugins from JsonStats.FetchStats import Fetcher class TestPluginMount(TestCase): def setUp(self): # Do stuff that has to happen on every test in this instance self.fetcher = Fetcher class _example_plugin(Fetcher): def __ini...
Fix the plugin mount text. And make it way more intelligent. from JsonStats.FetchStats.Plugins import * from . import TestCase import JsonStats.FetchStats.Plugins from JsonStats.FetchStats import Fetcher class TestPluginMount(TestCase): def setUp(self): # Do stuff that has to happen on every test in t...
4b855e62bd4f92c7aa9b2614cb6eb57e112d7db6
reclass/__init__.py
reclass/__init__.py
# # -*- coding: utf-8 -*- # # This file is part of reclass (http://github.com/madduck/reclass) # # Copyright © 2007–13 martin f. krafft <madduck@madduck.net> # Released under the terms of the Artistic Licence 2.0 # from output import OutputLoader from storage import StorageBackendLoader def get_data(storage_type, nod...
# # -*- coding: utf-8 -*- # # This file is part of reclass (http://github.com/madduck/reclass) # # Copyright © 2007–13 martin f. krafft <madduck@madduck.net> # Released under the terms of the Artistic Licence 2.0 # from output import OutputLoader from storage import StorageBackendLoader def get_data(storage_type, nod...
Allow node to be None to trigger inventory
Allow node to be None to trigger inventory Signed-off-by: martin f. krafft <acc3492a66a5949176a2fc8886cf441478ca46a1@madduck.net>
Python
artistic-2.0
madduck/reclass,rmoorman/reclass,jeroen92/reclass,michaelkuty/reclass,jeroen92/reclass,rmoorman/reclass
# # -*- coding: utf-8 -*- # # This file is part of reclass (http://github.com/madduck/reclass) # # Copyright © 2007–13 martin f. krafft <madduck@madduck.net> # Released under the terms of the Artistic Licence 2.0 # from output import OutputLoader from storage import StorageBackendLoader def get_data(storage_type, nod...
Allow node to be None to trigger inventory Signed-off-by: martin f. krafft <acc3492a66a5949176a2fc8886cf441478ca46a1@madduck.net> # # -*- coding: utf-8 -*- # # This file is part of reclass (http://github.com/madduck/reclass) # # Copyright © 2007–13 martin f. krafft <madduck@madduck.net> # Released under the terms of ...
d978f9c54d3509a5fd8ef3b287d2c3dfa7683d77
setup.py
setup.py
#!/usr/bin/python from setuptools import setup setup(name="catsnap", version="6.0.0", description="catalog and store images", author="Erin Call", author_email="hello@erincall.com", url="https://github.com/ErinCall/", packages=['catsnap', 'catsnap.document', ...
#!/usr/bin/python from setuptools import setup setup(name="catsnap", version="6.0.0", description="catalog and store images", author="Erin Call", author_email="hello@erincall.com", url="https://github.com/ErinCall/", packages=['catsnap', 'catsnap.document', ...
Upgrade to a newer gevent for OSX Yosemity compat
Upgrade to a newer gevent for OSX Yosemity compat See https://github.com/gevent/gevent/issues/656
Python
mit
ErinCall/catsnap,ErinCall/catsnap,ErinCall/catsnap
#!/usr/bin/python from setuptools import setup setup(name="catsnap", version="6.0.0", description="catalog and store images", author="Erin Call", author_email="hello@erincall.com", url="https://github.com/ErinCall/", packages=['catsnap', 'catsnap.document', ...
Upgrade to a newer gevent for OSX Yosemity compat See https://github.com/gevent/gevent/issues/656 #!/usr/bin/python from setuptools import setup setup(name="catsnap", version="6.0.0", description="catalog and store images", author="Erin Call", author_email="hello@erincall.com", url="ht...
32f99cd7a9f20e2c8d7ebd140c23ac0e43b1284c
pulldb/users.py
pulldb/users.py
# Copyright 2013 Russell Heilling import logging from google.appengine.api import users from pulldb import base from pulldb import session from pulldb.models.users import User class Profile(session.SessionHandler): def get(self): app_user = users.get_current_user() template_values = self.base_template_valu...
# Copyright 2013 Russell Heilling import logging from google.appengine.api import users from pulldb import base from pulldb import session from pulldb.models.users import User class Profile(session.SessionHandler): def get(self): app_user = users.get_current_user() template_values = self.base_template_valu...
Add logging to track down a bug
Add logging to track down a bug
Python
mit
xchewtoyx/pulldb
# Copyright 2013 Russell Heilling import logging from google.appengine.api import users from pulldb import base from pulldb import session from pulldb.models.users import User class Profile(session.SessionHandler): def get(self): app_user = users.get_current_user() template_values = self.base_template_valu...
Add logging to track down a bug # Copyright 2013 Russell Heilling import logging from google.appengine.api import users from pulldb import base from pulldb import session from pulldb.models.users import User class Profile(session.SessionHandler): def get(self): app_user = users.get_current_user() template...
9c6f3e1994f686e57092a7cd947c49b4f857743e
apps/predict/urls.py
apps/predict/urls.py
""" Predict app's urls """ # # pylint: disable=bad-whitespace # from django.conf.urls import patterns, include, url from .views import * def url_tree(regex, *urls): """Quick access to stitching url patterns""" return url(regex, include(patterns('', *urls))) urlpatterns = patterns('', url(r'^$', Datasets.as...
""" Predict app's urls """ # # pylint: disable=bad-whitespace # from django.conf.urls import patterns, include, url from .views import * def url_tree(regex, *urls): """Quick access to stitching url patterns""" return url(regex, include(patterns('', *urls))) urlpatterns = patterns('', url(r'^$', Datasets.as...
Remove callback url and bring uploads together
Remove callback url and bring uploads together
Python
agpl-3.0
IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site
""" Predict app's urls """ # # pylint: disable=bad-whitespace # from django.conf.urls import patterns, include, url from .views import * def url_tree(regex, *urls): """Quick access to stitching url patterns""" return url(regex, include(patterns('', *urls))) urlpatterns = patterns('', url(r'^$', Datasets.as...
Remove callback url and bring uploads together """ Predict app's urls """ # # pylint: disable=bad-whitespace # from django.conf.urls import patterns, include, url from .views import * def url_tree(regex, *urls): """Quick access to stitching url patterns""" return url(regex, include(patterns('', *urls))) url...
bec98cca8a765743cf990f5807f5d52b95dd5d9e
setup.py
setup.py
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('REA...
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('REA...
Add debugtools as a dependency.
Add debugtools as a dependency.
Python
mit
kxgames/glooey,kxgames/glooey
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('REA...
Add debugtools as a dependency. #!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file...
12cac5280ab5c74b3497055c4104f23e52cdd5f1
scripts/generate_posts.py
scripts/generate_posts.py
import os import ast import datetime import re grandparent = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) checks_dir = os.path.join(grandparent, "proselint", "checks") listing = os.listdir(checks_dir) def is_check(fn): return fn[-3:] == ".py" and not fn == "__init__.py" for fn in listing: i...
import os import ast import datetime import re grandparent = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) checks_dir = os.path.join(grandparent, "proselint", "checks") listing = os.listdir(checks_dir) def is_check(fn): return fn[-3:] == ".py" and not fn == "__init__.py" for fn in listing: i...
Use HTML entity for colon
Use HTML entity for colon
Python
bsd-3-clause
amperser/proselint,jstewmon/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint
import os import ast import datetime import re grandparent = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) checks_dir = os.path.join(grandparent, "proselint", "checks") listing = os.listdir(checks_dir) def is_check(fn): return fn[-3:] == ".py" and not fn == "__init__.py" for fn in listing: i...
Use HTML entity for colon import os import ast import datetime import re grandparent = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) checks_dir = os.path.join(grandparent, "proselint", "checks") listing = os.listdir(checks_dir) def is_check(fn): return fn[-3:] == ".py" and not fn == "__init__.py...
72e69f3535c7e2cd82cdda62636eabd7421ebddf
generative/tests/compare_test/concat_first/dump_hiddens.py
generative/tests/compare_test/concat_first/dump_hiddens.py
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os import subprocess if __name__ == "__main__": for hiddens_dim in [512, 256, 128, 64, 32, 16]: print('Dumping files for (%d)' % hiddens_dim) model_path = '/mnt/visual_communicat...
Add dump script for all hiddens
Add dump script for all hiddens
Python
mit
judithfan/pix2svg
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os import subprocess if __name__ == "__main__": for hiddens_dim in [512, 256, 128, 64, 32, 16]: print('Dumping files for (%d)' % hiddens_dim) model_path = '/mnt/visual_communicat...
Add dump script for all hiddens
aa9829567f65c36c5c7356aa5e7d6ac1762f62aa
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://git.barrera.io/hobarrera/todoman', license='MIT', packages=['todoman'], entry_points...
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/todoman', license='MIT', packages=['todoman'], entry_points={ ...
Update URL to current point to gitlab.com
Update URL to current point to gitlab.com
Python
isc
AnubhaAgrawal/todoman,asalminen/todoman,hobarrera/todoman,pimutils/todoman,Sakshisaraswat/todoman,rimshaakhan/todoman
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/todoman', license='MIT', packages=['todoman'], entry_points={ ...
Update URL to current point to gitlab.com #!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://git.barrera.io/hobarrera/todoman', license='MIT',...
9ee332f6f0af3d632860581971446f9edf4f74be
changetext/WIKIXML2TW.py
changetext/WIKIXML2TW.py
def WIKIXML2TW(inputfilename, outputfilename): "Convert Wikimedia XML dump to TiddlyWiki import file" inputfile = open(inputfilename, "r") xmlinput = unicode(inputfile.read(), errors='ignore') outputfilemenu = open(outputfilename + '.menu', "w") outputfile = open(outputfilename, "w") outputfile.w...
Convert wiki XML to Tiddlywiki import format
Convert wiki XML to Tiddlywiki import format
Python
mit
cottley/moruga
def WIKIXML2TW(inputfilename, outputfilename): "Convert Wikimedia XML dump to TiddlyWiki import file" inputfile = open(inputfilename, "r") xmlinput = unicode(inputfile.read(), errors='ignore') outputfilemenu = open(outputfilename + '.menu', "w") outputfile = open(outputfilename, "w") outputfile.w...
Convert wiki XML to Tiddlywiki import format
fe9f2b7e76088afb6f4d905c0c4188df88b81516
pollirio/modules/__init__.py
pollirio/modules/__init__.py
# -*- coding: utf-8 -*- from functools import wraps from pollirio import commands def old_expose(cmd): def inner(fn): def wrapped(*args, **kwargs): commands[cmd] = fn fn(*args) return wraps(fn)(wrapped) return inner def expose(cmd, args=None): def decorator(fn): ...
# -*- coding: utf-8 -*- from functools import wraps from pollirio import commands def old_expose(cmd): def inner(fn): def wrapped(*args, **kwargs): commands[cmd] = fn fn(*args) return wraps(fn)(wrapped) return inner def expose(cmd, args=None): def decorator(fn): ...
Disable bts plugin for general usage
Disable bts plugin for general usage
Python
mit
dpaleino/pollirio,dpaleino/pollirio
# -*- coding: utf-8 -*- from functools import wraps from pollirio import commands def old_expose(cmd): def inner(fn): def wrapped(*args, **kwargs): commands[cmd] = fn fn(*args) return wraps(fn)(wrapped) return inner def expose(cmd, args=None): def decorator(fn): ...
Disable bts plugin for general usage # -*- coding: utf-8 -*- from functools import wraps from pollirio import commands def old_expose(cmd): def inner(fn): def wrapped(*args, **kwargs): commands[cmd] = fn fn(*args) return wraps(fn)(wrapped) return inner def expose(cmd,...
8223d62c22d4c4f7a66e1e468de53556796a03a9
src/functions/exercise7.py
src/functions/exercise7.py
"""Module docstring. This serves as a long usage message. """ import sys import getopt def main(): # parse command line options try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) except getopt.error, msg: print msg print "for help use --help" sys.exit(2) # pro...
Write a function that print something n times including relatives spaces
Write a function that print something n times including relatives spaces
Python
mit
let42/python-course
"""Module docstring. This serves as a long usage message. """ import sys import getopt def main(): # parse command line options try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) except getopt.error, msg: print msg print "for help use --help" sys.exit(2) # pro...
Write a function that print something n times including relatives spaces
556e6ba4d9bc32384526501acbbc4c0c2b6f983e
mopidy/frontends/mpd/__init__.py
mopidy/frontends/mpd/__init__.py
import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr...
import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ ...
Make MpdFrontend a subclass of BaseFrontend
Make MpdFrontend a subclass of BaseFrontend
Python
apache-2.0
kingosticks/mopidy,SuperStarPL/mopidy,rawdlite/mopidy,tkem/mopidy,rawdlite/mopidy,diandiankan/mopidy,ZenithDK/mopidy,jcass77/mopidy,jodal/mopidy,SuperStarPL/mopidy,hkariti/mopidy,mokieyue/mopidy,rawdlite/mopidy,bacontext/mopidy,quartz55/mopidy,diandiankan/mopidy,tkem/mopidy,woutervanwijk/mopidy,adamcik/mopidy,swak/mopi...
import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ ...
Make MpdFrontend a subclass of BaseFrontend import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The ...
b0cf9904023c5ee20c5f29b3e88899420405550b
examples/puttiff.py
examples/puttiff.py
# Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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 ...
Migrate this version to new workstation.
Migrate this version to new workstation.
Python
apache-2.0
neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore
# Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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 ...
Migrate this version to new workstation.
874816497e7a9bd0e091a62a9e9b33ae832eb130
pyjsonts/time_series_json.py
pyjsonts/time_series_json.py
import json import ijson class TimeSeriesJSON: def __init__(self, f=None, fn=None, tag='item'): """ :param f: file object (_io.TextIOWrapper) :param fn: file name as a string :param tag: tag for dividing json items default value is 'item' because this value is default ...
import json import ijson class TimeSeriesJSON: def __init__(self, f=None, fn=None, tag='item'): """ :param f: file object (_io.TextIOWrapper) :param fn: file name as a string :param tag: tag for dividing json items default value is 'item' because this value is default ...
Remove unnecessary backslashes in parse_json_items
Remove unnecessary backslashes in parse_json_items
Python
apache-2.0
jeongmincha/pyjsonts
import json import ijson class TimeSeriesJSON: def __init__(self, f=None, fn=None, tag='item'): """ :param f: file object (_io.TextIOWrapper) :param fn: file name as a string :param tag: tag for dividing json items default value is 'item' because this value is default ...
Remove unnecessary backslashes in parse_json_items import json import ijson class TimeSeriesJSON: def __init__(self, f=None, fn=None, tag='item'): """ :param f: file object (_io.TextIOWrapper) :param fn: file name as a string :param tag: tag for dividing json items de...
d66355e4758b37be39d17d681ede1dbbd6b9b311
setmagic/admin.py
setmagic/admin.py
from django import forms from django.contrib import admin from setmagic import settings from setmagic.models import Setting _denied = lambda *args: False class SetMagicAdmin(admin.ModelAdmin): list_display = 'label', 'current_value', list_editable = 'current_value', list_display_links = None has_a...
from django import forms from django.contrib import admin from django.utils.importlib import import_module from setmagic import settings from setmagic.models import Setting _denied = lambda *args: False class SetMagicAdmin(admin.ModelAdmin): list_display = 'label', 'current_value', list_editable = 'current...
Use importlib to load custom fields by str
Use importlib to load custom fields by str
Python
mit
7ws/django-setmagic
from django import forms from django.contrib import admin from django.utils.importlib import import_module from setmagic import settings from setmagic.models import Setting _denied = lambda *args: False class SetMagicAdmin(admin.ModelAdmin): list_display = 'label', 'current_value', list_editable = 'current...
Use importlib to load custom fields by str from django import forms from django.contrib import admin from setmagic import settings from setmagic.models import Setting _denied = lambda *args: False class SetMagicAdmin(admin.ModelAdmin): list_display = 'label', 'current_value', list_editable = 'current_valu...
e4345634ea6a4c43db20ea1d3d33134b6ee6204d
alembic/versions/151b2f642877_text_to_json.py
alembic/versions/151b2f642877_text_to_json.py
"""text to JSON Revision ID: 151b2f642877 Revises: aee7291c81 Create Date: 2015-06-12 14:40:56.956657 """ # revision identifiers, used by Alembic. revision = '151b2f642877' down_revision = 'aee7291c81' from alembic import op import sqlalchemy as sa def upgrade(): query = 'ALTER TABLE project ALTER COLUMN info...
"""text to JSON Revision ID: 151b2f642877 Revises: ac115763654 Create Date: 2015-06-12 14:40:56.956657 """ # revision identifiers, used by Alembic. revision = '151b2f642877' down_revision = 'ac115763654' from alembic import op import sqlalchemy as sa def upgrade(): query = 'ALTER TABLE project ALTER COLUMN in...
Fix alembic revision after merge master
Fix alembic revision after merge master
Python
agpl-3.0
OpenNewsLabs/pybossa,PyBossa/pybossa,PyBossa/pybossa,Scifabric/pybossa,jean/pybossa,geotagx/pybossa,OpenNewsLabs/pybossa,jean/pybossa,Scifabric/pybossa,geotagx/pybossa
"""text to JSON Revision ID: 151b2f642877 Revises: ac115763654 Create Date: 2015-06-12 14:40:56.956657 """ # revision identifiers, used by Alembic. revision = '151b2f642877' down_revision = 'ac115763654' from alembic import op import sqlalchemy as sa def upgrade(): query = 'ALTER TABLE project ALTER COLUMN in...
Fix alembic revision after merge master """text to JSON Revision ID: 151b2f642877 Revises: aee7291c81 Create Date: 2015-06-12 14:40:56.956657 """ # revision identifiers, used by Alembic. revision = '151b2f642877' down_revision = 'aee7291c81' from alembic import op import sqlalchemy as sa def upgrade(): query...
e8c8464d36e91c9a8d61db0531a2e73dcdee88b7
utilities/tests/test_simulation_utils.py
utilities/tests/test_simulation_utils.py
from utilities.simulation_utilities import check_inputs import pytest import numpy as np @pytest.mark.parametrize("input,expected", [ (None, np.ndarray([0])), ([0], np.array([0])), (1, np.array([1])), (range(5), np.array([0,1,2,3,4])) ]) def test_check_inputs(input, expected): assert np.allclose(...
Add a test for check_inputs.
Add a test for check_inputs.
Python
mit
jason-neal/companion_simulations,jason-neal/companion_simulations
from utilities.simulation_utilities import check_inputs import pytest import numpy as np @pytest.mark.parametrize("input,expected", [ (None, np.ndarray([0])), ([0], np.array([0])), (1, np.array([1])), (range(5), np.array([0,1,2,3,4])) ]) def test_check_inputs(input, expected): assert np.allclose(...
Add a test for check_inputs.
a47b82f7feb18da55cf402e363508141764a180f
2014/round-1/labelmaker-v2.py
2014/round-1/labelmaker-v2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def solve(): L, N = input().split(' ') N = int(N) result = '' while N > 0: N -= 1 result = L[N % len(L)] + result N = int(N / len(L)) return result def main(): T = int(input()) for i in range(T): print('Case #...
Add solution v2 for Labelmaker.
Add solution v2 for Labelmaker.
Python
mit
changyuheng/hacker-cup-solutions
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def solve(): L, N = input().split(' ') N = int(N) result = '' while N > 0: N -= 1 result = L[N % len(L)] + result N = int(N / len(L)) return result def main(): T = int(input()) for i in range(T): print('Case #...
Add solution v2 for Labelmaker.
bdd842f55f3a234fefee4cd2a701fa23e07c3789
scikits/umfpack/setup.py
scikits/umfpack/setup.py
#!/usr/bin/env python # 05.12.2005, c from __future__ import division, print_function, absolute_import def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, dict_append config = Configuration('umfpack', par...
#!/usr/bin/env python # 05.12.2005, c from __future__ import division, print_function, absolute_import import sys def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, dict_append config = Configuration('um...
Add handling for building scikit-umfpack on the Mac, which doesn't have the librt file added to the umfpack dependencies.
Add handling for building scikit-umfpack on the Mac, which doesn't have the librt file added to the umfpack dependencies.
Python
bsd-3-clause
scikit-umfpack/scikit-umfpack,scikit-umfpack/scikit-umfpack,rc/scikit-umfpack-rc,rc/scikit-umfpack,rc/scikit-umfpack,rc/scikit-umfpack-rc
#!/usr/bin/env python # 05.12.2005, c from __future__ import division, print_function, absolute_import import sys def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, dict_append config = Configuration('um...
Add handling for building scikit-umfpack on the Mac, which doesn't have the librt file added to the umfpack dependencies. #!/usr/bin/env python # 05.12.2005, c from __future__ import division, print_function, absolute_import def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import...
1473af1b50da6390e1b4475ae63d5a28f712e791
tests/test_frijoles.py
tests/test_frijoles.py
import unittest from frijoles import app class TamalesAPITestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_basic(self): res = self.app.get('/api/v1/') self.assertEqual(res.status_code, 200)
import unittest from frijoles import app class FrijolesAPITestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_basic(self): res = self.app.get('/api/v1/') self.assertEqual(res.status_code, 200)
Fix wrong test case name
Fix wrong test case name
Python
agpl-3.0
Antojitos/frijoles
import unittest from frijoles import app class FrijolesAPITestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_basic(self): res = self.app.get('/api/v1/') self.assertEqual(res.status_code, 200)
Fix wrong test case name import unittest from frijoles import app class TamalesAPITestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_basic(self): res = self.app.get('/api/v1/') self.assertEqual(res.status_code, 200)
c32bdff4b0ee570ed58cd869830d89e3251cf82a
pytils/test/__init__.py
pytils/test/__init__.py
# -*- coding: utf-8 -*- """ Unit tests for pytils """ __all__ = ["test_numeral", "test_dt", "test_translit", "test_utils", "test_typo"] import unittest def get_django_suite(): try: import django except ImportError: return unittest.TestSuite() import pytils.test.templatetags return...
# -*- coding: utf-8 -*- """ Unit tests for pytils """ __all__ = ["test_numeral", "test_dt", "test_translit", "test_utils", "test_typo"] import unittest import sys def get_django_suite(): try: import django except ImportError: return unittest.TestSuite() import pytils.test.templatetags...
Exit with non-0 status if there are failed tests or errors.
Py3: Exit with non-0 status if there are failed tests or errors.
Python
mit
Forever-Young/pytils,j2a/pytils
# -*- coding: utf-8 -*- """ Unit tests for pytils """ __all__ = ["test_numeral", "test_dt", "test_translit", "test_utils", "test_typo"] import unittest import sys def get_django_suite(): try: import django except ImportError: return unittest.TestSuite() import pytils.test.templatetags...
Py3: Exit with non-0 status if there are failed tests or errors. # -*- coding: utf-8 -*- """ Unit tests for pytils """ __all__ = ["test_numeral", "test_dt", "test_translit", "test_utils", "test_typo"] import unittest def get_django_suite(): try: import django except ImportError: return unitte...
54b3b69d152611d55ce7db66c2c34dc2b1140cc7
wellknown/models.py
wellknown/models.py
from django.db import models from django.db.models.signals import post_save import mimetypes import wellknown # # create default host-meta handler # from wellknown.resources import HostMeta wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml') # # resource model # class Resource(mo...
from django.db import models from django.db.models.signals import post_save import mimetypes import wellknown # # create default host-meta handler # from wellknown.resources import HostMeta wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml') # # resource model # class Resource(mo...
Remove code that was causing a problem running syncdb. Code seems to be redundant anyway.
Remove code that was causing a problem running syncdb. Code seems to be redundant anyway.
Python
bsd-3-clause
jcarbaugh/django-wellknown
from django.db import models from django.db.models.signals import post_save import mimetypes import wellknown # # create default host-meta handler # from wellknown.resources import HostMeta wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml') # # resource model # class Resource(mo...
Remove code that was causing a problem running syncdb. Code seems to be redundant anyway. from django.db import models from django.db.models.signals import post_save import mimetypes import wellknown # # create default host-meta handler # from wellknown.resources import HostMeta wellknown.register('host-meta', handl...
ee0d901f0eb8c098e715485efb7d43ade4a8aeb8
tests/test_nsq.py
tests/test_nsq.py
import os import unittest import numpy as np import chainer from chainer import optimizers import q_function import nstep_q_learning import async import simple_abc import random_seed import replay_buffer from simple_abc import ABC class TestNSQ(unittest.TestCase): def setUp(self): pass def test_ab...
Add a ABC test for n-step Q-learning
Add a ABC test for n-step Q-learning
Python
mit
toslunar/chainerrl,toslunar/chainerrl
import os import unittest import numpy as np import chainer from chainer import optimizers import q_function import nstep_q_learning import async import simple_abc import random_seed import replay_buffer from simple_abc import ABC class TestNSQ(unittest.TestCase): def setUp(self): pass def test_ab...
Add a ABC test for n-step Q-learning
0e740b5fd924b113173b546f2dd2b8fa1e55d074
indra/sparser/sparser_api.py
indra/sparser/sparser_api.py
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from indra.sparser.processor import SparserProcessor logger = logging.getLogger('sparser') def process_xml(xml_s...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from indra.sparser.processor import SparserProcessor logger = logging.getLogger('sparser') def process_xml(xml_s...
Print XML parse errors in Sparser API
Print XML parse errors in Sparser API
Python
bsd-2-clause
sorgerlab/belpy,bgyori/indra,johnbachman/belpy,bgyori/indra,johnbachman/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from indra.sparser.processor import SparserProcessor logger = logging.getLogger('sparser') def process_xml(xml_s...
Print XML parse errors in Sparser API from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from indra.sparser.processor import SparserProcessor logger = logging.getL...
3a711d6005b16fcc6faf19c80f292ad6ef25455c
sqlserver_ado/__init__.py
sqlserver_ado/__init__.py
import os.path VERSION = (1, 0, 0, 'stable') def get_version(): """ Return the version as a string. If this is flagged as a development release and mercurial can be loaded the specifics about the changeset will be appended to the version string. """ if 'dev' in VERSION: t...
import os.path VERSION = (1, 0, 1, 'stable') def get_version(): """ Return the version as a string. If this is flagged as a development release and mercurial can be loaded the specifics about the changeset will be appended to the version string. """ if 'dev' in VERSION: t...
Bump version to 1.0.1 for unit test fix.
Bump version to 1.0.1 for unit test fix.
Python
mit
theoriginalgri/django-mssql,theoriginalgri/django-mssql
import os.path VERSION = (1, 0, 1, 'stable') def get_version(): """ Return the version as a string. If this is flagged as a development release and mercurial can be loaded the specifics about the changeset will be appended to the version string. """ if 'dev' in VERSION: t...
Bump version to 1.0.1 for unit test fix. import os.path VERSION = (1, 0, 0, 'stable') def get_version(): """ Return the version as a string. If this is flagged as a development release and mercurial can be loaded the specifics about the changeset will be appended to the version string. ...
d5cf661b2658d7f9a0f5436444373202e514bf37
src/psd_tools2/__init__.py
src/psd_tools2/__init__.py
from __future__ import absolute_import, unicode_literals from .api.psd_image import PSDImage
from __future__ import absolute_import, unicode_literals from .api.psd_image import PSDImage from .api.composer import compose
Include compose in the top level
Include compose in the top level
Python
mit
kmike/psd-tools,psd-tools/psd-tools,kmike/psd-tools
from __future__ import absolute_import, unicode_literals from .api.psd_image import PSDImage from .api.composer import compose
Include compose in the top level from __future__ import absolute_import, unicode_literals from .api.psd_image import PSDImage
3540f827e12960b5ce48608249514051bb02cf61
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2012 Urban Airship and Contributors import os import sys import mithril try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requir...
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2012 Urban Airship and Contributors import os import sys import mithril try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requir...
Make sure to include migrations! :hurtrealbad:
Make sure to include migrations! :hurtrealbad:
Python
bsd-3-clause
urbanairship/django-mithril,urbanairship/django-mithril
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2012 Urban Airship and Contributors import os import sys import mithril try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requir...
Make sure to include migrations! :hurtrealbad: #!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2012 Urban Airship and Contributors import os import sys import mithril try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python...
6ec0b59c3f105f13503acaab691bccf3a6bf70b1
test/runtest/testargv.py
test/runtest/testargv.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
Add test for "runtest test/somedir" case
Add test for "runtest test/somedir" case
Python
mit
andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
Add test for "runtest test/somedir" case
2539f8adbe2b7deed2974c4245fd8087a8f05e65
wluopensource/osl_comments/models.py
wluopensource/osl_comments/models.py
from django.contrib.comments.models import Comment from django.db import models class OslComment(Comment): parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment') inline_to_object = models.BooleanField() edit_timestamp = models.DateTimeField(auto_now=True)
from django.contrib.comments.models import Comment from django.contrib.comments.signals import comment_was_posted from django.db import models class OslComment(Comment): parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment') inline_to_object = models.BooleanField() ...
Use signals to add authenticated user URL to comment when posted
Use signals to add authenticated user URL to comment when posted
Python
bsd-3-clause
jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website
from django.contrib.comments.models import Comment from django.contrib.comments.signals import comment_was_posted from django.db import models class OslComment(Comment): parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment') inline_to_object = models.BooleanField() ...
Use signals to add authenticated user URL to comment when posted from django.contrib.comments.models import Comment from django.db import models class OslComment(Comment): parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment') inline_to_object = models.BooleanField()...
d9330450854e5fd7b7e9d038283c8fb80058cc2e
scripts/ensure_tilesize.py
scripts/ensure_tilesize.py
#!/usr/bin/python # # This is a helper script to ensure an image has the correct tile size. # It uses pgmagick[1] to read and (if needed) correct the image. To use # it on a number of files one could use e.g. the find command: # # find <data-folder> -name *.jpg -exec scripts/ensure_tilesize.py {} 256 \; # # [1] http:...
Add script to ensure the correct tile size of a file
Add script to ensure the correct tile size of a file
Python
agpl-3.0
htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID
#!/usr/bin/python # # This is a helper script to ensure an image has the correct tile size. # It uses pgmagick[1] to read and (if needed) correct the image. To use # it on a number of files one could use e.g. the find command: # # find <data-folder> -name *.jpg -exec scripts/ensure_tilesize.py {} 256 \; # # [1] http:...
Add script to ensure the correct tile size of a file
e1111ad6e8802b3c90df55e05eb695d6db9005e4
import_script/create_users.py
import_script/create_users.py
#!/usr/bin/python import django.contrib.auth.models as auth_models import django.contrib.contenttypes as contenttypes def main(): # Read only user: # auth_models.User.objects.create_user('cube', 'toolkit_admin_readonly@localhost', '***REMOVED***') # Read/write user: user_rw = auth_models.User.objects...
#!/usr/bin/python import django.contrib.auth.models as auth_models import django.contrib.contenttypes as contenttypes def get_password(): print "*" * 80 password = raw_input("Please enter string to use as admin password: ") check_password = None while check_password != password: print ...
Remove cube credentials from import script
Remove cube credentials from import script
Python
agpl-3.0
BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit
#!/usr/bin/python import django.contrib.auth.models as auth_models import django.contrib.contenttypes as contenttypes def get_password(): print "*" * 80 password = raw_input("Please enter string to use as admin password: ") check_password = None while check_password != password: print ...
Remove cube credentials from import script #!/usr/bin/python import django.contrib.auth.models as auth_models import django.contrib.contenttypes as contenttypes def main(): # Read only user: # auth_models.User.objects.create_user('cube', 'toolkit_admin_readonly@localhost', '***REMOVED***') # Read/write ...
2f63f134d2c9aa67044eb176a3f81857279f107d
troposphere/utils.py
troposphere/utils.py
import time def get_events(conn, stackname): """Get the events in batches and return in chronological order""" next = None event_list = [] while 1: events = conn.describe_stack_events(stackname, next) event_list.append(events) if events.next_token is None: break ...
import time def _tail_print(e): print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id)) def get_events(conn, stackname): """Get the events in batches and return in chronological order""" next = None event_list = [] while 1: events = conn.describe_stack_events(stackname, next...
Support a custom logging function and sleep time within tail
Support a custom logging function and sleep time within tail
Python
bsd-2-clause
mhahn/troposphere
import time def _tail_print(e): print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id)) def get_events(conn, stackname): """Get the events in batches and return in chronological order""" next = None event_list = [] while 1: events = conn.describe_stack_events(stackname, next...
Support a custom logging function and sleep time within tail import time def get_events(conn, stackname): """Get the events in batches and return in chronological order""" next = None event_list = [] while 1: events = conn.describe_stack_events(stackname, next) event_list.append(event...
9982e62981a7ec0fc7f05dcc8b5eabe11c65d2b3
anthology/representations.py
anthology/representations.py
"""Representation filters for API""" from flask import make_response, current_app from bson.json_util import dumps def output_bson(data, code, headers=None): """Makes Flask response with a BSON encoded body Copied from module `flask_restful.representations.json` """ settings = current_app.config.g...
"""Representation filters for API""" from flask import make_response, current_app from bson.json_util import dumps def output_bson(data, code, headers=None): """Makes Flask response with a JSON encoded body. Response items are serialized from MongoDB BSON objects to JSON compatible format. Modified...
Correct JSON/BSON terminology in docstrings
Correct JSON/BSON terminology in docstrings
Python
mit
surfmikko/anthology
"""Representation filters for API""" from flask import make_response, current_app from bson.json_util import dumps def output_bson(data, code, headers=None): """Makes Flask response with a JSON encoded body. Response items are serialized from MongoDB BSON objects to JSON compatible format. Modified...
Correct JSON/BSON terminology in docstrings """Representation filters for API""" from flask import make_response, current_app from bson.json_util import dumps def output_bson(data, code, headers=None): """Makes Flask response with a BSON encoded body Copied from module `flask_restful.representations.json` ...
f7e85968a3256485276858ebfa9ef9cc538e2ee2
blimp/urls.py
blimp/urls.py
from django.conf.urls import patterns, include from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns( # Prefix '', (r'^admin/', include(admin.site.urls)), (r'^api/', include('blimp.router')), (r'', include('blimp.users.urls'))...
from django.conf.urls import patterns, include from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns( # Prefix '', (r'^admin/', include(admin.site.urls)), (r'^api/', include('blimp.router')), (r'', include('blimp.users.urls'))...
Fix catch all URL to allow APPEND_SLASH to work
Fix catch all URL to allow APPEND_SLASH to work
Python
agpl-3.0
jessamynsmith/boards-backend,jessamynsmith/boards-backend,GetBlimp/boards-backend
from django.conf.urls import patterns, include from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns( # Prefix '', (r'^admin/', include(admin.site.urls)), (r'^api/', include('blimp.router')), (r'', include('blimp.users.urls'))...
Fix catch all URL to allow APPEND_SLASH to work from django.conf.urls import patterns, include from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns( # Prefix '', (r'^admin/', include(admin.site.urls)), (r'^api/', include('blimp.ro...
aa6e5e93406cc614d1935f0ee61f28dbc955c2c0
forms.py
forms.py
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comm...
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comm...
Make numbers the default comments style
Make numbers the default comments style
Python
mit
JamieMagee/reddit2kindle,JamieMagee/reddit2kindle
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comm...
Make numbers the default comments style from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments...
7ceba1f2b83628a2b89ffbdd30e435970e8c5e91
tests/test_kafka_streams.py
tests/test_kafka_streams.py
""" Test the top-level Kafka Streams class """ import pytest from winton_kafka_streams import kafka_config from winton_kafka_streams.errors.kafka_streams_error import KafkaStreamsError from winton_kafka_streams.kafka_streams import KafkaStreams from winton_kafka_streams.processor.processor import BaseProcessor from ...
""" Test the top-level Kafka Streams class """ import pytest from winton_kafka_streams import kafka_config from winton_kafka_streams.errors.kafka_streams_error import KafkaStreamsError from winton_kafka_streams.kafka_streams import KafkaStreams from winton_kafka_streams.processor.processor import BaseProcessor from ...
Use more Pythonic name for test.
Use more Pythonic name for test.
Python
apache-2.0
wintoncode/winton-kafka-streams
""" Test the top-level Kafka Streams class """ import pytest from winton_kafka_streams import kafka_config from winton_kafka_streams.errors.kafka_streams_error import KafkaStreamsError from winton_kafka_streams.kafka_streams import KafkaStreams from winton_kafka_streams.processor.processor import BaseProcessor from ...
Use more Pythonic name for test. """ Test the top-level Kafka Streams class """ import pytest from winton_kafka_streams import kafka_config from winton_kafka_streams.errors.kafka_streams_error import KafkaStreamsError from winton_kafka_streams.kafka_streams import KafkaStreams from winton_kafka_streams.processor.pr...
da8efb34fe00f4c625c6ab7d3cf5651193d972d0
mopidy/backends/__init__.py
mopidy/backends/__init__.py
import logging import time from mopidy.exceptions import MpdNotImplemented from mopidy.models import Playlist logger = logging.getLogger('backends.base') class BaseBackend(object): current_playlist = None library = None playback = None stored_playlists = None uri_handlers = [] class BaseCurrentP...
import logging import time from mopidy.exceptions import MpdNotImplemented from mopidy.models import Playlist logger = logging.getLogger('backends.base') class BaseBackend(object): current_playlist = None library = None playback = None stored_playlists = None uri_handlers = [] class BaseCurrentP...
Add add method to BaseCurrentPlaylistController
Add add method to BaseCurrentPlaylistController
Python
apache-2.0
priestd09/mopidy,jcass77/mopidy,mokieyue/mopidy,ZenithDK/mopidy,SuperStarPL/mopidy,mopidy/mopidy,bencevans/mopidy,tkem/mopidy,quartz55/mopidy,rawdlite/mopidy,tkem/mopidy,quartz55/mopidy,glogiotatidis/mopidy,SuperStarPL/mopidy,adamcik/mopidy,woutervanwijk/mopidy,bencevans/mopidy,pacificIT/mopidy,hkariti/mopidy,bacontext...
import logging import time from mopidy.exceptions import MpdNotImplemented from mopidy.models import Playlist logger = logging.getLogger('backends.base') class BaseBackend(object): current_playlist = None library = None playback = None stored_playlists = None uri_handlers = [] class BaseCurrentP...
Add add method to BaseCurrentPlaylistController import logging import time from mopidy.exceptions import MpdNotImplemented from mopidy.models import Playlist logger = logging.getLogger('backends.base') class BaseBackend(object): current_playlist = None library = None playback = None stored_playlists...
fa6402472e30f59e67acf45d9faba632a3efc5e8
raiden/constants.py
raiden/constants.py
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUTE_MS = 60 * 100...
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 # Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457acfdcc0ee ROPSTEN_REGISTRY_ADDRESS = 'aff1f958c69a6820b08a02549ff9041629ae8257' ROPSTEN_DIS...
Update pre-deployed Ropsten contract addresses
Update pre-deployed Ropsten contract addresses
Python
mit
hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 # Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457acfdcc0ee ROPSTEN_REGISTRY_ADDRESS = 'aff1f958c69a6820b08a02549ff9041629ae8257' ROPSTEN_DIS...
Update pre-deployed Ropsten contract addresses # -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdc...
3d7707d20c299358476cca01babf14c7cacddb50
smaug/tests/fullstack/test_providers.py
smaug/tests/fullstack/test_providers.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Add fullstack tests of the resource providers
Add fullstack tests of the resource providers Change-Id: Ie4f769de3060fdb279320637ba965d5b452e2a2d Closes-Bug: #1578889
Python
apache-2.0
openstack/smaug,openstack/smaug
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Add fullstack tests of the resource providers Change-Id: Ie4f769de3060fdb279320637ba965d5b452e2a2d Closes-Bug: #1578889
9c2075f13e2aa8ff7a5c4644208e8de17ebefbab
finding-geodesic-basins-with-scipy.py
finding-geodesic-basins-with-scipy.py
# IPython log file import numpy as np from scipy import sparse from skimage import graph from skimage.graph import _mcp image = np.array([[1, 1, 2, 2], [2, 1, 1, 3], [3, 2, 1, 2], [2, 2, 2, 1]]) mcp = graph.MCP_Geometric(image) destinations = [[0, 0], [3, 3]] costs, traceback = mcp.find_costs(destinations) offsets = ...
# IPython log file # See https://stackoverflow.com/questions/62135639/mcp-geometrics-for-calculating-marketsheds/62144556 import numpy as np from scipy import sparse from skimage import graph from skimage.graph import _mcp image = np.array([[1, 1, 2, 2], [2, 1, 1, 3], [3, 2, 1, 2], [2, 2, 2, 1]]) mcp = graph.MCP_Geom...
Add link to SO question
Add link to SO question
Python
bsd-3-clause
jni/useful-histories
# IPython log file # See https://stackoverflow.com/questions/62135639/mcp-geometrics-for-calculating-marketsheds/62144556 import numpy as np from scipy import sparse from skimage import graph from skimage.graph import _mcp image = np.array([[1, 1, 2, 2], [2, 1, 1, 3], [3, 2, 1, 2], [2, 2, 2, 1]]) mcp = graph.MCP_Geom...
Add link to SO question # IPython log file import numpy as np from scipy import sparse from skimage import graph from skimage.graph import _mcp image = np.array([[1, 1, 2, 2], [2, 1, 1, 3], [3, 2, 1, 2], [2, 2, 2, 1]]) mcp = graph.MCP_Geometric(image) destinations = [[0, 0], [3, 3]] costs, traceback = mcp.find_costs...
dca8802b77a4682d9f6a09e68cdc807736e830a8
fmn/rules/buidsys.py
fmn/rules/buidsys.py
def buildsys_build_state_change(config, message): """ Buildsys: build changed state (started, failed, finished) TODO description for the web interface goes here """ return message['topic'].endswith('buildsys.build.state.change') def buildsys_package_list_change(config, message): """ Buildsys: P...
Add filters for the buildsystem messages
Add filters for the buildsystem messages
Python
lgpl-2.1
jeremycline/fmn,jeremycline/fmn,jeremycline/fmn
def buildsys_build_state_change(config, message): """ Buildsys: build changed state (started, failed, finished) TODO description for the web interface goes here """ return message['topic'].endswith('buildsys.build.state.change') def buildsys_package_list_change(config, message): """ Buildsys: P...
Add filters for the buildsystem messages
3595bffb71f415999847f323af36737a41ce4b56
main.py
main.py
from flask import Flask, request from pprint import pprint import json app = Flask(__name__) lastCommit = "No recorded commits!" @app.route("/") def hello(): return "IntegralGit: continuous integration via GitHub" @app.route("/update", methods=["POST"]) def update(): print json.dumps(request.form['payload']) r...
from flask import Flask, request from pprint import pprint import json app = Flask(__name__) lastCommit = "No recorded commits!" @app.route("/") def hello(): return "IntegralGit: continuous integration via GitHub" @app.route("/latest") def latest(): return lastCommit @app.route("/update", methods=["POST"]) def ...
Add code to show last commit message
Add code to show last commit message
Python
mit
LinuxMercedes/IntegralGit,LinuxMercedes/IntegralGit
from flask import Flask, request from pprint import pprint import json app = Flask(__name__) lastCommit = "No recorded commits!" @app.route("/") def hello(): return "IntegralGit: continuous integration via GitHub" @app.route("/latest") def latest(): return lastCommit @app.route("/update", methods=["POST"]) def ...
Add code to show last commit message from flask import Flask, request from pprint import pprint import json app = Flask(__name__) lastCommit = "No recorded commits!" @app.route("/") def hello(): return "IntegralGit: continuous integration via GitHub" @app.route("/update", methods=["POST"]) def update(): print j...
6072022e2debeb4dcd75e4969bd2beb16bac8827
source/sqlserver_ado/fields.py
source/sqlserver_ado/fields.py
"""This module provides SQL Server specific fields for Django models.""" from django.db.models import AutoField, ForeignKey, IntegerField class BigAutoField(AutoField): """A bigint IDENTITY field""" def get_internal_type(self): return "BigAutoField" def to_python(self, value): if ...
"""This module provides SQL Server specific fields for Django models.""" from django.db.models import AutoField, ForeignKey, IntegerField from django.forms import ValidationError class BigAutoField(AutoField): """A bigint IDENTITY field""" def get_internal_type(self): return "BigAutoField" ...
Fix import error for custom Field validation
Fix import error for custom Field validation
Python
mit
theoriginalgri/django-mssql,theoriginalgri/django-mssql
"""This module provides SQL Server specific fields for Django models.""" from django.db.models import AutoField, ForeignKey, IntegerField from django.forms import ValidationError class BigAutoField(AutoField): """A bigint IDENTITY field""" def get_internal_type(self): return "BigAutoField" ...
Fix import error for custom Field validation """This module provides SQL Server specific fields for Django models.""" from django.db.models import AutoField, ForeignKey, IntegerField class BigAutoField(AutoField): """A bigint IDENTITY field""" def get_internal_type(self): return "BigAutoField" ...
a27b03a89af6442dc8e1be3d310a8fc046a98ed4
foampy/tests.py
foampy/tests.py
""" Tests for foamPy. """ from .core import * from .dictionaries import * from .types import * from .foil import *
"""Tests for foamPy.""" from .core import * from .dictionaries import * from .types import * from .foil import * def test_load_all_torque_drag(): """Test the `load_all_torque_drag` function.""" t, torque, drag = load_all_torque_drag(casedir="test") assert t.max() == 4.0
Add test for loading all torque and drag data
Add test for loading all torque and drag data
Python
mit
petebachant/foamPy,petebachant/foamPy,petebachant/foamPy
"""Tests for foamPy.""" from .core import * from .dictionaries import * from .types import * from .foil import * def test_load_all_torque_drag(): """Test the `load_all_torque_drag` function.""" t, torque, drag = load_all_torque_drag(casedir="test") assert t.max() == 4.0
Add test for loading all torque and drag data """ Tests for foamPy. """ from .core import * from .dictionaries import * from .types import * from .foil import *
3295b30ba3e243801a520adff332663dbe490cf9
tools/mini_spectrum.py
tools/mini_spectrum.py
# -*- encoding: utf-8 -*- # JN 2016-02-16 """ Plot a spectrum from the first 1000 records of data """ import sys import scipy.signal as sig import matplotlib.pyplot as mpl from combinato import NcsFile, DefaultFilter def plot_spectrum(fname): fid = NcsFile(fname) rawdata = fid.read(0, 1000) data = rawda...
Add small plot of power spectral density
Add small plot of power spectral density
Python
mit
jniediek/combinato
# -*- encoding: utf-8 -*- # JN 2016-02-16 """ Plot a spectrum from the first 1000 records of data """ import sys import scipy.signal as sig import matplotlib.pyplot as mpl from combinato import NcsFile, DefaultFilter def plot_spectrum(fname): fid = NcsFile(fname) rawdata = fid.read(0, 1000) data = rawda...
Add small plot of power spectral density
53e1ff21bb219495f1b99f84dbb31624fdd35231
lpthw/ex33.py
lpthw/ex33.py
#i = 0 #numbers = [] #while i < 6: # print "At the top i is %d" % i # numbers.append(i) # # i += 1 # print "Numbers now: ", numbers # print "At the bottom i is %d" % i # # #print "The numbers: " # #for num in numbers: # print num #Study Drills print "What's the limit of the list?" a = raw_input("> "...
#i = 0 #numbers = [] #while i < 6: # print "At the top i is %d" % i # numbers.append(i) # # i += 1 # print "Numbers now: ", numbers # print "At the bottom i is %d" % i # # #print "The numbers: " # #for num in numbers: # print num #Study Drills print "What's the limit of the list?" a = int(raw_input(...
Fix that crazy error that would cause enless looping...
Fix that crazy error that would cause enless looping...
Python
mit
jaredmanning/learning,jaredmanning/learning
#i = 0 #numbers = [] #while i < 6: # print "At the top i is %d" % i # numbers.append(i) # # i += 1 # print "Numbers now: ", numbers # print "At the bottom i is %d" % i # # #print "The numbers: " # #for num in numbers: # print num #Study Drills print "What's the limit of the list?" a = int(raw_input(...
Fix that crazy error that would cause enless looping... #i = 0 #numbers = [] #while i < 6: # print "At the top i is %d" % i # numbers.append(i) # # i += 1 # print "Numbers now: ", numbers # print "At the bottom i is %d" % i # # #print "The numbers: " # #for num in numbers: # print num #Study Drills...
31921ce5ca7ccbaa2db8b8fa11b2b9a6caa14aeb
daisyproducer/settings.py
daisyproducer/settings.py
from settings_common import * PACKAGE_VERSION = "0.5" DEBUG = TEMPLATE_DEBUG = True DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp', 'pipeline') EXTERNAL_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp') SERVE_STATIC_FILES = True # the following is an idea from https://code.djangopr...
from settings_common import * PACKAGE_VERSION = "0.5" DEBUG = TEMPLATE_DEBUG = True DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp', 'pipeline') EXTERNAL_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp') SERVE_STATIC_FILES = True # the following is an idea from https://code.djangopr...
Use django.contrib.staticfiles when running locally
Use django.contrib.staticfiles when running locally so that the admin interface uses the proper css when running on the dev machine
Python
agpl-3.0
sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer
from settings_common import * PACKAGE_VERSION = "0.5" DEBUG = TEMPLATE_DEBUG = True DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp', 'pipeline') EXTERNAL_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp') SERVE_STATIC_FILES = True # the following is an idea from https://code.djangopr...
Use django.contrib.staticfiles when running locally so that the admin interface uses the proper css when running on the dev machine from settings_common import * PACKAGE_VERSION = "0.5" DEBUG = TEMPLATE_DEBUG = True DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', '..', 'tmp', 'pipeline') EXTERNAL_PATH ...