commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
a5ceaa6401c53fc99a85ef69ee1357996877e141
ocradmin/core/tests/testutils.py
ocradmin/core/tests/testutils.py
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
Add a function to symlink reference_page files into existance
Add a function to symlink reference_page files into existance
Python
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
<commit_before>""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at t...
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at test teardown. ...
<commit_before>""" Functions for performing test setup/teardown etc. """ import os MODELDIR = "etc/defaultmodels" def symlink_model_fixtures(): """ Create symlinks between the files referenced in the OcrModel fixtures and our default model files. Need to do this because they get deleted again at t...
c79bec872f1bd9158d202cade39d5e2351688c22
src/hireme/server.py
src/hireme/server.py
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve) app.add...
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve, methods=['G...
Allow POST as well as GET
Allow POST as well as GET
Python
bsd-2-clause
cutoffthetop/hireme
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve) app.add...
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve, methods=['G...
<commit_before># -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.sol...
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve, methods=['G...
# -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.solve) app.add...
<commit_before># -*- coding: utf-8 -*- from tasks import task1, task2 import flask def index(): return flask.render_template('index.html', title='index') def app_factory(): app = flask.Flask(import_name=__package__) app.add_url_rule('/', 'index', index) app.add_url_rule('/task1', 'task1', task1.sol...
9ea7e49e11c3e05b86b9eeaffd416285c9a2551a
pushhub/models.py
pushhub/models.py
from persistent.mapping import PersistentMapping class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root import transaction transaction.commit() return zodb_roo...
from persistent.mapping import PersistentMapping from .subsciber import Subscribers from .topic import Topics class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root impor...
Add folder set up to the ZODB on app creation.
Add folder set up to the ZODB on app creation.
Python
bsd-3-clause
ucla/PushHubCore
from persistent.mapping import PersistentMapping class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root import transaction transaction.commit() return zodb_roo...
from persistent.mapping import PersistentMapping from .subsciber import Subscribers from .topic import Topics class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root impor...
<commit_before>from persistent.mapping import PersistentMapping class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root import transaction transaction.commit() ...
from persistent.mapping import PersistentMapping from .subsciber import Subscribers from .topic import Topics class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root impor...
from persistent.mapping import PersistentMapping class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root import transaction transaction.commit() return zodb_roo...
<commit_before>from persistent.mapping import PersistentMapping class Root(PersistentMapping): __parent__ = __name__ = None def appmaker(zodb_root): if not 'app_root' in zodb_root: app_root = Root() zodb_root['app_root'] = app_root import transaction transaction.commit() ...
d788375843d42d1de3c0143064e905a932394e30
library/tests/test_factories.py
library/tests/test_factories.py
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
Test that BookSpecimenFactory also creates the related book
Test that BookSpecimenFactory also creates the related book
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,ideascube/ideascube
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
<commit_before>import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factor...
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
<commit_before>import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factor...
972eaa90d4ffad7f4e74792e2bdc4917e5eb7c3a
puffin/core/compose.py
puffin/core/compose.py
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
Add dummy Let's Encrypt email
Add dummy Let's Encrypt email
Python
agpl-3.0
loomchild/jenca-puffin,loomchild/puffin,puffinrocks/puffin,loomchild/puffin,loomchild/puffin,puffinrocks/puffin,loomchild/puffin,loomchild/puffin,loomchild/jenca-puffin
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
<commit_before>from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): ...
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): compose_run(ma...
<commit_before>from .applications import get_application_domain, get_application_name from .machine import get_env_vars from .. import app from subprocess import Popen, STDOUT, PIPE from os import environ from os.path import join def init(): pass def compose_start(machine, user, application, **environment): ...
a292f2978f07839af07a8963a51fd48b046f0c73
website/addons/mendeley/settings/__init__.py
website/addons/mendeley/settings/__init__.py
import logging from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: logging.warn('No local.py settings file found')
import logging from .defaults import * # noqa logger = logging.getLogger(__name__) try: from .local import * # noqa except ImportError as error: logger.warn('No local.py settings file found')
Use namespaces logger in mendeley settings
Use namespaces logger in mendeley settings h/t Arpita for catching this [skip ci]
Python
apache-2.0
brianjgeiger/osf.io,Johnetordoff/osf.io,samchrisinger/osf.io,KAsante95/osf.io,crcresearch/osf.io,arpitar/osf.io,danielneis/osf.io,cslzchen/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,asanfilippo7/osf.io,kwierman/osf.io,SSJohns/osf.io,GageGaskins/osf.io,GageGaskins/osf.io,danielneis/osf.io,brandonPurvis/osf.io,emetsger/o...
import logging from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: logging.warn('No local.py settings file found') Use namespaces logger in mendeley settings h/t Arpita for catching this [skip ci]
import logging from .defaults import * # noqa logger = logging.getLogger(__name__) try: from .local import * # noqa except ImportError as error: logger.warn('No local.py settings file found')
<commit_before>import logging from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: logging.warn('No local.py settings file found') <commit_msg>Use namespaces logger in mendeley settings h/t Arpita for catching this [skip ci]<commit_after>
import logging from .defaults import * # noqa logger = logging.getLogger(__name__) try: from .local import * # noqa except ImportError as error: logger.warn('No local.py settings file found')
import logging from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: logging.warn('No local.py settings file found') Use namespaces logger in mendeley settings h/t Arpita for catching this [skip ci]import logging from .defaults import * # noqa logger = logging.getLo...
<commit_before>import logging from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: logging.warn('No local.py settings file found') <commit_msg>Use namespaces logger in mendeley settings h/t Arpita for catching this [skip ci]<commit_after>import logging from .defaults...
a5ff4c247030559c83a06976fcda062c0c42d810
django_fixmystreet/fixmystreet/tests/__init__.py
django_fixmystreet/fixmystreet/tests/__init__.py
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
Fix unit test fixtures files
Fix unit test fixtures files
Python
agpl-3.0
IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
<commit_before>import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid ...
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
<commit_before>import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid ...
1020bf478da327ddb805b28c6676c58ccef6675e
{{cookiecutter.repo_name}}/tests/test_cli.py
{{cookiecutter.repo_name}}/tests/test_cli.py
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
Fix mock to import app from cli
Fix mock to import app from cli
Python
mit
hackebrot/cookiedozer,hackebrot/cookiedozer
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
<commit_before>import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return reques...
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return request.param @pyte...
<commit_before>import pytest from click.testing import CliRunner from cli import main @pytest.fixture def runner(): return CliRunner() @pytest.fixture(params=['fr', 'en', 'tlh']) def lang(request): return request.param @pytest.fixture(params=['-l', '--language']) def cli_param(request): return reques...
faa4125dd8c491eb360ccfea5609a0dabb3cccda
fluent/apps.py
fluent/apps.py
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
Add missing name to the AppConfig
Add missing name to the AppConfig
Python
mit
potatolondon/fluent-2.0,potatolondon/fluent-2.0
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
<commit_before> try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatableco...
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatablecontent.required ...
<commit_before> try: # Configure a generator if the user is using model_mommy from model_mommy import generators def gen_translatablecontent(max_length): from fluent.fields import TranslatableContent return TranslatableContent(text=generators.gen_string(max_length)) gen_translatableco...
8812341b705e6cec98b2708d0a1481d769f5f476
salt/runners/config.py
salt/runners/config.py
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils def get(key, default='', delimiter=':'): ''' Retrieve master config options, with optional n...
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils import salt.utils.sdb def get(key, default='', delimiter=':'): ''' Retrieve master config op...
Add sdb support, and also properly return the default
Add sdb support, and also properly return the default
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils def get(key, default='', delimiter=':'): ''' Retrieve master config options, with optional n...
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils import salt.utils.sdb def get(key, default='', delimiter=':'): ''' Retrieve master config op...
<commit_before># -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils def get(key, default='', delimiter=':'): ''' Retrieve master config options, ...
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils import salt.utils.sdb def get(key, default='', delimiter=':'): ''' Retrieve master config op...
# -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils def get(key, default='', delimiter=':'): ''' Retrieve master config options, with optional n...
<commit_before># -*- coding: utf-8 -*- ''' This runner is designed to mirror the execution module config.py, but for master settings ''' from __future__ import absolute_import from __future__ import print_function import salt.utils def get(key, default='', delimiter=':'): ''' Retrieve master config options, ...
4e9c0cb3cd0d74ce008f0279bc6e9ec353c03fee
senlin_dashboard/api/utils.py
senlin_dashboard/api/utils.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Use entities.reverse() rather sorted(.., reverse=True)
Use entities.reverse() rather sorted(.., reverse=True) Change-Id: I33ee5b078e3d27a45bd159be0f0b241c20792f92
Python
apache-2.0
openstack/senlin-dashboard,stackforge/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard,openstack/senlin-dashboard
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
<commit_before># 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 # dist...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
<commit_before># 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 # dist...
5812aae9059ede1a3cb19be9033ebc435d5ebb94
scripts/create_user.py
scripts/create_user.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
Fix MySQL command executing (MySQL commit).
scripts: Fix MySQL command executing (MySQL commit).
Python
mit
alberand/tserver,alberand/tserver,alberand/tserver,alberand/tserver
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector...
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector...
d187a8434c9d64171f76efa3055bdc06afbc8981
scripts/pystart.py
scripts/pystart.py
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in this block exec(open(home+'/homedir/scripts/hexecho.py').read()) else: # Python 2 code in thi...
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil sys.ps1 = '\001\033[96m\002>>> \001\033[0m\002' sys.ps2 = '\001\033[96m\002... \001\033[0m\002' def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in t...
Add color to python prompt
Add color to python prompt
Python
mit
jdanders/homedir,jdanders/homedir,jdanders/homedir,jdanders/homedir
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in this block exec(open(home+'/homedir/scripts/hexecho.py').read()) else: # Python 2 code in thi...
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil sys.ps1 = '\001\033[96m\002>>> \001\033[0m\002' sys.ps2 = '\001\033[96m\002... \001\033[0m\002' def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in t...
<commit_before>import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in this block exec(open(home+'/homedir/scripts/hexecho.py').read()) else: # Pytho...
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil sys.ps1 = '\001\033[96m\002>>> \001\033[0m\002' sys.ps2 = '\001\033[96m\002... \001\033[0m\002' def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in t...
import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in this block exec(open(home+'/homedir/scripts/hexecho.py').read()) else: # Python 2 code in thi...
<commit_before>import os,sys,re from time import sleep from pprint import pprint home = os.path.expanduser('~') from math import log,ceil def clog2(num): return int(ceil(log(num,2))) if (sys.version_info > (3, 0)): # Python 3 code in this block exec(open(home+'/homedir/scripts/hexecho.py').read()) else: # Pytho...
d8b13dcb884046ee43d54fcf27f1bbfd0ff3263a
sentrylogs/parsers/__init__.py
sentrylogs/parsers/__init__.py
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message class Parser(object): """Abstract base class for any parser""" def __init__(self, filepath): self.filepath = filepath self.logger = self.__doc__.stri...
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message try: (FileNotFoundError, PermissionError) except NameError: # Python 2.7 FileNotFoundError = IOError # pylint: disable=redefined-builtin PermissionError = IOErro...
Handle FileNotFound and Permission errors gracefully
Handle FileNotFound and Permission errors gracefully
Python
bsd-3-clause
bittner/sentrylogs,mdgart/sentrylogs
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message class Parser(object): """Abstract base class for any parser""" def __init__(self, filepath): self.filepath = filepath self.logger = self.__doc__.stri...
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message try: (FileNotFoundError, PermissionError) except NameError: # Python 2.7 FileNotFoundError = IOError # pylint: disable=redefined-builtin PermissionError = IOErro...
<commit_before>""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message class Parser(object): """Abstract base class for any parser""" def __init__(self, filepath): self.filepath = filepath self.logger = se...
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message try: (FileNotFoundError, PermissionError) except NameError: # Python 2.7 FileNotFoundError = IOError # pylint: disable=redefined-builtin PermissionError = IOErro...
""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message class Parser(object): """Abstract base class for any parser""" def __init__(self, filepath): self.filepath = filepath self.logger = self.__doc__.stri...
<commit_before>""" Log file parsers provided by Sentry Logs """ import tailer # same functionality as UNIX tail in python from ..helpers import send_message class Parser(object): """Abstract base class for any parser""" def __init__(self, filepath): self.filepath = filepath self.logger = se...
a7e87621b3223e0c4df9d417129fcb7da545c629
integration/integration.py
integration/integration.py
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(variables): theta = 0 for var in variables: theta += var return np.sin(theta) def gen_random_list(count, rmin, rmax): variables = [] for i in range(count): value = np.rand...
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(theta): return np.sin(theta) def gen_random_value(count, rmin, rmax): value = 0 for i in range(count): value += np.random.uniform(rmin, rmax) # test_range(rmin, rmax, value) retu...
Add preliminary function to execute monte-carlo approximation.
Add preliminary function to execute monte-carlo approximation. Adjust functions, remove some generality for speed. Implement monte-carlo for the exercise case with initial config. No error calculation or execution for varied N yet. Initial tests with N = 10^7 give a value of ~537.1 and take ~1.20min.
Python
mit
lemming52/white_knight
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(variables): theta = 0 for var in variables: theta += var return np.sin(theta) def gen_random_list(count, rmin, rmax): variables = [] for i in range(count): value = np.rand...
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(theta): return np.sin(theta) def gen_random_value(count, rmin, rmax): value = 0 for i in range(count): value += np.random.uniform(rmin, rmax) # test_range(rmin, rmax, value) retu...
<commit_before># Python Packages import random # External Packages import numpy as np def sin_theta_sum(variables): theta = 0 for var in variables: theta += var return np.sin(theta) def gen_random_list(count, rmin, rmax): variables = [] for i in range(count): ...
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(theta): return np.sin(theta) def gen_random_value(count, rmin, rmax): value = 0 for i in range(count): value += np.random.uniform(rmin, rmax) # test_range(rmin, rmax, value) retu...
# Python Packages import random # External Packages import numpy as np def sin_theta_sum(variables): theta = 0 for var in variables: theta += var return np.sin(theta) def gen_random_list(count, rmin, rmax): variables = [] for i in range(count): value = np.rand...
<commit_before># Python Packages import random # External Packages import numpy as np def sin_theta_sum(variables): theta = 0 for var in variables: theta += var return np.sin(theta) def gen_random_list(count, rmin, rmax): variables = [] for i in range(count): ...
1b84734f9f016e098fa82e596ae851f3b9d4fe2b
simplecrypto/hashes.py
simplecrypto/hashes.py
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
Use SHA-256 as default hash
Use SHA-256 as default hash
Python
mit
boppreh/simplecrypto
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
<commit_before>""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() de...
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() def sha1(message)...
<commit_before>""" Module for standard hash algorithms, always returning the hash in hexadecimal string format. """ import hashlib from .formats import to_bytes def md5(message): """ Returns the hexadecimal representation of the MD5 hash digest. """ return hashlib.md5(to_bytes(message)).hexdigest() de...
1c41a79dc46bf717ee43ad46ac499f5310ad792e
invite/urls.py
invite/urls.py
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/(<slug:code>)/', views.resend, name='resend'), path('revoke/(<slug:code>)/', views.revoke, name='revoke'), path('...
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/<slug:code>/', views.resend, name='resend'), path('revoke/<slug:code>/', views.revoke, name='revoke'), path('logi...
Fix issue with URL patterns adding parentheses around codes.
Fix issue with URL patterns adding parentheses around codes.
Python
bsd-3-clause
unt-libraries/django-invite,unt-libraries/django-invite
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/(<slug:code>)/', views.resend, name='resend'), path('revoke/(<slug:code>)/', views.revoke, name='revoke'), path('...
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/<slug:code>/', views.resend, name='resend'), path('revoke/<slug:code>/', views.revoke, name='revoke'), path('logi...
<commit_before>from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/(<slug:code>)/', views.resend, name='resend'), path('revoke/(<slug:code>)/', views.revoke, name='revok...
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/<slug:code>/', views.resend, name='resend'), path('revoke/<slug:code>/', views.revoke, name='revoke'), path('logi...
from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/(<slug:code>)/', views.resend, name='resend'), path('revoke/(<slug:code>)/', views.revoke, name='revoke'), path('...
<commit_before>from django.urls import path from invite import views app_name = 'invite' urlpatterns = [ path('', views.index, name='index'), path('invite/', views.invite, name='invite'), path('resend/(<slug:code>)/', views.resend, name='resend'), path('revoke/(<slug:code>)/', views.revoke, name='revok...
bfd8ac40bed4535a91bfd645cbe80b47c827a8de
librarian/embeds/mathml.py
librarian/embeds/mathml.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.parse(get_resource(...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): """ >>> print(MathML(etr...
Fix XML entities left from MathML.
Fix XML entities left from MathML.
Python
agpl-3.0
fnp/librarian,fnp/librarian
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.parse(get_resource(...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): """ >>> print(MathML(etr...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.pars...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): """ >>> print(MathML(etr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.parse(get_resource(...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from lxml import etree import six from librarian import get_resource from . import TreeEmbed, create_embed, downgrades_to class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.pars...
ac55f6936551a0927b25aa520ab49649a6b4a904
plugins/basic_info_plugin.py
plugins/basic_info_plugin.py
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
Put basic info in one table
Put basic info in one table
Python
mit
Sakartu/stringinfo
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
<commit_before>import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info a...
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info about the string...
<commit_before>import string import textwrap from veryprettytable import VeryPrettyTable from plugins import BasePlugin __author__ = 'peter' class BasicInfoPlugin(BasePlugin): short_description = 'Basic info:' default = True description = textwrap.dedent('''\ This plugin provides some basic info a...
a922c8ed94670a70d9c3351ac7fa59e4d4a8ae65
polyaxon/libs/repos/utils.py
polyaxon/libs/repos/utils.py
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
Use latest build schema commit -> ref
Use latest build schema commit -> ref
Python
apache-2.0
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
<commit_before>from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: ret...
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
<commit_before>from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: ret...
98a79f8caf90cfed01f9dceaa70e71892ea42116
parsl/tests/test_staging/test_implicit_staging_ftp.py
parsl/tests/test_staging/test_implicit_staging_ftp.py
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
Change test FTP server address
Change test FTP server address
Python
apache-2.0
Parsl/parsl,Parsl/parsl,Parsl/parsl,Parsl/parsl,swift-lang/swift-e-lab,swift-lang/swift-e-lab
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
<commit_before>import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs =...
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs = u.readlines() ...
<commit_before>import pytest import parsl from parsl.app.app import App from parsl.data_provider.files import File from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def sort_strings(inputs=[], outputs=[]): with open(inputs[0].filepath, 'r') as u: strs =...
aa69ae87a947ee17d72d7881dc61a5091772ff6c
pythainlp/segment/pyicu.py
pythainlp/segment/pyicu.py
from __future__ import absolute_import,print_function from itertools import groupby import PyICU import six # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) bre...
from __future__ import absolute_import,print_function from itertools import groupby import PyICU # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) breaks = list(...
Revert "fix bug import six"
Revert "fix bug import six" This reverts commit a80c1d7c80d68f72d435dbb7ac5c48a6114716fb.
Python
apache-2.0
PyThaiNLP/pythainlp
from __future__ import absolute_import,print_function from itertools import groupby import PyICU import six # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) bre...
from __future__ import absolute_import,print_function from itertools import groupby import PyICU # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) breaks = list(...
<commit_before>from __future__ import absolute_import,print_function from itertools import groupby import PyICU import six # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six....
from __future__ import absolute_import,print_function from itertools import groupby import PyICU # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) breaks = list(...
from __future__ import absolute_import,print_function from itertools import groupby import PyICU import six # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six.u(txt)) bre...
<commit_before>from __future__ import absolute_import,print_function from itertools import groupby import PyICU import six # ตัดคำภาษาไทย def segment(txt): """รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU""" bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th")) bd.setText(six....
cbea20e07807df21645c0edd52ccfdef2c5f72f1
modules/dispatcher.py
modules/dispatcher.py
from os import unlink from configobj import ConfigObj from tests.ch_mock import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in chann...
from os import unlink from configobj import ConfigObj from twitter import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in channels: ...
Replace mock Twitter channel with actual channel
Replace mock Twitter channel with actual channel
Python
mit
alfie-max/Publish
from os import unlink from configobj import ConfigObj from tests.ch_mock import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in chann...
from os import unlink from configobj import ConfigObj from twitter import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in channels: ...
<commit_before>from os import unlink from configobj import ConfigObj from tests.ch_mock import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for c...
from os import unlink from configobj import ConfigObj from twitter import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in channels: ...
from os import unlink from configobj import ConfigObj from tests.ch_mock import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for channel in chann...
<commit_before>from os import unlink from configobj import ConfigObj from tests.ch_mock import Twitter def Dispatch(channels, msgFile): msgConfig = ConfigObj(msgFile) Topic = msgConfig['Topic'] To_Email = msgConfig['To_Email'] Message = msgConfig['Message'] unlink(msgFile) reply = {} for c...
8cfa861107ae9ed829561300baeab74e7d0dd0f3
mysite/urls.py
mysite/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
Add a separate endpoint for posting postcode lookups to
Add a separate endpoint for posting postcode lookups to
Python
agpl-3.0
mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,DemocracyClub/yournextrepresentative,mysociety/yournextrepresentative,openstate/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextmp-popit,neavouli/yournextrepresentative,openstate/yournextrepresentative,openst...
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
<commit_before>from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', Constituency...
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', ConstituencyPostcodeFinderV...
<commit_before>from django.conf.urls import patterns, include, url from django.contrib import admin from candidates.views import (ConstituencyPostcodeFinderView, ConstituencyDetailView, CandidacyView, CandidacyDeleteView, NewPersonView) admin.autodiscover() urlpatterns = patterns('', url(r'^$', Constituency...
61253510bc859ec1695484d11cbadcd92ad4b107
tests/test_misc.py
tests/test_misc.py
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_markdown() ...
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_...
Add test for allow harmful protocols
Add test for allow harmful protocols
Python
bsd-3-clause
lepture/mistune
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_markdown() ...
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_...
<commit_before>import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create...
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_...
import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create_markdown() ...
<commit_before>import mistune from unittest import TestCase class TestMiscCases(TestCase): def test_none(self): self.assertEqual(mistune.html(None), '') def test_before_parse_hooks(self): def _add_name(md, s, state): state['name'] = 'test' return s, state md = mistune.create...
2e187ae5ac2b38b0b704d2d24be56d7ebf529231
alignak_backend/__init__.py
alignak_backend/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 1) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 2) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
Set package version to 0.4.2
Set package version to 0.4.2
Python
agpl-3.0
Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 1) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 2) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 1) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 2) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 1) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 1) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ ...
ff14a65284603e27cff9628cd8eec0c4cfd8e81d
pale/arguments/url.py
pale/arguments/url.py
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): def validate_url(self, original_string): """Returns the original string if it was valid, raises an argument ...
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): path_only = False def validate_url(self, original_string): """Returns the original string if it was valid, r...
Add path_only support to URLArgument
Add path_only support to URLArgument
Python
mit
Loudr/pale
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): def validate_url(self, original_string): """Returns the original string if it was valid, raises an argument ...
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): path_only = False def validate_url(self, original_string): """Returns the original string if it was valid, r...
<commit_before>from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): def validate_url(self, original_string): """Returns the original string if it was valid, raises an ...
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): path_only = False def validate_url(self, original_string): """Returns the original string if it was valid, r...
from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): def validate_url(self, original_string): """Returns the original string if it was valid, raises an argument ...
<commit_before>from __future__ import absolute_import import string import urlparse from pale.arguments.string import StringArgument from pale.errors import ArgumentError class URLArgument(StringArgument): def validate_url(self, original_string): """Returns the original string if it was valid, raises an ...
213b889a580f58f5dea13fa63c999ca7dac04450
src/extras/__init__.py
src/extras/__init__.py
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis from stemmed_kucera_francis import StemmedKuceraFrancis
Add Stemmed Kucera Francis to extras package
Add Stemmed Kucera Francis to extras package
Python
mit
Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancisAdd Stemmed Kucera Francis to extras package
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis from stemmed_kucera_francis import StemmedKuceraFrancis
<commit_before>__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis<commit_msg>Add Stemmed Kucera Francis to extras package<commit_after>
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis from stemmed_kucera_francis import StemmedKuceraFrancis
__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancisAdd Stemmed Kucera Francis to extras package__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis from stemme...
<commit_before>__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera_francis import KuceraFrancis<commit_msg>Add Stemmed Kucera Francis to extras package<commit_after>__author__ = 's7a' # All imports from logger import Logger from sanitizer import Sanitizer from kucera...
06349ea257219e8ad1808fa4fd77f34f7371894a
test/test.py
test/test.py
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass try: os.path.mkdir('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbt...
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output') asse...
Remove dead code, os.path.mkdir does not even exist
Remove dead code, os.path.mkdir does not even exist
Python
bsd-3-clause
davvo/mbutil-eniro,mapbox/mbutil,mapbox/mbutil
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass try: os.path.mkdir('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbt...
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output') asse...
<commit_before>import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass try: os.path.mkdir('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_...
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output') asse...
import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass try: os.path.mkdir('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_disk(): mbt...
<commit_before>import os, shutil from nose import with_setup from mbutil import mbtiles_to_disk, disk_to_mbtiles def clear_data(): try: shutil.rmtree('test/output') except Exception: pass try: os.path.mkdir('test/output') except Exception: pass @with_setup(clear_data, clear_data) def test_mbtiles_to_...
d91b8f96290498f1e36d64bd797fcea5e43d3df1
apps/events/api.py
apps/events/api.py
from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name = 'events'
from copy import copy from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): def alter_list_data_to_serialize(self, request, data): # Rename list data object to 'events'. if isinstance(data, dict): data['events'] = copy(data['objects']...
Rename data objects to 'events'
Rename data objects to 'events'
Python
mit
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name = 'events' Rename data objects to 'events'
from copy import copy from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): def alter_list_data_to_serialize(self, request, data): # Rename list data object to 'events'. if isinstance(data, dict): data['events'] = copy(data['objects']...
<commit_before>from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name = 'events' <commit_msg>Rename data objects to 'events'<commit_after>
from copy import copy from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): def alter_list_data_to_serialize(self, request, data): # Rename list data object to 'events'. if isinstance(data, dict): data['events'] = copy(data['objects']...
from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name = 'events' Rename data objects to 'events'from copy import copy from tastypie.resources import ModelResource from models import Event c...
<commit_before>from tastypie.resources import ModelResource from models import Event class EventResource(ModelResource): class Meta: queryset = Event.objects.all() resource_name = 'events' <commit_msg>Rename data objects to 'events'<commit_after>from copy import copy from tastypie.resources import ...
0ce7a7b396dd62c7e52e355108f8f037335bc5ca
src/sentry/api/endpoints/project_environments.py
src/sentry/api/endpoints/project_environments.py
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
Hide "No Environment" environment from project environments
api: Hide "No Environment" environment from project environments
Python
bsd-3-clause
beeftornado/sentry,beeftornado/sentry,mvaled/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,mvaled/sentry,beeftornado/sentry,mvaled/sentry,looker/sentry,looker/sentry,looker/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
<commit_before>from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: quer...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: queryset, 'hidd...
<commit_before>from __future__ import absolute_import from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.models import EnvironmentProject environment_visibility_filter_options = { 'all': lambda queryset: quer...
e652e57be097949d06acd06cef813fd28a45afc2
base_report_auto_create_qweb/__manifest__.py
base_report_auto_create_qweb/__manifest__.py
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
Change authors to new ones
base_report_auto_create_qweb: Change authors to new ones
Python
agpl-3.0
ovnicraft/server-tools,ovnicraft/server-tools,ovnicraft/server-tools
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
<commit_before># -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], ...
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
# -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], "external_d...
<commit_before># -*- coding: utf-8 -*- # Authors: See README.RST for Contributors # Copyright 2015-2016 See __openerp__.py for Authors # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Report qweb auto generation", "version": "9.0.1.0.0", "depends": [ "report", ], ...
c94be38207dc9ec0cdf9c3d406954a249ff6e6ac
awsume/awsumepy/lib/saml.py
awsume/awsumepy/lib/saml.py
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
Handle having a single role in the SAML assertion
Handle having a single role in the SAML assertion
Python
mit
trek10inc/awsume,trek10inc/awsume
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
<commit_before>import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response'...
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response') is not None: ...
<commit_before>import base64 import xmltodict import json import colorama from . safe_print import safe_print from . exceptions import SAMLAssertionParseError def parse_assertion(assertion: str) -> list: roles = [] response = xmltodict.parse(base64.b64decode(assertion)) if response.get('saml2p:Response'...
02bacade9f9680662196e09b9d95086113e03da9
website/settings/local-travis.py
website/settings/local-travis.py
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
Add default test db name to travis local.py
Add default test db name to travis local.py
Python
apache-2.0
erinspace/osf.io,zachjanicki/osf.io,kch8qx/osf.io,brianjgeiger/osf.io,icereval/osf.io,brandonPurvis/osf.io,alexschiller/osf.io,felliott/osf.io,mfraezz/osf.io,billyhunt/osf.io,Johnetordoff/osf.io,caneruguz/osf.io,GageGaskins/osf.io,chennan47/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,leb2dg/osf.io,crcresearch/osf.io,ale...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
<commit_before># -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template cach...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc. SEAR...
<commit_before># -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' from . import defaults DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off template cach...
bf4c26907522a04ec77274d8f862e853a64f7d6a
avalon/__main__.py
avalon/__main__.py
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
Refactor manager argument to sceneinventory
Refactor manager argument to sceneinventory
Python
mit
mindbender-studio/core,getavalon/core,mindbender-studio/core,getavalon/core
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
<commit_before>import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
<commit_before>import argparse from . import pipeline if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--creator", action="store_true", help="Launch Instance Creator in standalone mode") parser.add_argument("--loader", action="store_true", ...
79ee512bb989056c521e3e38d9d8a52c2bd3d3fc
tests/__init__.py
tests/__init__.py
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
Remove duplicate setting of config variable
Remove duplicate setting of config variable
Python
bsd-3-clause
LibCrowds/libcrowds-statistics,LibCrowds/libcrowds-statistics,LibCrowds/libcrowds-statistics
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
<commit_before># -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_ap...
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
# -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_app with flas...
<commit_before># -*- coding: utf8 -*- import sys import os import libcrowds_statistics as plugin # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) os.environ['STATISTICS_SETTINGS'] = '../settings_test.py' def setUpPackage(): """Setup the plugin.""" from default import flask_ap...
27668d5e5c1c40b342ca4d280ed3aaa49532c845
email-ping.py
email-ping.py
import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') for to in to_list: m...
#!/usr/bin/python import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP_SSL('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') fo...
Update email_ping.py with header and SSL default
Update email_ping.py with header and SSL default
Python
mit
krzysztofr/gmail-force-check
import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') for to in to_list: m...
#!/usr/bin/python import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP_SSL('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') fo...
<commit_before>import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') for to in...
#!/usr/bin/python import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP_SSL('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') fo...
import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') for to in to_list: m...
<commit_before>import smtplib import time from email.mime.text import MIMEText to_list = ('',) # add recipient (your remote account) here from_email = '' # email from which the e-mail is sent; must be accepted by SMTP s = smtplib.SMTP('') # SMTP address s.login('', '') # ('smtp login', 'smtp password') for to in...
72b0ed654749bdd01989567a5eee2234cb8328ce
registration/admin.py
registration/admin.py
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, RegistrationAdmin)
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') raw_id_fields = ['user'] search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfil...
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
Python
bsd-3-clause
lubosz/django-registration,lubosz/django-registration
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, RegistrationAdmin) Use raw...
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') raw_id_fields = ['user'] search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfil...
<commit_before>from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, Registratio...
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') raw_id_fields = ['user'] search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfil...
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, RegistrationAdmin) Use raw...
<commit_before>from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, Registratio...
5b48bab8c884dd66dc40bc591fc0c66621fa01a1
game_state.py
game_state.py
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 over = 2
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 ended = 2
Change name from 'over' to 'ended'.
Change name from 'over' to 'ended'.
Python
mit
isaacarvestad/four-in-a-row
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 over = 2 Change name from 'over' to 'ended'.
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 ended = 2
<commit_before>""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 over = 2 <commit_msg>Change name from 'over' to 'ended'.<commit_after>
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 ended = 2
""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 over = 2 Change name from 'over' to 'ended'.""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 ended = 2
<commit_before>""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum): playing = 1 over = 2 <commit_msg>Change name from 'over' to 'ended'.<commit_after>""" An enum describing the various possible game states. Author: Isaac Arvestad """ class GameState(Enum):...
bc9656c1ced31f0592b6d73a0678386843afa5b5
db/migrations/migration5.py
db/migrations/migration5.py
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') curs...
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') cur...
Initialize unread column to 0
Initialize unread column to 0
Python
mit
tyler-smith/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,OpenBazaar/OpenBazaar-Server,cpacia/OpenBazaar-Server,cpacia/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,OpenBazaar/Network,OpenBazaar/OpenBazaar-Server,OpenBazaar/Network,saltduck/OpenBazaar-Server,OpenBazaar/Network,tomgalloway/OpenBazaar-Server,cpacia/O...
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') curs...
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') cur...
<commit_before>import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEG...
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') cur...
import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEGER''') curs...
<commit_before>import sqlite3 def migrate(database_path): print "migrating to db version 5" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # update settings table to include smtp server settings cursor.execute('''ALTER TABLE sales ADD COLUMN "unread" INTEG...
1abf1add68f9a1224fe5f754b0f01a86dbb1008c
maras/nestdb.py
maras/nestdb.py
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
Clean out the _key from the data, no need to double entry
Clean out the _key from the data, no need to double entry
Python
apache-2.0
thatch45/maras_old
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
<commit_before>''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Data...
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Database): ''' ...
<commit_before>''' Create a stock database with a built in nesting key index ''' # Import maras libs import maras.database import maras.tree_index # We can likely build these out as mixins, making it easy to apply high level # constructs to multiple unerlying database implimentations class NestDB(maras.database.Data...
a2713927beb4b80ba62cc0273df24d33cca4a689
namuhub/__init__.py
namuhub/__init__.py
"""namuhub --- namu.wiki contribution graph""" from flask import Flask, jsonify, render_template, request, url_for app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/<user>', methods=['GET']) def index_user(user=''): return render_template('...
"""namuhub --- namu.wiki contribution graph""" import time from collections import defaultdict from datetime import timedelta from flask import Flask, jsonify, render_template, request, url_for from namuhub import namu as namuwiki app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return rende...
Return namu.wiki contribution data as JSON
Return namu.wiki contribution data as JSON
Python
apache-2.0
ssut/namuhub,ssut/namuhub,ssut/namuhub
"""namuhub --- namu.wiki contribution graph""" from flask import Flask, jsonify, render_template, request, url_for app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/<user>', methods=['GET']) def index_user(user=''): return render_template('...
"""namuhub --- namu.wiki contribution graph""" import time from collections import defaultdict from datetime import timedelta from flask import Flask, jsonify, render_template, request, url_for from namuhub import namu as namuwiki app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return rende...
<commit_before>"""namuhub --- namu.wiki contribution graph""" from flask import Flask, jsonify, render_template, request, url_for app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/<user>', methods=['GET']) def index_user(user=''): return re...
"""namuhub --- namu.wiki contribution graph""" import time from collections import defaultdict from datetime import timedelta from flask import Flask, jsonify, render_template, request, url_for from namuhub import namu as namuwiki app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return rende...
"""namuhub --- namu.wiki contribution graph""" from flask import Flask, jsonify, render_template, request, url_for app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/<user>', methods=['GET']) def index_user(user=''): return render_template('...
<commit_before>"""namuhub --- namu.wiki contribution graph""" from flask import Flask, jsonify, render_template, request, url_for app = Flask('namuhub') @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/<user>', methods=['GET']) def index_user(user=''): return re...
f3978f2bee9fdbef4e2d415e4a6e584e451f4da4
nbtutor/__init__.py
nbtutor/__init__.py
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
Update to use tags instead of custom metadata
Update to use tags instead of custom metadata
Python
bsd-2-clause
jorisvandenbossche/nbtutor,jorisvandenbossche/nbtutor
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
<commit_before># -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode ...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
<commit_before># -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode ...
b7c0f274b227acad4d4b76e619a75ef7ac252732
tests/test_base.py
tests/test_base.py
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
Update test now that response is iterable
Update test now that response is iterable
Python
mit
funkybob/antfarm
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
<commit_before> from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): ...
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): self.as...
<commit_before> from unittest import TestCase, main from antfarm import App, Response from antfarm.response import STATUS BASE_ENV = { 'REQUEST_METHOD': 'GET', } class AppTest(TestCase): def test_001_basic(self): app = App(root_view=lambda r: Response('true')) def start_response(s, h): ...
89422fb5aaa10a99b3d9d0e576551fdd4d111a27
tests/registryd/test_registry_startup.py
tests/registryd/test_registry_startup.py
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
Test ChildCount on an empty registry
Test ChildCount on an empty registry
Python
lgpl-2.1
GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
<commit_before>PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = ...
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = [ ('Nam...
<commit_before>PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties' ACCESSIBLE_IFACE = 'org.a11y.atspi.Accessible' def get_property(proxy, iface_name, prop_name): return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE) def test_accessible_iface_properties(registry, session_manager): values = ...
a0bb9cbcb2999d06747dec78b4959baad8d374d8
organizer/models.py
organizer/models.py
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
Define NewsLink model related fields.
Ch03: Define NewsLink model related fields. [skip ci] https://docs.djangoproject.com/en/1.8/ref/models/fields/#foreignkey The NewsLink model now has a ForeignKey pointing to the Startup model. External news articles may thus only point to a single startup business, but any of our startup businesses may have multi...
Python
bsd-2-clause
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
<commit_before>from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models...
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() ...
<commit_before>from django.db import models # Model Field Reference # https://docs.djangoproject.com/en/1.8/ref/models/fields/ class Tag(models.Model): name = models.CharField(max_length=31) slug = models.SlugField() class Startup(models.Model): name = models.CharField(max_length=31) slug = models...
1090ecf891dd7c0928cdaae385464d3be660fdbf
penn/base.py
penn/base.py
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
Add better error handling for non-200 responses
Add better error handling for non-200 responses
Python
mit
pennlabs/penn-sdk-python,pennlabs/penn-sdk-python
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
<commit_before>from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.b...
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.bearer, ...
<commit_before>from requests import get class WrapperBase(object): def __init__(self, bearer, token): self.bearer = bearer self.token = token @property def headers(self): """The HTTP headers needed for signed requests""" return { "Authorization-Bearer": self.b...
4ee3900c8ac78c8ed1d0145f9d99a0485b542141
senic_hub/backend/views/setup_config.py
senic_hub/backend/views/setup_config.py
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', accept='application/json', ) @configuration_service.post() def ...
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path from ..supervisor import get_supervisor_rpc_client, stop_program configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', ...
Stop device discovery after onboarding
Stop device discovery after onboarding
Python
mit
grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', accept='application/json', ) @configuration_service.post() def ...
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path from ..supervisor import get_supervisor_rpc_client, stop_program configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', ...
<commit_before>from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', accept='application/json', ) @configuration_serv...
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path from ..supervisor import get_supervisor_rpc_client, stop_program configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', ...
from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', accept='application/json', ) @configuration_service.post() def ...
<commit_before>from cornice.service import Service from ..commands import create_configuration_files_and_restart_apps_ from ..config import path configuration_service = Service( name='configuration_create', path=path('setup/config'), renderer='json', accept='application/json', ) @configuration_serv...
608298a3bed65a36312500f15d58ac6c3cd6663d
pybeam/beam_file.py
pybeam/beam_file.py
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
Add @property exports Add @property imports
Add @property exports Add @property imports
Python
mit
matwey/pybeam
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
<commit_before>from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): re...
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): return self.selec...
<commit_before>from beam_construct import beam class BeamFile(object): def __init__(self, filename): self._tree = beam.parse(file(filename,"r").read()) def selectChunkByName(self, name): for c in self._tree.chunk: if c.chunk_name == name: return c raise KeyError(name) @property def atoms(self): re...
164e4b5f02fbe9558e9fa50b12e7b28921f5be9b
wxGestalt.py
wxGestalt.py
# -*- coding: utf-8 -*- import wx import wxClass class wxGestaltApp(wxClass.MyFrame1): def __init__(self, *args, **kw): super(wxGestaltApp, self).__init__(*args, **kw) self.InitUI() def InitUI(self): self.Show() def On_Quit( self, event ): self.Close(True) def On_S...
# -*- coding: utf-8 -*- # Modules # Modules for the wx Gui import wx import wxClass # Modules for the serial communication import serial import glob # Variables # Current global setting for the Serial port in use SerialPortInUse = "" # Functions def ScanSerialPorts(): # Scan for available ports. return a list ...
Add the functionality for choosing the serial port
Add the functionality for choosing the serial port
Python
mit
openp2pdesign/wxGestalt
# -*- coding: utf-8 -*- import wx import wxClass class wxGestaltApp(wxClass.MyFrame1): def __init__(self, *args, **kw): super(wxGestaltApp, self).__init__(*args, **kw) self.InitUI() def InitUI(self): self.Show() def On_Quit( self, event ): self.Close(True) def On_S...
# -*- coding: utf-8 -*- # Modules # Modules for the wx Gui import wx import wxClass # Modules for the serial communication import serial import glob # Variables # Current global setting for the Serial port in use SerialPortInUse = "" # Functions def ScanSerialPorts(): # Scan for available ports. return a list ...
<commit_before># -*- coding: utf-8 -*- import wx import wxClass class wxGestaltApp(wxClass.MyFrame1): def __init__(self, *args, **kw): super(wxGestaltApp, self).__init__(*args, **kw) self.InitUI() def InitUI(self): self.Show() def On_Quit( self, event ): self.Close(True...
# -*- coding: utf-8 -*- # Modules # Modules for the wx Gui import wx import wxClass # Modules for the serial communication import serial import glob # Variables # Current global setting for the Serial port in use SerialPortInUse = "" # Functions def ScanSerialPorts(): # Scan for available ports. return a list ...
# -*- coding: utf-8 -*- import wx import wxClass class wxGestaltApp(wxClass.MyFrame1): def __init__(self, *args, **kw): super(wxGestaltApp, self).__init__(*args, **kw) self.InitUI() def InitUI(self): self.Show() def On_Quit( self, event ): self.Close(True) def On_S...
<commit_before># -*- coding: utf-8 -*- import wx import wxClass class wxGestaltApp(wxClass.MyFrame1): def __init__(self, *args, **kw): super(wxGestaltApp, self).__init__(*args, **kw) self.InitUI() def InitUI(self): self.Show() def On_Quit( self, event ): self.Close(True...
2e23898ea287b6b9efcf6bcb8758cf61fca25256
rest/serializers.py
rest/serializers.py
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url') def to_representation(self, author): rv = serializers.Mo...
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url', 'github') def to_representation(self, author): rv = seri...
Add missing github field to Author serializer.
Add missing github field to Author serializer.
Python
apache-2.0
CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url') def to_representation(self, author): rv = serializers.Mo...
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url', 'github') def to_representation(self, author): rv = seri...
<commit_before># Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url') def to_representation(self, author): rv =...
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url', 'github') def to_representation(self, author): rv = seri...
# Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url') def to_representation(self, author): rv = serializers.Mo...
<commit_before># Author: Braedy Kuzma from rest_framework import serializers from dash.models import Post, Author, Comment, Category class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = ('id', 'host', 'url') def to_representation(self, author): rv =...
427b894fdd5690bc7a52dbcea42c4918b87d0046
run_tests.py
run_tests.py
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
Make coverage module optional during test run
Make coverage module optional during test run Change-Id: I79f767a90a84c7b482e0cc9acd311619611802e9
Python
apache-2.0
brainly/check-growth
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
<commit_before>#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 app...
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 ...
<commit_before>#!/usr/bin/env python3 # Copyright (c) 2013 Spotify AB # # 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 app...
5e1ea27b1334f74dee4f7d3f3823f80037da3690
serrano/cors.py
serrano/cors.py
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
Remove truth assertion on origin
Remove truth assertion on origin This is a remnant from testing in the SERRANO_CORS_ORIGIN string. Now that the `in` applies to a list, this assertion is no longer needed.
Python
bsd-2-clause
chop-dbhi/serrano,rv816/serrano_night,chop-dbhi/serrano,rv816/serrano_night
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
<commit_before>from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' ...
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' 'of SERRANO_COR...
<commit_before>from warnings import warn from django.conf import settings def patch_response(request, response, methods): if getattr(settings, 'SERRANO_CORS_ENABLED', False): if hasattr(settings, 'SERRANO_CORS_ORIGIN'): warn('SERRANO_CORS_ORIGIN has been deprecated in favor ' ...
6924b1326b664e405f926c36753192603204034e
salt/modules/nfs.py
salt/modules/nfs.py
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
Add multiple permissions to a single export
Add multiple permissions to a single export
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
<commit_before>''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ...
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ] if not sa...
<commit_before>''' Module for managing NFS. ''' # Import python libs import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms, specific service modules exist: disable = [ 'Windows', ...
7492133cbf46c2bfcf07b18d4d68de896c9eac69
svs_interface.py
svs_interface.py
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config(menu=menu) ...
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os GPG = 'gpg2' SERVER_KEY = '' # replace with gpg key ID of server key class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.tex...
Add method to encrypt files
Add method to encrypt files
Python
agpl-3.0
jrosco/securedrop,heartsucker/securedrop,ehartsuyker/securedrop,chadmiller/securedrop,heartsucker/securedrop,garrettr/securedrop,jaseg/securedrop,chadmiller/securedrop,kelcecil/securedrop,jeann2013/securedrop,ageis/securedrop,harlo/securedrop,jeann2013/securedrop,conorsch/securedrop,conorsch/securedrop,chadmiller/secur...
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config(menu=menu) ...
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os GPG = 'gpg2' SERVER_KEY = '' # replace with gpg key ID of server key class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.tex...
<commit_before>#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config...
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os GPG = 'gpg2' SERVER_KEY = '' # replace with gpg key ID of server key class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.tex...
#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config(menu=menu) ...
<commit_before>#!/usr/bin/env python import subprocess from Tkinter import * from tkFileDialog import * import os class GpgApp(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config...
1c6d93d83b6979ca9c5bfb298efb6fdb3e0c27ee
systempay/app.py
systempay/app.py
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
Remove the ending slash for handle ipn url
Remove the ending slash for handle ipn url
Python
mit
dulaccc/django-oscar-systempay,bastien34/django-oscar-systempay,bastien34/django-oscar-systempay
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
<commit_before>from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_vi...
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_view = views.Secu...
<commit_before>from django.conf.urls import patterns, url from oscar.core.application import Application from systempay import views class SystemPayApplication(Application): name = 'systempay' place_order_view = views.PlaceOrderView cancel_response_view = views.CancelResponseView secure_redirect_vi...
b89e210f95b8f41efa8019ee66d6449b7242d56f
tikplay/audio.py
tikplay/audio.py
import json import logging import pysoundcard import pysoundfile from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching fro...
import json import logging from pyglet import media from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching from the databas...
Change pysoundcard and pysoundfile to pyglet
Change pysoundcard and pysoundfile to pyglet
Python
mit
tietokilta-saato/tikplay,tietokilta-saato/tikplay,tietokilta-saato/tikplay,tietokilta-saato/tikplay
import json import logging import pysoundcard import pysoundfile from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching fro...
import json import logging from pyglet import media from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching from the databas...
<commit_before>import json import logging import pysoundcard import pysoundfile from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metada...
import json import logging from pyglet import media from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching from the databas...
import json import logging import pysoundcard import pysoundfile from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metadata fetching fro...
<commit_before>import json import logging import pysoundcard import pysoundfile from tikplay.database import interface class API(): """ Implements the audio parsing interface for tikplay. Parses song metadata, handles database updating, and pushes the audio to soundcard Also implements basic song metada...
336e81005deb485378fe594cf466773f36160d5e
demo/__init__.py
demo/__init__.py
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) exit("Python {}.{}+ is required.".format(*PYTHON_VERSION)...
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERS...
Deploy Travis CI build 646 to GitHub
Deploy Travis CI build 646 to GitHub
Python
mit
jacebrowning/template-python-demo
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) exit("Python {}.{}+ is required.".format(*PYTHON_VERSION)...
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERS...
<commit_before>"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) exit("Python {}.{}+ is required.".format(*...
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) sys.exit("Python {}.{}+ is required.".format(*PYTHON_VERS...
"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) exit("Python {}.{}+ is required.".format(*PYTHON_VERSION)...
<commit_before>"""Package for PythonTemplateDemo.""" import sys __project__ = 'PythonTemplateDemo' __version__ = '0.0.0' VERSION = "{0} v{1}".format(__project__, __version__) PYTHON_VERSION = 3, 5 if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test) exit("Python {}.{}+ is required.".format(*...
b1edf4678a57bb25220bd4c50f05ceb7fbd5e7fe
users/filters.py
users/filters.py
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
Change name of a filter field
Change name of a filter field
Python
mit
fernandolobato/balarco,fernandolobato/balarco,fernandolobato/balarco
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
<commit_before>"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group...
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group class UserFi...
<commit_before>"""Filter classes corresponding to each one of the works app's models that has the same fields as the model for an equalTo filter. There can be added extra fields inside each class as gt, lt, gte, lte and so on for convinience. """ import django_filters from django.contrib.auth.models import User, Group...
4e4390db6ed35de4fb7ad42579be5180a95bb96f
src/settings.py
src/settings.py
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", "/media/Music") # Tells flask to serve the mp3 files # Typi...
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", r"/media/Music/") # Tells flask to serve the mp3 files # Ty...
Allow for case-insensitive checking of file formats. Support m4a
Allow for case-insensitive checking of file formats. Support m4a
Python
apache-2.0
nhydock/ftmp3,lunared/ftmp3,nhydock/ftmp3,lunared/ftmp3,lunared/ftmp3
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", "/media/Music") # Tells flask to serve the mp3 files # Typi...
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", r"/media/Music/") # Tells flask to serve the mp3 files # Ty...
<commit_before>import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", "/media/Music") # Tells flask to serve the m...
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", r"/media/Music/") # Tells flask to serve the mp3 files # Ty...
import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", "/media/Music") # Tells flask to serve the mp3 files # Typi...
<commit_before>import re import os # Root directory that we scan for music from # Do not change this unless you're not using the docker-compose # It is preferred you use just change the volume mapping on the docker-compose.yml MUSIC_DIRECTORY = os.environ.get("FTMP3_MUSIC", "/media/Music") # Tells flask to serve the m...
7fe1ce9b1c9d6368bdb0945c2ed820cdafdc53c2
scrapeOMDB.py
scrapeOMDB.py
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
Fix typo and convert TV season/ep to str
Fix typo and convert TV season/ep to str
Python
mit
samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
<commit_before>#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url ...
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url response = ...
<commit_before>#!/usr/bin/python3 # scrapeOMDB.py - parses a movie and year from arguments and returns JSON import json, requests URL_BASE = 'http://www.omdbapi.com/?' def OMDBmovie(mTitle, mYear): # Craft the URL url = URL_BASE + 't=' + mTitle + '&y=' + mYear + '&plot=full&r=json' # Try to get the url ...
ac3db8b26bd6ac2e0db2c8221521aead9c996ec0
blog/views.py
blog/views.py
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
Use attribute for template in Post List.
Ch05: Use attribute for template in Post List.
Python
bsd-2-clause
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
<commit_before>from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) retur...
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) return render( ...
<commit_before>from django.shortcuts import ( get_object_or_404, render) from django.views.generic import View from .models import Post def post_detail(request, year, month, slug): post = get_object_or_404( Post, pub_date__year=year, pub_date__month=month, slug=slug) retur...
8a778750c2284045566c6f67b2aedffd2811f1ce
api/base/settings/__init__.py
api/base/settings/__init__.py
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setting...
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setti...
Put in at least two spaces before inline comment
Put in at least two spaces before inline comment
Python
apache-2.0
leb2dg/osf.io,jinluyuan/osf.io,ckc6cz/osf.io,brandonPurvis/osf.io,kch8qx/osf.io,KAsante95/osf.io,billyhunt/osf.io,abought/osf.io,emetsger/osf.io,felliott/osf.io,TomBaxter/osf.io,bdyetton/prettychart,alexschiller/osf.io,doublebits/osf.io,leb2dg/osf.io,ticklemepierce/osf.io,erinspace/osf.io,brianjgeiger/osf.io,samanehsan...
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setting...
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setti...
<commit_before># -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/l...
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setti...
# -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/local.py setting...
<commit_before># -*- coding: utf-8 -*- '''Consolidates settings from defaults.py and local.py. :: >>> from api.base import settings >>> settings.API_BASE 'v2/' ''' from .defaults import * # noqa try: from .local import * # noqa except ImportError as error: raise ImportError("No api/base/settings/l...
ef43e04970151ec5bba9688f268b2f85b5debd3f
bfg9000/builtins/__init__.py
bfg9000/builtins/__init__.py
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
Make the Environment object available to build.bfg files
Make the Environment object available to build.bfg files
Python
bsd-3-clause
jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
<commit_before>import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Bin...
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Binder(fn) _al...
<commit_before>import functools import glob import os import pkgutil _all_builtins = {} _loaded_builtins = False class Binder(object): def __init__(self, fn): self.fn = fn def bind(self, build_inputs, env): return functools.partial(self.fn, build_inputs, env) def builtin(fn): bound = Bin...
c30b4aa0d577e545193229d0f33b55998405cba2
trex/urls.py
trex/urls.py
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
Add url mapping for the tag details view
Add url mapping for the tag details view
Python
mit
bjoernricks/trex,bjoernricks/trex
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
<commit_before># -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
<commit_before># -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"...
c7d2e917df5e0c2182e351b5157271b6e62a06cd
app/soc/modules/gsoc/models/timeline.py
app/soc/modules/gsoc/models/timeline.py
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
Change verbage on program profile info.
Change verbage on program profile info. Fixes issue 1601.
Python
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
<commit_before>#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 req...
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 applic...
<commit_before>#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # 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 req...
0e2dbbd204d9c1c9bd31f4be78b0a76ce39786d2
test/test_ev3_lcd.py
test/test_ev3_lcd.py
from ev3.ev3dev import Lcd # -*- coding: utf-8 -*- import unittest from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
# -*- coding: utf-8 -*- import unittest from ev3.ev3dev import Lcd from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
Fix encoding issue when test lcd
Fix encoding issue when test lcd
Python
apache-2.0
MaxNoe/python-ev3,evz/python-ev3,topikachu/python-ev3,MaxNoe/python-ev3,evz/python-ev3,topikachu/python-ev3
from ev3.ev3dev import Lcd # -*- coding: utf-8 -*- import unittest from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
# -*- coding: utf-8 -*- import unittest from ev3.ev3dev import Lcd from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
<commit_before>from ev3.ev3dev import Lcd # -*- coding: utf-8 -*- import unittest from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) ...
# -*- coding: utf-8 -*- import unittest from ev3.ev3dev import Lcd from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
from ev3.ev3dev import Lcd # -*- coding: utf-8 -*- import unittest from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) d.update(...
<commit_before>from ev3.ev3dev import Lcd # -*- coding: utf-8 -*- import unittest from util import get_input import time from PIL import Image,ImageDraw,ImageFont class TestLcd(unittest.TestCase): def test_lcd(self): get_input('Test lcd') d= Lcd() d.draw.ellipse((20, 20, 60, 60)) ...
89cb9f325403e3094a5fb2090ef4ea5f804b9d20
pq.py
pq.py
# Chapter 2: The pq-system def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in theorem iq = theorem.find('q') return theorem[:iq] + '-' + theorem[iq:] + '-' # make a basic axiom a1 = make_axio...
# Chapter 2: The pq-system import re import random axiom_pattern = re.compile('(-*)p-q(-*)-') theorem_pattern = re.compile('(-*)p(-*)q(-*)') def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in the...
Add axiom and theorem checks
Add axiom and theorem checks
Python
mit
ericfs/geb
# Chapter 2: The pq-system def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in theorem iq = theorem.find('q') return theorem[:iq] + '-' + theorem[iq:] + '-' # make a basic axiom a1 = make_axio...
# Chapter 2: The pq-system import re import random axiom_pattern = re.compile('(-*)p-q(-*)-') theorem_pattern = re.compile('(-*)p(-*)q(-*)') def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in the...
<commit_before># Chapter 2: The pq-system def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in theorem iq = theorem.find('q') return theorem[:iq] + '-' + theorem[iq:] + '-' # make a basic axiom...
# Chapter 2: The pq-system import re import random axiom_pattern = re.compile('(-*)p-q(-*)-') theorem_pattern = re.compile('(-*)p(-*)q(-*)') def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in the...
# Chapter 2: The pq-system def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in theorem iq = theorem.find('q') return theorem[:iq] + '-' + theorem[iq:] + '-' # make a basic axiom a1 = make_axio...
<commit_before># Chapter 2: The pq-system def make_axiom(n): assert type(n) == int assert n > 0 x = '-' * n return x + 'p' + '-q' + x + '-' def next_theorem(theorem): assert 'p' in theorem assert 'q' in theorem iq = theorem.find('q') return theorem[:iq] + '-' + theorem[iq:] + '-' # make a basic axiom...
0d8bcbde2ca0e6596bb110649babda58bc66b273
CI/syntaxCheck.py
CI/syntaxCheck.py
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
Revert "Fix the location path of OpenIPSL"
Revert "Fix the location path of OpenIPSL" This reverts commit 5b3af4a6c1c77c651867ee2b5f5cef5100944ba6.
Python
bsd-3-clause
tinrabuzin/OpenIPSL,SmarTS-Lab/OpenIPSL,OpenIPSL/OpenIPSL,SmarTS-Lab/OpenIPSL
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
<commit_before>import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.m...
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.mo", #"IEEE14":"...
<commit_before>import sys from CITests import CITests # Libs in Application Examples appExamples = { #"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo", #"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo", #"SevenBus":"/ApplicationExamples/SevenBus/package.mo", #"IEEE9":"/ApplicationExamples/IEEE9/package.m...
48d234fffe052454356e09d7b3c69c938f1f7f87
all/hyperhelpcore/__init__.py
all/hyperhelpcore/__init__.py
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (1, 0, 0) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (0, 0, 1) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
Set the initial dependency version information
Set the initial dependency version information This sets our initial version tuple to 0.0.1, which is as far as I know the smallest possible version, or at least the smallest semver that makes any sense. From this point forward, changes to anything that we want anyone to see need to have the version tuple bumped and...
Python
mit
OdatNurd/hyperhelp
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (1, 0, 0) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (0, 0, 1) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
<commit_before>### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (1, 0, 0) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ ...
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (0, 0, 1) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (1, 0, 0) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ "common", "...
<commit_before>### --------------------------------------------------------------------------- from .startup import initialize __version_tuple = (1, 0, 0) __version__ = ".".join([str(num) for num in __version_tuple]) ### --------------------------------------------------------------------------- __all__ = [ ...
b0e21495e0421a3656ed4507fe7b43b65601f16f
bluebottle/settings/travis.py
bluebottle/settings/travis.py
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
Enable Selenium tests for Travis.
Enable Selenium tests for Travis.
Python
bsd-3-clause
onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
<commit_before> # SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put ...
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
<commit_before> # SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put ...
f5b085878b6bc9b461811a9083fdcaab5546497b
tests/test_server.py
tests/test_server.py
import os import threading import numpy as np import pytest from skimage import io from gala import serve, evaluate as ev D = os.path.dirname(os.path.abspath(__file__)) os.chdir(os.path.join(D, 'example-data/snemi-mini')) @pytest.fixture def data(): frag, gt, pr = map(io.imread, sorted(os.listdir('.'))) r...
Add test for solver/proofread pair
Add test for solver/proofread pair
Python
bsd-3-clause
jni/gala,janelia-flyem/gala
Add test for solver/proofread pair
import os import threading import numpy as np import pytest from skimage import io from gala import serve, evaluate as ev D = os.path.dirname(os.path.abspath(__file__)) os.chdir(os.path.join(D, 'example-data/snemi-mini')) @pytest.fixture def data(): frag, gt, pr = map(io.imread, sorted(os.listdir('.'))) r...
<commit_before><commit_msg>Add test for solver/proofread pair<commit_after>
import os import threading import numpy as np import pytest from skimage import io from gala import serve, evaluate as ev D = os.path.dirname(os.path.abspath(__file__)) os.chdir(os.path.join(D, 'example-data/snemi-mini')) @pytest.fixture def data(): frag, gt, pr = map(io.imread, sorted(os.listdir('.'))) r...
Add test for solver/proofread pairimport os import threading import numpy as np import pytest from skimage import io from gala import serve, evaluate as ev D = os.path.dirname(os.path.abspath(__file__)) os.chdir(os.path.join(D, 'example-data/snemi-mini')) @pytest.fixture def data(): frag, gt, pr = map(io.imre...
<commit_before><commit_msg>Add test for solver/proofread pair<commit_after>import os import threading import numpy as np import pytest from skimage import io from gala import serve, evaluate as ev D = os.path.dirname(os.path.abspath(__file__)) os.chdir(os.path.join(D, 'example-data/snemi-mini')) @pytest.fixture d...
1f25d3a8d73fe776a2182ee68c027105fd15ab04
tiamat/decorators.py
tiamat/decorators.py
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output, dict): ...
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) return HttpResponse(json.dumps(output), '...
Fix problem in as_json and as_jsonp
Fix problem in as_json and as_jsonp
Python
bsd-2-clause
rvause/django-tiamat
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output, dict): ...
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) return HttpResponse(json.dumps(output), '...
<commit_before>import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output,...
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) return HttpResponse(json.dumps(output), '...
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output, dict): ...
<commit_before>import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output,...
6fd5e51a797f3d85954f6a4c97eacc008b0e4d48
tohu/v5/namespace.py
tohu/v5/namespace.py
from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): self.generators = bidict() def __len__(self): ...
from mako.template import Template import textwrap from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): ...
Add repr method for TohuNamespace
Add repr method for TohuNamespace
Python
mit
maxalbert/tohu
from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): self.generators = bidict() def __len__(self): ...
from mako.template import Template import textwrap from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): ...
<commit_before>from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): self.generators = bidict() def ...
from mako.template import Template import textwrap from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): ...
from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): self.generators = bidict() def __len__(self): ...
<commit_before>from bidict import bidict, ValueDuplicationError def is_anonymous(name): return name.startswith("ANONYMOUS_ANONYMOUS_ANONYMOUS_") class TohuNamespaceError(Exception): """ Custom exception. """ class TohuNamespace: def __init__(self): self.generators = bidict() def ...
e9862c50c1d71800602ca78bf9bdd8aad2def0a2
run.py
run.py
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command)
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True --is_crop ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command)
Add is_crop for celebA example
Add is_crop for celebA example
Python
mit
MustafaMustafa/WassersteinGAN-TensorFlow
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command) Add is_crop for celebA example
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True --is_crop ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command)
<commit_before>import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command) <commit_msg>Add is_crop for celebA example<commit_after>
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True --is_crop ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command)
import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command) Add is_crop for celebA exampleimport os tag = 'celebA_dcgan' dataset = 'c...
<commit_before>import os tag = 'celebA_dcgan' dataset = 'celebA' command = 'python main.py --dataset %s --is_train True ' \ '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag) os.system(command) <commit_msg>Add is_crop for celebA example<commit_after>imp...
96db3441a0cc2e3010606b2017c900a16c6a8f2f
astropy/nddata/tests/test_nddatabase.py
astropy/nddata/tests/test_nddatabase.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
Add returns to test class properties
Add returns to test class properties
Python
bsd-3-clause
tbabej/astropy,lpsinger/astropy,dhomeier/astropy,larrybradley/astropy,pllim/astropy,dhomeier/astropy,AustereCuriosity/astropy,stargaser/astropy,mhvk/astropy,astropy/astropy,AustereCuriosity/astropy,pllim/astropy,lpsinger/astropy,MSeifert04/astropy,tbabej/astropy,stargaser/astropy,bsipocz/astropy,joergdietrich/astropy,j...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
<commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): def __init_...
<commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests of NDDataBase from __future__ import (absolute_import, division, print_function, unicode_literals) from ..nddatabase import NDDataBase from ...tests.helper import pytest class MinimalSubclass(NDDataBase): ...
1e63d21d5751da12ad4104b6d2a0c170cc3898ff
problem_3/solution.py
problem_3/solution.py
def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: print h largest_prime_factor(600851475143, 0)
import time def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: return h t1 = time.time() largest_prime_factor(600851475143, 0) t2 = time.time() print "=> largest_prime_factor(600851475143, 0)...
Add timing for problem 3's python implementation
Add timing for problem 3's python implementation
Python
mit
mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler
def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: print h largest_prime_factor(600851475143, 0) Add timing for problem 3's python implementation
import time def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: return h t1 = time.time() largest_prime_factor(600851475143, 0) t2 = time.time() print "=> largest_prime_factor(600851475143, 0)...
<commit_before>def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: print h largest_prime_factor(600851475143, 0) <commit_msg>Add timing for problem 3's python implementation<commit_after>
import time def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: return h t1 = time.time() largest_prime_factor(600851475143, 0) t2 = time.time() print "=> largest_prime_factor(600851475143, 0)...
def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: print h largest_prime_factor(600851475143, 0) Add timing for problem 3's python implementationimport time def largest_prime_factor(n, h): ...
<commit_before>def largest_prime_factor(n, h): for i in xrange(2, n+1): d, m = divmod(n, i) if m == 0: largest_prime_factor(d, i) break if n == 1: print h largest_prime_factor(600851475143, 0) <commit_msg>Add timing for problem 3's python implementation<commit_after>impor...
16a85be6597388092e497e642cdad8650fdfea95
app/tasks/twitter/listener.py
app/tasks/twitter/listener.py
# -*- coding: utf-8 -*- import time import json import sys import pika from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) self.channel = conn...
# -*- coding: utf-8 -*- import time import json import sys import pika import os from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection host = os.environ['CLOUDAMQP_URL'] connection = pika.BlockingConnection(pika.Connectio...
Set up environment specific connection to rabbitmq
Set up environment specific connection to rabbitmq
Python
mit
robot-overlord/syriarightnow
# -*- coding: utf-8 -*- import time import json import sys import pika from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) self.channel = conn...
# -*- coding: utf-8 -*- import time import json import sys import pika import os from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection host = os.environ['CLOUDAMQP_URL'] connection = pika.BlockingConnection(pika.Connectio...
<commit_before># -*- coding: utf-8 -*- import time import json import sys import pika from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) self...
# -*- coding: utf-8 -*- import time import json import sys import pika import os from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection host = os.environ['CLOUDAMQP_URL'] connection = pika.BlockingConnection(pika.Connectio...
# -*- coding: utf-8 -*- import time import json import sys import pika from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) self.channel = conn...
<commit_before># -*- coding: utf-8 -*- import time import json import sys import pika from tweepy.streaming import StreamListener class Listener(StreamListener): def __init__(self): #setup rabbitMQ Connection connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) self...
0a136631d78ee518aec96a1a6ec24ed3e7d4c613
taOonja/game/models.py
taOonja/game/models.py
import os from django.db import models def get_image_path(filename): return os.path.join('photos',filename) class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) class Detail(models.Model): ...
import os from django.db import models #def get_image_path(filename): # return os.path.join('media') class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) def __str__(self): return s...
Change model File to Show Better and Correct Image Field
Change model File to Show Better and Correct Image Field
Python
mit
Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja
import os from django.db import models def get_image_path(filename): return os.path.join('photos',filename) class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) class Detail(models.Model): ...
import os from django.db import models #def get_image_path(filename): # return os.path.join('media') class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) def __str__(self): return s...
<commit_before>import os from django.db import models def get_image_path(filename): return os.path.join('photos',filename) class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) class Detail(mod...
import os from django.db import models #def get_image_path(filename): # return os.path.join('media') class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) def __str__(self): return s...
import os from django.db import models def get_image_path(filename): return os.path.join('photos',filename) class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) class Detail(models.Model): ...
<commit_before>import os from django.db import models def get_image_path(filename): return os.path.join('photos',filename) class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) class Detail(mod...
ed12fe8cde425c75d02dbb9beb98abd8a814292a
alg_selection_sort.py
alg_selection_sort.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last elemenet reversely: len(ls) - 1, ..., 0. for i_max in re...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last position reversely: len(ls) - 1, ..., 0. for i in revers...
Refactor selection sort w/ comments
Refactor selection sort w/ comments
Python
bsd-2-clause
bowen0701/algorithms_data_structures
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last elemenet reversely: len(ls) - 1, ..., 0. for i_max in re...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last position reversely: len(ls) - 1, ..., 0. for i in revers...
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last elemenet reversely: len(ls) - 1, ..., 0. ...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last position reversely: len(ls) - 1, ..., 0. for i in revers...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last elemenet reversely: len(ls) - 1, ..., 0. for i_max in re...
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(ls): """Selection Sort algortihm. Time complexity: O(n^2). Space complexity: O(1). """ # Start from the last elemenet reversely: len(ls) - 1, ..., 0. ...
63a4a2dfa733fab15bb7e0d632c8efe6528b82cb
escpos/impl/__init__.py
escpos/impl/__init__.py
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
Fix import to support Python3
Fix import to support Python3
Python
apache-2.0
base4sistemas/pyescpos
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
<commit_before># -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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/lice...
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
# -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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....
<commit_before># -*- coding: utf-8 -*- # # escpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda 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/lice...
a492b0395ff56f150d2fde506b6536f0324f31f6
teerace/local_tests.py
teerace/local_tests.py
from django.test.simple import run_tests as default_run_tests from django.conf import settings def run_tests(test_labels, *args, **kwargs): del test_labels return default_run_tests(settings.OUR_APPS, *args, **kwargs)
from django.test.simple import DjangoTestSuiteRunner from django.conf import settings class LocalTestSuiteRunner(DjangoTestSuiteRunner): def run_tests(self, test_labels, extra_tests=None, **kwargs): del test_labels super(LocalTestSuiteRunner, self).run_tests(settings.OUR_APPS, extra_tests, **kwargs)
Test runner is now class-based.
Test runner is now class-based.
Python
bsd-3-clause
SushiTee/teerace,SushiTee/teerace,SushiTee/teerace
from django.test.simple import run_tests as default_run_tests from django.conf import settings def run_tests(test_labels, *args, **kwargs): del test_labels return default_run_tests(settings.OUR_APPS, *args, **kwargs) Test runner is now class-based.
from django.test.simple import DjangoTestSuiteRunner from django.conf import settings class LocalTestSuiteRunner(DjangoTestSuiteRunner): def run_tests(self, test_labels, extra_tests=None, **kwargs): del test_labels super(LocalTestSuiteRunner, self).run_tests(settings.OUR_APPS, extra_tests, **kwargs)
<commit_before>from django.test.simple import run_tests as default_run_tests from django.conf import settings def run_tests(test_labels, *args, **kwargs): del test_labels return default_run_tests(settings.OUR_APPS, *args, **kwargs) <commit_msg>Test runner is now class-based.<commit_after>
from django.test.simple import DjangoTestSuiteRunner from django.conf import settings class LocalTestSuiteRunner(DjangoTestSuiteRunner): def run_tests(self, test_labels, extra_tests=None, **kwargs): del test_labels super(LocalTestSuiteRunner, self).run_tests(settings.OUR_APPS, extra_tests, **kwargs)
from django.test.simple import run_tests as default_run_tests from django.conf import settings def run_tests(test_labels, *args, **kwargs): del test_labels return default_run_tests(settings.OUR_APPS, *args, **kwargs) Test runner is now class-based.from django.test.simple import DjangoTestSuiteRunner from django.c...
<commit_before>from django.test.simple import run_tests as default_run_tests from django.conf import settings def run_tests(test_labels, *args, **kwargs): del test_labels return default_run_tests(settings.OUR_APPS, *args, **kwargs) <commit_msg>Test runner is now class-based.<commit_after>from django.test.simple i...
dbc932d7776b22835ff15f086c41e1bff02e9daf
apps/private/views.py
apps/private/views.py
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from .forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @owner_req...
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from accounts.forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @o...
Change import InviteForm from private.forms to accounts.forms
Change import InviteForm from private.forms to accounts.forms
Python
mit
xobb1t/ddash2013,xobb1t/ddash2013
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from .forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @owner_req...
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from accounts.forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @o...
<commit_before>from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from .forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner...
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from accounts.forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @o...
from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from .forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner ) @owner_req...
<commit_before>from django.contrib.auth.decorators import user_passes_test from django.http import Http404 from django.shortcuts import redirect, render from accounts.utils import send_activation_email from .forms import InviteForm owner_required = user_passes_test( lambda u: u.is_authenticated() and u.is_owner...
252bc8df092f59ecd092ea5904fcc845dc22bee8
dbaas/util/update_instances_with_offering.py
dbaas/util/update_instances_with_offering.py
# coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
# coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
Change script to update offering on Host instead Instance
Change script to update offering on Host instead Instance
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 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
# coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
<commit_before># coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offe...
# coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
# coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offerings: ...
<commit_before># coding: utf-8 class UpdateInstances(object): @staticmethod def do(): from dbaas_cloudstack.models import DatabaseInfraOffering from dbaas_cloudstack.models import PlanAttr infra_offerings = DatabaseInfraOffering.objects.all() for infra_offering in infra_offe...
d3ca58e098fd872eb32c82e87a76361829d68f37
config/__init__.py
config/__init__.py
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
Print configuration contents in main.
Print configuration contents in main.
Python
mit
mgunyho/kiltiskahvi
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
<commit_before>""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, ...
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, "avera...
<commit_before>""" This module is responsible for handling configuration and files related to it, including calibration parameters. """ import configparser from os import path import syslog """ Default options """ #TODO: more default options... _CONFIG_DEFAULTS = { "general": { "poll_interval": 10, ...
579101f714201ba2cc933f64c83ca6cfda8eca8c
test/wheel_velocity.py
test/wheel_velocity.py
#!/usr/bin/python from config import Config from motor import Motor import Rpi.GPIO as GPIO import json import sys import time def _init_motor(self, pin1_s, pin2_s, pinE_s): pin1 = self.config.get("motors", pin1_s) pin2 = self.config.get("motors", pin2_s) pinE = self.config.get("motors", pinE_s) if pi...
#!/usr/bin/python from config import Config from motor import Motor from encoder import Encoder import Rpi.GPIO as GPIO import json import sys import time def _init_motor(config, pin1_s, pin2_s, pinE_s): pin1 = config.get("motors", pin1_s) pin2 = config.get("motors", pin2_s) pinE = config.get("motors", pi...
Add encoder to wheel velocity test
Add encoder to wheel velocity test
Python
mit
thomasweng15/rover
#!/usr/bin/python from config import Config from motor import Motor import Rpi.GPIO as GPIO import json import sys import time def _init_motor(self, pin1_s, pin2_s, pinE_s): pin1 = self.config.get("motors", pin1_s) pin2 = self.config.get("motors", pin2_s) pinE = self.config.get("motors", pinE_s) if pi...
#!/usr/bin/python from config import Config from motor import Motor from encoder import Encoder import Rpi.GPIO as GPIO import json import sys import time def _init_motor(config, pin1_s, pin2_s, pinE_s): pin1 = config.get("motors", pin1_s) pin2 = config.get("motors", pin2_s) pinE = config.get("motors", pi...
<commit_before>#!/usr/bin/python from config import Config from motor import Motor import Rpi.GPIO as GPIO import json import sys import time def _init_motor(self, pin1_s, pin2_s, pinE_s): pin1 = self.config.get("motors", pin1_s) pin2 = self.config.get("motors", pin2_s) pinE = self.config.get("motors", pi...
#!/usr/bin/python from config import Config from motor import Motor from encoder import Encoder import Rpi.GPIO as GPIO import json import sys import time def _init_motor(config, pin1_s, pin2_s, pinE_s): pin1 = config.get("motors", pin1_s) pin2 = config.get("motors", pin2_s) pinE = config.get("motors", pi...
#!/usr/bin/python from config import Config from motor import Motor import Rpi.GPIO as GPIO import json import sys import time def _init_motor(self, pin1_s, pin2_s, pinE_s): pin1 = self.config.get("motors", pin1_s) pin2 = self.config.get("motors", pin2_s) pinE = self.config.get("motors", pinE_s) if pi...
<commit_before>#!/usr/bin/python from config import Config from motor import Motor import Rpi.GPIO as GPIO import json import sys import time def _init_motor(self, pin1_s, pin2_s, pinE_s): pin1 = self.config.get("motors", pin1_s) pin2 = self.config.get("motors", pin2_s) pinE = self.config.get("motors", pi...
0d491c616284933e35bb5d61a94828aed0c8d3f2
setuptools/logging.py
setuptools/logging.py
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
Fix weird distutils.log reloading/caching situation
Fix weird distutils.log reloading/caching situation For some reason `distutils.log` module is getting cached in `distutils.dist` and then loaded again when we have the opportunity to patch it. This implies: id(distutils.log) != id(distutils.dist.log). We need to make sure the same module object is used everywhere.
Python
mit
pypa/setuptools,pypa/setuptools,pypa/setuptools
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
<commit_before>import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilt...
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilty with distutil...
<commit_before>import sys import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibilt...
799d6738bd189fa202f45c10e7b5361f71f14c57
bin/request_domain.py
bin/request_domain.py
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
Clarify error if otp is wrong
Clarify error if otp is wrong
Python
agpl-3.0
cloudfleet/blimp-engineroom,cloudfleet/blimp-engineroom
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
<commit_before>#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving...
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving domain for bli...
<commit_before>#!/usr/bin/python """An example demonstrating the client-side usage of the cretificate request API endpoint. """ import requests, sys, json otp = sys.argv[1] domain_req_url = 'https://spire.cloudfleet.io/api/v1/blimp/domain' domain_txt_path = '/opt/cloudfleet/data/config/domain.txt' print('retrieving...
600992d9bb3f357bdef8769a61b4829be8952573
blazar/api/context.py
blazar/api/context.py
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Fix map issues with Python3
Fix map issues with Python3 Partially implements: blueprint python-3 Change-Id: Ia7dfc2a28c311a378ca5ada477d18a5b741782b2
Python
apache-2.0
stackforge/blazar,openstack/blazar,ChameleonCloud/blazar,ChameleonCloud/blazar,stackforge/blazar,openstack/blazar
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
<commit_before># Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
<commit_before># Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
4943d9a7d6ed77d10c3185054c9c74846c89a450
bugimporters/items.py
bugimporters/items.py
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.item.Field() description = scrapy.ite...
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() _tracker_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.i...
Remove tracker field from ParsedBug. Add _tracker_name
Remove tracker field from ParsedBug. Add _tracker_name
Python
agpl-3.0
openhatch/oh-bugimporters,openhatch/oh-bugimporters,openhatch/oh-bugimporters
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.item.Field() description = scrapy.ite...
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() _tracker_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.i...
<commit_before>import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.item.Field() descripti...
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() _tracker_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.i...
import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.item.Field() description = scrapy.ite...
<commit_before>import scrapy.item class ParsedBug(scrapy.item.Item): # Fields beginning with an underscore are not really part of a # bug, but extra information that can be exported. _project_name = scrapy.item.Field() # These fields correspond to bug data title = scrapy.item.Field() descripti...
079ab75cc316c994bb3f63d32fa633aeebf08d87
grid/views.py
grid/views.py
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
Refresh the grid every 20 seconds.
Refresh the grid every 20 seconds.
Python
mit
bschmeck/gnarl,bschmeck/gnarl,bschmeck/gnarl
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
<commit_before>from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json fro...
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json from models import...
<commit_before>from django.core import serializers from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render_to_response from django.template import RequestContext from django.template.loader import get_template import json fro...
970eb92f6db8b2fd22594d662a7142a976d60559
airflow/contrib/hooks/__init__.py
airflow/contrib/hooks/__init__.py
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'bigquery_hook': ['BigQueryHook']...
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'ftps_hook': ['FTPSHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'b...
Add FTPSHook in _hooks register.
Add FTPSHook in _hooks register.
Python
apache-2.0
cjqian/incubator-airflow,KL-WLCR/incubator-airflow,dmitry-r/incubator-airflow,yiqingj/airflow,rishibarve/incubator-airflow,vineet-rh/incubator-airflow,ty707/airflow,preete-dixit-ck/incubator-airflow,saguziel/incubator-airflow,sdiazb/airflow,NielsZeilemaker/incubator-airflow,subodhchhabra/airflow,yiqingj/airflow,preete-...
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'bigquery_hook': ['BigQueryHook']...
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'ftps_hook': ['FTPSHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'b...
<commit_before># Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'bigquery_hook': [...
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'ftps_hook': ['FTPSHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'b...
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'bigquery_hook': ['BigQueryHook']...
<commit_before># Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs _hooks = { 'ftp_hook': ['FTPHook'], 'vertica_hook': ['VerticaHook'], 'ssh_hook': ['SSHHook'], 'bigquery_hook': [...
7db3a14636402a5c66179a9c60df33398190bd3e
app/modules/frest/api/__init__.py
app/modules/frest/api/__init__.py
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorated(*args, **kwa...
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER, API_VERSION def API(method=None): if method is None: return partial(API) @wraps(method) def decorated...
Return http status code 301 when api version is wrong
Return http status code 301 when api version is wrong
Python
mit
h4wldev/Frest
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorated(*args, **kwa...
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER, API_VERSION def API(method=None): if method is None: return partial(API) @wraps(method) def decorated...
<commit_before># -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorat...
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER, API_VERSION def API(method=None): if method is None: return partial(API) @wraps(method) def decorated...
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorated(*args, **kwa...
<commit_before># -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorat...
a46c152adb78996538128b63e441b00bea2790ea
django_su/forms.py
django_su/forms.py
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): user = forms.ModelChoiceField( label=_('Users'), queryset=get_user_model()._default_manager.order_by( ...
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): username_field = get_user_model().USERNAME_FIELD user = forms.ModelChoiceField( label=_('Users'), que...
Update UserSuForm to enhance compatibility with custom user models.
Update UserSuForm to enhance compatibility with custom user models. In custom user models, we cannot rely on there being a 'username' field. Instead, we should use whichever field has been specified as the username field.
Python
mit
adamcharnock/django-su,PetrDlouhy/django-su,PetrDlouhy/django-su,adamcharnock/django-su
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): user = forms.ModelChoiceField( label=_('Users'), queryset=get_user_model()._default_manager.order_by( ...
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): username_field = get_user_model().USERNAME_FIELD user = forms.ModelChoiceField( label=_('Users'), que...
<commit_before># -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): user = forms.ModelChoiceField( label=_('Users'), queryset=get_user_model()._default_manager...
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): username_field = get_user_model().USERNAME_FIELD user = forms.ModelChoiceField( label=_('Users'), que...
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): user = forms.ModelChoiceField( label=_('Users'), queryset=get_user_model()._default_manager.order_by( ...
<commit_before># -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from . import get_user_model class UserSuForm(forms.Form): user = forms.ModelChoiceField( label=_('Users'), queryset=get_user_model()._default_manager...
f3cf8b8e36dc7d2ed5096e17dcfa1f9456a7a996
Project-AENEAS/issues/models.py
Project-AENEAS/issues/models.py
from django.db import models # Create your models here.
"""Mini Issue Tracker program. Originally taken from Paul Bissex's blog post: http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/ """ from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy ...
Add an initial model for an issue
Add an initial model for an issue
Python
bsd-3-clause
zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS
from django.db import models # Create your models here. Add an initial model for an issue
"""Mini Issue Tracker program. Originally taken from Paul Bissex's blog post: http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/ """ from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy ...
<commit_before>from django.db import models # Create your models here. <commit_msg>Add an initial model for an issue<commit_after>
"""Mini Issue Tracker program. Originally taken from Paul Bissex's blog post: http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/ """ from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy ...
from django.db import models # Create your models here. Add an initial model for an issue"""Mini Issue Tracker program. Originally taken from Paul Bissex's blog post: http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/ """ from django.db import models from django.contrib.auth.models import...
<commit_before>from django.db import models # Create your models here. <commit_msg>Add an initial model for an issue<commit_after>"""Mini Issue Tracker program. Originally taken from Paul Bissex's blog post: http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/ """ from django.db import mode...
cd5d291fc1ccf3e2171ccfc0444e4748de450d3c
99_misc/control_flow.py
99_misc/control_flow.py
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
Test variable argument in a function
Test variable argument in a function
Python
bsd-2-clause
zzz0072/Python_Exercises,zzz0072/Python_Exercises
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
<commit_before>#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather tha...
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather than 11 + 11 # De...
<commit_before>#!/usr/bin/env python # function def sum(op1, op2): return op1 + op2 my_sum = sum print my_sum(1, 2) print my_sum("I am ", "zzz"); # Default value in a fuction init = 12 def accumulate(val = init): val += val return val my_accu = accumulate init = 11 print my_accu() # is 12 + 12 rather tha...
f9aeede7af207a672a867c4f310d7d357a4d47c9
icekit/utils/fluent_contents.py
icekit/utils/fluent_contents.py
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
Improve error reporting for content item testing utils
Improve error reporting for content item testing utils
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
<commit_before>from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugi...
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugin_class, test_p...
<commit_before>from django.contrib.contenttypes.models import ContentType # USEFUL FUNCTIONS FOR FLUENT CONTENTS ############################################################# # Fluent Contents Helper Functions ################################################################# def create_content_instance(content_plugi...
e9efe7ff408fe5dd3be596ce9ded3bce312cb9e6
shell/src/hook.py
shell/src/hook.py
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
Make sure that the wrapped function inherits doctring
Make sure that the wrapped function inherits doctring
Python
apache-2.0
probcomp/bayeslite,probcomp/bayeslite
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
<commit_before>import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value =...
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value = outer def cu...
<commit_before>import threading import contextlib the_current_shell = threading.local() the_current_shell.value = None @contextlib.contextmanager def set_current_shell(shell): outer = the_current_shell.value the_current_shell.value = shell try: yield finally: the_current_shell.value =...
331ce5fde1a653997900f3e247f9d34a2c47fb54
projects/models.py
projects/models.py
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
Add explicit ordering to inlist items
Add explicit ordering to inlist items
Python
mit
XeryusTC/projman,XeryusTC/projman,XeryusTC/projman
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
<commit_before># -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: uniqu...
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
# -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: unique_together = ('...
<commit_before># -*- coding: utf-8 from django.conf import settings from django.db import models class InlistItem(models.Model): text = models.CharField(max_length=255, default='') user = models.ForeignKey(settings.AUTH_USER_MODEL) def __str__(self): return self.text class Meta: uniqu...
c23e697ccc64340027d3b07728032247bb5b21a4
kerze.py
kerze.py
from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) back(GROESS...
import turtle as t GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" t.fillcolor(FARBE) t.shape(SHAPE) def zeichneKerze(brennt): t.pd() t.begin_fill() t.forward(GROESSE*100) t.left(90) t.forward(GROESSE*400) t.left(90) t.forward(GROESSE*100) t.right(90) t.forward(GROESSE...
Make imports compliant to PEP 8 suggestion
Make imports compliant to PEP 8 suggestion
Python
mit
luforst/adventskranz
from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) back(GROESS...
import turtle as t GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" t.fillcolor(FARBE) t.shape(SHAPE) def zeichneKerze(brennt): t.pd() t.begin_fill() t.forward(GROESSE*100) t.left(90) t.forward(GROESSE*400) t.left(90) t.forward(GROESSE*100) t.right(90) t.forward(GROESSE...
<commit_before>from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) ...
import turtle as t GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" t.fillcolor(FARBE) t.shape(SHAPE) def zeichneKerze(brennt): t.pd() t.begin_fill() t.forward(GROESSE*100) t.left(90) t.forward(GROESSE*400) t.left(90) t.forward(GROESSE*100) t.right(90) t.forward(GROESSE...
from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) back(GROESS...
<commit_before>from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) ...