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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a99150d5c98074bde9218d6feb68f4cb200a0e4c | q_and_a/urls.py | q_and_a/urls.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | Use URLs from the prototype app | Use URLs from the prototype app
| Python | bsd-3-clause | DemocracyClub/candidate_questions,DemocracyClub/candidate_questions,DemocracyClub/candidate_questions | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.c... |
580868c63f61bb7f6576dc7b0029aa137e274a51 | qnd/__init__.py | qnd/__init__.py | """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
| """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
__all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
| Add __all__ variable to top level package | Add __all__ variable to top level package
| Python | unlicense | raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd | """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
Add __all__ variable to top level package | """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
__all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
| <commit_before>"""Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
<commit_msg>Add __all__ variable to top level package<commit_after> | """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
__all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
| """Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
Add __all__ variable to top level package"""Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
__all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
| <commit_before>"""Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
<commit_msg>Add __all__ variable to top level package<commit_after>"""Quick and Distributed TensorFlow command framework"""
from .flag import *
from .run import def_run
__all__ = ["add_flag", "add_req... |
697120d4e693bf7fbc192164b5df3dfb30f71a3f | tests/__init__.py | tests/__init__.py | import logging
import unittest
import os
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure session factory to u... | import logging
import unittest
import os
import shutil
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessio... | Remove test data folder with contents | Remove test data folder with contents
| Python | apache-2.0 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | import logging
import unittest
import os
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure session factory to u... | import logging
import unittest
import os
import shutil
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessio... | <commit_before>import logging
import unittest
import os
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessi... | import logging
import unittest
import os
import shutil
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessio... | import logging
import unittest
import os
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure session factory to u... | <commit_before>import logging
import unittest
import os
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessi... |
2673f1bac21e43a4cad9edb7352f89750d6d0144 | tests/settings.py | tests/settings.py | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | Enforce that tests run with anonymous access off. | Enforce that tests run with anonymous access off.
| Python | bsd-2-clause | mozilla/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,shinglyu/moztrap,mccarrmb/moztrap,mozilla/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,bobs... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | <commit_before># Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | <commit_before># Case Conductor is a Test Case Management system.
# Copyright (C) 2011-2012 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... |
15c8215415d36da4fac9c7333e62239f7b81c12d | test/support/mock_definitions.py | test/support/mock_definitions.py | # Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOS... | import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLU... | Change mock to be env dependant | Change mock to be env dependant
| Python | bsd-2-clause | Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input | # Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOS... | import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLU... | <commit_before># Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv(... | import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLU... | # Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOS... | <commit_before># Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv(... |
2e3d133874e1df647df146ce90e0f4e2ccf84ef4 | todo-list/todo.py | todo-list/todo.py | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
from datetime import date
from collections import defaultdict
class Todo:
def __init__(self):
self.items = defaultdict(list)
def add_item(self, item, tag):
self.items[tag].append(item)
def remove_item(... | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
import os
from datetime import date
from collections import defaultdict
home = os.path.expanduser('~')
class Todo:
def __init__(self):
self.items = defaultdict(list)
def __load_items(self):
try:
... | Add and remove now work with minimal error checking. | Add and remove now work with minimal error checking.
| Python | mit | Kredns/python | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
from datetime import date
from collections import defaultdict
class Todo:
def __init__(self):
self.items = defaultdict(list)
def add_item(self, item, tag):
self.items[tag].append(item)
def remove_item(... | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
import os
from datetime import date
from collections import defaultdict
home = os.path.expanduser('~')
class Todo:
def __init__(self):
self.items = defaultdict(list)
def __load_items(self):
try:
... | <commit_before>#!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
from datetime import date
from collections import defaultdict
class Todo:
def __init__(self):
self.items = defaultdict(list)
def add_item(self, item, tag):
self.items[tag].append(item)
d... | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
import os
from datetime import date
from collections import defaultdict
home = os.path.expanduser('~')
class Todo:
def __init__(self):
self.items = defaultdict(list)
def __load_items(self):
try:
... | #!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
from datetime import date
from collections import defaultdict
class Todo:
def __init__(self):
self.items = defaultdict(list)
def add_item(self, item, tag):
self.items[tag].append(item)
def remove_item(... | <commit_before>#!/usr/bin/env python
# My solution to the following challenge: https://redd.it/39ws1x
from datetime import date
from collections import defaultdict
class Todo:
def __init__(self):
self.items = defaultdict(list)
def add_item(self, item, tag):
self.items[tag].append(item)
d... |
5c3b93649a32e4a3007a428473af5235a40ac92e | __openerp__.py | __openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.0",
'author': u"XCG Consulting",
'category': u"Custom Module",
'descri... | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.2.1",
'author': u"XCG Consulting",
'category': u"Custom Module",
'desc... | Change version to 1.2.1 (dev) | Change version to 1.2.1 (dev)
| Python | agpl-3.0 | xcgd/account_asset_streamline | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.0",
'author': u"XCG Consulting",
'category': u"Custom Module",
'descri... | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.2.1",
'author': u"XCG Consulting",
'category': u"Custom Module",
'desc... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.0",
'author': u"XCG Consulting",
'category': u"Custom Modul... | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.2.1",
'author': u"XCG Consulting",
'category': u"Custom Module",
'desc... | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.0",
'author': u"XCG Consulting",
'category': u"Custom Module",
'descri... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
'name': u"Asset Streamline",
'version': u"1.0",
'author': u"XCG Consulting",
'category': u"Custom Modul... |
1d2d3f5dcab390244c58aa04305d74570ace5e44 | pyramid_authsanity/__init__.py | pyramid_authsanity/__init__.py | from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
def includeme(config):
config.set_authentication_policy(AuthServicePolicy())
| from pyramid.settings import (
asbool,
aslist,
)
from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
from .sources import (
SessionAuthSourceInitializer,
CookieAuthSourceInitializer,
)
from .util im... | Add settings that can set various defaults | Add settings that can set various defaults
This makes it very simple to use pyramid_authsanity with one of two
sources, as well as allowing the user to tweak the settings for the
source of their choosing.
| Python | isc | usingnamespace/pyramid_authsanity | from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
def includeme(config):
config.set_authentication_policy(AuthServicePolicy())
Add settings that can set various defaults
This makes it very simple to use pyramid_authsa... | from pyramid.settings import (
asbool,
aslist,
)
from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
from .sources import (
SessionAuthSourceInitializer,
CookieAuthSourceInitializer,
)
from .util im... | <commit_before>from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
def includeme(config):
config.set_authentication_policy(AuthServicePolicy())
<commit_msg>Add settings that can set various defaults
This makes it very s... | from pyramid.settings import (
asbool,
aslist,
)
from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
from .sources import (
SessionAuthSourceInitializer,
CookieAuthSourceInitializer,
)
from .util im... | from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
def includeme(config):
config.set_authentication_policy(AuthServicePolicy())
Add settings that can set various defaults
This makes it very simple to use pyramid_authsa... | <commit_before>from .interfaces import (
IAuthSourceService,
IAuthService,
)
from .policy import (
AuthServicePolicy,
NoAuthCompleted,
)
def includeme(config):
config.set_authentication_policy(AuthServicePolicy())
<commit_msg>Add settings that can set various defaults
This makes it very s... |
4f2dabc45f22a9ad6350ab33267e4bdf4a00b4ea | tests/testapp/tests/modelview.py | tests/testapp/tests/modelview.py | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | Add tests for adding stuff through the ModelView | Add tests for adding stuff through the ModelView
| Python | bsd-3-clause | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | <commit_before>from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.... | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.assertContains(... | <commit_before>from django.test import TestCase
from towel import deletion
from testapp.models import Person, EmailAddress
class ModelViewTest(TestCase):
def test_list_view(self):
for i in range(7):
p = Person.objects.create(family_name='Family %r' % i)
# paginate_by=5
self.... |
fa55f976f4a41bfcbf2009e543fd2a0057451c31 | metakernel/magics/plot_magic.py | metakernel/magics/plot_magic.py | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | Fix the option and update the note | Fix the option and update the note
| Python | bsd-3-clause | Calysto/metakernel | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | <commit_before># Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f',... | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | # Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f', '--format', ac... | <commit_before># Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from metakernel import Magic, option
class PlotMagic(Magic):
@option(
'-s', '--size', action='store',
help='Pixel size of plots, "width,height"'
)
@option(
'-f',... |
630a8683ba748f130bbb70c285d30142e50cd8ba | playlist_kreator/gmusic.py | playlist_kreator/gmusic.py | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | Change logs for google music | Change logs for google music
| Python | mit | epayet/playlist_kreator,epayet/playlist_kreator | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | <commit_before>from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
... | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
for artist_n... | <commit_before>from gmusicapi import Mobileclient
def create_playlist(playlist_name, artists, email, password, max_top_tracks=2):
api = Mobileclient()
logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)
if not logged_in:
raise Exception('Could not connect')
song_ids = []
... |
6a4c6c11cd0d2496ee33b7536b6691a34e1c81a8 | salt/returners/redis_return.py | salt/returners/redis_return.py | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | Add : to the id:jobs set key | Add : to the id:jobs set key
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | <commit_before>'''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | <commit_before>'''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
... |
3bcd36a063b112edb657a739287c6a2db3141746 | appolo/models.py | appolo/models.py | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Dag(models.Model):
def __unicode__(self):
return unicode(self.datum)
datum = mode... | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Meta:
verbose_name_plural = 'locaties'
class Dag(models.Model):
def __unicode__(... | Correct meervoud modellen van appolo | Correct meervoud modellen van appolo
| Python | mit | jonge-democraten/zues,jonge-democraten/zues,jonge-democraten/zues | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Dag(models.Model):
def __unicode__(self):
return unicode(self.datum)
datum = mode... | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Meta:
verbose_name_plural = 'locaties'
class Dag(models.Model):
def __unicode__(... | <commit_before>from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Dag(models.Model):
def __unicode__(self):
return unicode(self.datum)
... | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Meta:
verbose_name_plural = 'locaties'
class Dag(models.Model):
def __unicode__(... | from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Dag(models.Model):
def __unicode__(self):
return unicode(self.datum)
datum = mode... | <commit_before>from django.db import models
class Locatie(models.Model):
def __unicode__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Dag(models.Model):
def __unicode__(self):
return unicode(self.datum)
... |
fe4a72a49b8291f680c31037baa1c8b33e2ed227 | tests/test_carddb.py | tests/test_carddb.py | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | Add a test for using card docstrings as names | Add a test for using card docstrings as names
| Python | agpl-3.0 | NightKev/fireplace,jleclanche/fireplace,beheh/fireplace | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | <commit_before>from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag... | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | <commit_before>from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag... |
a8571b066634b7e7cbeb35844e1ee0b0d678112c | tests/test_itunes.py | tests/test_itunes.py | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript
from itunes.exceptions import AppleScriptError
class ITunesTests... | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript, play_track
from itunes.exceptions import AppleScriptError, Track... | Add test for `play_track` function | Add test for `play_track` function
New tests make sure that `play_track` raises a TrackError when an
invalid track is requested.
| Python | mit | adanoff/iTunesTUI | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript
from itunes.exceptions import AppleScriptError
class ITunesTests... | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript, play_track
from itunes.exceptions import AppleScriptError, Track... | <commit_before>"""
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript
from itunes.exceptions import AppleScriptError
cl... | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript, play_track
from itunes.exceptions import AppleScriptError, Track... | """
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript
from itunes.exceptions import AppleScriptError
class ITunesTests... | <commit_before>"""
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript
from itunes.exceptions import AppleScriptError
cl... |
2ab1f7687e2cd3b2814ae4c68f48d76fcea4e42b | tests/test_parser.py | tests/test_parser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | Add test to check gear value | Add test to check gear value
| Python | mit | SpunkyBot/spunkybot,SpunkyBot/spunkybot | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43():
ret_val... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
line = " 0:00 InitGame: \g_matchmode\1\g_gametype\7\g_allowvote\536871039\g_gear\KQ\mapname\ut4_dust2_v2\gamename\q3urt43\g_survivor\0\auth\0\g_modversion\4.3.4"
def test_initgame():
tmp = line.split()
assert tmp[1] == "InitGame:"
def test_mod43... |
9837d14d4c9a1fa85d6dd122ebbdda6a6b559087 | tests/test_travis.py | tests/test_travis.py | import unittest
import permstruct
import permstruct.dag
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_prop, perm_b... | import unittest
import permstruct
import permstruct.dag
import sys
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_p... | Make tests working with python 2 and 3 | Make tests working with python 2 and 3
| Python | bsd-3-clause | PermutaTriangle/PermStruct | import unittest
import permstruct
import permstruct.dag
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_prop, perm_b... | import unittest
import permstruct
import permstruct.dag
import sys
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_p... | <commit_before>import unittest
import permstruct
import permstruct.dag
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(pe... | import unittest
import permstruct
import permstruct.dag
import sys
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_p... | import unittest
import permstruct
import permstruct.dag
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(perm_prop, perm_b... | <commit_before>import unittest
import permstruct
import permstruct.dag
class TestTravis(unittest.TestCase):
def test_travis(self):
perm_prop = lambda p: p.avoids([2,3,1])
perm_bound = 6
inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
sol_iter = permstruct.construct_rule(pe... |
267076bba8b28f82da4d714d5ee3babc4d24b8da | voteswap/forms.py | voteswap/forms.py | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | Make second_candidate not required in sign up form | Make second_candidate not required in sign up form
| Python | mit | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | <commit_before>from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second... | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second_candidate = fo... | <commit_before>from django import forms
from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES
class LandingPageForm(forms.Form):
state = forms.ChoiceField(choices=STATES)
preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
second... |
373f0f4637103d526c75cae304740e621ad3c39c | resize.py | resize.py | # -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print... | # -*- coding: utf-8 -*-
import cv2
import sys
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,((int)(width/100*w_ratio),(int)(height/100*h_ratio)))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print ("Us... | Fix bug and delete unused library | Fix bug and delete unused library
| Python | mit | karaage0703/python-image-processing,karaage0703/python-image-processing | # -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print... | # -*- coding: utf-8 -*-
import cv2
import sys
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,((int)(width/100*w_ratio),(int)(height/100*h_ratio)))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print ("Us... | <commit_before># -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4)... | # -*- coding: utf-8 -*-
import cv2
import sys
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,((int)(width/100*w_ratio),(int)(height/100*h_ratio)))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print ("Us... | # -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4):
print... | <commit_before># -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
def resize(src, w_ratio, h_ratio):
height = src.shape[0]
width = src.shape[1]
dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))
return dst
if __name__ == '__main__':
param = sys.argv
if (len(param) != 4)... |
1c231a8ef54af82d8ec03b828856ddac619fd345 | knights/compat/django.py | knights/compat/django.py | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | Add a dummy safe filter for Django compat | Add a dummy safe filter for Django compat
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | <commit_before>import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='inclu... | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='include')
def do_inc... | <commit_before>import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.tag(name='inclu... |
5d8555ffc9a4b0549d32161a79aada3857b9d639 | webapp/graphite/events/models.py | webapp/graphite/events/models.py | import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what = models.CharFie... | import time
import os
from django.db import models
from django.contrib import admin
from tagging.managers import ModelTaggedItemManager
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
whe... | Fix events to work on mysql | Fix events to work on mysql
Closes https://bugs.launchpad.net/graphite/+bug/993625
| Python | apache-2.0 | jssjr/graphite-web,mleinart/graphite-web,DanCech/graphite-web,bruce-lyft/graphite-web,dhtech/graphite-web,cgvarela/graphite-web,ceph/graphite-web,AICIDNN/graphite-web,kkdk5535/graphite-web,axibase/graphite-web,graphite-project/graphite-web,g76r/graphite-web,redice/graphite-web,section-io/graphite-web,cloudant/graphite-... | import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what = models.CharFie... | import time
import os
from django.db import models
from django.contrib import admin
from tagging.managers import ModelTaggedItemManager
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
whe... | <commit_before>import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what =... | import time
import os
from django.db import models
from django.contrib import admin
from tagging.managers import ModelTaggedItemManager
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
whe... | import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what = models.CharFie... | <commit_before>import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what =... |
32116cf93b30fc63394379b49e921f9e0ab2f652 | django_filepicker/widgets.py | django_filepicker/widgets.py | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 0
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 1
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | Use version 1 of Filepicker.js | Use version 1 of Filepicker.js | Python | mit | filepicker/filepicker-django,filepicker/filepicker-django,FundedByMe/filepicker-django,FundedByMe/filepicker-django | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 0
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 1
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | <commit_before>from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 0
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else... | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 1
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 0
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else:
INPUT_TYP... | <commit_before>from django.conf import settings
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
JS_VERSION = 0
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
else... |
767cf250a23c164cfcf7d6eba5a48116e3b111e5 | app/admin/forms.py | app/admin/forms.py | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | Return Post object in PostForm save method | Return Post object in PostForm save method
| Python | mit | Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | <commit_before>from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostF... | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostForm(RedirectFor... | <commit_before>from flask_pagedown.fields import PageDownField
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from app.models import Post, Tag
from app.utils.helpers import get_or_create
from app.utils.forms import RedirectForm
from app.utils.fields import TagListField
class PostF... |
1ba620c9e9459b935bb59ed55dbb3fc6c14b1994 | edi/units/__init__.py | edi/units/__init__.py | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units() -> List[ModuleType]:
"""Find and import units in this... | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units(root: Path = None) -> List[ModuleType]:
"""Find and imp... | Generalize import_units to enable custom directories | Generalize import_units to enable custom directories
| Python | mit | jreese/edi | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units() -> List[ModuleType]:
"""Find and import units in this... | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units(root: Path = None) -> List[ModuleType]:
"""Find and imp... | <commit_before># Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units() -> List[ModuleType]:
"""Find and impor... | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units(root: Path = None) -> List[ModuleType]:
"""Find and imp... | # Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units() -> List[ModuleType]:
"""Find and import units in this... | <commit_before># Copyright 2017 John Reese
# Licensed under the MIT license
import os.path
import logging
from pathlib import Path
from importlib import import_module
from types import ModuleType
from typing import List
log = logging.getLogger(__name__)
def import_units() -> List[ModuleType]:
"""Find and impor... |
6d9ad75ca3ac9a5ed9aac33e56a4809fc7e37f54 | gignore/__init__.py | gignore/__init__.py | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base_url(self):
... | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
errors = []
def get_bas... | Add errors attribute with setter/getter | Add errors attribute with setter/getter
| Python | bsd-3-clause | Alir3z4/python-gignore | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base_url(self):
... | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
errors = []
def get_bas... | <commit_before>__version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base... | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
errors = []
def get_bas... | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base_url(self):
... | <commit_before>__version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base... |
7141cedd5667b373e3dd5a723052de42ea5dfa10 | ome/terminal.py | ome/terminal.py | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and hasattr(... | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, '{}m'.format(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and... | Include m in colour code string instead of appending it later. | Include m in colour code string instead of appending it later.
| Python | mit | shaurz/ome,shaurz/ome | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and hasattr(... | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, '{}m'.format(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and... | <commit_before>import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
... | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, '{}m'.format(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and... | import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
and hasattr(... | <commit_before>import sys
import os
ansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
ansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))
def is_ansi_terminal(file):
return ((sys.platform != 'win32' or 'ANSICON' in os.environ)
... |
01b1b649539beb41073e7df427d6f4622d687a5d | tests/django_settings.py | tests/django_settings.py | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresq... | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
USE_TZ = True
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | Set USE_TZ=True, django 4 raises a warning if this is not set to a value | Set USE_TZ=True, django 4 raises a warning if this is not set to a value
| Python | bsd-3-clause | romgar/django-dirtyfields | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresq... | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
USE_TZ = True
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | <commit_before># Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.bac... | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
USE_TZ = True
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresq... | <commit_before># Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.bac... |
54dc5c3a6ddf7fdc630547836058d017c778008f | python/recursive-digit-sum.py | python/recursive-digit-sum.py | #!/bin/python3
def superDigit(n, k):
p = create_p(n, k)
return get_super_digit(p)
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
def create_p(n, k):
return n * k
if __name__ == '__main__':
... | #!/bin/python3
def super_digit(n, k):
digits = map(int, list(n))
return get_super_digit(str(sum(digits) * k))
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
if __name__ == '__main__':
nk = inp... | Implement shortcut to compute initial p super digit | Implement shortcut to compute initial p super digit
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | #!/bin/python3
def superDigit(n, k):
p = create_p(n, k)
return get_super_digit(p)
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
def create_p(n, k):
return n * k
if __name__ == '__main__':
... | #!/bin/python3
def super_digit(n, k):
digits = map(int, list(n))
return get_super_digit(str(sum(digits) * k))
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
if __name__ == '__main__':
nk = inp... | <commit_before>#!/bin/python3
def superDigit(n, k):
p = create_p(n, k)
return get_super_digit(p)
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
def create_p(n, k):
return n * k
if __name__ ==... | #!/bin/python3
def super_digit(n, k):
digits = map(int, list(n))
return get_super_digit(str(sum(digits) * k))
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
if __name__ == '__main__':
nk = inp... | #!/bin/python3
def superDigit(n, k):
p = create_p(n, k)
return get_super_digit(p)
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
def create_p(n, k):
return n * k
if __name__ == '__main__':
... | <commit_before>#!/bin/python3
def superDigit(n, k):
p = create_p(n, k)
return get_super_digit(p)
def get_super_digit(p):
if len(p) == 1:
return int(p)
else:
digits = map(int, list(p))
return get_super_digit(str(sum(digits)))
def create_p(n, k):
return n * k
if __name__ ==... |
5d09fef9ee1f6b8627e372695a93be3236820f46 | app/main/errors.py | app/main/errors.py | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
# TODO: log the error
headers = []
error = e.description
if e.code == 401:
... | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
headers = []
code = getattr(e, 'code', 500)
error = getattr(e, 'description', 'Inte... | Fix app error handler raising an attribute error | Fix app error handler raising an attribute error
We're using a single error handler to return a JSON response for
any error code.
The handler expects a flask HTTP error exception with `.code` and
`.description` attributes (like the ones raised by `abort`).
However, if the app raises an exception that's not handled b... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
# TODO: log the error
headers = []
error = e.description
if e.code == 401:
... | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
headers = []
code = getattr(e, 'code', 500)
error = getattr(e, 'description', 'Inte... | <commit_before>from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
# TODO: log the error
headers = []
error = e.description
if e.co... | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
headers = []
code = getattr(e, 'code', 500)
error = getattr(e, 'description', 'Inte... | from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
# TODO: log the error
headers = []
error = e.description
if e.code == 401:
... | <commit_before>from flask import jsonify
from . import main
from ..models import ValidationError
@main.app_errorhandler(ValidationError)
def validatation_error(e):
return jsonify(error=e.message), 400
def generic_error_handler(e):
# TODO: log the error
headers = []
error = e.description
if e.co... |
c313d6fb6803edabb956e1e90f040f8518c334bf | app/main/errors.py | app/main/errors.py | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
| from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html",
**main.config['BASE_TEMPLATE_DATA']), 404
| Fix 404 page template static resources | Fix 404 page template static resources
| Python | mit | mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace... | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
Fix 404 page template static resources | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html",
**main.config['BASE_TEMPLATE_DATA']), 404
| <commit_before>from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
<commit_msg>Fix 404 page template static resources<commit_after> | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html",
**main.config['BASE_TEMPLATE_DATA']), 404
| from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
Fix 404 page template static resourcesfrom flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template... | <commit_before>from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
<commit_msg>Fix 404 page template static resources<commit_after>from flask import render_template
from . import main
@main.app_errorhandler(404)
def page... |
3fe6d183b3c168da73f9fb65a9b52ffe1d79e6e1 | txkazoo/test/test_version.py | txkazoo/test/test_version.py | import txkazoo
from twisted.trial.unittest import SynchronousTestCase
class VersionTests(SynchronousTestCase):
"""
Tests for programmatically acquiring the version of txkazoo.
"""
def test_both_names(self):
"""
The version is programmatically avaialble on the ``txkazoo``
modul... | # Copyright 2013-2014 Rackspace, 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 ... | Add copyright header to test | Add copyright header to test
| Python | apache-2.0 | rackerlabs/txkazoo | import txkazoo
from twisted.trial.unittest import SynchronousTestCase
class VersionTests(SynchronousTestCase):
"""
Tests for programmatically acquiring the version of txkazoo.
"""
def test_both_names(self):
"""
The version is programmatically avaialble on the ``txkazoo``
modul... | # Copyright 2013-2014 Rackspace, 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 ... | <commit_before>import txkazoo
from twisted.trial.unittest import SynchronousTestCase
class VersionTests(SynchronousTestCase):
"""
Tests for programmatically acquiring the version of txkazoo.
"""
def test_both_names(self):
"""
The version is programmatically avaialble on the ``txkazoo`... | # Copyright 2013-2014 Rackspace, 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 ... | import txkazoo
from twisted.trial.unittest import SynchronousTestCase
class VersionTests(SynchronousTestCase):
"""
Tests for programmatically acquiring the version of txkazoo.
"""
def test_both_names(self):
"""
The version is programmatically avaialble on the ``txkazoo``
modul... | <commit_before>import txkazoo
from twisted.trial.unittest import SynchronousTestCase
class VersionTests(SynchronousTestCase):
"""
Tests for programmatically acquiring the version of txkazoo.
"""
def test_both_names(self):
"""
The version is programmatically avaialble on the ``txkazoo`... |
5d93d1fb887d76d6fbe0a2f699e973ed9f6e7556 | tests/test_navigation.py | tests/test_navigation.py | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | Delete debug comments and tool | Delete debug comments and tool
| Python | agpl-3.0 | PyAr/PyZombis,PyAr/PyZombis,PyAr/PyZombis | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | <commit_before>def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
... | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("i... | <commit_before>def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
... |
0a09dbb6cc0104c9e1d3e504f84a70f729d14af1 | tests/unit/test_utils.py | tests/unit/test_utils.py | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | Add a test for utils.make_unique_obj_list | Add a test for utils.make_unique_obj_list
| Python | mit | radish-bdd/radish,radish-bdd/radish | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | <commit_before># -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', '... | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', 'bar'], ['foo', ... | <commit_before># -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import pytest
import radish.utils as utils
@pytest.mark.parametrize('basedirs, expected_basedirs', [
(['foo', '... |
a2c419296a9f42f3c0d70ad3b7d10eed3702bd85 | download-and-process.py | download-and-process.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150105'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150126'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | Update version of Wikidata dump to 20150126 | Update version of Wikidata dump to 20150126
| Python | mit | patrickhoefler/wikidata-virtuoso,patrickhoefler/wikidata-virtuoso | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150105'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150126'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150105'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-e... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150126'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150105'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-exports/rdf/expo... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wikidata
# The data (= ID) of the Wikidata dump
dump_id = '20150105'
# The files to download
download_urls = [
"https://tools.wmflabs.org/wikidata-exports/rdf/exports/%s/wikidata-terms.nt.gz" % dump_id,
"https://tools.wmflabs.org/wikidata-e... |
f693f09bfedc4981557741a8ac445c160faab65d | assisstant/main.py | assisstant/main.py | #!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| #!/usr/bin/env python3
import sys
import signal
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| Add signal handler to quit the application | Add signal handler to quit the application
| Python | apache-2.0 | brainbots/assistant | #!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
Add signal handler to quit the application | #!/usr/bin/env python3
import sys
import signal
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| <commit_before>#!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
<commit_msg>Add signal handler to quit the application... | #!/usr/bin/env python3
import sys
import signal
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| #!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
Add signal handler to quit the application#!/usr/bin/env python3
impo... | <commit_before>#!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
<commit_msg>Add signal handler to quit the application... |
015ba19ceefacd82e68aa7a023e33140e868f5a6 | cybox/common/defined_object.py | cybox/common/defined_object.py | class DefinedObject(object):
pass
| from StringIO import StringIO
class DefinedObject(object):
def to_xml(self):
"""Export an object as an XML String"""
s = StringIO()
self.to_obj().export(s, 0)
return s.getvalue()
| Add utility method to DefinedObject base class | Add utility method to DefinedObject base class
| Python | bsd-3-clause | CybOXProject/python-cybox | class DefinedObject(object):
pass
Add utility method to DefinedObject base class | from StringIO import StringIO
class DefinedObject(object):
def to_xml(self):
"""Export an object as an XML String"""
s = StringIO()
self.to_obj().export(s, 0)
return s.getvalue()
| <commit_before>class DefinedObject(object):
pass
<commit_msg>Add utility method to DefinedObject base class<commit_after> | from StringIO import StringIO
class DefinedObject(object):
def to_xml(self):
"""Export an object as an XML String"""
s = StringIO()
self.to_obj().export(s, 0)
return s.getvalue()
| class DefinedObject(object):
pass
Add utility method to DefinedObject base classfrom StringIO import StringIO
class DefinedObject(object):
def to_xml(self):
"""Export an object as an XML String"""
s = StringIO()
self.to_obj().export(s, 0)
return s.getvalue()
| <commit_before>class DefinedObject(object):
pass
<commit_msg>Add utility method to DefinedObject base class<commit_after>from StringIO import StringIO
class DefinedObject(object):
def to_xml(self):
"""Export an object as an XML String"""
s = StringIO()
self.to_obj().export(s, 0)
... |
b9671e96e40b38d0662dbe0e32dca0ca0c5fe62e | tensor2tensor/rl/trainer_model_based_test.py | tensor2tensor/rl/trainer_model_based_test.py | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | Add a test for the AE experiment | Add a test for the AE experiment
| Python | apache-2.0 | tensorflow/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | <commit_before># coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 require... | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | <commit_before># coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 require... |
fff3e2ed2ef1bb3f87f31178ef03d6752f2dc152 | salt/modules/cmd.py | salt/modules/cmd.py | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
| '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
print 'Echo got called!'
return text
| Add a debugging line to the echo command | Add a debugging line to the echo command
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
Add a debugging line to the echo command | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
print 'Echo got called!'
return text
| <commit_before>'''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
<commit_msg>Add a debugging line to the echo command<commit_after> | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
print 'Echo got called!'
return text
| '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
Add a debugging line to the echo command'''
Module for shelling out commands, inclusion of this module sho... | <commit_before>'''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
<commit_msg>Add a debugging line to the echo command<commit_after>'''
Module for shelling o... |
bee340782a07a26a28bf89d91798d8091c42d1e1 | config.py | config.py | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(... | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ["DB_URL"]
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(Config... | Use DB_URL set in heroku to avoid sqlalchemy dialect issue | Use DB_URL set in heroku to avoid sqlalchemy dialect issue
| Python | mit | mdsrosa/routes_api_python | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(... | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ["DB_URL"]
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(Config... | <commit_before>import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class Dev... | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ["DB_URL"]
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(Config... | import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class DevelopmentConfig(... | <commit_before>import os
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEBUG = True
DEVELOPMENT = True
class Dev... |
2d8efdb0c5628f6262e7efd2d8a20369415982bb | teknologr/registration/views.py | teknologr/registration/views.py | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | Fix submit view in registration | Fix submit view in registration
| Python | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | <commit_before>from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
c... | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
class BaseView(V... | <commit_before>from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember
c... |
a5338e46ffd0684b2d4f21708176cf6c8bbdcc92 | tests/changes/api/test_author_build_index.py | tests/changes/api/test_author_build_index.py | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | Test self request without authentication | Test self request without authentication
| Python | apache-2.0 | wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | <commit_before>from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | <commit_before>from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/... |
8c9a8e715643ac76181a9c05b6dd0afbcd9802a9 | config.py | config.py | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACE... | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACEBOOK_KEY... | Use DATABASE_URL instead of CLEARDB_DATABASE_URL | Use DATABASE_URL instead of CLEARDB_DATABASE_URL
For Postgress this is what we need, because this is what the following
command sets:
$ heroku pg:promote HEROKU_POSTGRESQL_BLUE_URL
Promoting HEROKU_POSTGRESQL_BLUE_URL to DATABASE_URL... done
| Python | bsd-3-clause | HamutalCohen3/anyway,boazin/anyway,boazin/anyway,yosinv/anyway,idogi/anyway,hasadna/anyway,omerxx/anyway,yosinv/anyway,njenia/anyway,OmerSchechter/anyway,OmerSchechter/anyway,idogi/anyway,HamutalCohen3/anyway,njenia/anyway,esegal/anyway,eladkarakuli/anyway,HamutalCohen3/anyway,hasadna/anyway,eladkarakuli/anyway,boazin/... | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACE... | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACEBOOK_KEY... | <commit_before>import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoei... | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACEBOOK_KEY... | import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoeijfoisdjf'
FACE... | <commit_before>import os
#
# This is the configuration file of the application
#
# Please make sure you don't store here any secret information and use environment
# variables
#
SQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')
SQLALCHEMY_POOL_RECYCLE = 60
SECRET_KEY = 'aiosdjsaodjoidjioewnioewfnoei... |
a7535e3abc791bc3b13788fa321513a4a840f5a8 | rnacentral/nhmmer/settings.py | rnacentral/nhmmer/settings.py | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | Set minimum query length to 10 nts | Set minimum query length to 10 nts
The shortest length that the nhmmer alphabet guesser will work on is 10.
| Python | apache-2.0 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 appl... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 appl... |
594869bca15b93a8e583e29b1a65496bd6c058f2 | config.py | config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///... | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = Tru... | Add SQLALCHEMY_TRACK_MODIFICATION to supress warnings | Add SQLALCHEMY_TRACK_MODIFICATION to supress warnings
| Python | mit | fernando24164/flask_api,fernando24164/flask_api | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///... | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = Tru... | <commit_before>import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_UR... | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = Tru... | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///... | <commit_before>import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_UR... |
b4aae8d7f87bd3f1bb27610440c20ab1110d2b3a | 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:
... | Fix script to update offering on instances | Fix script to update offering on instances
| 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... |
a18ae589f8217bc26bf1d4a8841c637354aedbaa | ispmgr/wwwdomain.py | ispmgr/wwwdomain.py | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self.params = {
'auth' : self.sessid,
'out' : self.out,
... | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self._clear_params()
def _clear_params(self):
try:
self.p... | Clear parameters before editing/adding. Before it was been unpossible to call two functions in sequence. | Clear parameters before editing/adding. Before it was been unpossible to call two functions in sequence.
| Python | mit | jakubjedelsky/python-ispmgr | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self.params = {
'auth' : self.sessid,
'out' : self.out,
... | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self._clear_params()
def _clear_params(self):
try:
self.p... | <commit_before>import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self.params = {
'auth' : self.sessid,
'out'... | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self._clear_params()
def _clear_params(self):
try:
self.p... | import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self.params = {
'auth' : self.sessid,
'out' : self.out,
... | <commit_before>import json
import api
class WWWDomain(api.API):
def __init__(self, auth_handler):
self.url = auth_handler.url
self.sessid = auth_handler.sessid
self.func = 'wwwdomain.edit'
self.out = 'json'
self.params = {
'auth' : self.sessid,
'out'... |
c0a341bb285e9906747c1f872e3b022a3a491044 | falmer/events/filters.py | falmer/events/filters.py | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | Add type filter by slug | Add type filter by slug
| Python | mit | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | <commit_before>from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',
't... | <commit_before>from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter
from falmer.events.models import Curator
from . import models
class EventFilterSet(FilterSet):
class Meta:
model = models.Event
fields = (
'title',
'venue',... |
a7f761d662b98dea2b16f711e7d17ad826f491af | onestop/test_gtfs.py | onestop/test_gtfs.py | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | Remove this test for now | Remove this test for now
| Python | mit | srthurman/transitland-python-client,transitland/transitland-python-client | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | <commit_before>"""geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162... | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | """geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162',
'stop... | <commit_before>"""geohash unit tests."""
import unittest
import os
import json
import gtfs
class TestGTFSReader(unittest.TestCase):
test_gtfs = os.path.join('examples', 'sample-feed.zip')
def test_readcsv(self):
expect = {
'stop_lat': '36.425288',
'zone_id': '',
'stop_lon': '-117.133162... |
dd58dbbbdb9b3a9479fa5db38a4e4038a6514fef | configReader.py | configReader.py | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | Change 'pass' statements to 'continue' statements. | Change 'pass' statements to 'continue' statements. | Python | mit | ollien/PyConfigReader | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | <commit_before>class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#I... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | <commit_before>class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#I... |
a8966a4d3f9a160af3865b8cadb26e58eb36fd64 | src/database/__init__.py | src/database/__init__.py | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
connection_string = 'sqlite://'
from database.model import Base
global session
if drop:
t... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | Fix the database session init to work with the flask debug server. | Fix the database session init to work with the flask debug server.
The debug webserver consists of two parts: the watcher that watches
the files for changes and the worker that is forked and will be restarted
after each modification. Sqlachemy uses a SingletonPool that will not
work with this if the database was initi... | Python | bsd-3-clause | janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
connection_string = 'sqlite://'
from database.model import Base
global session
if drop:
t... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | <commit_before>from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
connection_string = 'sqlite://'
from database.model import Base
global session
if ... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
connection_string = 'sqlite://'
from database.model import Base
global session
if drop:
t... | <commit_before>from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
connection_string = 'sqlite://'
from database.model import Base
global session
if ... |
0dc3e4ffe86f25697799b8092822a8d77a22493b | pi_mqtt_gpio/__init__.py | pi_mqtt_gpio/__init__.py | import sys
print("FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us"
"ing 'make schema' before packaging.")
sys.exit(1)
| import yaml
CONFIG_SCHEMA = yaml.load("""
mqtt:
type: dict
required: yes
schema:
host:
type: string
empty: no
required: no
default: localhost
port:
type: integer
min: 1
max: 65535
required: no
default: 1883
user:
type: string
required:... | Add schema to repo for now | Add schema to repo for now
| Python | mit | flyte/pi-mqtt-gpio | import sys
print("FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us"
"ing 'make schema' before packaging.")
sys.exit(1)
Add schema to repo for now | import yaml
CONFIG_SCHEMA = yaml.load("""
mqtt:
type: dict
required: yes
schema:
host:
type: string
empty: no
required: no
default: localhost
port:
type: integer
min: 1
max: 65535
required: no
default: 1883
user:
type: string
required:... | <commit_before>import sys
print("FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us"
"ing 'make schema' before packaging.")
sys.exit(1)
<commit_msg>Add schema to repo for now<commit_after> | import yaml
CONFIG_SCHEMA = yaml.load("""
mqtt:
type: dict
required: yes
schema:
host:
type: string
empty: no
required: no
default: localhost
port:
type: integer
min: 1
max: 65535
required: no
default: 1883
user:
type: string
required:... | import sys
print("FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us"
"ing 'make schema' before packaging.")
sys.exit(1)
Add schema to repo for nowimport yaml
CONFIG_SCHEMA = yaml.load("""
mqtt:
type: dict
required: yes
schema:
host:
type: string
empty: no
require... | <commit_before>import sys
print("FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us"
"ing 'make schema' before packaging.")
sys.exit(1)
<commit_msg>Add schema to repo for now<commit_after>import yaml
CONFIG_SCHEMA = yaml.load("""
mqtt:
type: dict
required: yes
schema:
host:
t... |
d0c284139fe475a62fa53cde7e3e20cf2cc2d977 | plugins/FileHandlers/STLWriter/__init__.py | plugins/FileHandlers/STLWriter/__init__.py | from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
}
}
def register(app):
return STLWriter.STLWriter()
| from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
},
'mesh_writer': {
'extension': 'stl',
'description': 'STL File'
}
}
def register(app):
return STLWriter.STLWriter()
| Add writer metadata to the STL writer plugin so it can be used in Cura | Add writer metadata to the STL writer plugin so it can be used in Cura
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
}
}
def register(app):
return STLWriter.STLWriter()
Add writer metadata to the STL writer plugin so it can be used in Cura | from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
},
'mesh_writer': {
'extension': 'stl',
'description': 'STL File'
}
}
def register(app):
return STLWriter.STLWriter()
| <commit_before>from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
}
}
def register(app):
return STLWriter.STLWriter()
<commit_msg>Add writer metadata to the STL writer plugin so it can be used in Cura<commit_after> | from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
},
'mesh_writer': {
'extension': 'stl',
'description': 'STL File'
}
}
def register(app):
return STLWriter.STLWriter()
| from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
}
}
def register(app):
return STLWriter.STLWriter()
Add writer metadata to the STL writer plugin so it can be used in Curafrom . import STLWriter
def getMetaData()... | <commit_before>from . import STLWriter
def getMetaData():
return {
'type': 'mesh_writer',
'plugin': {
"name": "STL Writer"
}
}
def register(app):
return STLWriter.STLWriter()
<commit_msg>Add writer metadata to the STL writer plugin so it can be used in Cura<commit_after>... |
6f0a35372d625f923b9093194540cf0b0e9f054d | platformio_api/__init__.py | platformio_api/__init__.py | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | Increase repo size to 20Mb | Increase repo size to 20Mb
| Python | apache-2.0 | orgkhnargh/platformio-api,platformio/platformio-api | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | <commit_before># Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https:... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https://github.com/iv... | <commit_before># Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import logging.config
import os
from time import tzset
VERSION = (0, 3, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio-api"
__description__ = ("An API for PlatformIO")
__url__ = "https:... |
72b899fd0ae8bd07edf454d410e65ff00a9ca772 | generic_links/models.py | generic_links/models.py | # -*- coding: UTF-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
class GenericLink(models.Model):
"""
Relates an object with an url and its data
"""
c... | # -*- coding: UTF-8 -*-
from django import VERSION
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
def get_user_model_fk_ref():
"""Get us... | Update for custom user model support | Update for custom user model support | Python | bsd-3-clause | matagus/django-generic-links,matagus/django-generic-links | # -*- coding: UTF-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
class GenericLink(models.Model):
"""
Relates an object with an url and its data
"""
c... | # -*- coding: UTF-8 -*-
from django import VERSION
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
def get_user_model_fk_ref():
"""Get us... | <commit_before># -*- coding: UTF-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
class GenericLink(models.Model):
"""
Relates an object with an url and its data... | # -*- coding: UTF-8 -*-
from django import VERSION
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
def get_user_model_fk_ref():
"""Get us... | # -*- coding: UTF-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
class GenericLink(models.Model):
"""
Relates an object with an url and its data
"""
c... | <commit_before># -*- coding: UTF-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
class GenericLink(models.Model):
"""
Relates an object with an url and its data... |
72fe214ba0bb66e5f5c4ca9670c14468304bdd49 | winthrop/people/views.py | winthrop/people/views.py | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | Fix people autosuggest with winthrop_only flag | Fix people autosuggest with winthrop_only flag
| Python | apache-2.0 | Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | <commit_before>from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide V... | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide VIAF suggestions... | <commit_before>from django.http import JsonResponse
from dal import autocomplete
from .models import Person
from winthrop.books.models import PersonBook
from django.db.models import BooleanField, Case, When, Value
from .viaf import ViafAPI
class ViafAutoSuggest(autocomplete.Select2ListView):
""" View to provide V... |
76bb7b55b175a6495d0db2881f8d94f03708522c | poeditor/__init__.py | poeditor/__init__.py | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from client import POEditorAPI, POEditorException, POEditorArgsExc... | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from .client import POEditorAPI, POEditorException, POEditorArgsEx... | Fix package ImportError for Python3 | Fix package ImportError for Python3
https://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax
"The only acceptable syntax for relative imports is
from .[module] import name. All import forms not starting with . are
interpreted as absolute imports. (PEP 0328)"
| Python | mit | sporteasy/python-poeditor | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from client import POEditorAPI, POEditorException, POEditorArgsExc... | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from .client import POEditorAPI, POEditorException, POEditorArgsEx... | <commit_before>"""
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from client import POEditorAPI, POEditorException, ... | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from .client import POEditorAPI, POEditorException, POEditorArgsEx... | """
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from client import POEditorAPI, POEditorException, POEditorArgsExc... | <commit_before>"""
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from client import POEditorAPI, POEditorException, ... |
56d1416a486f48fcbcf425d535268dec19715f2e | blueplayer/__main__.py | blueplayer/__main__.py | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:... | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyS0"
else:
port = args[0]
player = None
with serial.Serial(port, 19200) as serial_... | Update serial port and baud rate | Update serial port and baud rate
| Python | mit | dylwhich/rpi-ipod-emulator | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:... | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyS0"
else:
port = args[0]
player = None
with serial.Serial(port, 19200) as serial_... | <commit_before>import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) ... | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyS0"
else:
port = args[0]
player = None
with serial.Serial(port, 19200) as serial_... | import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:... | <commit_before>import sys
import serial
import threading
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) ... |
851e515379a5da66b4171f5340b910a2db84d0f0 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | Use the config_file attribute to find .jscs.json | Use the config_file attribute to find .jscs.json | Python | mit | roberthoog/SublimeLinter-jscs,SublimeLinter/SublimeLinter-jscs | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides ... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ilya Akhmadullin
# Copyright (c) 2013 Ilya Akhmadullin
#
# License: MIT
#
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides ... |
0b853eb0d6a9d5f2ed6bb098c1fc1f9231cc52dc | djangobotcfg/status.py | djangobotcfg/status.py | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | Use an IRC username that's not already registered. | Use an IRC username that's not already registered.
| Python | bsd-3-clause | jacobian-archive/django-buildmaster,hochanh/django-buildmaster | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | <commit_before>from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAl... | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth... | <commit_before>from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from .djangoauth import DjangoAuth
authz = Authz(
auth = DjangoAuth(),
gracefulShutdown = 'auth',
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
stopBuild = 'auth',
stopAl... |
c3ada10657efa7435564a1d6f8ff7afbfb585f54 | pombola/nigeria/tests.py | pombola/nigeria/tests.py | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
@attr(country='nigeria')
class HomeViewTes... | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
from pombola.info.models import InfoPage
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
... | Add a regression test for displaying escaped HTML in the blog | NG: Add a regression test for displaying escaped HTML in the blog
A fixed version of the test that Chris Mytton suggested in:
https://github.com/mysociety/pombola/pull/1587
| Python | agpl-3.0 | patricmutwiri/pombola,patricmutwiri/pombola,patricmutwiri/pombola,mysociety/pombola,mysociety/pombola,ken-muturi/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,ken-muturi/pombola,hzj123/56th,geoffkilpin/pombola,ken-muturi/pombola,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,mysociety/pombol... | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
@attr(country='nigeria')
class HomeViewTes... | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
from pombola.info.models import InfoPage
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
... | <commit_before>import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
@attr(country='nigeria')
cl... | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
from pombola.info.models import InfoPage
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
... | import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
@attr(country='nigeria')
class HomeViewTes... | <commit_before>import unittest
import doctest
from . import views
from django.test import TestCase
from nose.plugins.attrib import attr
# Needed to run the doc tests in views.py
def suite():
suite = unittest.TestSuite()
suite.addTest(doctest.DocTestSuite(views))
return suite
@attr(country='nigeria')
cl... |
6ef289403b4d88bc5e1a70568133924de54c2b9f | pyang/plugins/bbf.py | pyang/plugins/bbf.py | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | Set the parent class 'ensure_hyphenated_names' and set 'ctx.max_line_len' to 70 | Set the parent class 'ensure_hyphenated_names' and set 'ctx.max_line_len' to 70
This is to match the settings that BBF uses when validating its modules. The max_line_len setting won't override an explicit --max-line-len from the command line.
| Python | isc | mbj4668/pyang,mbj4668/pyang | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | <commit_before>"""BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_pl... | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | """BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_plugin(BBFPlugin(... | <commit_before>"""BBF usage guidelines plugin
See BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces
"""
import optparse
from pyang import plugin
from pyang.plugins import lint
def pyang_plugin_init():
plugin.register_pl... |
dc6af73616163463bf2c5feac97ac1473ea76e07 | proj/proj/models/user.py | proj/proj/models/user.py | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
created_at = db.Column(db.DateTime, default=datetime.datetime.no... | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
password = db.Column(db.String(200))
created_at = db.Column(... | Add password to User model. | Add password to User model.
| Python | mit | 1045347128/Flask-Boost,hustlzp/Flask-Boost,hustlzp/Flask-Boost,1045347128/Flask-Boost,1045347128/Flask-Boost,1045347128/Flask-Boost,hustlzp/Flask-Boost,hustlzp/Flask-Boost | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
created_at = db.Column(db.DateTime, default=datetime.datetime.no... | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
password = db.Column(db.String(200))
created_at = db.Column(... | <commit_before># coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
created_at = db.Column(db.DateTime, default=datet... | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
password = db.Column(db.String(200))
created_at = db.Column(... | # coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
created_at = db.Column(db.DateTime, default=datetime.datetime.no... | <commit_before># coding: utf-8
import datetime
from ._base import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
email = db.Column(db.String(50))
avatar = db.Column(db.String(200))
created_at = db.Column(db.DateTime, default=datet... |
1a0339b85d852526c184eeace73021fc7d68b2c6 | python_dispatcher.py | python_dispatcher.py | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.connect('core', '/core/', a... | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
import ppp_spell_checker
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.co... | Fix name of spell checker. | Fix name of spell checker.
| Python | cc0-1.0 | ProjetPP/Deployment,ProjetPP/Deployment,ProjetPP/Deployment | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.connect('core', '/core/', a... | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
import ppp_spell_checker
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.co... | <commit_before>import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.connect('cor... | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
import ppp_spell_checker
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.co... | import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.connect('core', '/core/', a... | <commit_before>import traceback
from routes import Mapper
import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone
class Application:
def __init__(self):
self.mapper = Mapper()
self.mapper.connect('cor... |
89b54d9c7fec213465446148e39612a2ac659ca2 | test/common/test_openstack.py | test/common/test_openstack.py | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
self.connection = OpenStackBaseCo... | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
from libcloud.utils.py3 import PY25
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
... | Fix test so it works with python 2.5. | Fix test so it works with python 2.5.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1342997 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | Jc2k/libcloud,marcinzaremba/libcloud,Scalr/libcloud,mathspace/libcloud,Verizon/libcloud,DimensionDataCBUSydney/libcloud,Cloud-Elasticity-Services/as-libcloud,lochiiconnectivity/libcloud,MrBasset/libcloud,sfriesel/libcloud,wrigri/libcloud,Itxaka/libcloud,erjohnso/libcloud,jerryblakley/libcloud,Scalr/libcloud,marcinzarem... | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
self.connection = OpenStackBaseCo... | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
from libcloud.utils.py3 import PY25
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
... | <commit_before>import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
self.connection = ... | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
from libcloud.utils.py3 import PY25
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
... | import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
self.connection = OpenStackBaseCo... | <commit_before>import sys
import unittest
from mock import Mock
from libcloud.common.openstack import OpenStackBaseConnection
class OpenStackBaseConnectionTest(unittest.TestCase):
def setUp(self):
self.timeout = 10
OpenStackBaseConnection.conn_classes = (None, Mock())
self.connection = ... |
f8d90e92ce791650dc89944fca009fc36d9e3a90 | crawler/wikitravel-optimize-articles.py | crawler/wikitravel-optimize-articles.py | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.article'
outFileName = fileName + '.opt'
if os.path.exists(outFileName):
... | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
def formatPath(s):
return s.replace('(', '\\(').replace(')', '\\)')
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.articl... | Handle correctly paths with symbols '(' and ')'. | [crawler] Handle correctly paths with symbols '(' and ')'.
| Python | apache-2.0 | VladiMihaylenko/omim,edl00k/omim,dobriy-eeh/omim,65apps/omim,65apps/omim,Zverik/omim,vasilenkomike/omim,UdjinM6/omim,syershov/omim,milchakov/omim,yunikkk/omim,ygorshenin/omim,alexzatsepin/omim,mapsme/omim,kw217/omim,dobriy-eeh/omim,AlexanderMatveenko/omim,vasilenkomike/omim,rokuz/omim,mpimenov/omim,andrewshadura/omim,g... | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.article'
outFileName = fileName + '.opt'
if os.path.exists(outFileName):
... | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
def formatPath(s):
return s.replace('(', '\\(').replace(')', '\\)')
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.articl... | <commit_before>#!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.article'
outFileName = fileName + '.opt'
if os.path.exists... | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
def formatPath(s):
return s.replace('(', '\\(').replace(')', '\\)')
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.articl... | #!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.article'
outFileName = fileName + '.opt'
if os.path.exists(outFileName):
... | <commit_before>#!/opt/local/bin/python
import json
import os
import re
import string
import sys
myPath = os.path.dirname(os.path.realpath(__file__))
for i, line in enumerate(sys.stdin):
(url, title, fileBase) = json.loads(line)
fileName = fileBase + '.article'
outFileName = fileName + '.opt'
if os.path.exists... |
5389fb8575251e2bd8ed18d96f4aa615e9a37bfa | deploy.py | deploy.py | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | Fix virtualenv path on PythonAnywhere | Fix virtualenv path on PythonAnywhere
| Python | apache-2.0 | ajdavis/twitter-gender-ratio,ajdavis/twitter-gender-distribution,ajdavis/twitter-gender-distribution,ajdavis/twitter-gender-ratio | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | <commit_before>#!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.pa... | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | #!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.parse_args()
pri... | <commit_before>#!/usr/bin/env python
import argparse
import os
import requests
my_domain = "www.proporti.onl"
username = "emptysquare"
parser = argparse.ArgumentParser()
parser.add_argument(
"token",
metavar="PYTHON_ANYWHERE_TOKEN",
help="A Python Anywhere API token for your account",
)
args = parser.pa... |
81ca235178a742e0041f2483d1f80d367d77264d | markov.py | markov.py | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | Fix find_seed behavior when the word is not present | Fix find_seed behavior when the word is not present
| Python | mit | calzoneman/MarkovBot,calzoneman/MarkovBot | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | <commit_before>import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
... | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
if seed ... | <commit_before>import random
class Markov:
def __init__(self, source, k=5):
self.source = source
self.k = k
self._init_source()
def _init_source(self):
self.seeds = {}
for i in range(len(self.source) - self.k - 1):
seed = tuple(self.source[i:i+self.k])
... |
09a395526dadac36f295674e01121818278ac91f | kobold/hash_functions.py | kobold/hash_functions.py | def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in default.items():
new[key] = value
for key, value in extra.items():
new[key] = value
return new
... | def project(hash_in, attributes):
return {key: value for (key, value) in hash_in.iteritems() if key in attributes}
def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in... | Add a "project" hash function, for projecting certain keys out of a dict | Add a "project" hash function, for projecting certain keys out of a dict | Python | mit | krieghan/kobold_python,krieghan/kobold_python | def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in default.items():
new[key] = value
for key, value in extra.items():
new[key] = value
return new
... | def project(hash_in, attributes):
return {key: value for (key, value) in hash_in.iteritems() if key in attributes}
def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in... | <commit_before>def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in default.items():
new[key] = value
for key, value in extra.items():
new[key] = value
... | def project(hash_in, attributes):
return {key: value for (key, value) in hash_in.iteritems() if key in attributes}
def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in... | def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in default.items():
new[key] = value
for key, value in extra.items():
new[key] = value
return new
... | <commit_before>def merge(default, to_mutate):
for key, value in default.items():
to_mutate.setdefault(key, value)
return to_mutate
def combine(default, extra):
new = {}
for key, value in default.items():
new[key] = value
for key, value in extra.items():
new[key] = value
... |
f3d3750986a8710c54c110c43c00fa152dbbd383 | src/hades/bin/su.py | src/hades/bin/su.py | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EUID != 0)")
... | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
os.setgid(group.gr_gid)
os.initgroups(passwd.pw_name, group.gr_gid)
os.setui... | Abort if privileges can't be dropped | Abort if privileges can't be dropped
| Python | mit | agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EUID != 0)")
... | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
os.setgid(group.gr_gid)
os.initgroups(passwd.pw_name, group.gr_gid)
os.setui... | <commit_before>import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EU... | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
os.setgid(group.gr_gid)
os.initgroups(passwd.pw_name, group.gr_gid)
os.setui... | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EUID != 0)")
... | <commit_before>import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EU... |
258c24c86ebbcc4a4a347e916d520c0f98f82f90 | reboot_router_claro3G.py | reboot_router_claro3G.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Fstatus... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# Data Router
user_router = "user_here"
pass_router = "password_here"
ip_router = "IP_here"
port_router = "80"
# URL with filling the fields above, URL with GET to reboot router or status main page to tests
url_get_reboot = "http://" + ip_rout... | Add variables with info access router | Add variables with info access router
| Python | apache-2.0 | cleitonbueno/reboot_router | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Fstatus... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# Data Router
user_router = "user_here"
pass_router = "password_here"
ip_router = "IP_here"
port_router = "80"
# URL with filling the fields above, URL with GET to reboot router or status main page to tests
url_get_reboot = "http://" + ip_rout... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# Data Router
user_router = "user_here"
pass_router = "password_here"
ip_router = "IP_here"
port_router = "80"
# URL with filling the fields above, URL with GET to reboot router or status main page to tests
url_get_reboot = "http://" + ip_rout... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Fstatus... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2 as http
# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=... |
5c7e83a20fe031e586a5a243c642506c9a2dbe9b | epoxy/metaclasses/scalar.py | epoxy/metaclasses/scalar.py | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | Rename some copy pasted variable. | Rename some copy pasted variable.
| Python | mit | graphql-python/graphql-epoxy | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | <commit_before>from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, ... | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, mcs).__new__(mc... | <commit_before>from graphql.core.type import GraphQLScalarType
class ScalarMeta(type):
def __new__(mcs, name, bases, attrs):
if attrs.pop('abstract', False):
return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)
registry = mcs._get_registry()
cls = super(ScalarMeta, ... |
6dc16ffca3fb2b3e95c7399fffd9f48493a8b969 | chatterbot/__init__.py | chatterbot/__init__.py | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.7'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| Update package version to 0.8.7 | Update package version to 0.8.7
| Python | bsd-3-clause | vkosuri/ChatterBot,gunthercox/ChatterBot | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
Update package version to 0.8.7 | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.7'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| <commit_before>"""
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
<commit_msg>Update package version... | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.7'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
Update package version to 0.8.7"""
ChatterBot is ... | <commit_before>"""
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
<commit_msg>Update package version... |
5e42ab2aa7e5537a995e8d3ca81a29299a077116 | examples/01-web/13-wikia.py | examples/01-web/13-wikia.py | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | Increment counter in wikia example per @satoru | Increment counter in wikia example per @satoru | Python | bsd-3-clause | z0by/pattern,abcht/pattern,bijandhakal/pattern,NTesla/pattern,loretoparisi/pattern,Sri0405/pattern,pombredanne/pattern,shuangsong/pattern,jatinmistry13/pattern,sfprime/pattern,z0by/pattern,arne-cl/pattern,rebeling/pattern,clips/pattern,jatinmistry13/pattern,bijandhakal/pattern,codeaudit/pattern-1,aoom/pattern,ashhher3/... | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | <commit_before># -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can b... | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | # -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can be quite slow.
#... | <commit_before># -*- coding: utf-8 *-*
import os, sys, pprint; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Wikia, WikiaArticleSet, URLTimeout
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# A query requests the article's HTML source from the server, which can b... |
4af368b3d3a4f5cfb8b78e19827c99078fb5ccab | client.py | client.py | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_Close(self):
... | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_RequstIndex(self... | Add request index page test. | Add request index page test.
| Python | bsd-3-clause | starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_Close(self):
... | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_RequstIndex(self... | <commit_before>#!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def tes... | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_RequstIndex(self... | #!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def test_Close(self):
... | <commit_before>#!/usr/bin/env python3
import unittest
import http.client
url = "localhost:8000"
class Client:
def test_Connect(self):
connected = 0
try:
self.conn = http.client.HTTPConnection(url)
self.conn.connect()
connected = 1
except Exception:
print(Exception)
return connected
def tes... |
00a29c535dc699b5bbbc7b6eb9d439d289c8de18 | common.py | common.py | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | Store raw data as well as content hash | Store raw data as well as content hash
..for now.
Trying to work out why the content hashes are
changing when I am not expecting them to.
| Python | mit | wdiv-scrapers/dc-base-scrapers | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | <commit_before>import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a ha... | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | <commit_before>import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a ha... |
7e89c3fbd08e4824cc84e46b8bad7289db801866 | tests/test_story.py | tests/test_story.py | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
mystr... | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
myst... | Add Tests for the lists adventure | Add Tests for the lists adventure
| Python | mit | sophilabs/py101 | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
mystr... | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
myst... | <commit_before>from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myin... | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
myst... | from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myinteger = 4
mystr... | <commit_before>from py101 import Story
from py101 import variables
from py101 import lists
import unittest
class TestStory(unittest.TestCase):
def test_name(self):
self.assertEqual(Story().name, 'py101', "name should be py101")
class TestAdventureVariables(unittest.TestCase):
good_solution = """
myin... |
62da8b8a2774db2ccb725bc0c5a1598252ebf4a7 | fuzzer/tasks.py | fuzzer/tasks.py | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | Kill fuzzers when we've found a crash or timed out | Kill fuzzers when we've found a crash or timed out
| Python | bsd-2-clause | shellphish/driller | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | <commit_before>import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=... | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | <commit_before>import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=... |
c95dc576153f60c8c56b7b2c5bfac467ccd9dd97 | gin/__init__.py | gin/__init__.py | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | Add import for constants_from_enum to be able to use @gin.constants_from_enum | Add import for constants_from_enum to be able to use @gin.constants_from_enum
PiperOrigin-RevId: 198401971
| Python | apache-2.0 | google/gin-config,google/gin-config | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | <commit_before># coding=utf-8
# Copyright 2018 The Gin-Config 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 b... | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | # coding=utf-8
# Copyright 2018 The Gin-Config 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 applicable la... | <commit_before># coding=utf-8
# Copyright 2018 The Gin-Config 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 b... |
f1359fb6b8117a00afd833765646f03650df6a54 | _lib/wordpress_post_processor.py | _lib/wordpress_post_processor.py | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | Remove commented line we definitely will never need | Remove commented line we definitely will never need
| Python | cc0-1.0 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | <commit_before>import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | <commit_before>import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads... |
6d57372c270d980e0f7d662a60195e54f88b9be5 | web/gunicorn.conf.py | web/gunicorn.conf.py | import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
| import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
accesslog = '-'
errorlog = '-'
| Make gunicorn log to stdout | Make gunicorn log to stdout
| Python | mit | slava-sh/messenger,slava-sh/messenger,slava-sh/messenger,slava-sh/messenger | import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
Make gunicorn log to stdout | import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
accesslog = '-'
errorlog = '-'
| <commit_before>import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
<commit_msg>Make gunicorn log to stdout<commit_after> | import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
accesslog = '-'
errorlog = '-'
| import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
Make gunicorn log to stdoutimport os
import multiprocessing
proc_name = 'gunicorn: {... | <commit_before>import os
import multiprocessing
proc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])
user = 'www-data'
group = 'www-data'
bind = '0.0.0.0:80'
workers = multiprocessing.cpu_count() * 2 + 1
threads = workers
<commit_msg>Make gunicorn log to stdout<commit_after>import os
import ... |
61029c887729032c8c832e64dfb63c444a637931 | alfred/__main__.py | alfred/__main__.py | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | Add an option to disable code reloader to runserver command | Add an option to disable code reloader to runserver command
| Python | isc | alfredhq/alfred,alfredhq/alfred | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | <commit_before>#!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred i... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred import create_ap... | <commit_before>#!/usr/bin/env python
import os
from argh import arg, ArghParser
from argh.exceptions import CommandError
from functools import wraps
CONFIG = os.environ.get('ALFRED_CONFIG')
def with_app(func):
@wraps(func)
@arg('--config', help='path to config')
def wrapper(args):
from alfred i... |
5493f78cd9225dc4a46689f09f75af59dfea9e16 | shortuuidfield/__init__.py | shortuuidfield/__init__.py | try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception, e:
VERSION = 'unknown'
from fields import ShortUUIDField | try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception:
VERSION = 'unknown'
from fields import ShortUUIDField
| Remove old-style assignment of raised exception | Remove old-style assignment of raised exception
I've removed the old-style assignment of the ``Exception`` because
it is no longer supported in Python 3.x. Since it is not used, I've
removed it completely.
| Python | bsd-3-clause | mriveralee/django-shortuuidfield,nebstrebor/django-shortuuidfield | try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception, e:
VERSION = 'unknown'
from fields import ShortUUIDFieldRemove old-style assignment of raised exception
I've removed the old-style assignment of the ``Exception`` because
it is no long... | try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception:
VERSION = 'unknown'
from fields import ShortUUIDField
| <commit_before>try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception, e:
VERSION = 'unknown'
from fields import ShortUUIDField<commit_msg>Remove old-style assignment of raised exception
I've removed the old-style assignment of the ``Except... | try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception:
VERSION = 'unknown'
from fields import ShortUUIDField
| try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception, e:
VERSION = 'unknown'
from fields import ShortUUIDFieldRemove old-style assignment of raised exception
I've removed the old-style assignment of the ``Exception`` because
it is no long... | <commit_before>try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-shortuuidfield').version
except Exception, e:
VERSION = 'unknown'
from fields import ShortUUIDField<commit_msg>Remove old-style assignment of raised exception
I've removed the old-style assignment of the ``Except... |
bc3063a36655f436257beffd2d8815827f601a71 | ui/widgets/Style.py | ui/widgets/Style.py | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | Make tab widgets look good on ElementaryOS. | Make tab widgets look good on ElementaryOS.
Any other linux distribution will probably look bad because of this. In
the future a better solution must be found to styling the background of
a widget inside a scrollarea inside a tabwidget.
| Python | mit | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | <commit_before>"""
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slig... | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | """
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slightly darker tha... | <commit_before>"""
Style
Contains convenience functions for styling widgets.
:Authors:
Berend Klein Haneveld
"""
import sys
def styleWidgetForTab(widget):
"""
This function style a widget that can be used inside a QScrollArea that
is inside a QTabWidget. On OS X the background color inside a tab
widget is slig... |
c6e48c224b48e90c57d7731fc88be7703990a02a | app/chess/piece.py | app/chess/piece.py | class ChessPiece(object):
def __init__(self):
self.column = 0
self.row = 0
self.symbol = ''
# Checks piece can attack the specified position
def can_attack_position(self, column, row):
pass
# return the character representation of this chess piece
def get_symbol(se... | from math import hypot
class ChessPiece(object):
def __init__(self):
self.x = 0
self.y = 0
self.symbol = ''
# Checks piece can attack the specified position
def deplace_piece(self, square):
self.x = square.x
self.y = square.y
# return the character representa... | Add attack function to KING class | Add attack function to KING class
| Python | mit | aymguesmi/ChessChallenge | class ChessPiece(object):
def __init__(self):
self.column = 0
self.row = 0
self.symbol = ''
# Checks piece can attack the specified position
def can_attack_position(self, column, row):
pass
# return the character representation of this chess piece
def get_symbol(se... | from math import hypot
class ChessPiece(object):
def __init__(self):
self.x = 0
self.y = 0
self.symbol = ''
# Checks piece can attack the specified position
def deplace_piece(self, square):
self.x = square.x
self.y = square.y
# return the character representa... | <commit_before>class ChessPiece(object):
def __init__(self):
self.column = 0
self.row = 0
self.symbol = ''
# Checks piece can attack the specified position
def can_attack_position(self, column, row):
pass
# return the character representation of this chess piece
de... | from math import hypot
class ChessPiece(object):
def __init__(self):
self.x = 0
self.y = 0
self.symbol = ''
# Checks piece can attack the specified position
def deplace_piece(self, square):
self.x = square.x
self.y = square.y
# return the character representa... | class ChessPiece(object):
def __init__(self):
self.column = 0
self.row = 0
self.symbol = ''
# Checks piece can attack the specified position
def can_attack_position(self, column, row):
pass
# return the character representation of this chess piece
def get_symbol(se... | <commit_before>class ChessPiece(object):
def __init__(self):
self.column = 0
self.row = 0
self.symbol = ''
# Checks piece can attack the specified position
def can_attack_position(self, column, row):
pass
# return the character representation of this chess piece
de... |
0943079243e918496bc2cc5a764025bd9dd4f0db | groundstation/stream_client.py | groundstation/stream_client.py | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(self, addr):
super(StreamClient, sel... | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
from groundstation.utils import path2id
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(sel... | Convert paths to objectnames before trying to use them | Convert paths to objectnames before trying to use them
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(self, addr):
super(StreamClient, sel... | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
from groundstation.utils import path2id
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(sel... | <commit_before>from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(self, addr):
super(St... | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
from groundstation.utils import path2id
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(sel... | from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(self, addr):
super(StreamClient, sel... | <commit_before>from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(self, addr):
super(St... |
e2132caf1c677b34eddd679e23983022ec12b5df | watermarker/conf.py | watermarker/conf.py | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = 30
class Meta:
prefix = 'watermark'
... | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = getattr(settings, 'WATERMARK_PERCENTAGE', 30)
... | Change AppConf class to use settings defined value or default. | Change AppConf class to use settings defined value or default.
| Python | bsd-3-clause | lzanuz/django-watermark,lzanuz/django-watermark | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = 30
class Meta:
prefix = 'watermark'
... | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = getattr(settings, 'WATERMARK_PERCENTAGE', 30)
... | <commit_before># -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = 30
class Meta:
prefix =... | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = getattr(settings, 'WATERMARK_PERCENTAGE', 30)
... | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = 30
class Meta:
prefix = 'watermark'
... | <commit_before># -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class WatermarkSettings(AppConf):
QUALITY = 85
OBSCURE_ORIGINAL = True
RANDOM_POSITION_ONCE = True
WATERMARK_PERCENTAGE = 30
class Meta:
prefix =... |
13291e4862ef48a3de3615e8eef5704c6bfff628 | importlib_metadata/__init__.py | importlib_metadata/__init__.py | import os
import sys
import glob
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for path_item in path:
glob_spec = os.p... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | Implement metadata loading and version retrieval | Implement metadata loading and version retrieval
| Python | apache-2.0 | python/importlib_metadata | import os
import sys
import glob
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for path_item in path:
glob_spec = os.p... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | <commit_before>import os
import sys
import glob
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for path_item in path:
g... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | import os
import sys
import glob
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for path_item in path:
glob_spec = os.p... | <commit_before>import os
import sys
import glob
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for path_item in path:
g... |
48543d559d13bb9446f455d14ec3e8ae1ff4f2d7 | angular_flask/__init__.py | angular_flask/__init__.py | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_path='/instance')
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py')
import angular_flask.core
import angular_flask.models
import angular_flask.control... | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_relative_config=True)
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py', True)
import angular_flask.core
import angular_flask.models
import angular_fla... | Set tru to config from pyfile | Set tru to config from pyfile
| Python | mit | Clarity-89/blog,Clarity-89/blog,Clarity-89/blog | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_path='/instance')
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py')
import angular_flask.core
import angular_flask.models
import angular_flask.control... | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_relative_config=True)
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py', True)
import angular_flask.core
import angular_flask.models
import angular_fla... | <commit_before>import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_path='/instance')
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py')
import angular_flask.core
import angular_flask.models
import angula... | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_relative_config=True)
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py', True)
import angular_flask.core
import angular_flask.models
import angular_fla... | import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_path='/instance')
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py')
import angular_flask.core
import angular_flask.models
import angular_flask.control... | <commit_before>import os
from flask import Flask
from flask_sslify import SSLify
app = Flask(__name__, instance_path='/instance')
if 'DYNO' in os.environ:
sslify = SSLify(app)
app.config.from_object('config')
app.config.from_pyfile('config.py')
import angular_flask.core
import angular_flask.models
import angula... |
dcba06dfc3ae1e558c3b7926780b0934b7ac3fda | trackpy/tests/test_misc.py | trackpy/tests/test_misc.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | Fix pims warning test under Py3 | TST: Fix pims warning test under Py3
| Python | bsd-3-clause | daniorerio/trackpy,daniorerio/trackpy | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | <commit_before>from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
de... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | <commit_before>from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
de... |
bebc2a499a4190c8c3090bcab0203b913aa7592d | events/auth.py | events/auth.py | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | Fix checking apikey outside runserver | Fix checking apikey outside runserver
| Python | mit | City-of-Helsinki/linkedevents,aapris/linkedevents,aapris/linkedevents,aapris/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | <commit_before>from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authen... | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, re... | <commit_before>from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
class ApiKeyAuthentication(authentication.BaseAuthentication):
def authen... |
b0a275e2430a04bf4e47b823f48cade92c407673 | apiserver/worker/grab_config.py | apiserver/worker/grab_config.py | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | Fix typo in GPU worker config setup | Fix typo in GPU worker config setup
| Python | mit | HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | <commit_before>"""
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | <commit_before>"""
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance... |
7b520e973ed9a72cc3b68bda0a48c89b6d60558b | examples/connect4_uci_outcomes.py | examples/connect4_uci_outcomes.py | from __future__ import division, print_function
from collections import Counter
from capstone.util.c4uci import load_instance
FILENAME = 'datasets/connect-4.data'
outcomes = []
with open(FILENAME) as f:
for i, line in enumerate(f, 1):
_, outcome = load_instance(line)
outcomes.append(outcome)
... | from __future__ import division, print_function
import pandas as pd
from sklearn.linear_model import LinearRegression
from capstone.game import Connect4 as C4
from capstone.util import print_header
FILENAME = 'datasets/connect-4.data'
def column_name(i):
if i == 42:
return 'outcome'
row = chr(ord('a')... | Use pandas dataframes for UCI C4 dataset | Use pandas dataframes for UCI C4 dataset
| Python | mit | davidrobles/mlnd-capstone-code | from __future__ import division, print_function
from collections import Counter
from capstone.util.c4uci import load_instance
FILENAME = 'datasets/connect-4.data'
outcomes = []
with open(FILENAME) as f:
for i, line in enumerate(f, 1):
_, outcome = load_instance(line)
outcomes.append(outcome)
... | from __future__ import division, print_function
import pandas as pd
from sklearn.linear_model import LinearRegression
from capstone.game import Connect4 as C4
from capstone.util import print_header
FILENAME = 'datasets/connect-4.data'
def column_name(i):
if i == 42:
return 'outcome'
row = chr(ord('a')... | <commit_before>from __future__ import division, print_function
from collections import Counter
from capstone.util.c4uci import load_instance
FILENAME = 'datasets/connect-4.data'
outcomes = []
with open(FILENAME) as f:
for i, line in enumerate(f, 1):
_, outcome = load_instance(line)
outcomes.appen... | from __future__ import division, print_function
import pandas as pd
from sklearn.linear_model import LinearRegression
from capstone.game import Connect4 as C4
from capstone.util import print_header
FILENAME = 'datasets/connect-4.data'
def column_name(i):
if i == 42:
return 'outcome'
row = chr(ord('a')... | from __future__ import division, print_function
from collections import Counter
from capstone.util.c4uci import load_instance
FILENAME = 'datasets/connect-4.data'
outcomes = []
with open(FILENAME) as f:
for i, line in enumerate(f, 1):
_, outcome = load_instance(line)
outcomes.append(outcome)
... | <commit_before>from __future__ import division, print_function
from collections import Counter
from capstone.util.c4uci import load_instance
FILENAME = 'datasets/connect-4.data'
outcomes = []
with open(FILENAME) as f:
for i, line in enumerate(f, 1):
_, outcome = load_instance(line)
outcomes.appen... |
7eb8466484043dea127c168f41027aea9ff7679d | examples/generate-manager-file.py | examples/generate-manager-file.py | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | Include default values in generated .manager files | Include default values in generated .manager files
20070911135919-4210b-773464bb139c29ab8da7ee85334bf2907e5d6e3c.gz
| Python | lgpl-2.1 | freedesktop-unofficial-mirror/telepathy__telepathy-python,detrout/telepathy-python,epage/telepathy-python,freedesktop-unofficial-mirror/telepathy__telepathy-python,epage/telepathy-python,PabloCastellano/telepathy-python,PabloCastellano/telepathy-python,max-posedon/telepathy-python,detrout/telepathy-python,max-posedon/t... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | <commit_before>#!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "h... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_na... | <commit_before>#!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
from telepathy.constants import CONN_MGR_PARAM_FLAG_REQUIRED, \
CONN_MGR_PARAM_FLAG_REGISTER
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "h... |
6ddba0706a377874978da064b47bb6245e362f5b | floyd/floyd.py | floyd/floyd.py | #!-*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | # -*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | Implement of Cantor Paring Function | Implement of Cantor Paring Function
| Python | mit | rokujyouhitoma/tips,rokujyouhitoma/tips,rokujyouhitoma/tips,rokujyouhitoma/tips | #!-*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | # -*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | <commit_before>#!-*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3... | # -*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | #!-*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3,1,2,3,1])
... | <commit_before>#!-*- coding:utf-8 -*-
"""
Floyd's cycle-finding algorithm
http://en.wikipedia.org/wiki/Cycle_detection
http://www.siafoo.net/algorithm/10
"""
def floyd(top):
"""
>>> floyd([1,2,3,4])
False
>>> floyd([1,2,1,2,1])
True
>>> floyd([1,2,3,1,2,3,1])
True
>>> floyd([1,2,3,1,2,3... |
655e741375b3fad7e3b7657662d33ca8017c0220 | test/requests/link_checker.py | test/requests/link_checker.py | import requests
def check_links(args_obj, parser):
print("")
print("Checking links")
print("########################")
print("Not implemented yet.")
print("This is supposed to check all links in the system.")
print("########################")
| from __future__ import print_function
import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
def is_root_link(link):
pattern = re.compile("^/$")
return pattern.match(link)
def is_mailto_link(link):
pattern = re.compile("^mailto:.*")
return pattern.match(l... | Add tests to check links. | Add tests to check links.
| Python | agpl-3.0 | zsloan/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,DannyArends/gen... | import requests
def check_links(args_obj, parser):
print("")
print("Checking links")
print("########################")
print("Not implemented yet.")
print("This is supposed to check all links in the system.")
print("########################")
Add tests to check links. | from __future__ import print_function
import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
def is_root_link(link):
pattern = re.compile("^/$")
return pattern.match(link)
def is_mailto_link(link):
pattern = re.compile("^mailto:.*")
return pattern.match(l... | <commit_before>import requests
def check_links(args_obj, parser):
print("")
print("Checking links")
print("########################")
print("Not implemented yet.")
print("This is supposed to check all links in the system.")
print("########################")
<commit_msg>Add tests to check links.... | from __future__ import print_function
import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
def is_root_link(link):
pattern = re.compile("^/$")
return pattern.match(link)
def is_mailto_link(link):
pattern = re.compile("^mailto:.*")
return pattern.match(l... | import requests
def check_links(args_obj, parser):
print("")
print("Checking links")
print("########################")
print("Not implemented yet.")
print("This is supposed to check all links in the system.")
print("########################")
Add tests to check links.from __future__ import prin... | <commit_before>import requests
def check_links(args_obj, parser):
print("")
print("Checking links")
print("########################")
print("Not implemented yet.")
print("This is supposed to check all links in the system.")
print("########################")
<commit_msg>Add tests to check links.... |
2bb9eab65b56f012076ed6f122cda4d58b576eb7 | gather/main.py | gather/main.py | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | Fix regexes so that so doesn't match s | Fix regexes so that so doesn't match s
| Python | mit | veryhappythings/discord-gather | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | <commit_before>#!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as... | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | #!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as f:
con... | <commit_before>#!/usr/bin/env python3
import logging
import json
from gather.gatherbot import GatherBot
from gather import commands
def main():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s",
)
with open('config.json') as... |
1e8fd33ef4e8b75632d8a4fe4d86944fdfc5a649 | beetle/__init__.py | beetle/__init__.py | name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
pass
| name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
def __init__(self, page=None):
self.page = page
| Allow the BeetleError class to take a page object as an argument | Allow the BeetleError class to take a page object as an argument
| Python | mit | cknv/beetle | name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
pass
Allow the BeetleError class to take a page object as an argument | name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
def __init__(self, page=None):
self.page = page
| <commit_before>name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
pass
<commit_msg>Allow the BeetleError class to take a page object as an argument<commit_after> | name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
def __init__(self, page=None):
self.page = page
| name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
pass
Allow the BeetleError class to take a page object as an argumentname = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
def __init_... | <commit_before>name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
class BeetleError(Exception):
pass
<commit_msg>Allow the BeetleError class to take a page object as an argument<commit_after>name = 'beetle'
version = '0.4.1-dev'
project_url = 'https://github.com/cknv/beetle'
clas... |
98ebd229819cb108af7746dfdd950019111063ce | http_server.py | http_server.py | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | Add HttpServer.close_socket() to the server's socket | Add HttpServer.close_socket() to the server's socket
| Python | mit | jefrailey/network_tools | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | <commit_before>import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socke... | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socket.socket(
... | <commit_before>import socket
class HttpServer(object):
"""docstring for HttpServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self._ip = ip
self._port = port
self._backlog = backlog
self._socket = None
def open_socket(self):
self._socket = socke... |
0824bb4025d00d9e435c162a0b1931d448baf7c9 | hardware/sense_hat/marble_maze.py | hardware/sense_hat/marble_maze.py | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | Add moving of marble on x axis - currently brokwn | Add moving of marble on x axis - currently brokwn
| Python | mit | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | <commit_before># based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r... | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | # based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r,r,r,b,r,b,b,r]... | <commit_before># based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.clear()
time.sleep(0.5)
r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )
x = 1
y = 1
maze = [[r,r,r,r,r,r,r,r],
[r,b,b,b,b,b,b,r],
[r... |
0d81d93a0c90c8cda2e762255c2d41b99ddc16f3 | macdict/cli.py | macdict/cli.py | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | Fix CJK input in command line arguments | Fix CJK input in command line arguments
| Python | mit | tonyseek/macdict | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | <commit_before>from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
... | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
def report(te... | <commit_before>from __future__ import absolute_import
import sys
import argparse
from macdict.dictionary import lookup_word
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('word')
return parser.parse_args()
def abort(text):
sys.stderr.write(u'%s\n' % text)
sys.exit(1)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.