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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ab2d1296dd189016daa8012fc80d821d1b71486c | telephony/radio_station.py | telephony/radio_station.py | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | Fix no id property for RadioStation | Fix no id property for RadioStation
| Python | agpl-3.0 | rootio/rootio_web,rootio/rootio_web,rootio/rootio_web,rootio/rootio_web | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | <commit_before>import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
... | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
return
... | <commit_before>import time
from rootio.radio.models import Station
from call_handler import CallHandler
from program_handler import ProgramHandler
from community_menu import CommunityMenu
class RadioStation:
def run(self):
self.__program_handler.run()
while True:
time.sleep(1)
... |
ff564c646cedf7f8129fb4ce3d6736424252f8a6 | pundler/config.py | pundler/config.py | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | Fix iteritems isn't a method name in Py3 | Fix iteritems isn't a method name in Py3
| Python | mit | hirokazumiyaji/pundler | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | <commit_before># coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
... | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | # coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
else:
... | <commit_before># coding: utf-8
from __future__ import absolute_import
import os
import yaml
from .exceptions import EnvironmentNotFound, FileNotFound
from .package import Package
class Config(object):
def __init__(self, pyfile=None, environment='development'):
if pyfile:
self.pyfile = pyfile
... |
18374ff4e3906f704276bb0a7b5a5feae50875a2 | aspy/yaml/__init__.py | aspy/yaml/__init__.py | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(yaml.loader.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_... | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(getattr(yaml, 'CSafeLoader', yaml.SafeLoader)):
pass
OrderedLoader.add_constructor(
yaml.resolver.Ba... | Use the C Loader/Dumper when available | Use the C Loader/Dumper when available
| Python | mit | asottile/aspy.yaml | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(yaml.loader.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_... | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(getattr(yaml, 'CSafeLoader', yaml.SafeLoader)):
pass
OrderedLoader.add_constructor(
yaml.resolver.Ba... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(yaml.loader.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.D... | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(getattr(yaml, 'CSafeLoader', yaml.SafeLoader)):
pass
OrderedLoader.add_constructor(
yaml.resolver.Ba... | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(yaml.loader.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import yaml
# Adapted from http://stackoverflow.com/a/21912744/812183
class OrderedLoader(yaml.loader.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.D... |
942b5603da12f43395c0fba35ffd34a31462a023 | schedule.py | schedule.py | #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
| #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
# The uninterpr... | Define an uninterpreted scheduling function | Define an uninterpreted scheduling function
| Python | bsd-2-clause | jmorse/numbness | #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
Define an uninte... | #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
# The uninterpr... | <commit_before>#!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
<... | #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
# The uninterpr... | #!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
Define an uninte... | <commit_before>#!/usr/bin/python
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(12):
print "t{0}".format(i),
print ")"
<... |
5a6b903fc0a309d61e02d020f46ebf2d6c482ed3 | tests/factory_tests/test_images.py | tests/factory_tests/test_images.py | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
def test_local_file_field():
class FileFactory(factory.StubFactory):
file = images.LocalFileField()
file = FileFactory.build().file
assert isinstance(file, Fil... | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
# In Python 2 Django's File wraps the builtin `file`, but that doesn't exist in Python 3.
try:
FILE_TYPE = file
except NameError:
FILE_TYPE = BufferedReader
def test_loca... | Fix the file type asserts on Python 2 (I hope). | Fix the file type asserts on Python 2 (I hope).
| Python | bsd-2-clause | incuna/incuna-test-utils,incuna/incuna-test-utils | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
def test_local_file_field():
class FileFactory(factory.StubFactory):
file = images.LocalFileField()
file = FileFactory.build().file
assert isinstance(file, Fil... | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
# In Python 2 Django's File wraps the builtin `file`, but that doesn't exist in Python 3.
try:
FILE_TYPE = file
except NameError:
FILE_TYPE = BufferedReader
def test_loca... | <commit_before>from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
def test_local_file_field():
class FileFactory(factory.StubFactory):
file = images.LocalFileField()
file = FileFactory.build().file
assert isins... | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
# In Python 2 Django's File wraps the builtin `file`, but that doesn't exist in Python 3.
try:
FILE_TYPE = file
except NameError:
FILE_TYPE = BufferedReader
def test_loca... | from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
def test_local_file_field():
class FileFactory(factory.StubFactory):
file = images.LocalFileField()
file = FileFactory.build().file
assert isinstance(file, Fil... | <commit_before>from io import BufferedReader, BytesIO
import factory
from django.core.files import File
from incuna_test_utils.factories import images
def test_local_file_field():
class FileFactory(factory.StubFactory):
file = images.LocalFileField()
file = FileFactory.build().file
assert isins... |
6423bb87a392bf6f8abd3b04a0a1bab3181542a0 | run_time/src/gae_server/font_mapper.py | run_time/src/gae_server/font_mapper.py | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | Add support for NotoSans and Arimo. | Add support for NotoSans and Arimo. | Python | apache-2.0 | googlefonts/TachyFont,googlei18n/TachyFont,moyogo/tachyfont,googlei18n/TachyFont,moyogo/tachyfont,bstell/TachyFont,bstell/TachyFont,bstell/TachyFont,moyogo/tachyfont,googlefonts/TachyFont,googlei18n/TachyFont,googlei18n/TachyFont,googlei18n/TachyFont,moyogo/tachyfont,googlefonts/TachyFont,bstell/TachyFont,googlefonts/T... | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | <commit_before>"""
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by app... | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | """
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | <commit_before>"""
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by app... |
691ccb9e99240f36ab954974e1ecbdea61c4c7b6 | datagroupings/templatetags/key.py | datagroupings/templatetags/key.py | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register... | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if d is not None:
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if d is not None:
if key_name in ... | Fix TemplateTag issue with filters | Fix TemplateTag issue with filters
| Python | apache-2.0 | nagyistoce/geokey,nagyistoce/geokey,nagyistoce/geokey | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register... | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if d is not None:
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if d is not None:
if key_name in ... | <commit_before>import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if key_name in d:
return d[key_name]
return... | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if d is not None:
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if d is not None:
if key_name in ... | import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register... | <commit_before>import json
from django import template
register = template.Library()
@register.filter(name='key')
def key(d, key_name):
if key_name in d:
return d[key_name]
return ''
@register.filter(name='value')
def value(d, key_name):
if key_name in d:
return d[key_name]
return... |
8119e33a6074df2140ee9f20011495ac754c4d34 | newsApp/notifierBase.py | newsApp/notifierBase.py | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | Allow tweets only from 9am | Allow tweets only from 9am
| Python | mit | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | <commit_before>import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz =... | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz = timezone('Asia... | <commit_before>import os
import logging
from datetime import datetime
from pytz import timezone
logger = logging.getLogger('notifierTwitter')
class NotifierBase:
def __init__(self):
self.domainName = os.environ['DOMAIN']
def isNightTime(self, locale):
# for now we only have cities in india
india_tz =... |
a7aa0fb21a04b6c6b8e1548f17064462e07e2d74 | punic/errors.py | punic/errors.py | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | Fix suggested solution for failure to clone. | Fix suggested solution for failure to clone.
| Python | mit | schwa/punic | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | <commit_before>from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):... | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):
pass
cla... | <commit_before>from __future__ import division, absolute_import, print_function
import contextlib
from punic.logger import logger
class RepositoryNotClonedError(Exception):
pass
class CartfileNotFound(Exception):
def __init__(self, path):
self.path = path
class PunicRepresentableError(Exception):... |
1e84e4f8cadd6f776bde4b64839a7e919cb95228 | website/addons/s3/tests/factories.py | website/addons/s3/tests/factories.py | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | Use newer factory-boy Meta syntax for s3 | Use newer factory-boy Meta syntax for s3
| Python | apache-2.0 | mluke93/osf.io,mattclark/osf.io,abought/osf.io,adlius/osf.io,laurenrevere/osf.io,kch8qx/osf.io,RomanZWang/osf.io,chrisseto/osf.io,asanfilippo7/osf.io,hmoco/osf.io,caseyrollins/osf.io,rdhyee/osf.io,brianjgeiger/osf.io,zamattiac/osf.io,alexschiller/osf.io,kch8qx/osf.io,mfraezz/osf.io,alexschiller/osf.io,pattisdr/osf.io,S... | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | <commit_before># -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(Ext... | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(ExternalAccountFac... | <commit_before># -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
from factory import SubFactory, Sequence
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, ExternalAccountFactory
from website.addons.s3.model import (
S3UserSettings,
S3NodeSettings
)
class S3AccountFactory(Ext... |
d314504621b3b0d36d8248a4ef36d089cd593108 | 153957_theme/theme.py | 153957_theme/theme.py | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def register(settings):
signals.ga... | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from shutil import rmtree
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def remove_l... | Remove leaflet static files included by default by sigal | Remove leaflet static files included by default by sigal
Leaflet is not used by this theme, those static files are unnecessary.
| Python | mit | 153957/153957-theme,153957/153957-theme | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def register(settings):
signals.ga... | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from shutil import rmtree
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def remove_l... | <commit_before>"""Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def register(settings):... | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from shutil import rmtree
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def remove_l... | """Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def register(settings):
signals.ga... | <commit_before>"""Use the 153957-theme as theme for the gallery"""
from pathlib import Path
from sigal import signals
def get_path():
return str(Path(__file__).resolve().parent)
def theme(gallery):
"""Set theme settings to this theme"""
gallery.settings['theme'] = get_path()
def register(settings):... |
3bb79d53e71d3d3b6d22a6958e39e102917e1161 | environment_tools/config.py | environment_tools/config.py | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/nail/etc/services'
def _read_data_json(filename):
path = os.path.join(DATA_DIRECTORY, filename)
with open(path) as f:
return json.load(f)
def _convert_mapping_to_graph(dict_mapping):
""" Converts the diction... | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/etc/yelp_location'
OVERRIDE_DATA_DIRECTORY = '/nail/etc/services'
# FIXME - we're moving from distributing location information
# via our configs system to via just baking the package
# into AMIs, but to do that w... | Support a different path to /nail/etc/services | Support a different path to /nail/etc/services
This will allow us to distribute location mapping info via an alternate mechanism to yelpsoa-configs,
as I want to use IP mapping information in preference to DNS to produce the habitat etc mapping
for a machine, and I don't want to make every machine depend on yelpsoa-co... | Python | apache-2.0 | Yelp/environment_tools | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/nail/etc/services'
def _read_data_json(filename):
path = os.path.join(DATA_DIRECTORY, filename)
with open(path) as f:
return json.load(f)
def _convert_mapping_to_graph(dict_mapping):
""" Converts the diction... | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/etc/yelp_location'
OVERRIDE_DATA_DIRECTORY = '/nail/etc/services'
# FIXME - we're moving from distributing location information
# via our configs system to via just baking the package
# into AMIs, but to do that w... | <commit_before># -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/nail/etc/services'
def _read_data_json(filename):
path = os.path.join(DATA_DIRECTORY, filename)
with open(path) as f:
return json.load(f)
def _convert_mapping_to_graph(dict_mapping):
""" Conve... | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/etc/yelp_location'
OVERRIDE_DATA_DIRECTORY = '/nail/etc/services'
# FIXME - we're moving from distributing location information
# via our configs system to via just baking the package
# into AMIs, but to do that w... | # -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/nail/etc/services'
def _read_data_json(filename):
path = os.path.join(DATA_DIRECTORY, filename)
with open(path) as f:
return json.load(f)
def _convert_mapping_to_graph(dict_mapping):
""" Converts the diction... | <commit_before># -*- coding: utf-8 -*-
import json
import os
import networkx as nx
DATA_DIRECTORY = '/nail/etc/services'
def _read_data_json(filename):
path = os.path.join(DATA_DIRECTORY, filename)
with open(path) as f:
return json.load(f)
def _convert_mapping_to_graph(dict_mapping):
""" Conve... |
57ca59e225119a031dee6b0c10a27c43a41f56ce | settings.py | settings.py | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | Add a zone port range. | Add a zone port range.
| Python | agpl-3.0 | cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | <commit_before># ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, eith... | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | # ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | <commit_before># ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, eith... |
402cf0192a7c90ced34acd7bdf1a93c487389a1f | python/setup.py | python/setup.py | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | Rename extension to .so so python can import | Rename extension to .so so python can import
| Python | apache-2.0 | scanner-research/storehouse,apoms/storehouse,scanner-research/storehouse,scanner-research/storehouse | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | <commit_before>from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR ... | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR = os.path.join(... | <commit_before>from setuptools import setup
import os
import shutil
from sys import platform
if platform == 'linux' or platform == 'linux2':
EXT = '.so'
else:
EXT = '.dylib'
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STOREHOUSE_DIR = '.'
BUILD_DIR = os.path.join(STOREHOUSE_DIR, 'build')
PIP_DIR ... |
a8a5fa7327e11964f130c8590994dd000c1f7e06 | qiime_studio/server.py | qiime_studio/server.py | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blueprint(v1, url_prefix='/api/0.0.1')
studio.debug = T... | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.cors import add_cors_headers
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blue... | Add CORS headers to main studio Flask application, to allow initial API version request | Add CORS headers to main studio Flask application, to allow initial API version request
Remove before_request from main application
| Python | bsd-3-clause | qiime2/qiime-studio,qiime2/qiime-studio,jakereps/qiime-studio,jakereps/qiime-studio-frontend,qiime2/qiime-studio-frontend,jakereps/qiime-studio,jakereps/qiime-studio,jakereps/qiime-studio-frontend,qiime2/qiime-studio-frontend,qiime2/qiime-studio | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blueprint(v1, url_prefix='/api/0.0.1')
studio.debug = T... | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.cors import add_cors_headers
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blue... | <commit_before>import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blueprint(v1, url_prefix='/api/0.0.1')
s... | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.cors import add_cors_headers
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blue... | import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blueprint(v1, url_prefix='/api/0.0.1')
studio.debug = T... | <commit_before>import webbrowser
from flask import Flask, jsonify
from gevent.pywsgi import WSGIServer
from qiime_studio.api.security import make_url
from qiime_studio.api.v1 import v1
from qiime_studio.static import static_files
studio = Flask('qiime_studio')
studio.register_blueprint(v1, url_prefix='/api/0.0.1')
s... |
2a6e7ffdfcaa916557da2e65ad23d3789d430dbd | doc/examples/plot_rag_draw.py | doc/examples/plot_rag_draw.py | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | Replace cubehelix with the viridis colormap in the RAG drawing example | Replace cubehelix with the viridis colormap in the RAG drawing example
| Python | bsd-3-clause | rjeli/scikit-image,paalge/scikit-image,oew1v07/scikit-image,ClinicalGraphics/scikit-image,WarrenWeckesser/scikits-image,vighneshbirodkar/scikit-image,emon10005/scikit-image,rjeli/scikit-image,Midafi/scikit-image,blink1073/scikit-image,rjeli/scikit-image,youprofit/scikit-image,jwiggins/scikit-image,ajaybhat/scikit-image... | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | <commit_before>"""
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplo... | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | """
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyp... | <commit_before>"""
======================================
Drawing Region Adjacency Graphs (RAGs)
======================================
This example constructs a Region Adjacency Graph (RAG) and draws it with
the `rag_draw` method.
"""
from skimage import data, segmentation
from skimage.future import graph
from matplo... |
7c33ff3ff94b933fe9e5c8b53fa08041ef8ee404 | runserver.py | runserver.py | from geomancer import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)
| from geomancer import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
except IndexError:
port = 5000
app.run(debug=True, port=port)
| Make it so we can choose port | Make it so we can choose port
| Python | mit | associatedpress/geomancer,associatedpress/geomancer,datamade/geomancer,associatedpress/geomancer,datamade/geomancer,datamade/geomancer | from geomancer import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)
Make it so we can choose port | from geomancer import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
except IndexError:
port = 5000
app.run(debug=True, port=port)
| <commit_before>from geomancer import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)
<commit_msg>Make it so we can choose port<commit_after> | from geomancer import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
except IndexError:
port = 5000
app.run(debug=True, port=port)
| from geomancer import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)
Make it so we can choose portfrom geomancer import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
except IndexError:
port = 5000
ap... | <commit_before>from geomancer import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)
<commit_msg>Make it so we can choose port<commit_after>from geomancer import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
exce... |
38bc8c8599d4165485ada8ca0b55dafd547385c4 | runserver.py | runserver.py | import sys
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
if __name__ == '__main__':
conf_file, options = parse_options()
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
| import sys
from optparse import OptionParser
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
def run_objgraph(types):
import objgraph
import os
import random
objgraph.show_most_common_types(limit=50, shortnames=False)
for type_ in types:
count = objgraph... | Allow to run objgraph before exiting | Allow to run objgraph before exiting
Use "--objgraph" to show most common types.
Add "--show-backrefs <some type>" do draw a graph of backreferences.
| Python | apache-2.0 | open-io/oio-swift,open-io/oio-swift | import sys
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
if __name__ == '__main__':
conf_file, options = parse_options()
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
Allow to run objgraph before exiting
Use "--objgraph" to show most common types.
Add "--show-b... | import sys
from optparse import OptionParser
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
def run_objgraph(types):
import objgraph
import os
import random
objgraph.show_most_common_types(limit=50, shortnames=False)
for type_ in types:
count = objgraph... | <commit_before>import sys
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
if __name__ == '__main__':
conf_file, options = parse_options()
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
<commit_msg>Allow to run objgraph before exiting
Use "--objgraph" to show most ... | import sys
from optparse import OptionParser
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
def run_objgraph(types):
import objgraph
import os
import random
objgraph.show_most_common_types(limit=50, shortnames=False)
for type_ in types:
count = objgraph... | import sys
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
if __name__ == '__main__':
conf_file, options = parse_options()
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
Allow to run objgraph before exiting
Use "--objgraph" to show most common types.
Add "--show-b... | <commit_before>import sys
from swift.common.utils import parse_options
from swift.common.wsgi import run_wsgi
if __name__ == '__main__':
conf_file, options = parse_options()
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
<commit_msg>Allow to run objgraph before exiting
Use "--objgraph" to show most ... |
2280d17fc2c6c144c1490617811b4665d5d41545 | tests/unit/test_context.py | tests/unit/test_context.py | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Use oslotest instead of common test module | Use oslotest instead of common test module
Module openstack.common.test is obsolete, so we should use
oslotest library instead of it.
Modified tests and common database code, new requirement added.
Change-Id: I853e548f11a4c3785eaf75124510a6d789536634
| Python | apache-2.0 | varunarya10/oslo.context,JioCloud/oslo.context,dims/oslo.context,citrix-openstack-build/oslo.context,openstack/oslo.context,yanheven/oslo.middleware | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | <commit_before># Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | <commit_before># Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
03f3ee254c2a1c4ebd91728263b66ff29e8b4f78 | defenses/torch/audio/input_tranformation/resampling.py | defenses/torch/audio/input_tranformation/resampling.py | import torchaudio
import librosa
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio
T = torchaudio.transforms
# Read audio file
audio_data = librosa.load(files, sr=16000)[0][-19456:]
audio_data = torch.tensor(audio_data).float().to(device)
# Di... | import torchaudio
import librosa
# There exist a limitation of this defense that it may lead to the problem of aliasing, and we can use the narrowband sample rate
# rather than downsampling followed by upsampling.
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation de... | Add limitation of this defence in the comment | Add limitation of this defence in the comment | Python | mit | cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans | import torchaudio
import librosa
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio
T = torchaudio.transforms
# Read audio file
audio_data = librosa.load(files, sr=16000)[0][-19456:]
audio_data = torch.tensor(audio_data).float().to(device)
# Di... | import torchaudio
import librosa
# There exist a limitation of this defense that it may lead to the problem of aliasing, and we can use the narrowband sample rate
# rather than downsampling followed by upsampling.
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation de... | <commit_before>import torchaudio
import librosa
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio
T = torchaudio.transforms
# Read audio file
audio_data = librosa.load(files, sr=16000)[0][-19456:]
audio_data = torch.tensor(audio_data).float().t... | import torchaudio
import librosa
# There exist a limitation of this defense that it may lead to the problem of aliasing, and we can use the narrowband sample rate
# rather than downsampling followed by upsampling.
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation de... | import torchaudio
import librosa
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio
T = torchaudio.transforms
# Read audio file
audio_data = librosa.load(files, sr=16000)[0][-19456:]
audio_data = torch.tensor(audio_data).float().to(device)
# Di... | <commit_before>import torchaudio
import librosa
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio
T = torchaudio.transforms
# Read audio file
audio_data = librosa.load(files, sr=16000)[0][-19456:]
audio_data = torch.tensor(audio_data).float().t... |
a93635977bbdbe8d0ebfbc054b068c7e5fae7e9c | runners/serializers.py | runners/serializers.py | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'path')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSer... | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'url')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSeri... | Fix url field for runner version serializer | Fix url field for runner version serializer
| Python | agpl-3.0 | lutris/website,lutris/website,Turupawn/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,Turupawn/website | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'path')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSer... | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'url')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSeri... | <commit_before>from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'path')
class RunnerSerializer(serializers.ModelSerializer):
versions = R... | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'url')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSeri... | from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'path')
class RunnerSerializer(serializers.ModelSerializer):
versions = RunnerVersionSer... | <commit_before>from rest_framework import serializers
from .models import Runner, RunnerVersion
class RunnerVersionSerializer(serializers.ModelSerializer):
class Meta(object):
model = RunnerVersion
fields = ('version', 'path')
class RunnerSerializer(serializers.ModelSerializer):
versions = R... |
1f3dc9aee3a73582c75ac14ef079f2cf970537e6 | service_config.py | service_config.py | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | Update configuration options for Flask-SQLAlchemy | Update configuration options for Flask-SQLAlchemy
| Python | apache-2.0 | pegasus-isi/pegasus-service,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus-service,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus-service,pegasus-isi/pegasus | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | <commit_before># This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by ... | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | # This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by Flask to encryp... | <commit_before># This is the config file for the pegasus service. Save a copy of it in
# one of the following locations:
#
# 1. $PWD/service_config.py
# 2. ~/.pegasus/service_config.py
# 3. /etc/pegasus/service_config.py
#
# The first file found is the one that will be used.
#
import os
# The secret key used by ... |
3929484162d4fde2b71100a1d0b6265f40499b59 | plugins/anime_planet.py | plugins/anime_planet.py | from motobot import command
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For channel rules, please go to http://bit.ly/1aRaMhh"
| from motobot import command
from requests import get
from bs4 import BeautifulSoup
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For... | Add search functions (currently disabled) | Add search functions (currently disabled)
| Python | mit | Motoko11/MotoBot | from motobot import command
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For channel rules, please go to http://bit.ly/1aRaMhh"
Add... | from motobot import command
from requests import get
from bs4 import BeautifulSoup
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For... | <commit_before>from motobot import command
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For channel rules, please go to http://bit.... | from motobot import command
from requests import get
from bs4 import BeautifulSoup
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For... | from motobot import command
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For channel rules, please go to http://bit.ly/1aRaMhh"
Add... | <commit_before>from motobot import command
@command('rr')
def rr_command(message, database):
return "If you are looking for anime/manga recommendations we have a database created specifically for that! Just visit www.anime-planet.com and let us do the hard work for you! For channel rules, please go to http://bit.... |
6ab6d1ddfd0a8a94956223014af634e4768f57bd | vdirsyncer/utils/compat.py | vdirsyncer/utils/compat.py | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote as urlquote, \
unquote as urlunquote
text_type = unicode # flake8: noqa
iteritems = lambda x: x.iteritems()
itervalues = lambda x: x.iterval... | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if sys.version_info < (3, 3) and sys.version_info[:2] != (2, 7):
raise RuntimeError(
'vdirsyncer only works on Python versions 2.7.x and 3.3+'
)
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote ... | Check Python version at runtime | Check Python version at runtime
| Python | mit | hobarrera/vdirsyncer,tribut/vdirsyncer,credativUK/vdirsyncer,untitaker/vdirsyncer,hobarrera/vdirsyncer,tribut/vdirsyncer,untitaker/vdirsyncer,credativUK/vdirsyncer,untitaker/vdirsyncer | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote as urlquote, \
unquote as urlunquote
text_type = unicode # flake8: noqa
iteritems = lambda x: x.iteritems()
itervalues = lambda x: x.iterval... | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if sys.version_info < (3, 3) and sys.version_info[:2] != (2, 7):
raise RuntimeError(
'vdirsyncer only works on Python versions 2.7.x and 3.3+'
)
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote ... | <commit_before># -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote as urlquote, \
unquote as urlunquote
text_type = unicode # flake8: noqa
iteritems = lambda x: x.iteritems()
itervalues = lamb... | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if sys.version_info < (3, 3) and sys.version_info[:2] != (2, 7):
raise RuntimeError(
'vdirsyncer only works on Python versions 2.7.x and 3.3+'
)
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote ... | # -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote as urlquote, \
unquote as urlunquote
text_type = unicode # flake8: noqa
iteritems = lambda x: x.iteritems()
itervalues = lambda x: x.iterval... | <commit_before># -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2: # pragma: no cover
import urlparse
from urllib import \
quote as urlquote, \
unquote as urlunquote
text_type = unicode # flake8: noqa
iteritems = lambda x: x.iteritems()
itervalues = lamb... |
ecbbc523ab3349a3f05403c06106b41562f9ca03 | fireplace/cards/game/all.py | fireplace/cards/game/all.py | # The Coin
class GAME_005:
def play(self):
self.controller.temp_mana += 1
| """
GAME set and other special cards
"""
from ..utils import *
# The Coin
class GAME_005:
play = ManaThisTurn(CONTROLLER, 1)
| Use ManaThisTurn action for The Coin | Use ManaThisTurn action for The Coin
| Python | agpl-3.0 | butozerca/fireplace,smallnamespace/fireplace,Meerkov/fireplace,amw2104/fireplace,Ragowit/fireplace,amw2104/fireplace,NightKev/fireplace,liujimj/fireplace,butozerca/fireplace,Meerkov/fireplace,smallnamespace/fireplace,jleclanche/fireplace,oftc-ftw/fireplace,beheh/fireplace,Ragowit/fireplace,liujimj/fireplace,oftc-ftw/fi... | # The Coin
class GAME_005:
def play(self):
self.controller.temp_mana += 1
Use ManaThisTurn action for The Coin | """
GAME set and other special cards
"""
from ..utils import *
# The Coin
class GAME_005:
play = ManaThisTurn(CONTROLLER, 1)
| <commit_before># The Coin
class GAME_005:
def play(self):
self.controller.temp_mana += 1
<commit_msg>Use ManaThisTurn action for The Coin<commit_after> | """
GAME set and other special cards
"""
from ..utils import *
# The Coin
class GAME_005:
play = ManaThisTurn(CONTROLLER, 1)
| # The Coin
class GAME_005:
def play(self):
self.controller.temp_mana += 1
Use ManaThisTurn action for The Coin"""
GAME set and other special cards
"""
from ..utils import *
# The Coin
class GAME_005:
play = ManaThisTurn(CONTROLLER, 1)
| <commit_before># The Coin
class GAME_005:
def play(self):
self.controller.temp_mana += 1
<commit_msg>Use ManaThisTurn action for The Coin<commit_after>"""
GAME set and other special cards
"""
from ..utils import *
# The Coin
class GAME_005:
play = ManaThisTurn(CONTROLLER, 1)
|
b40bec85439f8b45f338b848b118ee11aec52377 | examples/flask_alchemy/demoapp.py | examples/flask_alchemy/demoapp.py | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
userna... | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username =... | Adjust to Flask>=1.0 extension nanespace | examples: Adjust to Flask>=1.0 extension nanespace
Previous versions of Flask installed extensions under `flask.ext`; that
is no longer the case.
| Python | mit | FactoryBoy/factory_boy,rbarrois/factory_boy | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
userna... | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username =... | <commit_before># -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=T... | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username =... | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
userna... | <commit_before># -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=T... |
c22554f7979d07be881db5cb27c249581f99ce5a | nflpool/data/secret-config.py | nflpool/data/secret-config.py | from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
| from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
msf_a... | Add the MSF API key and password fields | Add the MSF API key and password fields
| Python | mit | prcutler/nflpool,prcutler/nflpool | from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
Add th... | from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
msf_a... | <commit_before>from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_... | from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
msf_a... | from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_url = ''
Add th... | <commit_before>from nflpool.data.dbsession import DbSessionFactory
# You will need an account from MySportsFeed to access their API. They offer free access to developers
# Edit below with your credentials and then save as secret.py
msf_username = 'YOURUSERNAME'
msf_pw = 'YOURPASSWORD'
su_email = ''
slack_webhook_... |
7e2c31d748b458b96b0d31c40868e538727862eb | Lib/hotshot/stones.py | Lib/hotshot/stones.py | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
logf = tempfile.NamedTemporaryFile()
logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
... | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
def main(logfile):
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
print "Pystone(%s) time for %d passes = %g" % \
(test.pystone.__version__, test.pystone.LOO... | Move testing code into "if __name__ == '__main__'" so it's not run on import. | Move testing code into "if __name__ == '__main__'" so it's not run on import.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
logf = tempfile.NamedTemporaryFile()
logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
... | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
def main(logfile):
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
print "Pystone(%s) time for %d passes = %g" % \
(test.pystone.__version__, test.pystone.LOO... | <commit_before>import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
logf = tempfile.NamedTemporaryFile()
logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pyston... | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
def main(logfile):
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
print "Pystone(%s) time for %d passes = %g" % \
(test.pystone.__version__, test.pystone.LOO... | import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
logf = tempfile.NamedTemporaryFile()
logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
... | <commit_before>import errno
import hotshot
import hotshot.stats
import os
import sys
import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
logf = tempfile.NamedTemporaryFile()
logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pyston... |
dc56d2634f05ec57ba594c5c70193d2b113c53e5 | Mathematics/Fundamentals/jim-and-the-jokes.py | Mathematics/Fundamentals/jim-and-the-jokes.py | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | Fix code to deal with large numbers | Fix code to deal with large numbers
| Python | mit | ugaliguy/HackerRank,ugaliguy/HackerRank,ugaliguy/HackerRank | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | <commit_before># Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
... | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | # Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
c *= m
r... | <commit_before># Python 2
# Enter your code here. Read input from STDIN. Print output to STDOUT
def base(m,d): # Converts d (base m) to its decimal equivalent
result = 0
c = 1
while(d > 0):
x = d%10
if(x >= m):
return -1
d /= 10
result += x*c
... |
c4e0bc68db9e0e897c51181e5dd23370a7a08734 | pypocketexplore/jobs.py | pypocketexplore/jobs.py | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format(topic)).json()... | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
resp = req.get('http://localhost:5000/api/topic/{}'.format(topic))\
d... | Handle topics with zero elements | Handle topics with zero elements
| Python | mit | Florents-Tselai/PyPocketExplore | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format(topic)).json()... | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
resp = req.get('http://localhost:5000/api/topic/{}'.format(topic))\
d... | <commit_before>from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format... | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
resp = req.get('http://localhost:5000/api/topic/{}'.format(topic))\
d... | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format(topic)).json()... | <commit_before>from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format... |
771c3bead487aa989dd19558bc2a4107abc29b6b | webapp/apps/staff/views.py | webapp/apps/staff/views.py | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | Add more msgs for staff/user/new view | Add more msgs for staff/user/new view
| Python | apache-2.0 | patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | <commit_before>from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def ... | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def users_new_view(... | <commit_before>from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
def admin_view(request):
return render(request, 'staff/base.jinja', {})
def ... |
3544f211913ba67f0bd7e433c23d2e5b22bba719 | lightcurve_pipeline/database/reset_database.py | lightcurve_pipeline/database/reset_database.py | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTINGS['db_connection_string'])
prompt +... | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from __future__ import print_function
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTING... | Change the print statement to use __future__. | Change the print statement to use __future__.
| Python | bsd-3-clause | justincely/lightcurve_pipeline | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTINGS['db_connection_string'])
prompt +... | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from __future__ import print_function
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTING... | <commit_before>#! /usr/bin/env python
"""
Reset all tables in the database.
"""
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTINGS['db_connection_string'... | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from __future__ import print_function
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTING... | #! /usr/bin/env python
"""
Reset all tables in the database.
"""
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTINGS['db_connection_string'])
prompt +... | <commit_before>#! /usr/bin/env python
"""
Reset all tables in the database.
"""
from lightcurve_pipeline.database.database_interface import base
from lightcurve_pipeline.utils.utils import SETTINGS
if __name__ == '__main__':
prompt = 'About to reset database instance {}. '.format(SETTINGS['db_connection_string'... |
62ebb94f09ea2dee3276041bd471502d57078650 | mcrouter/test/test_mcrouter_to_mcrouter_tko.py | mcrouter/test/test_mcrouter_to_mcrouter_tko.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(McrouterTestCas... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
import time
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(Mcr... | Fix flaky mcrouter tko tests | Fix flaky mcrouter tko tests
Summary: As above
Reviewed By: edenzik
Differential Revision: D25722019
fbshipit-source-id: 06ff9200e99f3580db25fef9ca5ab167c50b97ed
| Python | mit | facebook/mcrouter,facebook/mcrouter,facebook/mcrouter,facebook/mcrouter | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(McrouterTestCas... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
import time
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(Mcr... | <commit_before>#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
import time
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(Mcr... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(McrouterTestCas... | <commit_before>#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(... |
5fdd28a4707c8dcc9fe9ef3607742e6856725288 | examples/connect4/connect4.py | examples/connect4/connect4.py | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | Make Connect4's __str__ more readable | Make Connect4's __str__ more readable
| Python | mit | tysonzero/py-ann | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | <commit_before>class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
se... | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
self.turn = 1 - s... | <commit_before>class Connect4(object):
def __init__(self):
self.pieces = [[] for i in xrange(7)]
self.turn = 0
def move(self, column):
for i in xrange(column, column + 7):
if len(self.pieces[i % 7]) < 6:
self.pieces[i % 7].append(self.turn)
se... |
90ee1f19ad1b99c3960f5b4917d6801cd4d4d607 | paypal_registration/models.py | paypal_registration/models.py | from django.db import models
# Create your models here.
| from django.db import models
from registration.models import RegistrationProfile
class PaypalRegistrationProfile(RegistrationProfile):
paid = models.BooleanField(default=False)
| Make a bit more sensible model. | Make a bit more sensible model.
| Python | bsd-3-clause | buchuki/django-registration-paypal | from django.db import models
# Create your models here.
Make a bit more sensible model. | from django.db import models
from registration.models import RegistrationProfile
class PaypalRegistrationProfile(RegistrationProfile):
paid = models.BooleanField(default=False)
| <commit_before>from django.db import models
# Create your models here.
<commit_msg>Make a bit more sensible model.<commit_after> | from django.db import models
from registration.models import RegistrationProfile
class PaypalRegistrationProfile(RegistrationProfile):
paid = models.BooleanField(default=False)
| from django.db import models
# Create your models here.
Make a bit more sensible model.from django.db import models
from registration.models import RegistrationProfile
class PaypalRegistrationProfile(RegistrationProfile):
paid = models.BooleanField(default=False)
| <commit_before>from django.db import models
# Create your models here.
<commit_msg>Make a bit more sensible model.<commit_after>from django.db import models
from registration.models import RegistrationProfile
class PaypalRegistrationProfile(RegistrationProfile):
paid = models.BooleanField(default=False)
|
4c6c0561743c03ac70d82fc0e7af1a3a135b7c84 | test/test_pipeline/components/regression/test_liblinear_svr.py | test/test_pipeline/components/regression/test_liblinear_svr.py | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | FIX numerical issues in test on travis-ci | FIX numerical issues in test on travis-ci
| Python | bsd-3-clause | automl/auto-sklearn,automl/auto-sklearn | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | <commit_before>import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(1... | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(10):
... | <commit_before>import unittest
from autosklearn.pipeline.components.regression.liblinear_svr import \
LibLinear_SVR
from autosklearn.pipeline.util import _test_regressor
import sklearn.metrics
class SupportVectorComponentTest(unittest.TestCase):
def test_default_configuration(self):
for i in range(1... |
1dc7383a2f51c225f0138792eff6d35dc35dac8c | infinite_memcached/tests.py | infinite_memcached/tests.py | import time
from django.test import TestCase
from infinite_memcached.cache import MemcachedCache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = MemcachedCache(
server="127.0.0.1:11211",
params={},
)
self.assertEqual(0, mc._get_memcache_timeou... | import time
from django.test import TestCase
from django.core.cache import get_cache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = get_cache('infinite_memcached.cache.MemcachedCache',
LOCATION='127.0.0.1:11211')
self.assertEqual(0, mc._get_memcache_... | Load the backend with get_cache | Load the backend with get_cache
| Python | bsd-3-clause | edavis/django-infinite-memcached,edavis/django-infinite-memcached | import time
from django.test import TestCase
from infinite_memcached.cache import MemcachedCache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = MemcachedCache(
server="127.0.0.1:11211",
params={},
)
self.assertEqual(0, mc._get_memcache_timeou... | import time
from django.test import TestCase
from django.core.cache import get_cache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = get_cache('infinite_memcached.cache.MemcachedCache',
LOCATION='127.0.0.1:11211')
self.assertEqual(0, mc._get_memcache_... | <commit_before>import time
from django.test import TestCase
from infinite_memcached.cache import MemcachedCache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = MemcachedCache(
server="127.0.0.1:11211",
params={},
)
self.assertEqual(0, mc._get_... | import time
from django.test import TestCase
from django.core.cache import get_cache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = get_cache('infinite_memcached.cache.MemcachedCache',
LOCATION='127.0.0.1:11211')
self.assertEqual(0, mc._get_memcache_... | import time
from django.test import TestCase
from infinite_memcached.cache import MemcachedCache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = MemcachedCache(
server="127.0.0.1:11211",
params={},
)
self.assertEqual(0, mc._get_memcache_timeou... | <commit_before>import time
from django.test import TestCase
from infinite_memcached.cache import MemcachedCache
class InfiniteMemcached(TestCase):
def test_handle_timeouts(self):
mc = MemcachedCache(
server="127.0.0.1:11211",
params={},
)
self.assertEqual(0, mc._get_... |
86091dedfe1fc9ececb5c9e36a79866660525e90 | ckanext/ckanext-apicatalog_routes/ckanext/apicatalog_routes/tests/test_plugin.py | ckanext/ckanext-apicatalog_routes/ckanext/apicatalog_routes/tests/test_plugin.py | """Tests for plugin.py."""
def test_plugin():
pass
| """Tests for plugin.py."""
import pytest
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckan.plugins.toolkit import NotAuthorized
@pytest.mark.ckan_config('ckan.plugins', 'apicatalog_routes')
@pytest.mark.usefixtures('clean_db', 'with_plugins', 'with_request_context')
class Apicatalog_Rout... | Add test for deleting subsystem as normal user | Add test for deleting subsystem as normal user
| Python | mit | vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog | """Tests for plugin.py."""
def test_plugin():
pass
Add test for deleting subsystem as normal user | """Tests for plugin.py."""
import pytest
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckan.plugins.toolkit import NotAuthorized
@pytest.mark.ckan_config('ckan.plugins', 'apicatalog_routes')
@pytest.mark.usefixtures('clean_db', 'with_plugins', 'with_request_context')
class Apicatalog_Rout... | <commit_before>"""Tests for plugin.py."""
def test_plugin():
pass
<commit_msg>Add test for deleting subsystem as normal user<commit_after> | """Tests for plugin.py."""
import pytest
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckan.plugins.toolkit import NotAuthorized
@pytest.mark.ckan_config('ckan.plugins', 'apicatalog_routes')
@pytest.mark.usefixtures('clean_db', 'with_plugins', 'with_request_context')
class Apicatalog_Rout... | """Tests for plugin.py."""
def test_plugin():
pass
Add test for deleting subsystem as normal user"""Tests for plugin.py."""
import pytest
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckan.plugins.toolkit import NotAuthorized
@pytest.mark.ckan_config('ckan.plugins', 'apicatalog_rout... | <commit_before>"""Tests for plugin.py."""
def test_plugin():
pass
<commit_msg>Add test for deleting subsystem as normal user<commit_after>"""Tests for plugin.py."""
import pytest
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckan.plugins.toolkit import NotAuthorized
@pytest.mark.cka... |
d921858302f8bba715a7f4e63eaec68dfe04927a | app/grandchallenge/workstations/context_processors.py | app/grandchallenge/workstations/context_processors.py | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.exclude(status__in=[Session.Q... | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
try:
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.excl... | Handle no user at all | Handle no user at all
| Python | apache-2.0 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.exclude(status__in=[Session.Q... | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
try:
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.excl... | <commit_before>from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.exclude(status... | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
try:
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.excl... | from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.exclude(status__in=[Session.Q... | <commit_before>from grandchallenge.workstations.models import Session
def workstation_session(request):
""" Adds workstation_session. request.user must be set """
s = None
if not request.user.is_anonymous:
s = (
Session.objects.filter(creator=request.user)
.exclude(status... |
76dff207a128cb9230d8dceea24d0fb8e174ac3d | exporter/settings.py | exporter/settings.py | # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils')
| # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils', 'sjevents')
| Add sjevents to modules exported. | Add sjevents to modules exported.
| Python | lgpl-2.1 | SmartJog/webengine,SmartJog/webengine | # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils')
Add sjevents to modules exported. | # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils', 'sjevents')
| <commit_before># Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils')
<commit_msg>Add sjevents to modules exported.<commit_after> | # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils', 'sjevents')
| # Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils')
Add sjevents to modules exported.# Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MO... | <commit_before># Settings for Exporter module.
# Exportable modules.
# Modules must be a valid python module, in the import path.
EXPORT_MODULES = ('sjtools', 'sjfs', 'utils')
<commit_msg>Add sjevents to modules exported.<commit_after># Settings for Exporter module.
# Exportable modules.
# Modules must be a valid pyt... |
907169a645cd779de1a382dc09765a04c0217206 | dyngraph/exporter.py | dyngraph/exporter.py | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | Remove NA values from export. | Remove NA values from export.
| Python | isc | jaj42/GraPhysio,jaj42/dyngraph,jaj42/GraPhysio | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | <commit_before>from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = ... | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | <commit_before>from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = ... |
355205554a7b95ae81fe7fc04fa65c3a850b3c47 | Tools/ecl_ekf/batch_process_logdata_ekf.py | Tools/ecl_ekf/batch_process_logdata_ekf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | Use format to properly format file for process_logdata_parser.py | Use format to properly format file for process_logdata_parser.py
| Python | bsd-3-clause | acfloria/Firmware,mje-nz/PX4-Firmware,dagar/Firmware,dagar/Firmware,krbeverx/Firmware,mje-nz/PX4-Firmware,mje-nz/PX4-Firmware,PX4/Firmware,mcgill-robotics/Firmware,jlecoeur/Firmware,krbeverx/Firmware,dagar/Firmware,krbeverx/Firmware,Aerotenna/Firmware,Aerotenna/Firmware,dagar/Firmware,acfloria/Firmware,acfloria/Firmwar... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in the specified di... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
"""
Runs process_logdata_ekf.py on all the files in the suplied directory with a .ulg extension
"""
parser = argparse.ArgumentParser(description='Analyse the estimator_status and ekf2_innovation message data for all .ulg files in t... |
2a731fba72268c9a07d81c591be608f2292b06cb | byceps/blueprints/core_admin/views.py | byceps/blueprints/core_admin/views.py | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand.models import Brand
blueprint = create_blueprint('core_admin... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand import service as brand_service
blueprint = create_blueprint... | Move database query assembly and execution from view functions to services ('core_admin' blueprint) | Move database query assembly and execution from view functions to services ('core_admin' blueprint)
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand.models import Brand
blueprint = create_blueprint('core_admin... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand import service as brand_service
blueprint = create_blueprint... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand.models import Brand
blueprint = create_bluepr... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand import service as brand_service
blueprint = create_blueprint... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand.models import Brand
blueprint = create_blueprint('core_admin... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.blueprints.core_admin.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ...util.framework import create_blueprint
from ..brand.models import Brand
blueprint = create_bluepr... |
d882e6f707455113c133c843e40852acdf343e1a | dodo_commands/extra/git_commands/git-create-branch.py | dodo_commands/extra/git_commands/git-create-branch.py | # noqa
from dodo_commands.defaults.commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argum... | # noqa
from dodo_commands.default_commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argume... | Fix import path to default_commands | Fix import path to default_commands
| Python | mit | mnieber/dodo_commands | # noqa
from dodo_commands.defaults.commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argum... | # noqa
from dodo_commands.default_commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argume... | <commit_before># noqa
from dodo_commands.defaults.commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
p... | # noqa
from dodo_commands.default_commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argume... | # noqa
from dodo_commands.defaults.commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
parser.add_argum... | <commit_before># noqa
from dodo_commands.defaults.commands.standard_commands import DodoCommand
from dodo_commands import call_command
from plumbum import local
from plumbum.cmd import git
class Command(DodoCommand): # noqa
help = ""
decorators = []
def add_arguments_imp(self, parser): # noqa
p... |
c5ef250240cbaa894ee84615c5d07a383bd16962 | fluent_contents/plugins/oembeditem/content_plugins.py | fluent_contents/plugins/oembeditem/content_plugins.py | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
@plugin_pool.register
class O... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
import re
re_safe = re.compile... | Make sure the OEmbed type can never be used to control filenames. | Make sure the OEmbed type can never be used to control filenames.
Minor risk, as it's still a template path, but better be safe then sorry.
| Python | apache-2.0 | pombredanne/django-fluent-contents,edoburu/django-fluent-contents,jpotterm/django-fluent-contents,ixc/django-fluent-contents,pombredanne/django-fluent-contents,ixc/django-fluent-contents,jpotterm/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,pombredanne/django-fluent-content... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
@plugin_pool.register
class O... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
import re
re_safe = re.compile... | <commit_before>"""
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
@plugin_pool.r... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
import re
re_safe = re.compile... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
@plugin_pool.register
class O... | <commit_before>"""
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.forms import OEmbedItemForm
from fluent_contents.plugins.oembeditem.models import OEmbedItem
@plugin_pool.r... |
a78bc9909780e8621216b11855e23998a169e8af | test_core.py | test_core.py | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# . o . . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# o / + . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | Put both victory exit and defeat trap on a map | test: Put both victory exit and defeat trap on a map
| Python | mit | vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# . o . . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# o / + . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | <commit_before>#!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# . o . . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"... | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# o / + . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | #!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# . o . . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"
status = core... | <commit_before>#!/usr/bin/env python
from ookoobah import core
from ookoobah import utils
game = core.Game()
utils.populate_grid_from_string(game.grid, """
# # # # # #
# > . . \ #
# . # . . #
# . o . . #
# . \ . / #
# # # # # #
""")
game.start()
print "hit <enter> to render next; ^C to abort"... |
0a28636f2ddd1a088556adeca8767abde1bcc34d | src/webassets/__init__.py | src/webassets/__init__.py | __version__ = (0, 10, 1)
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
| __version__ = (0, 11, 'dev')
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
| Change version number to dev again. | Change version number to dev again.
| Python | bsd-2-clause | wijerasa/webassets,glorpen/webassets,john2x/webassets,heynemann/webassets,glorpen/webassets,aconrad/webassets,aconrad/webassets,florianjacob/webassets,heynemann/webassets,heynemann/webassets,glorpen/webassets,scorphus/webassets,JDeuce/webassets,scorphus/webassets,john2x/webassets,aconrad/webassets,JDeuce/webassets,flor... | __version__ = (0, 10, 1)
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
Change version number to dev again. | __version__ = (0, 11, 'dev')
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
| <commit_before>__version__ = (0, 10, 1)
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
<commit_msg>Change version number to dev again.<commit_after> | __version__ = (0, 11, 'dev')
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
| __version__ = (0, 10, 1)
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
Change version number to dev again.__version__ = (0, 11, 'dev')
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Envir... | <commit_before>__version__ = (0, 10, 1)
# Make a couple frequently used things available right here.
from .bundle import Bundle
from .env import Environment
<commit_msg>Change version number to dev again.<commit_after>__version__ = (0, 11, 'dev')
# Make a couple frequently used things available right here.
from .bu... |
1569da946dbe3010984b90f83382c31750551935 | testapp/settings.py | testapp/settings.py | # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
| # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
CQLENGINE_DEFAULT_KEYSPACE = 'flask_cqlengine'
| Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app | Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app | Python | apache-2.0 | chillinc/Flask-CQLEngine | # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app | # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
CQLENGINE_DEFAULT_KEYSPACE = 'flask_cqlengine'
| <commit_before># CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
<commit_msg>Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app<commit_after> | # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
CQLENGINE_DEFAULT_KEYSPACE = 'flask_cqlengine'
| # CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app# CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
CQLENGINE_DEFAULT_KEYSPACE = 'flask_cqlengine'
| <commit_before># CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
<commit_msg>Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app<commit_after># CQLENGINE settings
CQLENGINE_HOSTS= 'localhost:9160'
CQLENGINE_DEFAULT_KEYSPACE = 'flask_cqlengine'
|
dbe40d21d6f38cbb0827eeaaaaab425dd9b724ca | tasks/__init__.py | tasks/__init__.py | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | Add tasks to list of mq tasks | Add tasks to list of mq tasks
| Python | apache-2.0 | BishopFox/SpoofcheckSelfTest,BishopFox/SpoofcheckSelfTest,BishopFox/SpoofcheckSelfTest | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | <commit_before>from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celer... | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celery(
'selftes... | <commit_before>from celery import Celery
from tornado.options import options
from tasks.helpers import create_mq_url
queue_conf = {
'CELERY_TASK_SERIALIZER': 'json',
'CELERY_ACCEPT_CONTENT': ['json'],
'CELERY_RESULT_SERIALIZER': 'json',
'CELERY_TASK_RESULT_EXPIRES': 3600
}
selftest_task_queue = Celer... |
e38859cacd02553761593719db8420c4bb6c005f | srttools/core/__init__.py | srttools/core/__init__.py | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | Fix bug with comparison of lists and tuples | Fix bug with comparison of lists and tuples
| Python | bsd-3-clause | matteobachetti/srt-single-dish-tools | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | <commit_before>import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for... | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for i in sm.versio... | <commit_before>import warnings
DEFAULT_MPL_BACKEND = 'TkAgg'
try:
import matplotlib
# This is necessary. Random backends might respond incorrectly.
matplotlib.use(DEFAULT_MPL_BACKEND)
HAS_MPL = True
except ImportError:
HAS_MPL = False
try:
import statsmodels.api as sm
version = [int(i) for... |
bf21ad33327129047d5e1d30b908c7a386da6d77 | test_/models.py | test_/models.py | import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
| import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
my_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
| Change test to use a user model with name not id for pk | Change test to use a user model with name not id for pk
| Python | mit | feffe/django-selenium-login,feffe/django-selenium-login | import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Change test to use a user model with name not id for pk | import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
my_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
| <commit_before>import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
<commit_msg>Change test to use a user model with name not id for pk<commit_after> | import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
my_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
| import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Change test to use a user model with name not id for pkimport uuid
from django.db import models
from django.contrib.a... | <commit_before>import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
<commit_msg>Change test to use a user model with name not id for pk<commit_after>import uuid
from djan... |
8a0953345279c40e3b3cf63a748e8ca7b3ad0199 | test_urlconf.py | test_urlconf.py | from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
| Test urls - list of urls instead of patterns() | Test urls - list of urls instead of patterns()
| Python | isc | yprez/django-logentry-admin,yprez/django-logentry-admin | from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
Test urls - list of urls instead of patterns() | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
| <commit_before>from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
<commit_msg>Test urls - list of urls instead of patterns()<commit_after> | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
| from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
Test urls - list of urls instead of patterns()from django.conf.urls import url, include
from django.contrib import admin
urlpat... | <commit_before>from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
<commit_msg>Test urls - list of urls instead of patterns()<commit_after>from django.conf.urls import url, include
... |
7923baf30bcd41e17182599e46b4efd86f4eab49 | tests/conftest.py | tests/conftest.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | Stop making --integration an argument. | Stop making --integration an argument.
| Python | apache-2.0 | probcomp/cgpm,probcomp/cgpm | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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/LICEN... | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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/LICEN... |
0b74a76899d4ece2b3d7a8559fdc58c312231174 | tests/conftest.py | tests/conftest.py | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | Add docstring explaining the parametrization of data files | Add docstring explaining the parametrization of data files
| Python | mit | rmariano/compr,rmariano/compr | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | <commit_before>"""Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
... | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | """Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
for file_ in ... | <commit_before>"""Base for all tests with definitions of fixtures"""
import glob
import os
TEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), "data")
TEST_DATA_FILES = glob.glob(os.path.join(TEST_DATA_FILES_LOCATION, "*.txt"))
DATA_FILES_FIXTURE_NAME = "data_file"
def _load_files_contents(*files):
... |
4165ca1eb5ea43c198c86c4dcf2cfbfe4a6b1c6c | run_tests.py | run_tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | Make sure tests run on 'setup.py test' | Make sure tests run on 'setup.py test'
Nose was parsing the argv passed to setup.py (oh, global variables).
Assume that if 'distutils' are loaded then this is the case; and pass
through argv if it isn't. Also, update the suggested commands for the
extra requirements.
| Python | mit | tomo-otsuka/normalize,hearsaycorp/normalize,samv/normalize | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_tra... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_trace()'
works:
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a convenience nose wrapper, for use with 'coverage' and
'setup.py test'; run it using:
$ ./run_tests.py
You can also pass 'nose' arguments to this script, for instance to run
individual tests or to skip redirection of output so 'pdb.set_tra... |
0c21d60108d38f43d22aa03c882a62c93754d5da | tests/test_cli.py | tests/test_cli.py | from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOWN)
assert run((str(file_path),))... | from io import StringIO
import sys
from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOW... | Test read from stdin and write to stdout | Test read from stdin and write to stdout
| Python | mit | executablebooks/mdformat | from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOWN)
assert run((str(file_path),))... | from io import StringIO
import sys
from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOW... | <commit_before>from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOWN)
assert run((st... | from io import StringIO
import sys
from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOW... | from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOWN)
assert run((str(file_path),))... | <commit_before>from mdformat._cli import run
UNFORMATTED_MARKDOWN = "\n\n# A header\n\n"
FORMATTED_MARKDOWN = "# A header\n"
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
file_path = tmp_path / "test_markdown.md"
file_path.write_text(UNFORMATTED_MARKDOWN)
assert run((st... |
bb7e01988a50131c4f9649d9142b1770cb9263e5 | java/kotlin-extractor/kotlin_plugin_versions.py | java/kotlin-extractor/kotlin_plugin_versions.py | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Ex... | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.10' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Excep... | Change kotlin dependency version from 1.6.0-RC2 to 1.6.10 | Change kotlin dependency version from 1.6.0-RC2 to 1.6.10
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Ex... | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.10' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Excep... | <commit_before>import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
... | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.10' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Excep... | import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
raise Ex... | <commit_before>import re
import subprocess
many_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]
def get_single_version():
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True)
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
if m is None:
... |
30ea5b30746f12feb7b5915bce180ff4934ae204 | problem67.py | problem67.py |
import math
def blad():
ins = open( "triangles_18.txt", "r" )
arr = []
idx = 0
for line in ins:
try:
l = [int(x) for x in line.split()]
if ( l[idx] < l[idx+1] ):
idx += 1
except IndexError:
pass
arr.append(l[idx])
ins.close()
pr... | # Project Euler
# problems 18 and 67
def generic():
data = []
ins = open( "triangles.txt", "r" )
for i,line in enumerate(ins):
data.insert(0, [int(x) for x in line.split()] )
ins.close()
for n,d in enumerate(data):
if n == 0: pass
else:
data[n] = [ max(i+data[n-1][nn], i+data[n-1][nn+1]) ... | Add proper solution for projects 18 and 67 | Add proper solution for projects 18 and 67
| Python | mit | jakubczaplicki/projecteuler,jakubczaplicki/projecteuler |
import math
def blad():
ins = open( "triangles_18.txt", "r" )
arr = []
idx = 0
for line in ins:
try:
l = [int(x) for x in line.split()]
if ( l[idx] < l[idx+1] ):
idx += 1
except IndexError:
pass
arr.append(l[idx])
ins.close()
pr... | # Project Euler
# problems 18 and 67
def generic():
data = []
ins = open( "triangles.txt", "r" )
for i,line in enumerate(ins):
data.insert(0, [int(x) for x in line.split()] )
ins.close()
for n,d in enumerate(data):
if n == 0: pass
else:
data[n] = [ max(i+data[n-1][nn], i+data[n-1][nn+1]) ... | <commit_before>
import math
def blad():
ins = open( "triangles_18.txt", "r" )
arr = []
idx = 0
for line in ins:
try:
l = [int(x) for x in line.split()]
if ( l[idx] < l[idx+1] ):
idx += 1
except IndexError:
pass
arr.append(l[idx])
ins... | # Project Euler
# problems 18 and 67
def generic():
data = []
ins = open( "triangles.txt", "r" )
for i,line in enumerate(ins):
data.insert(0, [int(x) for x in line.split()] )
ins.close()
for n,d in enumerate(data):
if n == 0: pass
else:
data[n] = [ max(i+data[n-1][nn], i+data[n-1][nn+1]) ... |
import math
def blad():
ins = open( "triangles_18.txt", "r" )
arr = []
idx = 0
for line in ins:
try:
l = [int(x) for x in line.split()]
if ( l[idx] < l[idx+1] ):
idx += 1
except IndexError:
pass
arr.append(l[idx])
ins.close()
pr... | <commit_before>
import math
def blad():
ins = open( "triangles_18.txt", "r" )
arr = []
idx = 0
for line in ins:
try:
l = [int(x) for x in line.split()]
if ( l[idx] < l[idx+1] ):
idx += 1
except IndexError:
pass
arr.append(l[idx])
ins... |
64745f9dc3e31d55c5b73457b719484384ba0d76 | runserver.py | runserver.py | from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
| from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
| Set default port to 8000 | Set default port to 8000
| Python | mit | nvlbg/gepify,nvlbg/gepify | from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
Set default port to 8000 | from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
| <commit_before>from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
<commit_msg>Set default port to 8000<commit_after> | from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
| from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
Set default port to 8000from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
| <commit_before>from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
<commit_msg>Set default port to 8000<commit_after>from gepify import create_app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
|
20dbd80d0262869f3378597d7152dab7a6104de8 | routes/__init__.py | routes/__init__.py | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | Tweak for exporting the symbols | [svn] Tweak for exporting the symbols
--HG--
branch : trunk
| Python | mit | alex/routes,bbangert/routes,mikepk/routes,webknjaz/routes,mikepk/pybald-routes | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | <commit_before>import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__set... | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__setattr__(name, va... | <commit_before>import threadinglocal, sys
if sys.version < '2.4':
class _RequestConfig(object):
__shared_state = threadinglocal.local()
def __getattr__(self, name):
return self.__shared_state.__getattr__(name)
def __setattr__(self, name, value):
return self.__shared_state.__set... |
61ec5bdf739b0c7165c8aed85378e0b88c51e920 | twango/manager.py | twango/manager.py | from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_query_set(self):
return self.queryset_class(self.model, using=self._db)
| from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_queryset(self):
return self.queryset_class(self.model, using=self._db)
| Fix for deprecation warning in django 1.7rc2 | Fix for deprecation warning in django 1.7rc2
| Python | mit | Bonus05/djangotworm,gdoermann/twango | from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_query_set(self):
return self.queryset_class(self.model, using=self._db)
Fix for deprecation warning in django 1.7rc2 | from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_queryset(self):
return self.queryset_class(self.model, using=self._db)
| <commit_before>from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_query_set(self):
return self.queryset_class(self.model, using=self._db)
<commit_msg>Fix for deprecation warning in django 1.7rc2<commit_af... | from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_queryset(self):
return self.queryset_class(self.model, using=self._db)
| from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_query_set(self):
return self.queryset_class(self.model, using=self._db)
Fix for deprecation warning in django 1.7rc2from django.db import models
from twa... | <commit_before>from django.db import models
from twango.query import TwistedQuerySet
class TwistedManager(models.Manager):
queryset_class = TwistedQuerySet
def get_query_set(self):
return self.queryset_class(self.model, using=self._db)
<commit_msg>Fix for deprecation warning in django 1.7rc2<commit_af... |
1bb7ff80906058370839eb22ff2ebc67f11ad09e | django_auth_adfs/rest_framework.py | django_auth_adfs/rest_framework.py | import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthentication):
"""
ADFS access Token... | from __future__ import absolute_import
import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthen... | Make sure we don't have a import namespace clash with DRF | Make sure we don't have a import namespace clash with DRF
For python 2.7 you need to add from __future__ import absolute_import
| Python | bsd-2-clause | jobec/django-auth-adfs,jobec/django-auth-adfs | import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthentication):
"""
ADFS access Token... | from __future__ import absolute_import
import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthen... | <commit_before>import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthentication):
"""
AD... | from __future__ import absolute_import
import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthen... | import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthentication):
"""
ADFS access Token... | <commit_before>import logging
from django.contrib.auth import authenticate
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
logger = logging.getLogger(__name__)
class AdfsAccessTokenAuthentication(BaseAuthentication):
"""
AD... |
a67e45347f0119c4e1a3fb55b401a9acce939c7a | script/lib/util.py | script/lib/util.py | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
return ... | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
elif ta... | Fix output dir for arm target | Fix output dir for arm target
| Python | mit | atom/libchromiumcontent,eric-seekas/libchromiumcontent,paulcbetts/libchromiumcontent,adamjgray/libchromiumcontent,synaptek/libchromiumcontent,atom/libchromiumcontent,electron/libchromiumcontent,bbondy/libchromiumcontent,hokein/libchromiumcontent,adamjgray/libchromiumcontent,synaptek/libchromiumcontent,hokein/libchromiu... | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
return ... | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
elif ta... | <commit_before>#!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += ... | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
elif ta... | #!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += '_32'
return ... | <commit_before>#!/usr/bin/env python
import sys
def get_output_dir(target_arch, component):
# Build in "out_component" for component build.
output_dir = 'out'
if component == 'shared_library':
output_dir += '_component'
# Build in "out_32" for 32bit target.
if target_arch == 'ia32':
output_dir += ... |
d27723ed3c3006a5bd9567e992c6d37a9ca0d159 | run_tests.py | run_tests.py | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | Remove coverage on replay; development is suspended. | MNT: Remove coverage on replay; development is suspended.
| Python | bsd-3-clause | tacaswell/dataportal,danielballan/datamuxer,NSLS-II/dataportal,danielballan/dataportal,ericdill/databroker,NSLS-II/datamuxer,NSLS-II/dataportal,tacaswell/dataportal,ericdill/databroker,ericdill/datamuxer,danielballan/dataportal,danielballan/datamuxer,ericdill/datamuxer | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | <commit_before>#!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detaile... | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | #!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detailed description o... | <commit_before>#!/usr/bin/env python
# This file is closely based on tests.py from matplotlib
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by nosetests.
#
# See https://nose.readthedocs.org/ for a detaile... |
f31fcceede055a7c2955066d1c2086cd8246e4f7 | runserver.py | runserver.py | from mmmpaste import app
app.run(debug = True)
| import os
from mmmpaste import app
PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000
app.run(debug = True, port = PORT)
| Allow the port to overridden by and environment variable. | Allow the port to overridden by and environment variable.
| Python | bsd-2-clause | ryanc/mmmpaste,ryanc/mmmpaste | from mmmpaste import app
app.run(debug = True)
Allow the port to overridden by and environment variable. | import os
from mmmpaste import app
PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000
app.run(debug = True, port = PORT)
| <commit_before>from mmmpaste import app
app.run(debug = True)
<commit_msg>Allow the port to overridden by and environment variable.<commit_after> | import os
from mmmpaste import app
PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000
app.run(debug = True, port = PORT)
| from mmmpaste import app
app.run(debug = True)
Allow the port to overridden by and environment variable.import os
from mmmpaste import app
PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000
app.run(debug = True, port = PORT)
| <commit_before>from mmmpaste import app
app.run(debug = True)
<commit_msg>Allow the port to overridden by and environment variable.<commit_after>import os
from mmmpaste import app
PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000
app.run(debug = True, port = PORT)
|
9bb312c505c2749862372c0ff56ba47e087a9edc | searx/engines/semantic_scholar.py | searx/engines/semantic_scholar.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | Remove duplicated key from dict in Semantic Scholar | Remove duplicated key from dict in Semantic Scholar
| Python | agpl-3.0 | dalf/searx,dalf/searx,dalf/searx,dalf/searx | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | <commit_before># SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = ... | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = 'application/js... | <commit_before># SPDX-License-Identifier: AGPL-3.0-or-later
"""
Semantic Scholar (Science)
"""
from json import dumps, loads
search_url = 'https://www.semanticscholar.org/api/1/search'
def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['content-type'] = ... |
129081d873a4e812a32b126cd7738b72979a814f | softwareindex/handlers/coreapi.py | softwareindex/handlers/coreapi.py | import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"... | # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import reque... | Convert into a class to match the other handlers. | Convert into a class to match the other handlers.
| Python | bsd-3-clause | softwaresaved/softwareindex,softwaresaved/softwareindex | import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"... | # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import reque... | <commit_before>import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api... | # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import reque... | import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"... | <commit_before>import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api... |
1a0b0c8b5424c3cc1a944902281a6a02c75cc66c | voting-app/app.py | voting-app/app.py | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | Set redis socket timeout to 5s | Set redis socket timeout to 5s
| Python | apache-2.0 | TeamHeqing/voting-app,reshma-k/example-voting-app,sergey-korolev/demo-app,sergey-korolev/demo-app,sergey-korolev/demo-app,sergey-korolev/demo-app,TeamHeqing/voting-app,reshma-k/example-voting-app,reshma-k/example-voting-app,chrisdias/example-voting-app,reshma-k/example-voting-app,chrisdias/example-voting-app,reshma-k/e... | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | <commit_before>from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if ... | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | <commit_before>from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Cats")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if ... |
e3f846d99280ab24120f34d52308ab9040b5e31b | Gateway_v2/packet_tester.py | Gateway_v2/packet_tester.py | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | Change wait period from 30 seconds to 60 seconds | Change wait period from 30 seconds to 60 seconds
| Python | mit | scel-hawaii/data-gateway,scel-hawaii/data-gateway | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | <commit_before>from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(deco... | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(decoder.write_to_fi... | <commit_before>from xbee import ZigBee
import sys
import serial
import datetime
import struct
import collections
import threading
from decoder import Decoder
from xbee_gateway import XBeeGateway
decoder = Decoder()
xbg = XBeeGateway()
decoder.register_callback(decoder.print_dictionary)
decoder.register_callback(deco... |
98f0313e935db2491a615e868e3bd5da21769c03 | gocd/api/pipeline.py | gocd/api/pipeline.py | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | Add trigger as an alias for schedule | Add trigger as an alias for schedule
"Have you triggered that pipeline" is a fairly common thing to say.
| Python | mit | henriquegemignani/py-gocd,gaqzi/py-gocd | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | <commit_before>from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(o... | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(offset=offset or... | <commit_before>from gocd.api.endpoint import Endpoint
class Pipeline(Endpoint):
base_path = 'go/api/pipelines/{id}'
id = 'name'
def __init__(self, server, name):
self.server = server
self.name = name
def history(self, offset=0):
return self._get('/history/{offset:d}'.format(o... |
936302bf5db057a01644014aabc1357f925c6afa | mezzanine/accounts/models.py | mezzanine/accounts/models.py | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(user_model, instance, created, **kwargs):
... | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(**kwargs):
if kwargs["created"]:
... | Fix user profile signal handler. | Fix user profile signal handler.
| Python | bsd-2-clause | wbtuomela/mezzanine,Cicero-Zhao/mezzanine,gradel/mezzanine,christianwgd/mezzanine,eino-makitalo/mezzanine,frankier/mezzanine,jerivas/mezzanine,Cicero-Zhao/mezzanine,frankier/mezzanine,readevalprint/mezzanine,dsanders11/mezzanine,stephenmcd/mezzanine,frankier/mezzanine,eino-makitalo/mezzanine,ryneeverett/mezzanine,viare... | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(user_model, instance, created, **kwargs):
... | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(**kwargs):
if kwargs["created"]:
... | <commit_before>from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(user_model, instance, created,... | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(**kwargs):
if kwargs["created"]:
... | from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(user_model, instance, created, **kwargs):
... | <commit_before>from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings
__all__ = ()
if getattr(settings, "AUTH_PROFILE_MODULE", None):
def create_profile(user_model, instance, created,... |
148ebbb82f824a091ae439f49b543165878eeee4 | cloudly/cache.py | cloudly/cache.py | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | Fix missing auth handler when trying to access EC2. | Fix missing auth handler when trying to access EC2.
| Python | mit | ooda/cloudly,ooda/cloudly | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | <commit_before>import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST... | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST, else
... | <commit_before>import os
import redis as pyredis
from cloudly.aws import ec2
from cloudly.memoized import Memoized
import cloudly.logger as logger
log = logger.init(__name__)
@Memoized
def get_conn():
""" Get a connection to a Redis server. The priority is:
- look for an environment variable REDIS_HOST... |
54121f2b82950868db596d75e37e12f4c10c3339 | troposphere/ce.py | troposphere/ce.py | # Copyright (c) 2020, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class CostCategory(AWSObject):
resource_type = "AWS::CE::CostCategory"
props = {
'Name': (basestring, True),
'Rules': (basestring, True),
'RuleVersion... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject
from . import AWSProperty
from .validators import double
class AnomalyMonitor(AWS... | Update CE per 2021-03-11 changes | Update CE per 2021-03-11 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2020, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class CostCategory(AWSObject):
resource_type = "AWS::CE::CostCategory"
props = {
'Name': (basestring, True),
'Rules': (basestring, True),
'RuleVersion... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject
from . import AWSProperty
from .validators import double
class AnomalyMonitor(AWS... | <commit_before># Copyright (c) 2020, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class CostCategory(AWSObject):
resource_type = "AWS::CE::CostCategory"
props = {
'Name': (basestring, True),
'Rules': (basestring, True),
... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject
from . import AWSProperty
from .validators import double
class AnomalyMonitor(AWS... | # Copyright (c) 2020, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class CostCategory(AWSObject):
resource_type = "AWS::CE::CostCategory"
props = {
'Name': (basestring, True),
'Rules': (basestring, True),
'RuleVersion... | <commit_before># Copyright (c) 2020, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class CostCategory(AWSObject):
resource_type = "AWS::CE::CostCategory"
props = {
'Name': (basestring, True),
'Rules': (basestring, True),
... |
fedf54fba832fd073f1a984e48b4e76400018aa0 | mamba/application_factory.py | mamba/application_factory.py | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | Fix the enable coverage issue | Fix the enable coverage issue
| Python | mit | dex4er/mamba,alejandrodob/mamba,markng/mamba,eferro/mamba,angelsanz/mamba,nestorsalceda/mamba,jaimegildesagredo/mamba | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | <commit_before># -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settin... | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | # -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settings()
se... | <commit_before># -*- coding: utf-8 -*-
from mamba import settings, formatters, reporter, runners, example_collector
class ApplicationFactory(object):
def __init__(self, arguments):
self._instances = {}
self.arguments = arguments
def create_settings(self):
settings_ = settings.Settin... |
f5ac1fa0738384fada4abb979ba25dddecc56372 | compose/utils.py | compose/utils.py | import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True)
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
| import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True, separators=(',', ':'))
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
| Remove whitespace from json hash | Remove whitespace from json hash
Reasoning:
https://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitcomment-11243708
Signed-off-by: Ben Firshman <[email protected]>
| Python | apache-2.0 | alunduil/fig,danix800/docker.github.io,joaofnfernandes/docker.github.io,tiry/compose,mrfuxi/compose,mnowster/compose,talolard/compose,joaofnfernandes/docker.github.io,JimGalasyn/docker.github.io,bdwill/docker.github.io,jrabbit/compose,uvgroovy/compose,rgbkrk/compose,Chouser/compose,anweiss/docker.github.io,shin-/docker... | import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True)
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
Remove whitespace from json hash
Reasoning:
https://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitcomment-11243708
Signed-off-... | import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True, separators=(',', ':'))
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
| <commit_before>import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True)
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
<commit_msg>Remove whitespace from json hash
Reasoning:
https://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitco... | import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True, separators=(',', ':'))
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
| import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True)
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
Remove whitespace from json hash
Reasoning:
https://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitcomment-11243708
Signed-off-... | <commit_before>import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True)
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()
<commit_msg>Remove whitespace from json hash
Reasoning:
https://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitco... |
e78ce4d29fda36bcd946e6c54a745761596ee7f1 | spec/puzzle/examples/gph/a_basic_puzzle_spec.py | spec/puzzle/examples/gph/a_basic_puzzle_spec.py | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | Update test values. Trie no longer provides 2 of the answers. | Update test values. Trie no longer provides 2 of the answers.
| Python | mit | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | <commit_before>from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = ... | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | <commit_before>from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = ... |
03a3f15daf7c90f8146987f09491c69b899a0130 | corehq/apps/domainsync/management/commands/copy_utils.py | corehq/apps/domainsync/management/commands/copy_utils.py | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list of doc-ids from a remote postgres
databas... | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
from phonelog.models import DeviceReportEntry
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list... | Add phonelog to postgres models copied by copy_domain | Add phonelog to postgres models copied by copy_domain
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list of doc-ids from a remote postgres
databas... | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
from phonelog.models import DeviceReportEntry
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list... | <commit_before>from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list of doc-ids from a remote postg... | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
from phonelog.models import DeviceReportEntry
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list... | from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list of doc-ids from a remote postgres
databas... | <commit_before>from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping
from corehq.apps.products.models import SQLProduct
def copy_postgres_data_for_docs(remote_postgres_slug, doc_ids, simulate=False):
"""
Copies a set of data associated with a list of doc-ids from a remote postg... |
0c593f66c0b51903c38b76bf1163d716f59c56d8 | FreeMemory.py | FreeMemory.py | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | Fix to ensure we dont leave any open file handles laying around | Fix to ensure we dont leave any open file handles laying around
| Python | apache-2.0 | inbloom/server-density-plugins | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | <commit_before>/*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 re... | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | /*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 appli... | <commit_before>/*
* Copyright 2012-2014 inBloom, Inc. and its affiliates.
*
* 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 re... |
0e2d792cfe8d7afff08e08f5eaecdc126c369f54 | asyncio/compat.py | asyncio/compat.py | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | Use str type instead of bytes in Python 2 | Use str type instead of bytes in Python 2
| Python | apache-2.0 | overcastcloud/trollius,overcastcloud/trollius,overcastcloud/trollius | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | <commit_before>"""
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.ve... | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | """
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.version_info >= (... | <commit_before>"""
Compatibility constants and functions for the different Python versions.
"""
import sys
# Python 2.6 or older?
PY26 = (sys.version_info < (2, 7))
# Python 3.0 or newer?
PY3 = (sys.version_info >= (3,))
# Python 3.3 or newer?
PY33 = (sys.version_info >= (3, 3))
# Python 3.4 or newer?
PY34 = sys.ve... |
0e0b33a88ee050d7c02c0ba292d56478ba99e75d | stag/base.py | stag/base.py | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | Add __repr__ for elements for easier debugging | Add __repr__ for elements for easier debugging
| Python | mit | russiancow/stag | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | <commit_before>try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs ... | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... | <commit_before>try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs ... |
7a6e8af11ac28cf10e5ce33637bc883324dde641 | game/models.py | game/models.py | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | Add new fields to the task model | Add new fields to the task model
| Python | bsd-3-clause | stefantsov/blackbox3,stefantsov/blackbox3,stefantsov/blackbox3 | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | <commit_before>from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=25... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | <commit_before>from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=25... |
ddae9e02ab2bc9099fcb215ba5803210767f72a5 | common/lib/xmodule/xmodule/edxnotes_utils.py | common/lib/xmodule/xmodule/edxnotes_utils.py | """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "edxnotes" in sys.modules:
from edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
return cls
| """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "lms.djangoapps.edxnotes" in sys.modules:
from lms.djangoapps.edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
... | Use fully-qualified edxnotes app name when checking if installed | Use fully-qualified edxnotes app name when checking if installed
| Python | agpl-3.0 | angelapper/edx-platform,stvstnfrd/edx-platform,arbrandes/edx-platform,arbrandes/edx-platform,edx/edx-platform,eduNEXT/edunext-platform,EDUlib/edx-platform,EDUlib/edx-platform,angelapper/edx-platform,edx/edx-platform,eduNEXT/edx-platform,angelapper/edx-platform,EDUlib/edx-platform,edx/edx-platform,stvstnfrd/edx-platform... | """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "edxnotes" in sys.modules:
from edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
return cls
Use fully-qualif... | """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "lms.djangoapps.edxnotes" in sys.modules:
from lms.djangoapps.edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
... | <commit_before>"""
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "edxnotes" in sys.modules:
from edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
return cls
<... | """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "lms.djangoapps.edxnotes" in sys.modules:
from lms.djangoapps.edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
... | """
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "edxnotes" in sys.modules:
from edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
return cls
Use fully-qualif... | <commit_before>"""
Utilities related to edXNotes.
"""
import sys
def edxnotes(cls):
"""
Conditional decorator that loads edxnotes only when they exist.
"""
if "edxnotes" in sys.modules:
from edxnotes.decorators import edxnotes as notes
return notes(cls)
else:
return cls
<... |
61b2266cbd70eacf1382f3a6c46dd16485e4f7e7 | utils/exporter.py | utils/exporter.py | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs/'
def export(fig, module, dates):
graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename=graph_di... | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs'
def export(fig, module, dates):
graph_dir = '{}/{}'.format(_out_dir, module[:-3]) # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename='{}/{}'.format(... | Fix naming of output dir and file names | Fix naming of output dir and file names
| Python | mit | f-jiang/sleep-pattern-grapher | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs/'
def export(fig, module, dates):
graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename=graph_di... | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs'
def export(fig, module, dates):
graph_dir = '{}/{}'.format(_out_dir, module[:-3]) # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename='{}/{}'.format(... | <commit_before>import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs/'
def export(fig, module, dates):
graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, fi... | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs'
def export(fig, module, dates):
graph_dir = '{}/{}'.format(_out_dir, module[:-3]) # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename='{}/{}'.format(... | import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs/'
def export(fig, module, dates):
graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, filename=graph_di... | <commit_before>import plotly as py
from os import makedirs
from utils.names import output_file_name
_out_dir = 'graphs/'
def export(fig, module, dates):
graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names
makedirs(graph_dir, exist_ok=True)
py.offline.plot(fig, fi... |
9c7b617829a953c8e7a4b377f8da84f8de94c9bf | src/rgrep.py | src/rgrep.py | def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
else:
if case == 'i':
return pattern.lower() in text.lower()
else:
return pattern in text
| def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return display_usage()
else:
if case == 'i':
pattern = pattern.lower()
text = text.... | Refactor the case insensitive option | Refactor the case insensitive option
| Python | bsd-2-clause | ambidextrousTx/RGrep-Python | def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
else:
if case == 'i':
return pattern.lower() in text.lower()
else:
return pattern in text
Refactor the... | def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return display_usage()
else:
if case == 'i':
pattern = pattern.lower()
text = text.... | <commit_before>def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
else:
if case == 'i':
return pattern.lower() in text.lower()
else:
return pattern in te... | def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return display_usage()
else:
if case == 'i':
pattern = pattern.lower()
text = text.... | def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
else:
if case == 'i':
return pattern.lower() in text.lower()
else:
return pattern in text
Refactor the... | <commit_before>def rgrep(pattern='', text='', case=''):
if pattern == '' or text == '':
return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
else:
if case == 'i':
return pattern.lower() in text.lower()
else:
return pattern in te... |
894fb1d68e82679720ed0acb71d478a8a1ba525d | openchordcharts/views/api.py | openchordcharts/views/api.py | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
return [chart.to_json() for chart in model.Chart.find()]
| # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
title = request.GET.get('title')
user = request.GET.get('user')
spec = {}
if title:
spec['title'] = title
if u... | Add search by title and user for API. | Add search by title and user for API.
| Python | agpl-3.0 | openchordcharts/web-api,openchordcharts/openchordcharts-api | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
return [chart.to_json() for chart in model.Chart.find()]
Add search by title and user for API. | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
title = request.GET.get('title')
user = request.GET.get('user')
spec = {}
if title:
spec['title'] = title
if u... | <commit_before># -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
return [chart.to_json() for chart in model.Chart.find()]
<commit_msg>Add search by title and user for API.<commit_after... | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
title = request.GET.get('title')
user = request.GET.get('user')
spec = {}
if title:
spec['title'] = title
if u... | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
return [chart.to_json() for chart in model.Chart.find()]
Add search by title and user for API.# -*- coding: utf-8 -*-
from pyramid.vi... | <commit_before># -*- coding: utf-8 -*-
from pyramid.view import view_config
from openchordcharts import model
@view_config(route_name='charts.json', renderer='jsonp')
def charts_json(request):
return [chart.to_json() for chart in model.Chart.find()]
<commit_msg>Add search by title and user for API.<commit_after... |
2fabca2c3a358e5c744c85eeeefcc78be3537a57 | Demo/sockets/unixserver.py | Demo/sockets/unixserver.py | # Echo server program using Unix sockets (handles one connection only)
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not... | # Echo server demo using Unix sockets (handles one connection only)
# Piet van Oostrum
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(... | Add Piet van Oostrum's name to the comments. | Add Piet van Oostrum's name to the comments.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # Echo server program using Unix sockets (handles one connection only)
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not... | # Echo server demo using Unix sockets (handles one connection only)
# Piet van Oostrum
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(... | <commit_before># Echo server program using Unix sockets (handles one connection only)
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1... | # Echo server demo using Unix sockets (handles one connection only)
# Piet van Oostrum
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(... | # Echo server program using Unix sockets (handles one connection only)
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not... | <commit_before># Echo server program using Unix sockets (handles one connection only)
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.bind(FILE)
print 'Sock name is: ['+s.getsockname()+']'
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1... |
501ede985c034f4883ac93a38f8486af6fddf766 | src/nodeconductor_saltstack/saltstack/perms.py | src/nodeconductor_saltstack/saltstack/perms.py | from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole
PERMISSION_LOGICS = (
('saltstack.SaltStackService', FilteredCollaboratorsPermissionLogic(
collaborators_query='customer__roles__permission... | from nodeconductor.structure import perms as structure_perms
PERMISSION_LOGICS = (
('saltstack.SaltStackService', structure_perms.service_permission_logic),
('saltstack.SaltStackServiceProjectLink', structure_perms.service_project_link_permission_logic),
)
property_permission_logic = structure_perms.property... | Make permissions declaration DRY (NC-1282) | Make permissions declaration DRY (NC-1282)
| Python | mit | opennode/nodeconductor-saltstack | from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole
PERMISSION_LOGICS = (
('saltstack.SaltStackService', FilteredCollaboratorsPermissionLogic(
collaborators_query='customer__roles__permission... | from nodeconductor.structure import perms as structure_perms
PERMISSION_LOGICS = (
('saltstack.SaltStackService', structure_perms.service_permission_logic),
('saltstack.SaltStackServiceProjectLink', structure_perms.service_project_link_permission_logic),
)
property_permission_logic = structure_perms.property... | <commit_before>from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole
PERMISSION_LOGICS = (
('saltstack.SaltStackService', FilteredCollaboratorsPermissionLogic(
collaborators_query='customer__ro... | from nodeconductor.structure import perms as structure_perms
PERMISSION_LOGICS = (
('saltstack.SaltStackService', structure_perms.service_permission_logic),
('saltstack.SaltStackServiceProjectLink', structure_perms.service_project_link_permission_logic),
)
property_permission_logic = structure_perms.property... | from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole
PERMISSION_LOGICS = (
('saltstack.SaltStackService', FilteredCollaboratorsPermissionLogic(
collaborators_query='customer__roles__permission... | <commit_before>from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole
PERMISSION_LOGICS = (
('saltstack.SaltStackService', FilteredCollaboratorsPermissionLogic(
collaborators_query='customer__ro... |
792e498350615cdaef2d76d009f5e049583896e8 | papers/templatetags/orcid.py | papers/templatetags/orcid.py | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | Use https for links to ORCID | Use https for links to ORCID
| Python | agpl-3.0 | wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | <commit_before># -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True... | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | # -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def orcid_to_... | <commit_before># -*- encoding: utf-8 -*-
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True... |
86522eab0758ac6bf92ad19b60417b279c71a42c | tabtranslator/model.py | tabtranslator/model.py | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(Sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | FIX class name in camel case: | FIX class name in camel case:
| Python | mit | ograndedjogo/tab-translator,ograndedjogo/tab-translator | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(Sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | <commit_before># coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where ... | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(Sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | # coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are d... | <commit_before># coding: utf-8
class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where ... |
76e0279268f30b87dfbbd4358b3f462b7b89b0f1 | tabtranslator/model.py | tabtranslator/model.py | class sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | CLEAN class name with camel case | CLEAN class name with camel case
| Python | mit | ograndedjogo/tab-translator,ograndedjogo/tab-translator | class sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | <commit_before>class sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are dis... | class Sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class Bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | class sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are displayed on the s... | <commit_before>class sheet(object):
""" sheet: Top level object.
Models the entire music sheet """
def __init__(self, name):
super(sheet, self).__init__()
self.name = name
self.bars = list()
class bar(object):
""" bar: Models a measure.
Compose the sheet as the temporal layer
=> Where the notes are dis... |
7ad5e00abc9158951697e86242781567b82dd52c | oauth2_provider/generators.py | oauth2_provider/generators.py | from oauthlib.common import CLIENT_ID_CHARACTER_SET, generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
raise NotImplementedError(... | from oauthlib.common import generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
CLIENT_ID_CHARACTER_SET = r'_-.:;=?!@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.... | Change default generator for client_id and client_secret: now use a safe set of characters that don't need escaping. That way we should avoid problems with many dummy client implementations | Change default generator for client_id and client_secret: now use a safe set of characters that don't need escaping. That way we should avoid problems with many dummy client implementations
| Python | bsd-2-clause | cheif/django-oauth-toolkit,svetlyak40wt/django-oauth-toolkit,jensadne/django-oauth-toolkit,bleib1dj/django-oauth-toolkit,vmalavolta/django-oauth-toolkit,Knotis/django-oauth-toolkit,jensadne/django-oauth-toolkit,mjrulesamrat/django-oauth-toolkit,andrefsp/django-oauth-toolkit,DeskConnect/django-oauth-toolkit,CloudNcodeIn... | from oauthlib.common import CLIENT_ID_CHARACTER_SET, generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
raise NotImplementedError(... | from oauthlib.common import generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
CLIENT_ID_CHARACTER_SET = r'_-.:;=?!@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.... | <commit_before>from oauthlib.common import CLIENT_ID_CHARACTER_SET, generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
raise NotIm... | from oauthlib.common import generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
CLIENT_ID_CHARACTER_SET = r'_-.:;=?!@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.... | from oauthlib.common import CLIENT_ID_CHARACTER_SET, generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
raise NotImplementedError(... | <commit_before>from oauthlib.common import CLIENT_ID_CHARACTER_SET, generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator(object):
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
raise NotIm... |
b7238c0178eee43ccc6cfb3ac2039aad3bf0f2ce | relengapi/blueprints/slaveloan/tests/test_slaveloan.py | relengapi/blueprints/slaveloan/tests/test_slaveloan.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
test_context = TestContext()
@test_c... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
def userperms(perms, email='me@exampl... | Add a few tests that some endpoints load | Add a few tests that some endpoints load
| Python | mpl-2.0 | Callek/build-relengapi,andrei987/services,lundjordan/build-relengapi,djmitche/build-relengapi,Callek/build-relengapi,lundjordan/services,srfraser/services,garbas/mozilla-releng-services,Callek/build-relengapi,Callek/build-relengapi,mozilla/build-relengapi,djmitche/build-relengapi,andrei987/services,Callek/build-relenga... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
test_context = TestContext()
@test_c... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
def userperms(perms, email='me@exampl... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
test_context = TestCont... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
def userperms(perms, email='me@exampl... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
test_context = TestContext()
@test_c... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_
from relengapi.lib.testing.context import TestContext
test_context = TestCont... |
1fa6bcbd5ab5e51f9e4250024c848933ea0911e7 | examples/upsidedownternet.py | examples/upsidedownternet.py | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s2.getvalue()
| import cStringIO
from PIL import Image
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = ... | Update another reference to PIL. | Update another reference to PIL.
| Python | mit | dwfreed/mitmproxy,tdickers/mitmproxy,StevenVanAcker/mitmproxy,bazzinotti/mitmproxy,owers19856/mitmproxy,liorvh/mitmproxy,liorvh/mitmproxy,ryoqun/mitmproxy,guiquanz/mitmproxy,Endika/mitmproxy,dufferzafar/mitmproxy,dwfreed/mitmproxy,laurmurclar/mitmproxy,jvillacorta/mitmproxy,dufferzafar/mitmproxy,mosajjal/mitmproxy,dxq-... | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s2.getvalue()
Up... | import cStringIO
from PIL import Image
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = ... | <commit_before>import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s... | import cStringIO
from PIL import Image
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = ... | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s2.getvalue()
Up... | <commit_before>import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s... |
98bed3a2c410fc0a6fee491c35f3b49bf48c08db | arguments.py | arguments.py | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | Add argument for launching client | Add argument for launching client
Before, client would launch automatically on port you specify as a
positional argument.
This means you can't just not to launch the client.
Now, there are 2 options:
1) -c to launch client on the port defined in settings
2) --client to specify the port explicitly
So, if you wa... | Python | mit | Zloool/manyfaced-honeypot | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | <commit_before>import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
e... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | <commit_before>import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
e... |
1d0cd4bcc35042bf5146339a817a953e20229f30 | freezer_api/tests/freezer_api_tempest_plugin/clients.py | freezer_api/tests/freezer_api_tempest_plugin/clients.py | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | Fix failed tempest tests with KeystoneV2 | Fix failed tempest tests with KeystoneV2
Change-Id: I78e6a2363d006c6feec84db4d755974e6a6a81b4
Signed-off-by: Ruslan Aliev <[email protected]>
| Python | apache-2.0 | openstack/freezer-api,szaher/freezer-api,szaher/freezer-api,openstack/freezer-api,openstack/freezer-api,szaher/freezer-api,openstack/freezer-api,szaher/freezer-api | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | <commit_before># (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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
#
# U... | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ... | <commit_before># (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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
#
# U... |
7b3faffb655a3d4b44b52bd907b7e17f952a9f43 | src/pve_exporter/cli.py | src/pve_exporter/cli.py | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
if args is None:
args = sys.argv
if len(args) not in [1, 2, 3]:
print("Usage: pve_exporter [config_file] [po... | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from argparse import ArgumentParser
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
parser = ArgumentParser()
parser.add_argument('config', nargs='?', default='pve.yml',
... | Add argparse and provide usage/command line help | Add argparse and provide usage/command line help
| Python | apache-2.0 | znerol/prometheus-pve-exporter | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
if args is None:
args = sys.argv
if len(args) not in [1, 2, 3]:
print("Usage: pve_exporter [config_file] [po... | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from argparse import ArgumentParser
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
parser = ArgumentParser()
parser.add_argument('config', nargs='?', default='pve.yml',
... | <commit_before>"""
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
if args is None:
args = sys.argv
if len(args) not in [1, 2, 3]:
print("Usage: pve_exporter [c... | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from argparse import ArgumentParser
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
parser = ArgumentParser()
parser.add_argument('config', nargs='?', default='pve.yml',
... | """
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
if args is None:
args = sys.argv
if len(args) not in [1, 2, 3]:
print("Usage: pve_exporter [config_file] [po... | <commit_before>"""
Proxmox VE exporter for the Prometheus monitoring system.
"""
import sys
from pve_exporter.http import start_http_server
def main(args=None):
"""
Main entry point.
"""
if args is None:
args = sys.argv
if len(args) not in [1, 2, 3]:
print("Usage: pve_exporter [c... |
b8764c10f108393b7de1332f5061bb7a8b7def25 | future/disable_obsolete_builtins.py | future/disable_obsolete_builtins.py | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | Add reduce() and reload() to disabled builtins | Add reduce() and reload() to disabled builtins
| Python | mit | PythonCharmers/python-future,krischer/python-future,michaelpacer/python-future,PythonCharmers/python-future,michaelpacer/python-future,QuLogic/python-future,krischer/python-future,QuLogic/python-future | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | <commit_before>"""
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we jus... | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | """
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we just create new gl... | <commit_before>"""
This disables builtin functions (and one exception class) which are removed
from Python 3.3.
This module is designed to be used like this:
from future import disable_obsolete_builtins
We don't hack __builtin__, which is very fragile because it contaminates
imported modules too. Instead, we jus... |
7051e7bb98c1d1227d3beebc809498b963124a41 | pal/services/joke_service.py | pal/services/joke_service.py | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | Add Tom Hanks in a way that's actually reachable | Add Tom Hanks in a way that's actually reachable
| Python | bsd-3-clause | Machyne/pal,Machyne/pal,Machyne/pal,Machyne/pal | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | <commit_before>import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not inj... | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | <commit_before>import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not inj... |
aa3f4120bf3915fd99a8ef5affb620920aeed99b | aioredlock/lock.py | aioredlock/lock.py | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | Add release() method to Lock. | Add release() method to Lock.
| Python | mit | joanvila/aioredlock | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | <commit_before>import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await sel... | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.lock_manager.... | <commit_before>import attr
@attr.s
class Lock:
lock_manager = attr.ib()
resource = attr.ib()
id = attr.ib()
lock_timeout = attr.ib(default=10.0)
valid = attr.ib(default=False)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await sel... |
80cc986ebf16c59fa79c3c406e9060e49b93ad24 | test/test_getavgpdb.py | test/test_getavgpdb.py | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to getavgpdb"""
for arg... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
ALIGN_ALI = """
>P1;pdb1
structureX:asite_pdb1: 1 :A:+30 :A:::-1.00:-1.00
... | Add a simple test of getavgpdb. | Add a simple test of getavgpdb.
| Python | lgpl-2.1 | salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to getavgpdb"""
for arg... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
ALIGN_ALI = """
>P1;pdb1
structureX:asite_pdb1: 1 :A:+30 :A:::-1.00:-1.00
... | <commit_before>import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to getavgpdb"""
... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
ALIGN_ALI = """
>P1;pdb1
structureX:asite_pdb1: 1 :A:+30 :A:::-1.00:-1.00
... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to getavgpdb"""
for arg... | <commit_before>import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to getavgpdb"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.