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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f9a3c62c4117e0e674d33e675c3a54d800dacb6 | comics/accounts/models.py | comics/accounts/models.py | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | Add a M2M table for the subscription relation between users and comics | Add a M2M table for the subscription relation between users and comics
| Python | agpl-3.0 | jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,jodal/comics | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | <commit_before>import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserPro... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.cr... | <commit_before>import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from comics.core.models import Comic
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserPro... |
ccdefc6584f64a832614be172ec384022805fa20 | hitchstory/arguments.py | hitchstory/arguments.py | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | REFACTOR : Removed unnecessary code. | REFACTOR : Removed unnecessary code.
| Python | agpl-3.0 | hitchtest/hitchstory | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | <commit_before>from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
... | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | <commit_before>from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
... |
0e5b0ccb7eb79fe68b8e40ad46d8e2e0efa01ba7 | test_queue.py | test_queue.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5"""
new_queu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5
"""
new... | Fix errors in test file | Fix errors in test file
Fix errors and typos in 'test_queue.py'
| Python | mit | jesseklein406/data-structures | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5"""
new_queu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5
"""
new... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5"... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5
"""
new... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5"""
new_queu... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A series of pytest tests to test the quality
of our Queue class and its methods
"""
from __future__ import unicode_literals
import pytest
import queue
@pytest.fixture(scope="function")
def create_queue(request):
"""Create a queue with numbers 1 - 5"... |
26de6c5decac3345dee470a0968926a65d3497b9 | test_stack.py | test_stack.py | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.next is None
n = Element(3)
assert n.val == 3
assert n.next is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_push():
... | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.previous is None
m = Element(3)
assert m.val == 3
assert m.previous is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_pu... | Add test for pop and adjust element init test | Add test for pop and adjust element init test
| Python | mit | constanthatz/data-structures | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.next is None
n = Element(3)
assert n.val == 3
assert n.next is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_push():
... | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.previous is None
m = Element(3)
assert m.val == 3
assert m.previous is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_pu... | <commit_before>import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.next is None
n = Element(3)
assert n.val == 3
assert n.next is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_s... | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.previous is None
m = Element(3)
assert m.val == 3
assert m.previous is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_pu... | import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.next is None
n = Element(3)
assert n.val == 3
assert n.next is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_stack_push():
... | <commit_before>import pytest
from stack import Element
from stack import Stack
def test_element_init():
n = Element()
assert n.val is None
assert n.next is None
n = Element(3)
assert n.val == 3
assert n.next is None
def test_stack_init():
l = Stack()
assert l.top is None
def test_s... |
151c97a3a5cd0f9103c891ee9c60f3fe52fc3d12 | test_suite.py | test_suite.py | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
management.call_command('test', 'resources', 'forms', 'tokens')
| import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
apps = sys.argv[1:]
if not apps:
apps = [
'resources',
'forms',
'tokens',
]
management.call_command('test', *apps)
| Allow apps to be specified from the command line | Allow apps to be specified from the command line
| Python | bsd-2-clause | chop-dbhi/serrano,chop-dbhi/serrano,rv816/serrano_night,rv816/serrano_night | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
management.call_command('test', 'resources', 'forms', 'tokens')
Allow apps to be specified from the command line | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
apps = sys.argv[1:]
if not apps:
apps = [
'resources',
'forms',
'tokens',
]
management.call_command('test', *apps)
| <commit_before>import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
management.call_command('test', 'resources', 'forms', 'tokens')
<commit_msg>Allow apps to be specified from the command line<commit_after> | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
apps = sys.argv[1:]
if not apps:
apps = [
'resources',
'forms',
'tokens',
]
management.call_command('test', *apps)
| import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
management.call_command('test', 'resources', 'forms', 'tokens')
Allow apps to be specified from the command lineimport os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import ma... | <commit_before>import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
management.call_command('test', 'resources', 'forms', 'tokens')
<commit_msg>Allow apps to be specified from the command line<commit_after>import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'te... |
9e365b0738a6fcd5f0f67375288cf8bea771c6eb | freight/notifiers/base.py | freight/notifiers/base.py | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_options(self):
... | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [
NotifierEvent.TASK_QUEUED,
NotifierEvent.TASK_STARTED,
NotifierEvent.TASK... | Add TASK_QUEUED to default notifier events | Add TASK_QUEUED to default notifier events
| Python | apache-2.0 | rshk/freight,getsentry/freight,rshk/freight,klynton/freight,getsentry/freight,getsentry/freight,klynton/freight,getsentry/freight,rshk/freight,getsentry/freight,klynton/freight,klynton/freight,rshk/freight | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_options(self):
... | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [
NotifierEvent.TASK_QUEUED,
NotifierEvent.TASK_STARTED,
NotifierEvent.TASK... | <commit_before>from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_optio... | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [
NotifierEvent.TASK_QUEUED,
NotifierEvent.TASK_STARTED,
NotifierEvent.TASK... | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_options(self):
... | <commit_before>from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_optio... |
1243d484009e621338a5fcd609d62bedd9796f05 | tests/base.py | tests/base.py | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | Add authorization and content-type headers to request for tests | [CHORE] Add authorization and content-type headers to request for tests
| Python | mit | brayoh/bucket-list-api | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | <commit_before>import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | <commit_before>import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self... |
6b7e220cdaa403354104aa0fbeabdce8ce37ff13 | indra/tests/test_tas.py | indra/tests/test_tas.py | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 51722, num_stmts
assert all(len(s... | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 1601159, num_stmts
assert all(len... | Update expected number of tas statements in test | Update expected number of tas statements in test
| Python | bsd-2-clause | sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 51722, num_stmts
assert all(len(s... | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 1601159, num_stmts
assert all(len... | <commit_before>from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 51722, num_stmts
a... | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 1601159, num_stmts
assert all(len... | from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 51722, num_stmts
assert all(len(s... | <commit_before>from indra.sources.tas import process_from_web
def test_processor():
tp = process_from_web(affinity_class_limit=10)
assert tp
assert tp.statements
num_stmts = len(tp.statements)
# This is the total number of statements about human genes
assert num_stmts == 51722, num_stmts
a... |
863828c37eca9046a7dd169114e2a6c3e02e28aa | proxy-firewall.py | proxy-firewall.py | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | Fix proxy URIs with credentials in them | Fix proxy URIs with credentials in them
| Python | apache-2.0 | sassoftware/jobmaster,sassoftware/jobmaster,sassoftware/jobmaster | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | <commit_before>#!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConf... | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | #!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConfiguration(False... | <commit_before>#!/usr/bin/python
"""
Set the firewall to allow access to configured HTTP(S) proxies.
This is only necessary until rBuilder handles the EC2 image posting
and registration process.
"""
import os, sys, urllib, urlparse
from conary.conarycfg import ConaryConfiguration
def main(args):
cfg = ConaryConf... |
607728b17c0a79725d997b458a53d1b3d1394a59 | pymue/__init__.py | pymue/__init__.py | from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator
| from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator, GuestPair
def pair_pprint(pair):
return "(%s, %s)" % (pair.first, pair.second)
GuestPair.__repr__ = pair_pprint
| Add string representation to GuestPair | Add string representation to GuestPair
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>
| Python | bsd-3-clause | janLo/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool | from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator
Add string representation to GuestPair
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de> | from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator, GuestPair
def pair_pprint(pair):
return "(%s, %s)" % (pair.first, pair.second)
GuestPair.__repr__ = pair_pprint
| <commit_before>from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator
<commit_msg>Add string representation to GuestPair
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de><commit_after> | from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator, GuestPair
def pair_pprint(pair):
return "(%s, %s)" % (pair.first, pair.second)
GuestPair.__repr__ = pair_pprint
| from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator
Add string representation to GuestPair
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator, GuestPair
def pair_pprint(pair):
... | <commit_before>from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGenerator
<commit_msg>Add string representation to GuestPair
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de><commit_after>from _pymue import peng, Team, DistanceMatrix, SeenTable, GuestTupleGener... |
641e31fcb05016e5fb27e8f115a763b72c7638f3 | python/tag_img.py | python/tag_img.py | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | Tag an image based on detected visual content | Tag an image based on detected visual content | Python | bsd-2-clause | symisc/pixlab,symisc/pixlab,symisc/pixlab | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | <commit_before>import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
im... | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-... | <commit_before>import requests
import json
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
im... |
bf6f77d90c3749983eb0b5358fb2f9fedb7d53da | app/main.py | app/main.py | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | Use Python 3.6 compatible API for threading | Use Python 3.6 compatible API for threading
| Python | mit | alwye/spark-pi,alwye/spark-pi | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | <commit_before>import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_mo... | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_motion_detection(... | <commit_before>import spark
import motion
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detected():
print("motion detected!")
def run_mo... |
9eff339cba38a4a7f2a57a123cdc67f8cc23619f | in-class-code/2017-03-06-simulatingKinematics.py | in-class-code/2017-03-06-simulatingKinematics.py | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | Remove dataframe error we were testing | Remove dataframe error we were testing
| Python | agpl-3.0 | ComputationalModeling/spring-2017-danielak,ComputationalModeling/spring-2017-danielak,ComputationalModeling/spring-2017-danielak,ComputationalModeling/spring-2017-danielak | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | <commit_before>### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_step... | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | ### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_steps[1] - time_ste... | <commit_before>### Import our stuff
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
### Set up initial values
position = 555 # feet
velocity = 0 # feet/second
acceleration = -32.17 # feet / second^2
time_steps = np.linspace(0, 5, 501) # creates two entries at time zero
time_step_size = time_step... |
dc65920f52ca584608633cc511590b41b590f79e | billjobs/permissions.py | billjobs/permissions.py | from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define pe... | from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(... | Create permission for admin and user can access GET, PUT, DELETE method, user can access is instance only | Create permission for admin and user can access GET, PUT, DELETE method, user can access is instance only
| Python | mit | ioO/billjobs | from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define pe... | from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(... | <commit_before>from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
... | from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(... | from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define pe... | <commit_before>from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
... |
96ddbd97d1aaf7a373adb04942e2d3d17931a285 | pytips/app.py | pytips/app.py | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/')
def index():
my_param... | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
QUERY = "#python+tip"
PER_PAGE = 100
SEARCH... | Choose tip from *all* results. | Choose tip from *all* results.
Before, we were just choosing from the first page of results. Now, we perform
a query to get the full number of results, calculate the page number and
position on the page of a random result, and then pull that result for the
tip.
| Python | isc | gthank/pytips,gthank/pytips,gthank/pytips,gthank/pytips | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/')
def index():
my_param... | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
QUERY = "#python+tip"
PER_PAGE = 100
SEARCH... | <commit_before>#! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/')
def index(... | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
QUERY = "#python+tip"
PER_PAGE = 100
SEARCH... | #! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/')
def index():
my_param... | <commit_before>#! /usr/bin/env python
"""The main application logic for PyTips."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import random
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/')
def index(... |
96e60f1b56f37d1b953d63bf948cde33d1e04e65 | halaqat/settings/shaha.py | halaqat/settings/shaha.py | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
PROJECT_ROOT = os.path.dirnam... | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['shaha-halaqat.herokuapp.com', '0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/... | Add heroku app url to ALLOWED_HOSTS | Add heroku app url to ALLOWED_HOSTS
| Python | mit | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
PROJECT_ROOT = os.path.dirnam... | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['shaha-halaqat.herokuapp.com', '0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/... | <commit_before>from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
PROJECT_ROOT =... | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['shaha-halaqat.herokuapp.com', '0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/... | from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
PROJECT_ROOT = os.path.dirnam... | <commit_before>from .base_settings import *
import dj_database_url
import os
ALLOWED_HOSTS = ['0.0.0.0']
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
PROJECT_ROOT =... |
054503e406146eeff5f8d5437eb7db581eaeb0f2 | oscar_adyen/__init__.py | oscar_adyen/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
from . import views
urlpatterns = [
url(r'^payment-done/$', views.PaymentResultView.as_view(),
name='payment-result'),
url(r'^notify/$', views.NotificationView.as_vi... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
urlpatterns = [
url(r'^payment-done/$', 'oscar_adyen.views.payment_result',
name='payment-result'),
url(r'^notify/$', 'oscar_adyen.views.notification',
name='... | Allow importing oscar_adyen.mixins without importing oscar_adyen.views | Allow importing oscar_adyen.mixins without importing oscar_adyen.views
| Python | mit | machtfit/adyen | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
from . import views
urlpatterns = [
url(r'^payment-done/$', views.PaymentResultView.as_view(),
name='payment-result'),
url(r'^notify/$', views.NotificationView.as_vi... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
urlpatterns = [
url(r'^payment-done/$', 'oscar_adyen.views.payment_result',
name='payment-result'),
url(r'^notify/$', 'oscar_adyen.views.notification',
name='... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
from . import views
urlpatterns = [
url(r'^payment-done/$', views.PaymentResultView.as_view(),
name='payment-result'),
url(r'^notify/$', views.Notific... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
urlpatterns = [
url(r'^payment-done/$', 'oscar_adyen.views.payment_result',
name='payment-result'),
url(r'^notify/$', 'oscar_adyen.views.notification',
name='... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
from . import views
urlpatterns = [
url(r'^payment-done/$', views.PaymentResultView.as_view(),
name='payment-result'),
url(r'^notify/$', views.NotificationView.as_vi... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django_adyen import urlpatterns
from . import views
urlpatterns = [
url(r'^payment-done/$', views.PaymentResultView.as_view(),
name='payment-result'),
url(r'^notify/$', views.Notific... |
3f92ca011d08d69c5443994c79958a5d1f3b7415 | werobot/session/saekvstorage.py | werobot/session/saekvstorage.py | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | Add param doc of SAEKVStorage | Add param doc of SAEKVStorage
| Python | mit | whtsky/WeRoBot,FlyRabbit/WeRoBot,whtsky/WeRoBot,adrianzhang/WeRoBot,notwin/WeRoBot,weberwang/WeRoBot,Infixz/WeRoBot,weberwang/WeRoBot,chenjiancan/WeRoBot,Zeacone/WeRoBot,tdautc19841202/WeRoBot,one-leaf/WeRoBot,Zhenghaotao/WeRoBot,kmalloc/WeRoBot,FlyRabbit/WeRoBot,whtsky/WeRoBot,adam139/WeRobot,adam139/WeRobot | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | <commit_before># -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot... | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | <commit_before># -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot... |
cee2f2132cb54d5089f44bb48c9a19bd538dc72a | src/commoner_i/urls.py | src/commoner_i/urls.py | from django.conf.urls.defaults import patterns, include, handler500, url
from django.conf import settings
from django.contrib import admin
handler500 # Pyflakes
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
| from django.conf.urls.defaults import patterns, include, handler500, handler404, url
from django.conf import settings
from django.contrib import admin
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
| Use the default 404/500 handlers for i.cc.net. | Use the default 404/500 handlers for i.cc.net.
| Python | agpl-3.0 | cc-archive/commoner,cc-archive/commoner | from django.conf.urls.defaults import patterns, include, handler500, url
from django.conf import settings
from django.contrib import admin
handler500 # Pyflakes
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
Use the d... | from django.conf.urls.defaults import patterns, include, handler500, handler404, url
from django.conf import settings
from django.contrib import admin
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
| <commit_before>from django.conf.urls.defaults import patterns, include, handler500, url
from django.conf import settings
from django.contrib import admin
handler500 # Pyflakes
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'... | from django.conf.urls.defaults import patterns, include, handler500, handler404, url
from django.conf import settings
from django.contrib import admin
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
| from django.conf.urls.defaults import patterns, include, handler500, url
from django.conf import settings
from django.contrib import admin
handler500 # Pyflakes
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'),
)
Use the d... | <commit_before>from django.conf.urls.defaults import patterns, include, handler500, url
from django.conf import settings
from django.contrib import admin
handler500 # Pyflakes
urlpatterns = patterns(
'',
# Profile view
url(r'^p/(?P<username>\w+)/$', 'commoner_i.views.badge',
name='profile_badge'... |
b5ea9f83fc9422c165663920af1317365a3e6c4d | mangopaysdk/types/payinexecutiondetailsdirect.py | mangopaysdk/types/payinexecutiondetailsdirect.py | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
# Mode3DSType { DEFAULT, FORCE }
self.SecureMode... | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
self.SecureModeRedirectURL = None
# Mode3DSType ... | Add SecureModeRedirectURL attribute to PayInExecutionDetailsDirect | Add SecureModeRedirectURL attribute to PayInExecutionDetailsDirect
| Python | mit | Mangopay/mangopay2-python-sdk,chocopoche/mangopay2-python-sdk | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
# Mode3DSType { DEFAULT, FORCE }
self.SecureMode... | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
self.SecureModeRedirectURL = None
# Mode3DSType ... | <commit_before>from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
# Mode3DSType { DEFAULT, FORCE }
... | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
self.SecureModeRedirectURL = None
# Mode3DSType ... | from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
# Mode3DSType { DEFAULT, FORCE }
self.SecureMode... | <commit_before>from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails
class PayInExecutionDetailsDirect(PayInExecutionDetails):
def __init__(self):
# direct card
self.CardId = None
self.SecureModeReturnURL = None
# Mode3DSType { DEFAULT, FORCE }
... |
c1fd0f12810be544d12d4bea8ccd0ce9f8a190cc | jupyterlab/labhubapp.py | jupyterlab/labhubapp.py | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | Add hub user info to page | Add hub user info to page
| Python | bsd-3-clause | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | <commit_before>from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_weba... | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_webapp(self, *args,... | <commit_before>from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):
def init_weba... |
ab79661216ff972bd696eb568c68ebd221c9a003 | seabird/modules/url.py | seabird/modules/url.py | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLPlugin(Plugin):
url_regex = re.compile(r'https?://[^ ]+')
def irc_privmsg(self, msg):
for match in URLPlugin.url_regex.finditer(msg.trailing):
url = match.group(0)
# As a fal... | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLMixin:
"""Simple marker class to mark a plugin as a url plugin
A URL plugin requires only one thing:
- A method named url_match which takes a msg and url as an argument and
returns True if the url ... | Add a method for plugins to add their own URL handlers | Add a method for plugins to add their own URL handlers
| Python | mit | belak/pyseabird,belak/python-seabird | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLPlugin(Plugin):
url_regex = re.compile(r'https?://[^ ]+')
def irc_privmsg(self, msg):
for match in URLPlugin.url_regex.finditer(msg.trailing):
url = match.group(0)
# As a fal... | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLMixin:
"""Simple marker class to mark a plugin as a url plugin
A URL plugin requires only one thing:
- A method named url_match which takes a msg and url as an argument and
returns True if the url ... | <commit_before>import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLPlugin(Plugin):
url_regex = re.compile(r'https?://[^ ]+')
def irc_privmsg(self, msg):
for match in URLPlugin.url_regex.finditer(msg.trailing):
url = match.group(0)
... | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLMixin:
"""Simple marker class to mark a plugin as a url plugin
A URL plugin requires only one thing:
- A method named url_match which takes a msg and url as an argument and
returns True if the url ... | import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLPlugin(Plugin):
url_regex = re.compile(r'https?://[^ ]+')
def irc_privmsg(self, msg):
for match in URLPlugin.url_regex.finditer(msg.trailing):
url = match.group(0)
# As a fal... | <commit_before>import asyncio
import re
import aiohttp
import lxml.html
from seabird.plugin import Plugin
class URLPlugin(Plugin):
url_regex = re.compile(r'https?://[^ ]+')
def irc_privmsg(self, msg):
for match in URLPlugin.url_regex.finditer(msg.trailing):
url = match.group(0)
... |
8e9dc62f01f4b6ccaab819d21d92f3d6c53e3e1c | src/common/constants.py | src/common/constants.py | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
"""
AUTHENTICATION_FAILURE = ValueConstant('AuthenticationFailure')
SUCCESS = ValueConstant('Success')
FAIL = ... | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
See
https://library.vuforia.com/articles/Solution/How-To-Interperete-VWS-API-Result-Codes
"""
SUCCESS = Value... | Add all documented result codes | Add all documented result codes
| Python | mit | adamtheturtle/vws-python,adamtheturtle/vws-python | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
"""
AUTHENTICATION_FAILURE = ValueConstant('AuthenticationFailure')
SUCCESS = ValueConstant('Success')
FAIL = ... | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
See
https://library.vuforia.com/articles/Solution/How-To-Interperete-VWS-API-Result-Codes
"""
SUCCESS = Value... | <commit_before>"""
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
"""
AUTHENTICATION_FAILURE = ValueConstant('AuthenticationFailure')
SUCCESS = ValueConstant('Succes... | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
See
https://library.vuforia.com/articles/Solution/How-To-Interperete-VWS-API-Result-Codes
"""
SUCCESS = Value... | """
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
"""
AUTHENTICATION_FAILURE = ValueConstant('AuthenticationFailure')
SUCCESS = ValueConstant('Success')
FAIL = ... | <commit_before>"""
Constants used to make the VWS mock and wrapper.
"""
from constantly import ValueConstant, Values
class ResultCodes(Values):
"""
Constants representing various VWS result codes.
"""
AUTHENTICATION_FAILURE = ValueConstant('AuthenticationFailure')
SUCCESS = ValueConstant('Succes... |
7ae4954a40b5b143cadff917456ba67c2653bdb8 | asyncmailer/tests/settings.py | asyncmailer/tests/settings.py | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | Add NOQA to make flake8 happy | Add NOQA to make flake8 happy
| Python | mit | andyfangdz/django-asyncmailer,andyfangdz/django-asyncmailer | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | <commit_before>"""
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so th... | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | """
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two... | <commit_before>"""
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so th... |
c1ac7c357d5a7ce3e96af9b4356fc2f0493e2b1d | apps/people/admin.py | apps/people/admin.py | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | Fix usage of `url_title` in TeamAdmin. | Fix usage of `url_title` in TeamAdmin.
| Python | mit | onespacemedia/cms-people,onespacemedia/cms-people | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | <commit_before>from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fiel... | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fieldsets = (
... | <commit_before>from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin
from django.contrib import admin
from .models import Person, Team
@admin.register(Person)
class PersonAdmin(SearchMetaBaseAdmin):
prepopulated_fields = {"url_title": ("first_name", "last_name",)}
filter_horizontal = ("teams",)
fiel... |
42a523393d6ec2d5dfc80d1b82e2c703e1afa29b | calc.py | calc.py | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | Update usage string for min | Update usage string for min
| Python | bsd-3-clause | mkuiper/calc-1 | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | <commit_before>"""calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
... | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | """calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command =... | <commit_before>"""calc.py: A simple calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
... |
1cd930883b4168f99da0a16d95f370b001126134 | src/reduce_framerate.py | src/reduce_framerate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | Reduce frequency to 10 Hz instead of 2. | Reduce frequency to 10 Hz instead of 2.
| Python | mit | masasin/spirit,masasin/spirit | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one fifteenth of t... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_color framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
Reduces the framerate of a video feed to one... |
28e95a2aad1efc3fa409b273b74e5173b5eba1ad | conjureup/ui/__init__.py | conjureup/ui/__init__.py | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
class ConjureUI(Frame):
def show_exception_message(self, ex):
errmsg = str(ex)... | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
from pathlib import Path
class ConjureUI(Frame):
def show_exception_message(self, ex):... | Use proper cache directory in error view | Use proper cache directory in error view
Fixes #1254
Signed-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>
| Python | mit | conjure-up/conjure-up,ubuntu/conjure-up,ubuntu/conjure-up,Ubuntu-Solutions-Engineering/conjure,Ubuntu-Solutions-Engineering/conjure,conjure-up/conjure-up | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
class ConjureUI(Frame):
def show_exception_message(self, ex):
errmsg = str(ex)... | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
from pathlib import Path
class ConjureUI(Frame):
def show_exception_message(self, ex):... | <commit_before>from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
class ConjureUI(Frame):
def show_exception_message(self, ex):
e... | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
from pathlib import Path
class ConjureUI(Frame):
def show_exception_message(self, ex):... | from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
class ConjureUI(Frame):
def show_exception_message(self, ex):
errmsg = str(ex)... | <commit_before>from ubuntui.frame import Frame # noqa
from ubuntui.views import ErrorView
from conjureup import async
from conjureup.app_config import app
from conjureup.ui.views.shutdown import ShutdownView
from ubuntui.ev import EventLoop
class ConjureUI(Frame):
def show_exception_message(self, ex):
e... |
ff4e92fc75392a5c3ed2a91591369046ba59f2a3 | ambassador/tests/test_ambassador.py | ambassador/tests/test_ambassador.py | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | Drop the TLS tests for a moment to see if we can get a success for timing. | Drop the TLS tests for a moment to see if we can get a success for timing.
| Python | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | <commit_before>from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
imp... | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
import t_loadbalan... | <commit_before>from kat.harness import Runner
from abstract_tests import AmbassadorTest
# Import all the real tests from other files, to make it easier to pick and choose during development.
import t_basics
import t_extauth
import t_grpc
import t_grpc_bridge
import t_grpc_web
import t_gzip
import t_headerrouting
imp... |
990158b8fd0407129f776b6d28989b7717c331f5 | compose_mode/__init__.py | compose_mode/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
| Bump minor version to 0.5.0 | Bump minor version to 0.5.0
| Python | mit | KitB/compose-mode | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
Bump minor version to 0.5.0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
<commit_msg>Bump minor version to 0.5.0<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
Bump minor version to 0.5.0#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
<commit_msg>Bump minor version to 0.5.0<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
|
d8913869c466bea4e301e8502decdc01f6d9987e | cowserver.py | cowserver.py | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | Disable SQLALCHEMY_TRACK_MODIFICATIONS to fix deprecation warning and meet recommendation | Disable SQLALCHEMY_TRACK_MODIFICATIONS to fix deprecation warning and meet recommendation
| Python | mit | competitiveoverwatch/RankVerification,competitiveoverwatch/RankVerification | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | <commit_before>from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsaf... | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsafe-inline\'',
'... | <commit_before>from flask import Flask
from flask_talisman import Talisman
from flask_seasurf import SeaSurf
from redditflair.redditflair import redditflair, limiter
from redissession import RedisSessionInterface
from database import db, User, Specials
import os.path
content_security_policy = {
'script-src': '\'unsaf... |
d9ef4c798e50de12cc4ab41fa470cd0e04d77322 | opendebates/tests/test_context_processors.py | opendebates/tests/test_context_processors.py | import urlparse
from django.test import TestCase, override_settings
from django.conf import settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
... | import urlparse
from django.test import TestCase, override_settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
mock_request = Mock()
... | Remove unused import in test | Remove unused import in test
| Python | apache-2.0 | ejucovy/django-opendebates,ejucovy/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,ejucovy/django-opendebates,ejucovy/django-opendebates | import urlparse
from django.test import TestCase, override_settings
from django.conf import settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
... | import urlparse
from django.test import TestCase, override_settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
mock_request = Mock()
... | <commit_before>import urlparse
from django.test import TestCase, override_settings
from django.conf import settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_... | import urlparse
from django.test import TestCase, override_settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
mock_request = Mock()
... | import urlparse
from django.test import TestCase, override_settings
from django.conf import settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_votes(self):
... | <commit_before>import urlparse
from django.test import TestCase, override_settings
from django.conf import settings
from mock import patch, Mock
from opendebates.context_processors import global_vars
from opendebates.tests.factories import SubmissionFactory
class NumberOfVotesTest(TestCase):
def test_number_of_... |
f50b4bb49345db05d3601fc1d828d2491f902c31 | Lib/sandbox/pyem/misc.py | Lib/sandbox/pyem/misc.py | # Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1]
DEF_ELL_NP = ... | # Last Change: Sat Jun 09 08:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = (0, 1)
DEF_ELL_NP = ... | Set def arguments to immutable to avoid nasty side effect. | Set def arguments to immutable to avoid nasty side effect.
| Python | bsd-3-clause | hainm/scipy,rgommers/scipy,efiring/scipy,surhudm/scipy,rmcgibbo/scipy,dch312/scipy,Stefan-Endres/scipy,jakevdp/scipy,andyfaff/scipy,mikebenfield/scipy,anntzer/scipy,giorgiop/scipy,sargas/scipy,e-q/scipy,dominicelse/scipy,bkendzior/scipy,Shaswat27/scipy,ndchorley/scipy,haudren/scipy,aarchiba/scipy,grlee77/scipy,person14... | # Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1]
DEF_ELL_NP = ... | # Last Change: Sat Jun 09 08:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = (0, 1)
DEF_ELL_NP = ... | <commit_before># Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1... | # Last Change: Sat Jun 09 08:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = (0, 1)
DEF_ELL_NP = ... | # Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1]
DEF_ELL_NP = ... | <commit_before># Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1... |
9948b5a2930cd2e6f13383bd969a33f6fc655936 | example/dlf_app/models.py | example/dlf_app/models.py | from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=[city], zoom=7)
| from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=['city'], zoom=7)
| Use field name instead of field instance | Use field name instead of field instance
| Python | mit | caioariede/django-location-field,voodmania/django-location-field,voodmania/django-location-field,caioariede/django-location-field,voodmania/django-location-field,caioariede/django-location-field | from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=[city], zoom=7)
Use field name instead of fi... | from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=['city'], zoom=7)
| <commit_before>from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=[city], zoom=7)
<commit_msg>U... | from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=['city'], zoom=7)
| from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=[city], zoom=7)
Use field name instead of fi... | <commit_before>from django.db import models
from location_field.models.plain import PlainLocationField
class Place(models.Model):
parent_place = models.ForeignKey('self', null=True, blank=True)
city = models.CharField(max_length=255)
location = PlainLocationField(based_fields=[city], zoom=7)
<commit_msg>U... |
c4eef5919fa60c87b59d60c1bd005f97183ce057 | aiozk/test/test_connection.py | aiozk/test/test_connection.py | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=mock.MagicMock(wraps=event_loop))
... | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=event_loop)
connection.writer... | Modify and add tests for the revised connection.close | Modify and add tests for the revised connection.close
| Python | mit | tipsi/aiozk,tipsi/aiozk | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=mock.MagicMock(wraps=event_loop))
... | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=event_loop)
connection.writer... | <commit_before>from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=mock.MagicMock(wrap... | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=event_loop)
connection.writer... | from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=mock.MagicMock(wraps=event_loop))
... | <commit_before>from unittest import mock
import pytest
import aiozk.connection
@pytest.fixture
def connection(event_loop):
connection = aiozk.connection.Connection(
host='zookeeper.test',
port=2181,
watch_handler=mock.MagicMock(),
read_timeout=30,
loop=mock.MagicMock(wrap... |
23837afe465eb88ec4cb7d5bfcbc99970c417aa7 | cmsocial/db/__init__.py | cmsocial/db/__init__.py | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
from cmsocial.db.socialtask i... | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
from .test import Test
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
fr... | Create table "tests" as well | Create table "tests" as well
| Python | agpl-3.0 | elsantodel90/oia-juez,algorithm-ninja/cmsocial,elsantodel90/oia-juez,algorithm-ninja/cmsocial,elsantodel90/oia-juez,algorithm-ninja/cmsocial,algorithm-ninja/cmsocial,algorithm-ninja/cmsocial,elsantodel90/oia-juez | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
from cmsocial.db.socialtask i... | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
from .test import Test
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
fr... | <commit_before># -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
from cmsocial.... | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
from .test import Test
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
fr... | # -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
from cmsocial.db.socialtask i... | <commit_before># -*- coding: utf-8 -*-
def init_db():
from cms.db import Base
from .socialtask import SocialTask
from .socialuser import SocialUser
# Issue CREATE queries
Base.metadata.create_all()
# FIXME: The following is here just to avoid a circular dependency in socialuser.py
from cmsocial.... |
72ed64fad2d03ba97f12d5ad4802bcb956a1f29b | temba/chatbase/tasks.py | temba/chatbase/tasks.py | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | Change dict declaration to inline | Change dict declaration to inline
| Python | agpl-3.0 | pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | <commit_before>from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, co... | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, contact):
try... | <commit_before>from __future__ import print_function, unicode_literals
import logging
from celery.task import task
from temba.orgs.models import Org
from .models import Chatbase
logger = logging.getLogger(__name__)
@task(track_started=True, name='send_chatbase_event')
def send_chatbase_event(org, channel, msg, co... |
6a58c7f0eb1b92ec12d0e48d7fd3f2586de20755 | sal/management/commands/update_admin_user.py | sal/management/commands/update_admin_user.py | '''
Creates an admin user if there aren't any existing superusers
'''
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from optparse import make_option
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, pars... | """Creates an admin user if there aren't any existing superusers."""
from optparse import make_option
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, par... | Fix exception handling in management command. Clean up. | Fix exception handling in management command. Clean up.
| Python | apache-2.0 | salopensource/sal,sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,salopensource/sal | '''
Creates an admin user if there aren't any existing superusers
'''
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from optparse import make_option
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, pars... | """Creates an admin user if there aren't any existing superusers."""
from optparse import make_option
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, par... | <commit_before>'''
Creates an admin user if there aren't any existing superusers
'''
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from optparse import make_option
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_argum... | """Creates an admin user if there aren't any existing superusers."""
from optparse import make_option
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, par... | '''
Creates an admin user if there aren't any existing superusers
'''
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from optparse import make_option
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_arguments(self, pars... | <commit_before>'''
Creates an admin user if there aren't any existing superusers
'''
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from optparse import make_option
class Command(BaseCommand):
help = 'Creates/Updates an Admin user'
def add_argum... |
0fc6394e156246367bdee26b03ca94bfebb21545 | examples/django_demo/generic_foreignkey/models.py | examples/django_demo/generic_foreignkey/models.py | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeinKey model from django docs"""
tag = models.SlugField()
c... | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeignKey model from django docs"""
tag = models.SlugField()
... | Fix GenericForeignKey typo in examples | Fix GenericForeignKey typo in examples | Python | mit | FactoryBoy/factory_boy | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeinKey model from django docs"""
tag = models.SlugField()
c... | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeignKey model from django docs"""
tag = models.SlugField()
... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeinKey model from django docs"""
tag = models.Sl... | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeignKey model from django docs"""
tag = models.SlugField()
... | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeinKey model from django docs"""
tag = models.SlugField()
c... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class TaggedItem(models.Model):
"""Example GenericForeinKey model from django docs"""
tag = models.Sl... |
8a51446ee8833c3472d9f97cc29a58dd42d872b8 | core/tests/test_utils.py | core/tests/test_utils.py | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | Fix to account for casing diffs between Mac OS X and Linux | Fix to account for casing diffs between Mac OS X and Linux
| Python | mit | QLGu/djangopackages,nanuxbe/djangopackages,nanuxbe/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,pydanny/djangopackages,pydanny/djangopackages,QLGu/djangopackages,pydanny/djangopackages | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | <commit_before>from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
... | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
('Jump_the ... | <commit_before>from django.test import TestCase
from core import utils
class SlugifyOC(TestCase):
def test_oc_slugify(self):
lst = (
('test.this.value', 'test-this-value'),
('Plone.OpenComparison', 'plone-opencomparison'),
('Run from here', 'run-from-here'),
... |
c35957b7219f572e80a550893150e8041c5f14b2 | create_ands_rif_cs_xml.py | create_ands_rif_cs_xml.py | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
- http://www.ands.org.au/resource/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, AN... | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://ands.org.au/resource/rif-cs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, ANDS_... | Fix links in ANDS RIF-CS script | Fix links in ANDS RIF-CS script
| Python | mit | AustralianAntarcticDataCentre/metadata_xml_convert,AustralianAntarcticDataCentre/metadata_xml_convert | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
- http://www.ands.org.au/resource/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, AN... | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://ands.org.au/resource/rif-cs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, ANDS_... | <commit_before>"""
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
- http://www.ands.org.au/resource/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_... | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://ands.org.au/resource/rif-cs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, ANDS_... | """
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
- http://www.ands.org.au/resource/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_FOLDER_PATH, AN... | <commit_before>"""
Create an ANDS RIF-CS XML file.
Links
-----
- http://ands.org.au/guides/cpguide/cpgrifcs.html
- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html
- http://www.ands.org.au/resource/rif-cs.html
"""
import logging
import os
from settings import (
ANDS_XML_FILE_NAME, ANDS_XML_... |
4184b9b87a5b2684df47bcf6bb19703ae381ec55 | modules/module_urlsize.py | modules/module_urlsize.py | """Warns about large files"""
def handle_url(bot, user, channel, url):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
| """Warns about large files"""
def handle_url(bot, user, channel, url, msg):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
| Update to the latest method signature | Update to the latest method signature
git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@65 dda364a1-ef19-0410-af65-756c83048fb2
| Python | bsd-3-clause | aapa/pyfibot,huqa/pyfibot,rnyberg/pyfibot,EArmour/pyfibot,nigeljonez/newpyfibot,rnyberg/pyfibot,aapa/pyfibot,lepinkainen/pyfibot,EArmour/pyfibot,huqa/pyfibot,lepinkainen/pyfibot | """Warns about large files"""
def handle_url(bot, user, channel, url):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
Update to t... | """Warns about large files"""
def handle_url(bot, user, channel, url, msg):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
| <commit_before>"""Warns about large files"""
def handle_url(bot, user, channel, url):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % si... | """Warns about large files"""
def handle_url(bot, user, channel, url, msg):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
| """Warns about large files"""
def handle_url(bot, user, channel, url):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % size)
Update to t... | <commit_before>"""Warns about large files"""
def handle_url(bot, user, channel, url):
if channel == "#wow": return
# inform about large files (over 5MB)
size = getUrl(url).getSize()
if not size: return
size = size / 1024
if size > 5:
bot.say(channel, "File size: %s MB" % si... |
d1e9586fbbadd8278d1d4023490df3348915b217 | migrations/versions/0082_set_international.py | migrations/versions/0082_set_international.py | """empty message
Revision ID: 0082_set_international
Revises: 0080_fix_rate_start_date
Create Date: 2017-05-05 15:26:34.621670
"""
# revision identifiers, used by Alembic.
from datetime import datetime
revision = '0082_set_international'
down_revision = '0080_fix_rate_start_date'
from alembic import op
import sqla... | """empty message
Revision ID: 0082_set_international
Revises: 0081_noti_status_as_enum
Create Date: 2017-05-05 15:26:34.621670
"""
from datetime import datetime
from alembic import op
# revision identifiers, used by Alembic.
revision = '0082_set_international'
down_revision = '0081_noti_status_as_enum'
def upgrade... | Update the script to set the international flag to do the notifications and notification_history in separate loops. It takes about 1.5 minutes to update 27,000 notifications and 27,000 notification_history. The update is a row level lock so will only affect updates to the same row. This is unlikely as the data being up... | Update the script to set the international flag to do the notifications and notification_history in separate loops.
It takes about 1.5 minutes to update 27,000 notifications and 27,000 notification_history. The update is a row level lock so will only affect updates to the same row.
This is unlikely as the data being up... | Python | mit | alphagov/notifications-api,alphagov/notifications-api | """empty message
Revision ID: 0082_set_international
Revises: 0080_fix_rate_start_date
Create Date: 2017-05-05 15:26:34.621670
"""
# revision identifiers, used by Alembic.
from datetime import datetime
revision = '0082_set_international'
down_revision = '0080_fix_rate_start_date'
from alembic import op
import sqla... | """empty message
Revision ID: 0082_set_international
Revises: 0081_noti_status_as_enum
Create Date: 2017-05-05 15:26:34.621670
"""
from datetime import datetime
from alembic import op
# revision identifiers, used by Alembic.
revision = '0082_set_international'
down_revision = '0081_noti_status_as_enum'
def upgrade... | <commit_before>"""empty message
Revision ID: 0082_set_international
Revises: 0080_fix_rate_start_date
Create Date: 2017-05-05 15:26:34.621670
"""
# revision identifiers, used by Alembic.
from datetime import datetime
revision = '0082_set_international'
down_revision = '0080_fix_rate_start_date'
from alembic import... | """empty message
Revision ID: 0082_set_international
Revises: 0081_noti_status_as_enum
Create Date: 2017-05-05 15:26:34.621670
"""
from datetime import datetime
from alembic import op
# revision identifiers, used by Alembic.
revision = '0082_set_international'
down_revision = '0081_noti_status_as_enum'
def upgrade... | """empty message
Revision ID: 0082_set_international
Revises: 0080_fix_rate_start_date
Create Date: 2017-05-05 15:26:34.621670
"""
# revision identifiers, used by Alembic.
from datetime import datetime
revision = '0082_set_international'
down_revision = '0080_fix_rate_start_date'
from alembic import op
import sqla... | <commit_before>"""empty message
Revision ID: 0082_set_international
Revises: 0080_fix_rate_start_date
Create Date: 2017-05-05 15:26:34.621670
"""
# revision identifiers, used by Alembic.
from datetime import datetime
revision = '0082_set_international'
down_revision = '0080_fix_rate_start_date'
from alembic import... |
b6eb5e5ed4c12bea6239a58f76b7c944258c32b5 | paypal/payflow/codes.py | paypal/payflow/codes.py | # Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Autho... | # Make strings collectable with gettext tools, but don't translate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Auth... | Fix simple typo, trnslate -> translate | docs: Fix simple typo, trnslate -> translate
There is a small typo in paypal/payflow/codes.py.
Should read `translate` rather than `trnslate`.
| Python | bsd-3-clause | django-oscar/django-oscar-paypal,evonove/django-oscar-paypal,lpakula/django-oscar-paypal,lpakula/django-oscar-paypal,st8st8/django-oscar-paypal,evonove/django-oscar-paypal,lpakula/django-oscar-paypal,django-oscar/django-oscar-paypal,evonove/django-oscar-paypal,django-oscar/django-oscar-paypal,st8st8/django-oscar-paypal... | # Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Autho... | # Make strings collectable with gettext tools, but don't translate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Auth... | <commit_before># Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZ... | # Make strings collectable with gettext tools, but don't translate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Auth... | # Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Autho... | <commit_before># Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZ... |
a121b79cd9260f17e85f3a611a47bb913170b353 | scripts/poweron/DRAC.py | scripts/poweron/DRAC.py | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | Change path to the supplemental pack | CA-40618: Change path to the supplemental pack
Signed-off-by: Javier Alvarez-Valle <cf4c8668a0b4c5e013f594a6940d05b3d4d9ddcf@citrix.com>
| Python | lgpl-2.1 | djs55/xcp-networkd,sharady/xcp-networkd,johnelse/xcp-rrdd,sharady/xcp-networkd,robhoes/squeezed,djs55/xcp-rrdd,simonjbeaumont/xcp-rrdd,koushikcgit/xcp-networkd,koushikcgit/xcp-networkd,koushikcgit/xcp-rrdd,djs55/xcp-networkd,simonjbeaumont/xcp-rrdd,johnelse/xcp-rrdd,koushikcgit/xcp-rrdd,djs55/xcp-rrdd,djs55/squeezed,ko... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | <commit_before>import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin err... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | <commit_before>import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin err... |
8e51085d9843b6b78f601ac28a2d01d2fc20cb09 | tests/test_settings.py | tests/test_settings.py | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | Fix tests for django 2.2 | Fix tests for django 2.2
| Python | mit | nshafer/django-hashid-field,nshafer/django-hashid-field | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | <commit_before>import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
D... | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
DATABASES = {
... | <commit_before>import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'fake-key'
HASHID_FIELD_SALT = 'gg ez'
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.sessions",
"django.contrib.admin",
"tests",
]
D... |
b414d74a639151785ef02a9d390e1398b7167886 | app/forms/simple_form.py | app/forms/simple_form.py | from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(Form):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
| from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(FlaskForm):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
| Change Form to FlaskForm (prevent deprecated) | Change Form to FlaskForm (prevent deprecated)
| Python | mit | rustyworks/flask-structure,rustyworks/flask-structure | from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(Form):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
Change Form to FlaskForm (prevent deprecated) | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(FlaskForm):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
| <commit_before>from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(Form):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
<commit_msg>Change Form to FlaskForm (prevent deprecated)<commit_after> | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(FlaskForm):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
| from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(Form):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
Change Form to FlaskForm (prevent deprecated)from flask_wtf import FlaskForm
from wtfo... | <commit_before>from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SimpleForm(Form):
name = StringField('Your name', validators=[Required()])
submit = SubmitField('Submit')
<commit_msg>Change Form to FlaskForm (prevent deprecated)<commit_after>... |
4e8a9b2520642e3f2204ee3da59a153b61a95160 | polyaxon_client/transport/socket_transport.py | polyaxon_client/transport/socket_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocke... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import threading
import websocket
from polyaxon_client.logger import logger
from polyaxon_client.workers.socket_worker import SocketWorker
class SocketTransportMixin(object):
"""Socket operations transport."""
... | Add utf decode for reading data | Add utf decode for reading data
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocke... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import threading
import websocket
from polyaxon_client.logger import logger
from polyaxon_client.workers.socket_worker import SocketWorker
class SocketTransportMixin(object):
"""Socket operations transport."""
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import threading
import websocket
from polyaxon_client.logger import logger
from polyaxon_client.workers.socket_worker import SocketWorker
class SocketTransportMixin(object):
"""Socket operations transport."""
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocke... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
... |
029edcfe1769dd65fa2fac566abb5686c5986890 | backdrop/core/records.py | backdrop/core/records.py | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
days_since_week_start = datetime.timedelta(
days=self.data['_timestamp'].weekday())
week_start = self.data['_timestamp'] - ... | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
day_of_week = self.data['_timestamp'].weekday()
delta_from_week_start = datetime.timedelta(days=day_of_week)
week_start = self... | Refactor for clarity around _week_start_at | Refactor for clarity around _week_start_at
| Python | mit | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
days_since_week_start = datetime.timedelta(
days=self.data['_timestamp'].weekday())
week_start = self.data['_timestamp'] - ... | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
day_of_week = self.data['_timestamp'].weekday()
delta_from_week_start = datetime.timedelta(days=day_of_week)
week_start = self... | <commit_before>import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
days_since_week_start = datetime.timedelta(
days=self.data['_timestamp'].weekday())
week_start = self.data['... | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
day_of_week = self.data['_timestamp'].weekday()
delta_from_week_start = datetime.timedelta(days=day_of_week)
week_start = self... | import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
days_since_week_start = datetime.timedelta(
days=self.data['_timestamp'].weekday())
week_start = self.data['_timestamp'] - ... | <commit_before>import datetime
class Record(object):
def __init__(self, data):
self.data = data
self.meta = {}
if "_timestamp" in self.data:
days_since_week_start = datetime.timedelta(
days=self.data['_timestamp'].weekday())
week_start = self.data['... |
e4841c674545892dfc6a8390574cec7c2836e004 | main.py | main.py | from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
a = video.getImage()
a.rotate(90).invert().toGray().binarize().save(display)
| from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
image = video.getImage().rotate(90).crop(850,50,400,400)
image2 = image.colorDistance(Color.RED)
blobs = image2.findBlobs()
image3 = image2.grayscale()
if... | Add code to accomodate a new '3 circles' approach | Add code to accomodate a new '3 circles' approach
| Python | mit | ColdSauce/Iris | from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
a = video.getImage()
a.rotate(90).invert().toGray().binarize().save(display)
Add code to accomodate a new '3 circles' approach | from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
image = video.getImage().rotate(90).crop(850,50,400,400)
image2 = image.colorDistance(Color.RED)
blobs = image2.findBlobs()
image3 = image2.grayscale()
if... | <commit_before>from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
a = video.getImage()
a.rotate(90).invert().toGray().binarize().save(display)
<commit_msg>Add code to accomodate a new '3 circles' approach<commit_aft... | from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
image = video.getImage().rotate(90).crop(850,50,400,400)
image2 = image.colorDistance(Color.RED)
blobs = image2.findBlobs()
image3 = image2.grayscale()
if... | from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
a = video.getImage()
a.rotate(90).invert().toGray().binarize().save(display)
Add code to accomodate a new '3 circles' approachfrom SimpleCV import *
winsize = (640,... | <commit_before>from SimpleCV import *
winsize = (640,480)
display = Display(winsize)
video = VirtualCamera('stefan_eye.mp4', 'video')
while display.isNotDone():
a = video.getImage()
a.rotate(90).invert().toGray().binarize().save(display)
<commit_msg>Add code to accomodate a new '3 circles' approach<commit_aft... |
e120c264f16f89b197ff3416deaefb7f553611db | pages/urlconf_registry.py | pages/urlconf_registry.py | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a widget for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested widget was not found
... | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a urlconf for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested urlconf was not found... | Fix typos in urlconf registry | Fix typos in urlconf registry
| Python | bsd-3-clause | batiste/django-page-cms,remik/django-page-cms,oliciv/django-page-cms,oliciv/django-page-cms,remik/django-page-cms,pombredanne/django-page-cms-1,oliciv/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms,akaihola/django-page-cms,batiste/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,rem... | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a widget for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested widget was not found
... | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a urlconf for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested urlconf was not found... | <commit_before>"""Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a widget for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested widget ... | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a urlconf for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested urlconf was not found... | """Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a widget for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested widget was not found
... | <commit_before>"""Django page CMS urlconf registry."""
from django.utils.translation import ugettext as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a widget for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested widget ... |
ed6a69dc2efefdb8cf5e32c9c71b122b6357b1fa | parks/test/test_finder.py | parks/test/test_finder.py | #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
| #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
def test_tbd():
"""Placeholder for the first test."""
assert True
| Add a placeholder test so pytest will not report an error | Add a placeholder test so pytest will not report an error
| Python | mit | friendlycode/gr-parks,friendlycode/gr-parks,friendlycode/gr-parks,friendlycode/gr-parks | #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
Add a placeholder test so pytest will not report an error | #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
def test_tbd():
"""Placeholder for the first test."""
assert True
| <commit_before>#!/usr/bin/env python
"""Unit tests for the 'finder' module."""
<commit_msg>Add a placeholder test so pytest will not report an error<commit_after> | #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
def test_tbd():
"""Placeholder for the first test."""
assert True
| #!/usr/bin/env python
"""Unit tests for the 'finder' module."""
Add a placeholder test so pytest will not report an error#!/usr/bin/env python
"""Unit tests for the 'finder' module."""
def test_tbd():
"""Placeholder for the first test."""
assert True
| <commit_before>#!/usr/bin/env python
"""Unit tests for the 'finder' module."""
<commit_msg>Add a placeholder test so pytest will not report an error<commit_after>#!/usr/bin/env python
"""Unit tests for the 'finder' module."""
def test_tbd():
"""Placeholder for the first test."""
assert True
|
d7c6a7f78c8620e0e01e57eb082860e90f782a30 | parsl/tests/test_swift.py | parsl/tests/test_swift.py | #!/usr/bin/env python3.5
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x * y
def test_simple():
print("... | #!/usr/bin/env python3.5
from nose.tools import assert_raises
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x ... | Make `test_except` swift test pass | Make `test_except` swift test pass
Currently it is expected to fail. This asserts that the correct
exception is raised. Fixes #155.
| Python | apache-2.0 | Parsl/parsl,swift-lang/swift-e-lab,Parsl/parsl,Parsl/parsl,swift-lang/swift-e-lab,Parsl/parsl | #!/usr/bin/env python3.5
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x * y
def test_simple():
print("... | #!/usr/bin/env python3.5
from nose.tools import assert_raises
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x ... | <commit_before>#!/usr/bin/env python3.5
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x * y
def test_simple... | #!/usr/bin/env python3.5
from nose.tools import assert_raises
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x ... | #!/usr/bin/env python3.5
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x * y
def test_simple():
print("... | <commit_before>#!/usr/bin/env python3.5
import parsl
from parsl import *
parsl.set_stream_logger()
from parsl.executors.swift_t import *
def foo(x, y):
return x * y
def slow_foo(x, y):
import time
time.sleep(x)
return x * y
def bad_foo(x, y):
time.sleep(x)
return x * y
def test_simple... |
9d1a5932ad25b075b095f170c1b374e46b6f740b | setup/create_players.py | setup/create_players.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.path.dirname(__file__), 'nhl_players.json')
migration_data = json.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
from db.team import Team
from utils.player_finder import PlayerFinder
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.p... | Add stub to search for players remotely | Add stub to search for players remotely
| Python | mit | leaffan/pynhldb | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.path.dirname(__file__), 'nhl_players.json')
migration_data = json.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
from db.team import Team
from utils.player_finder import PlayerFinder
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.p... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.path.dirname(__file__), 'nhl_players.json')
migrati... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
from db.team import Team
from utils.player_finder import PlayerFinder
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.path.dirname(__file__), 'nhl_players.json')
migration_data = json.... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from db import commit_db_item
from db.player import Player
def migrate_players(plr_src_file=None):
if not plr_src_file:
plr_src_file = os.path.join(
os.path.dirname(__file__), 'nhl_players.json')
migrati... |
c1f221b638405af81c637ddd79bd8c9eef24b488 | main.py | main.py | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | Apply modification from Feb 5 | Apply modification from Feb 5
| Python | mit | rschiang/pineapple.py | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | <commit_before>import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file... | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file.read(8192)
... | <commit_before>import hashlib
import models
import os
import os.path
def init():
models.db.connect()
models.db.create_tables([models.Entry])
def digest(file_path):
h = hashlib.sha1()
file = open(file_path, 'rb')
buf = file.read(8192)
while len(buf) > 0:
h.update(buf)
buf = file... |
fc263902e845c21aa3379bf985cef693d30bc56b | senlin/tests/functional/test_policy_type.py | senlin/tests/functional/test_policy_type.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Fix functional test for policy type listing | Fix functional test for policy type listing
This patch fixes the funtional test for policy type listing. We have
changed the names of builtin policy types.
Change-Id: I9f04ab2a4245e8946db3a0255658676cc5f600ab
| Python | apache-2.0 | stackforge/senlin,openstack/senlin,stackforge/senlin,Alzon/senlin,tengqm/senlin-container,tengqm/senlin-container,openstack/senlin,Alzon/senlin,openstack/senlin | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... |
2faf0facda08df07fbe9ed5363a3546d726326f6 | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | Use the release version rather than public version for GitHub links | Use the release version rather than public version for GitHub links
| Python | apache-2.0 | asphalt-framework/asphalt-web | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | <commit_before>#!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["... | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | #!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["_templates"]
so... | <commit_before>#!/usr/bin/env python3
from importlib.metadata import version
from packaging.version import parse
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxcontrib.asyncio",
"sphinx_tabs.tabs",
]
templates_path = ["... |
ae0e2a481f91e94cf05ac2df63f1d66f76a5e442 | indra/preassembler/grounding_mapper/gilda.py | indra/preassembler/grounding_mapper/gilda.py | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio/ground'
def ground_statements(stmts):
"""Set grounding fo... | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio'
def get_gilda_models():
"""Return a list of strings for ... | Refactor Gilda module and add function to get models | Refactor Gilda module and add function to get models
| Python | bsd-2-clause | bgyori/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio/ground'
def ground_statements(stmts):
"""Set grounding fo... | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio'
def get_gilda_models():
"""Return a list of strings for ... | <commit_before>"""This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio/ground'
def ground_statements(stmts):
"""S... | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio'
def get_gilda_models():
"""Return a list of strings for ... | """This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio/ground'
def ground_statements(stmts):
"""Set grounding fo... | <commit_before>"""This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import requests
from .mapper import GroundingMapper
grounding_service_url = 'http://grounding.indra.bio/ground'
def ground_statements(stmts):
"""S... |
c7cc0e24ea5d4cbb44665c1267a771f08f1bda4f | cityhallmonitor/signals/handlers.py | cityhallmonitor/signals/handlers.py | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *args, **kwargs):
... | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment, MatterSponsor
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *ar... | Add post_save handler for MatterSponsor | Add post_save handler for MatterSponsor
| Python | mit | NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *args, **kwargs):
... | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment, MatterSponsor
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *ar... | <commit_before>from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *ar... | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment, MatterSponsor
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *ar... | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *args, **kwargs):
... | <commit_before>from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
from cityhallmonitor.models import DirtyFieldsModel, \
Matter, MatterAttachment
@receiver(pre_save, sender=DirtyFieldsModel)
def handle_pre_save(sender, instance, *ar... |
6420eca5e458f981aa9f506bfa6354eba50e1e49 | processing/face_detect.py | processing/face_detect.py | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
# detect faces in the image
rectangles = self.faceCascade.detectMultiScale(i... | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
rectangles = self.faceCascade.detectMultiScale(image, scaleFactor=scale_factor,
... | Align Face and Feature Mapping | Align Face and Feature Mapping
| Python | bsd-3-clause | javaTheHutts/Java-the-Hutts | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
# detect faces in the image
rectangles = self.faceCascade.detectMultiScale(i... | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
rectangles = self.faceCascade.detectMultiScale(image, scaleFactor=scale_factor,
... | <commit_before>import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
# detect faces in the image
rectangles = self.faceCascade.det... | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
rectangles = self.faceCascade.detectMultiScale(image, scaleFactor=scale_factor,
... | import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
# detect faces in the image
rectangles = self.faceCascade.detectMultiScale(i... | <commit_before>import cv2
class FaceDetector:
def __init__(self, face_cascade_path):
self.faceCascade = cv2.CascadeClassifier(face_cascade_path)
def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):
# detect faces in the image
rectangles = self.faceCascade.det... |
38ed00b38d9cb005f9b25643afa7ce480da6febe | examples/enable/resize_tool_demo.py | examples/enable/resize_tool_demo.py | """
This demonstrates the most basic drawing capabilities using Enable. A new
component is created and added to a container.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resiz... | """
This demonstrates the resize tool.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resizable = ""
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"):
... | Fix resize tool demo comments. | Fix resize tool demo comments.
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | """
This demonstrates the most basic drawing capabilities using Enable. A new
component is created and added to a container.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resiz... | """
This demonstrates the resize tool.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resizable = ""
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"):
... | <commit_before>"""
This demonstrates the most basic drawing capabilities using Enable. A new
component is created and added to a container.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Compone... | """
This demonstrates the resize tool.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resizable = ""
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"):
... | """
This demonstrates the most basic drawing capabilities using Enable. A new
component is created and added to a container.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Component):
resiz... | <commit_before>"""
This demonstrates the most basic drawing capabilities using Enable. A new
component is created and added to a container.
"""
from enable.example_support import DemoFrame, demo_main
from enable.api import Component, Container, Window
from enable.tools.resize_tool import ResizeTool
class Box(Compone... |
b654ce911d458fc623929ac2a2e04c995201eb1e | runtests.py | runtests.py | #!/usr/bin/env python
# Setup Django
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'... | #!/usr/bin/env python
# Django must be set up before we import our libraries and run our tests
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
... | Add clarifying comment about Django setup | Add clarifying comment about Django setup
| Python | mit | educreations/django-ormcache | #!/usr/bin/env python
# Setup Django
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'... | #!/usr/bin/env python
# Django must be set up before we import our libraries and run our tests
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
... | <commit_before>#!/usr/bin/env python
# Setup Django
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locm... | #!/usr/bin/env python
# Django must be set up before we import our libraries and run our tests
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
... | #!/usr/bin/env python
# Setup Django
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'... | <commit_before>#!/usr/bin/env python
# Setup Django
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
},
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locm... |
6502087c63df816e3a4d4b256af7685f638b477d | account_check/migrations/8.0.0.0/pre-migrate.py | account_check/migrations/8.0.0.0/pre-migrate.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | Set last id in sequence | [FIX] Set last id in sequence
| Python | agpl-3.0 | csrocha/account_check,csrocha/account_check | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradeli... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradelib
_logger = log... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import logging
import openupgradeli... |
b4806b4650f576c7b5cd7f33742ccb108e37321c | StartWithPython/StartWithPython/Theory/Loops/Range.py | StartWithPython/StartWithPython/Theory/Loops/Range.py | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an action ('n') times
... | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an actio... | Add some range application with list | Add some range application with list
| Python | mit | CaptainMich/Python_Project | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an action ('n') times
... | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an actio... | <commit_before># -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an action... | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an actio... | # -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an action ('n') times
... | <commit_before># -------------------------------------------------------------------------------------------------
# RANGE
# -------------------------------------------------------------------------------------------------
print('\n\t\tRANGE\n')
for x in range(10): # to make an action... |
091f3c6eafcf2041517463e48f7209716a925b9f | website/files/utils.py | website/files/utils.py |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder parent: The parent of to attach the clone of src to, if ap... |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node to copy files to
:param Folder parent: The parent of to attach the clone of src to, if applicable
"""
ass... | Update the most recent fileversions region for copied files across regions | Update the most recent fileversions region for copied files across regions
[#PLAT-1100]
| Python | apache-2.0 | aaxelb/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,saradbowman/osf.io,brianjgeiger/osf.io,adlius/osf.io,adlius/osf.io,cslzchen/osf.io,cslzchen/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,mfraezz/osf.io,mfraezz/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,cas... |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder parent: The parent of to attach the clone of src to, if ap... |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node to copy files to
:param Folder parent: The parent of to attach the clone of src to, if applicable
"""
ass... | <commit_before>
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder parent: The parent of to attach the clone o... |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node to copy files to
:param Folder parent: The parent of to attach the clone of src to, if applicable
"""
ass... |
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder parent: The parent of to attach the clone of src to, if ap... | <commit_before>
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder parent: The parent of to attach the clone o... |
7d1f471f9723b7f8c12b5713a1a61f6391665009 | src/load_remote_data.py | src/load_remote_data.py | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://dashboard.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats = 'ht... | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://publishingstats.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats... | Update download links to summary_stats and humanitarian | Update download links to summary_stats and humanitarian
With the split of the dashboard and publishing statistics, `humanitarian.csv` and `summary_stats.csv` will be moving to a different url, this PR points to that. | Python | mit | devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://dashboard.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats = 'ht... | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://publishingstats.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats... | <commit_before>#!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://dashboard.iatistandard.org/summary_stats.csv'
csv_url_humanitar... | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://publishingstats.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats... | #!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://dashboard.iatistandard.org/summary_stats.csv'
csv_url_humanitarian_stats = 'ht... | <commit_before>#!/usr/bin/env python
import os
import requests
# local configuration
remote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')
# URLs at which data can be found
csv_url_summary_stats = 'http://dashboard.iatistandard.org/summary_stats.csv'
csv_url_humanitar... |
8157f0887d5fe9b78f484b5a556555b8ee26145f | fig/cli/formatter.py | fig/cli/formatter.py | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return width
class Formatter(object):
def table(self, h... | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return int(width)
class Formatter(object):
def table(se... | Fix the return value of get_tty_width() it should return an int. | Fix the return value of get_tty_width() it should return an int.
Signed-off-by: Daniel Nephin <6347c07ae509164cffebfb1e2a0d6ed64958db19@gmail.com>
| Python | apache-2.0 | LuisBosquez/docker.github.io,simonista/compose,simonista/compose,jorgeLuizChaves/compose,calou/compose,gtrdotmcs/compose,joeuo/docker.github.io,charleswhchan/compose,ouziel-slama/compose,VinceBarresi/compose,goloveychuk/compose,Dakno/compose,shubheksha/docker.github.io,RobertNorthard/compose,dbdd4us/compose,sanscontext... | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return width
class Formatter(object):
def table(self, h... | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return int(width)
class Formatter(object):
def table(se... | <commit_before>from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return width
class Formatter(object):
de... | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return int(width)
class Formatter(object):
def table(se... | from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return width
class Formatter(object):
def table(self, h... | <commit_before>from __future__ import unicode_literals
from __future__ import absolute_import
import os
import texttable
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
if len(tty_size) != 2:
return 80
_, width = tty_size
return width
class Formatter(object):
de... |
0989682ad858a6f14a1d387c24511b228881d645 | flake8_docstrings.py | flake8_docstrings.py | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.0'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.1'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | Use different pep257 entry point | Use different pep257 entry point
The check_source() function of pep257.py does not handle AllError and
EnvironmentError exceptions. We can use instead the check() function
and ignore any errors that do not belong to the pep257.Error class and
thus are of no use to Flake8.
| Python | mit | PyCQA/flake8-docstrings | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.0'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.1'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | <commit_before># -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.0'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
... | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.1'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | # -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.0'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
def __init__(... | <commit_before># -*- coding: utf-8 -*-
"""pep257 docstrings convention needs error code and class parser for be
included as module into flakes8
"""
import pep257
__version__ = '0.2.0'
class pep257Checker(object):
"""flake8 needs a class to check python file."""
name = 'pep257'
version = __version__
... |
dafbe424546020cc5a53eae5d10391d3dbf81870 | test/style_test.py | test/style_test.py | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['theanets'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match() + match('... | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['downhill'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match())
... | Update style test to work with this package. | Update style test to work with this package.
| Python | mit | rodrigob/downhill,lmjohns3/downhill | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['theanets'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match() + match('... | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['downhill'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match())
... | <commit_before>import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['theanets'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(ma... | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['downhill'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match())
... | import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['theanets'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(match() + match('... | <commit_before>import glob
import os
import pep8
class TestCodeFormat:
def test_pep8(self):
def match(*p):
s = ['theanets'] + list(p) + ['*.py']
return glob.glob(os.path.join(*s))
pep8style = pep8.StyleGuide(config_file='setup.cfg')
result = pep8style.check_files(ma... |
93dfefff12569c180e20fefc9380358753c6771e | molo/core/tests/test_import_from_git_view.py | molo/core/tests/test_import_from_git_view.py | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | Fix import UI django view's tests | Fix import UI django view's tests
| Python | bsd-2-clause | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | <commit_before>import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
... | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
def test_wagt... | <commit_before>import pytest
from django.test import TestCase
from django.core.urlresolvers import reverse
from molo.core.tests.base import MoloTestCaseMixin
@pytest.mark.django_db
class TestImportFromGit(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
self.user = self.login()
... |
a8b9e999a34039d64a2fe27b53a938feeb07a013 | flask_app.py | flask_app.py | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/')
@cache.cached(timeout=3600)
def nbis_list_entities():
re... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | Put API under /api/ by default | Put API under /api/ by default
| Python | bsd-3-clause | talavis/kimenu | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/')
@cache.cached(timeout=3600)
def nbis_list_entities():
re... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | <commit_before>from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/')
@cache.cached(timeout=3600)
def nbis_list_ent... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/')
@cache.cached(timeout=3600)
def nbis_list_entities():
re... | <commit_before>from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/')
@cache.cached(timeout=3600)
def nbis_list_ent... |
d2eb23a0dcf768d3d47966122b6f3717009eb2fd | Python/ds.py | Python/ds.py | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | Add one more line of comment in printList function. | Add one more line of comment in printList function.
| Python | mit | comicxmz001/LeetCode,comicxmz001/LeetCode | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | <commit_before>"""
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListN... | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | """
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListNode(0)
head = ... | <commit_before>"""
This file includes several data structures used in LeetCode question.
"""
# Definition for a list node.
class ListNode(object):
def __init__(self, n):
self.val = n
self.next = None
def createLinkedList(nodelist):
#type nodelist: list[int/float]
#rtype: head of linked list
linkedList = ListN... |
a3bb5ca86cbba530718e55f97407d7c5d3ad0a57 | stagecraft/apps/organisation/admin.py | stagecraft/apps/organisation/admin.py | from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class NodeAdmin(admin.ModelAdmin):
list_display = ('name', 'abbreviation',)
admin.site.register(NodeType, NodeTypeAdmin)
admin.site.register(Node, NodeAdmin)
| from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class ParentInline(admin.TabularInline):
model = Node.parents.through
verbose_name = 'Parent relationship'
verbose_name_plural = 'Parents'
extra = 1
fk_name = ... | Improve Django Admin interface for Organisations | Improve Django Admin interface for Organisations
We have a lot of nodes now so adding some way of filtering by type and
searching by name seemed wise.
I've switched the multiselect box to pick parents for an interface that
is a little more sane when we have over a 1000 possible parents.
| Python | mit | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class NodeAdmin(admin.ModelAdmin):
list_display = ('name', 'abbreviation',)
admin.site.register(NodeType, NodeTypeAdmin)
admin.site.register(Node, NodeAdmin)
Improve Django ... | from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class ParentInline(admin.TabularInline):
model = Node.parents.through
verbose_name = 'Parent relationship'
verbose_name_plural = 'Parents'
extra = 1
fk_name = ... | <commit_before>from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class NodeAdmin(admin.ModelAdmin):
list_display = ('name', 'abbreviation',)
admin.site.register(NodeType, NodeTypeAdmin)
admin.site.register(Node, NodeAdmin)
... | from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class ParentInline(admin.TabularInline):
model = Node.parents.through
verbose_name = 'Parent relationship'
verbose_name_plural = 'Parents'
extra = 1
fk_name = ... | from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class NodeAdmin(admin.ModelAdmin):
list_display = ('name', 'abbreviation',)
admin.site.register(NodeType, NodeTypeAdmin)
admin.site.register(Node, NodeAdmin)
Improve Django ... | <commit_before>from django.contrib import admin
from .models import NodeType, Node
class NodeTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
class NodeAdmin(admin.ModelAdmin):
list_display = ('name', 'abbreviation',)
admin.site.register(NodeType, NodeTypeAdmin)
admin.site.register(Node, NodeAdmin)
... |
a01d306a887eabc912a9e57af0ad862e6c45f652 | saleor/cart/__init__.py | saleor/cart/__init__.py | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | Use clear cart method from satchless | Use clear cart method from satchless
https://github.com/mirumee/satchless/commit/3acaa8f6a27d9ab259a2d66fc3f7416a18fab1ad
This reverts commit 2ad16c44adb20e9ba023e873149d67068504c34c.
| Python | bsd-3-clause | dashmug/saleor,taedori81/saleor,avorio/saleor,avorio/saleor,tfroehlich82/saleor,arth-co/saleor,laosunhust/saleor,dashmug/saleor,rchav/vinerack,arth-co/saleor,Drekscott/Motlaesaleor,taedori81/saleor,rchav/vinerack,josesanch/saleor,arth-co/saleor,KenMutemi/saleor,paweltin/saleor,KenMutemi/saleor,jreigel/saleor,Drekscott/... | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | <commit_before>from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pas... | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pass
class Digit... | <commit_before>from __future__ import unicode_literals
from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemList, ClassifyingPartitioner
from ..product.models import DigitalShip
class ShippedGroup(ItemList):
'''
Group for shippable products.
'''
pas... |
5b50b96b35c678ca17b069630875a9d86e2cbca3 | scripts/i18n/commons.py | scripts/i18n/commons.py | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
'commons-nowcommons-template' : 'en': u'{{subst:ncd|%s}}',
},
'qqq... | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
},
'qqq': {
'commons-file-now-available' : u'Edit summary when the bot has moved... | Remove the template for now. | Remove the template for now.
git-svn-id: 9a050473c2aca1e14f53d73349e19b938c2cf203@9344 6a7f98fc-eeb0-4dc1-a6e2-c2c589a08aa6
| Python | mit | legoktm/pywikipedia-rewrite | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
'commons-nowcommons-template' : 'en': u'{{subst:ncd|%s}}',
},
'qqq... | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
},
'qqq': {
'commons-file-now-available' : u'Edit summary when the bot has moved... | <commit_before># -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
'commons-nowcommons-template' : 'en': u'{{subst:ncd|%... | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
},
'qqq': {
'commons-file-now-available' : u'Edit summary when the bot has moved... | # -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
'commons-nowcommons-template' : 'en': u'{{subst:ncd|%s}}',
},
'qqq... | <commit_before># -*- coding: utf-8 -*-
msg = {
'en': {
'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',
'commons-file-now-available' : u'File is now available on Wikimedia Commons.',
'commons-nowcommons-template' : 'en': u'{{subst:ncd|%... |
11ab81f67df3f7579cb1b85d87499480c3cea351 | wafer/pages/serializers.py | wafer/pages/serializers.py | from rest_framework import serializers
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
def create(self, validated_data):
# TODO: Implement
return super(PageSerializer, self).create(validated_data)
| from rest_framework import serializers
from reversion import revisions
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
exclude = ('_content_rendered',)
@revisions.create_revision()
def create(self, validated_data):
... | Add create & update methods for page API | Add create & update methods for page API
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | from rest_framework import serializers
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
def create(self, validated_data):
# TODO: Implement
return super(PageSerializer, self).create(validated_data)
Add create & update me... | from rest_framework import serializers
from reversion import revisions
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
exclude = ('_content_rendered',)
@revisions.create_revision()
def create(self, validated_data):
... | <commit_before>from rest_framework import serializers
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
def create(self, validated_data):
# TODO: Implement
return super(PageSerializer, self).create(validated_data)
<commit... | from rest_framework import serializers
from reversion import revisions
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
exclude = ('_content_rendered',)
@revisions.create_revision()
def create(self, validated_data):
... | from rest_framework import serializers
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
def create(self, validated_data):
# TODO: Implement
return super(PageSerializer, self).create(validated_data)
Add create & update me... | <commit_before>from rest_framework import serializers
from wafer.pages.models import Page
class PageSerializer(serializers.ModelSerializer):
class Meta:
model = Page
def create(self, validated_data):
# TODO: Implement
return super(PageSerializer, self).create(validated_data)
<commit... |
9eafc01ef8260a313f2e214924cfd5bda706c1c0 | cactusbot/handler.py | cactusbot/handler.py | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
if hasattr(handler, "on_" + event):
... | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.logger = logging.getLogger(__name__)
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
... | Add exception logging to Handlers | Add exception logging to Handlers
| Python | mit | CactusDev/CactusBot | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
if hasattr(handler, "on_" + event):
... | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.logger = logging.getLogger(__name__)
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
... | <commit_before>"""Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
if hasattr(handler, "on_" +... | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.logger = logging.getLogger(__name__)
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
... | """Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
if hasattr(handler, "on_" + event):
... | <commit_before>"""Handle handlers."""
import logging
class Handlers(object):
"""Handlers."""
def __init__(self, *handlers):
self.handlers = handlers
def handle(self, event, packet):
"""Handle incoming data."""
for handler in self.handlers:
if hasattr(handler, "on_" +... |
3a30074c13d1740ae24c8e381bd9d170ed6b6808 | wafer/sponsors/views.py | wafer/sponsors/views.py | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | Order sponsors by ID on the sponsors page, too | Order sponsors by ID on the sponsors page, too
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | <commit_before>from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import... | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import SponsorSeriali... | <commit_before>from django.views.generic.list import ListView
from django.views.generic import DetailView
from rest_framework import viewsets
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
from wafer.sponsors.models import Sponsor, SponsorshipPackage
from wafer.sponsors.serializers import... |
801a209eb208c629d4ea84199b7779e8c6a0396d | tests/sentry/interfaces/user/tests.py | tests/sentry/interfaces/user/tests.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | Fix text to prove that behavior | Fix text to prove that behavior
| Python | bsd-3-clause | imankulov/sentry,BayanGroup/sentry,songyi199111/sentry,ifduyue/sentry,kevinlondon/sentry,JackDanger/sentry,zenefits/sentry,pauloschilling/sentry,kevinlondon/sentry,TedaLIEz/sentry,looker/sentry,camilonova/sentry,gg7/sentry,daevaorn/sentry,gg7/sentry,ngonzalvez/sentry,JamesMura/sentry,mitsuhiko/sentry,mvaled/sentry,wong... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@fixtu... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event... |
48e63186b3f3912134c167a6f74ffe8a98de3b16 | testrunner.py | testrunner.py | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | Add newline at the end of file | Add newline at the end of file
| Python | mit | naiquevin/jinger,naiquevin/jinger | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | <commit_before>#!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['j... | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | #!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['jinger.test.test... | <commit_before>#!/usr/bin/env python
import unittest
import glob
import sys
def create_test_suite(mod):
if mod is None:
test_file_strings = glob.glob('jinger/test/test_*.py')
module_strings = [str[0:len(str)-3].replace('/', '.') for str in test_file_strings]
else:
module_strings = ['j... |
3befcbaf3a78a46edc31cc1910fcd8e0a9381102 | money_conversion/money.py | money_conversion/money.py |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
| from currency_rates import rates
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
def to_currency(self, new_currency):
new_currency = new_c... | Add to_currency method in order to be able to convert to a new currency | Add to_currency method in order to be able to convert to a new currency
| Python | mit | mdsrosa/money-conversion-py |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
Add to_currency method in order to be able to convert to a new currency | from currency_rates import rates
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
def to_currency(self, new_currency):
new_currency = new_c... | <commit_before>
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
<commit_msg>Add to_currency method in order to be able to convert to a new currency<commi... | from currency_rates import rates
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
def to_currency(self, new_currency):
new_currency = new_c... |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
Add to_currency method in order to be able to convert to a new currencyfrom currency_rates import rates
... | <commit_before>
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
<commit_msg>Add to_currency method in order to be able to convert to a new currency<commi... |
503e8f4ba3cbf388ffd9e88d58f783349d8354a3 | froide/document/views.py | froide/document/views.py | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^5', 'descriptio... | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^3', 'descriptio... | Reduce title, description search boost on document | Reduce title, description search boost on document | Python | mit | fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^5', 'descriptio... | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^3', 'descriptio... | <commit_before>from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^... | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^3', 'descriptio... | from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^5', 'descriptio... | <commit_before>from elasticsearch_dsl.query import Q
from froide.helper.search.views import BaseSearchView
from froide.helper.search.filters import BaseSearchFilterSet
from filingcabinet.models import Page
from .documents import PageDocument
class DocumentFilterset(BaseSearchFilterSet):
query_fields = ['title^... |
5ffc1cc1d65b1e1bb364a8270b2a6a563c362733 | tests/test_pubtator.py | tests/test_pubtator.py |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... | Simplify pubtator test to only check for entities, not exact number | Simplify pubtator test to only check for entities, not exact number
| Python | mit | jakelever/kindred,jakelever/kindred |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... | <commit_before>
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
asse... |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... |
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
assert docCount == ... | <commit_before>
import kindred
def test_pubtator_pmid():
corpus = kindred.pubtator.load(19894120)
assert isinstance(corpus,kindred.Corpus)
docCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.documents ])
asse... |
1119a249d2e5dcbb2dd965a6e162d24e390d77f5 | website/prereg/utils.py | website/prereg/utils.py | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | Remove reference to manager that no longer exists | Remove reference to manager that no longer exists
| Python | apache-2.0 | chennan47/osf.io,monikagrabowska/osf.io,cwisecarver/osf.io,felliott/osf.io,mfraezz/osf.io,pattisdr/osf.io,binoculars/osf.io,hmoco/osf.io,laurenrevere/osf.io,TomBaxter/osf.io,Johnetordoff/osf.io,cwisecarver/osf.io,cslzchen/osf.io,sloria/osf.io,acshi/osf.io,mattclark/osf.io,hmoco/osf.io,laurenrevere/osf.io,monikagrabowsk... | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | <commit_before>from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftReg... | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftRegistration.objec... | <commit_before>from modularodm import Q
PREREG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'erpc': 'Election Research Preacceptance Competition',
}
def drafts_for_user(user, campaign):
from osf import models # noqa
PREREG_CHALLENGE_METASCHEMA = get_prereg_schema(campaign)
return models.DraftReg... |
121c76f6af1987ba8ebef4f506604d37e6608a64 | scalaBee.py | scalaBee.py | #!/usr/bin/env python
## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os
import sys
## Showing initial message
print "=================\nStarting ScalaBe... | #!/usr/bin/env python
# Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
# Ex: python scalaBee.py 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os, sys, time
## Showing initial message
print "=================\nStarting S... | ADD - Python script looping correctly | ADD - Python script looping correctly
| Python | mit | danielholanda/ScalaBee,danielholanda/ScalaBee | #!/usr/bin/env python
## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os
import sys
## Showing initial message
print "=================\nStarting ScalaBe... | #!/usr/bin/env python
# Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
# Ex: python scalaBee.py 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os, sys, time
## Showing initial message
print "=================\nStarting S... | <commit_before>#!/usr/bin/env python
## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os
import sys
## Showing initial message
print "=================\nS... | #!/usr/bin/env python
# Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
# Ex: python scalaBee.py 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os, sys, time
## Showing initial message
print "=================\nStarting S... | #!/usr/bin/env python
## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os
import sys
## Showing initial message
print "=================\nStarting ScalaBe... | <commit_before>#!/usr/bin/env python
## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...
## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000
# Importing everything needed
import os
import sys
## Showing initial message
print "=================\nS... |
4607e0d837829621a2da32581137cc6dcab306f5 | nix/tests.py | nix/tests.py | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | Add a test for nix.core.DataArray.label | [test] Add a test for nix.core.DataArray.label
| Python | bsd-3-clause | stoewer/nixpy,stoewer/nixpy | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | <commit_before>__author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
asser... | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | __author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
assert(b)
as... | <commit_before>__author__ = 'gicmo'
import unittest
import nix.core
class TestFile(unittest.TestCase):
def setUp(self):
self.nix_file = nix.core.File.open('test.h5')
assert(self.nix_file.version == '1.0')
def basic_test(self):
b = self.nix_file.create_block('foo', 'bar')
asser... |
b20e236bd40c0d3c1d06aa1393f02b98e13e58bb | subscriptions/management/commands/add_missed_call_service_audio_notification_to_active_subscriptions.py | subscriptions/management/commands/add_missed_call_service_audio_notification_to_active_subscriptions.py | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call servic... | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call service.")
def ... | Remove unused import and fix typo | Remove unused import and fix typo
| Python | bsd-3-clause | praekelt/seed-staged-based-messaging,praekelt/seed-stage-based-messaging,praekelt/seed-stage-based-messaging | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call servic... | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call service.")
def ... | <commit_before>from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new mis... | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call service.")
def ... | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new missed call servic... | <commit_before>from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from subscriptions.models import Subscription
class Command(BaseCommand):
help = ("Active subscription holders need to be informed via audio file "
"about the new mis... |
c61929f0d0d8dbf53ef3c9ff2a98cf8f249bfca4 | handlers/base_handler.py | handlers/base_handler.py | from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
if offset < 0:
raise IndexError("File offset must be greater than 0")
... | from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
return self.file[offset:offset + size]
| Revert "Add bounds checking to BaseHandler.read()" | Revert "Add bounds checking to BaseHandler.read()"
This reverts commit 045ead44ef69d6ebf2cb0dddf084762efcc62995.
| Python | mit | drx/rom-info | from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
if offset < 0:
raise IndexError("File offset must be greater than 0")
... | from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
return self.file[offset:offset + size]
| <commit_before>from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
if offset < 0:
raise IndexError("File offset must be great... | from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
return self.file[offset:offset + size]
| from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
if offset < 0:
raise IndexError("File offset must be greater than 0")
... | <commit_before>from collections import OrderedDict
class BaseHandler:
def __init__(self, file, file_name):
self.file = file
self.file_name = file_name
self.info = OrderedDict()
def read(self, offset, size):
if offset < 0:
raise IndexError("File offset must be great... |
6f87c12306e0daaae2bcee3da3229f34fa7f464c | src/reduce_framerate.py | src/reduce_framerate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone_camera framerate to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_raw framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.
"""
def __init__(self)... | Change docstrings and function names. | Change docstrings and function names.
| Python | mit | masasin/spirit,masasin/spirit | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone_camera framerate to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_raw framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.
"""
def __init__(self)... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone_camera framerate to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageFeature(object):
"""
A ROS image Publis... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_raw framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.
"""
def __init__(self)... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone_camera framerate to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageFeature(object):
"""
A ROS image Publisher/Subscriber.... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone_camera framerate to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageFeature(object):
"""
A ROS image Publis... |
f106a434df84497e12cfbdf1e693e28b6c567711 | kubespawner/utils.py | kubespawner/utils.py | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | Add docstrings to exponential backoff | Add docstrings to exponential backoff
| Python | bsd-3-clause | yuvipanda/jupyterhub-kubernetes-spawner,jupyterhub/kubespawner | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | <commit_before>"""
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(Sing... | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | """
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(SingletonConfigurab... | <commit_before>"""
Misc. general utility functions, not tied to Kubespawner directly
"""
from concurrent.futures import ThreadPoolExecutor
import random
from jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE
from tornado import gen, ioloop
from traitlets.config import SingletonConfigurable
class SingletonExecutor(Sing... |
61d42efa009525e5efd90d147ba70e038f978ae3 | Lib/sublime_lib/__init__.py | Lib/sublime_lib/__init__.py | import sublime_plugin
from sublime import Window, View
class WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):
"""A class to derive from when using a Window- and a TextCommand in one class
(e.g. when you make a build system that should/could also be calles from the command
pa... | Add WindowAndTextCommand class to sublime_lib | Add WindowAndTextCommand class to sublime_lib
Probably has limited use but w/e.
| Python | mit | SublimeText/PackageDev,SublimeText/AAAPackageDev,SublimeText/AAAPackageDev | Add WindowAndTextCommand class to sublime_lib
Probably has limited use but w/e. | import sublime_plugin
from sublime import Window, View
class WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):
"""A class to derive from when using a Window- and a TextCommand in one class
(e.g. when you make a build system that should/could also be calles from the command
pa... | <commit_before><commit_msg>Add WindowAndTextCommand class to sublime_lib
Probably has limited use but w/e.<commit_after> | import sublime_plugin
from sublime import Window, View
class WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):
"""A class to derive from when using a Window- and a TextCommand in one class
(e.g. when you make a build system that should/could also be calles from the command
pa... | Add WindowAndTextCommand class to sublime_lib
Probably has limited use but w/e.import sublime_plugin
from sublime import Window, View
class WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):
"""A class to derive from when using a Window- and a TextCommand in one class
(e.g. when ... | <commit_before><commit_msg>Add WindowAndTextCommand class to sublime_lib
Probably has limited use but w/e.<commit_after>import sublime_plugin
from sublime import Window, View
class WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):
"""A class to derive from when using a Window- and a... | |
ea22192c9debe171db5d4b6b83d581fe079d6fa4 | ipython/profile_bots/startup/05-import-company.py | ipython/profile_bots/startup/05-import-company.py | """Set up access to important employer data for IPython"""
from dataclasses import dataclass
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
| """Set up access to important employer data for IPython"""
from dataclasses import dataclass
from tools.issues import issues
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
def issue_branch(issue):
name = issues.one(issue).branch_name()
print(name)
| Add functuion to ibots to name a branch | Add functuion to ibots to name a branch
| Python | mit | jalanb/jab,jalanb/dotjab,jalanb/jab,jalanb/dotjab | """Set up access to important employer data for IPython"""
from dataclasses import dataclass
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
Add functuion to ibots to name a branch | """Set up access to important employer data for IPython"""
from dataclasses import dataclass
from tools.issues import issues
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
def issue_branch(issue):
name = issues.one(issue).branch_name()
print(name)
| <commit_before>"""Set up access to important employer data for IPython"""
from dataclasses import dataclass
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
<commit_msg>Add functuion to ibots to name a branch<commit_after> | """Set up access to important employer data for IPython"""
from dataclasses import dataclass
from tools.issues import issues
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
def issue_branch(issue):
name = issues.one(issue).branch_name()
print(name)
| """Set up access to important employer data for IPython"""
from dataclasses import dataclass
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
Add functuion to ibots to name a branch"""Set up access to important employer data for IPython"""
from dataclasses import dataclass
from tools.issues... | <commit_before>"""Set up access to important employer data for IPython"""
from dataclasses import dataclass
@dataclass
class EmployerData:
name: str
wwts = EmployerData('wwts')
<commit_msg>Add functuion to ibots to name a branch<commit_after>"""Set up access to important employer data for IPython"""
from datacl... |
9e131c863c7ff147b95a016b0dfd52c03c60341e | tests/test_cmd_write.py | tests/test_cmd_write.py | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
os.chdir("test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.expected") as expected:
actual_lines = actual.read().splitlines()
... | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
test_root_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_root_dir + "/test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.e... | Fix running tests form command line | Fix running tests form command line
| Python | mit | rzhilkibaev/cfgen | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
os.chdir("test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.expected") as expected:
actual_lines = actual.read().splitlines()
... | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
test_root_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_root_dir + "/test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.e... | <commit_before>from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
os.chdir("test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.expected") as expected:
actual_lines = actual.read().s... | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
test_root_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_root_dir + "/test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.e... | from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
os.chdir("test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.expected") as expected:
actual_lines = actual.read().splitlines()
... | <commit_before>from cfgen import cfgen
from nose.tools import assert_equals
import os
def setup():
os.chdir("test_dir")
clean()
def test_cmd_write():
cfgen.cmd_write("test.cfg")
with open("test.cfg") as actual, open("test.cfg.expected") as expected:
actual_lines = actual.read().s... |
b435bc206bfa6dc6654c5a904363faedc856835d | tests/test_flask_get.py | tests/test_flask_get.py | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | Add a test for json retrieval. | Add a test for json retrieval.
| Python | mit | jwg4/flask-autodoc,jwg4/flask-autodoc | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | <commit_before>import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
... | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
"""R... | <commit_before>import unittest
from flask import Flask
from flask.ext.autodoc import Autodoc
class TestAutodocWithFlask(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.autodoc = Autodoc(self.app)
@self.app.route('/')
@self.autodoc.doc()
def index():
... |
dc887df974cc9a060b048543d6280c5492ef8ac8 | main/main.py | main/main.py | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import data_models
import views
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
import roles
import partners
import foreign_tra... | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import db
import data_models
import views
import properties
import renderers
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
im... | Add receent activity to dashboard | Add receent activity to dashboard
| Python | mit | keith-lewis100/pont-workbench,keith-lewis100/pont-workbench,keith-lewis100/pont-workbench | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import data_models
import views
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
import roles
import partners
import foreign_tra... | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import db
import data_models
import views
import properties
import renderers
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
im... | <commit_before>#_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import data_models
import views
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
import roles
import partners
imp... | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import db
import data_models
import views
import properties
import renderers
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
im... | #_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import data_models
import views
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
import roles
import partners
import foreign_tra... | <commit_before>#_*_ coding: UTF-8 _*_
from flask import render_template
from application import app
import data_models
import views
import funds
import projects
import grants
import pledges
import suppliers
import supplier_funds
import internal_transfers
import purchases
import users
import roles
import partners
imp... |
9cb485e97873eff66ba283f30765bb9c66a3c864 | djangae/core/management/__init__.py | djangae/core/management/__init__.py | import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
Django as no... | import sys
import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
D... | Support no-args for djangae.core.management.execute_from_commandline - matches django implementation. | Support no-args for djangae.core.management.execute_from_commandline - matches django implementation.
| Python | bsd-3-clause | kirberich/djangae,nealedj/djangae,asendecka/djangae,stucox/djangae,martinogden/djangae,chargrizzle/djangae,stucox/djangae,armirusco/djangae,leekchan/djangae,armirusco/djangae,trik/djangae,jscissr/djangae,grzes/djangae,SiPiggles/djangae,trik/djangae,kirberich/djangae,armirusco/djangae,trik/djangae,asendecka/djangae,stuc... | import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
Django as no... | import sys
import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
D... | <commit_before>import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
... | import sys
import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
D... | import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
Django as no... | <commit_before>import argparse
import djangae.sandbox as sandbox
def execute_from_command_line(argv=None):
"""Wraps Django's `execute_from_command_line` to initialize a djangae
sandbox before running a management command.
Note: The '--sandbox' arg must come first. All other args are forwarded to
... |
eaea466e29725c04ccb31a24807668dee1a09a91 | courses/developingapps/python/devenv/server.py | courses/developingapps/python/devenv/server.py |
# Copyright 2017 Google 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 writing... |
# Copyright 2017 Google 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 writing... | Fix ImportError and use bytes in outstream | Fix ImportError and use bytes in outstream
| Python | apache-2.0 | turbomanage/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,turbomanage/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,turbomanage/training-data-analyst,turboman... |
# Copyright 2017 Google 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 writing... |
# Copyright 2017 Google 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 writing... | <commit_before>
# Copyright 2017 Google 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 agree... |
# Copyright 2017 Google 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 writing... |
# Copyright 2017 Google 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 writing... | <commit_before>
# Copyright 2017 Google 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 agree... |
b914fee46220633c81f244e388c9385614db7d60 | karspexet/ticket/tasks.py | karspexet/ticket/tasks.py | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
from django.template import Context
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=N... | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=None):
'''Send an email to the cu... | Use dict in render_to_string when sending email | Use dict in render_to_string when sending email
Building a Context manually like this is deprecated in Django 1.11, so
let's not do it this way.
| Python | mit | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
from django.template import Context
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=N... | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=None):
'''Send an email to the cu... | <commit_before>import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
from django.template import Context
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation... | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=None):
'''Send an email to the cu... | import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
from django.template import Context
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation, email, name=N... | <commit_before>import logging
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.template.loader import render_to_string
from django.template import Context
logger = logging.getLogger(__file__)
def send_ticket_email_to_customer(reservation... |
2cbbf3d2175f35370ca4e9a0a8d9e6f01f3a2240 | python_plot/plot_test.py | python_plot/plot_test.py | from matplotlib import pyplot as plt
import numpy as np
import os
import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_files... | from matplotlib import pyplot as plt
import numpy as np
import os
# import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_fil... | Comment out pandas because its unused | Comment out pandas because its unused
| Python | mit | agurusa/practice_code,agurusa/practice_code | from matplotlib import pyplot as plt
import numpy as np
import os
import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_files... | from matplotlib import pyplot as plt
import numpy as np
import os
# import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_fil... | <commit_before>from matplotlib import pyplot as plt
import numpy as np
import os
import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.... | from matplotlib import pyplot as plt
import numpy as np
import os
# import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_fil... | from matplotlib import pyplot as plt
import numpy as np
import os
import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.walk(data_files... | <commit_before>from matplotlib import pyplot as plt
import numpy as np
import os
import pandas as pd
data_files = "./data"
def movingAv(interval, window_size):
window = np.ones(int(window_size))/float(window_size)
return np.convolve(interval, window, 'same')
fig,ax = plt.subplots()
for subdir, dirs, files in os.... |
f2db056d4da23b96034f7c3ac5c4c12dd2853e91 | luigi_slack/slack_api.py | luigi_slack/slack_api.py | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | Validate token when fetching channels | Validate token when fetching channels
| Python | mit | bonzanini/luigi-slack | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | <commit_before>import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._... | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._get_channels()
... | <commit_before>import json
from slackclient import SlackClient
class SlackBotConf(object):
def __init__(self):
self.username = 'Luigi-slack Bot'
class SlackAPI(object):
def __init__(self, token, bot_conf=SlackBotConf()):
self.client = SlackClient(token)
self._all_channels = self._... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.