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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e525db1171ccd75db737cea08c377c8c03400c24 | imdb_main.py | imdb_main.py |
from AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
session= register... |
from AllMovies_imdb import get_all_movies, add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
s... | Add omitted get_all_movies function in main. | Add omitted get_all_movies function in main.
| Python | apache-2.0 | softinus/IMDB_DataMiner,softinus/Movie_DataMiner,softinus/IMDB_DataMiner,softinus/Movie_DataMiner |
from AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
session= register... |
from AllMovies_imdb import get_all_movies, add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
s... | <commit_before>
from AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
se... |
from AllMovies_imdb import get_all_movies, add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
s... |
from AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
session= register... | <commit_before>
from AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, get_techinfo_of_movie, get_detail_of_movie, register_toServer, upload_data, init_page
#Here's the main
while True:
se... |
0981fee3834467fcde7f2231ff3b7d35371b9d09 | cms/__init__.py | cms/__init__.py | """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 7, 11)
| """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 8)
| Bump version number for release. | Bump version number for release.
| Python | bsd-3-clause | lewiscollard/cms,jamesfoley/cms,dan-gamble/cms,danielsamuels/cms,dan-gamble/cms,dan-gamble/cms,jamesfoley/cms,lewiscollard/cms,danielsamuels/cms,danielsamuels/cms,jamesfoley/cms,jamesfoley/cms,lewiscollard/cms | """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 7, 11)
Bump version number for release. | """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 8)
| <commit_before>"""
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 7, 11)
<commit_msg>Bump version number for release.<commit_after> | """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 8)
| """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 7, 11)
Bump version number for release."""
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave H... | <commit_before>"""
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
VERSION = (1, 7, 11)
<commit_msg>Bump version number for release.<commit_after>"""
A collection of Django extensions that add content-management facilities... |
67e0d2b943ef467cfef46f71195f205b1be15a0a | cms/__init__.py | cms/__init__.py | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.19'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.20'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | Bump version as instructed by bamboo. | Bump version as instructed by bamboo. | Python | bsd-3-clause | pbs/django-cms,pbs/django-cms,pbs/django-cms,pbs/django-cms | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.19'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.20'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | <commit_before># -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.19'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the... | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.20'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.19'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | <commit_before># -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.19'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the... |
3c534faee2f97dd8e2b5503fdbcac59737489f54 | backend/scripts/ddirdenorm.py | backend/scripts/ddirdenorm.py | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
if __name__ == "__main__":
selection = list(r.table('datadirs').run(conn))
for datadir in selection:
print "Updating datadir %s" % (datadir['name'])
ddir = {}
ddir['id'] = datadir['... | #!/usr/bin/env python
import rethinkdb as r
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-p", "--port", dest="port",
help="rethinkdb port", default=30815)
(options, args) = parser.parse_args()
conn = r.connect('localhost', int(op... | Add options for setting the port. | Add options for setting the port.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
if __name__ == "__main__":
selection = list(r.table('datadirs').run(conn))
for datadir in selection:
print "Updating datadir %s" % (datadir['name'])
ddir = {}
ddir['id'] = datadir['... | #!/usr/bin/env python
import rethinkdb as r
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-p", "--port", dest="port",
help="rethinkdb port", default=30815)
(options, args) = parser.parse_args()
conn = r.connect('localhost', int(op... | <commit_before>#!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
if __name__ == "__main__":
selection = list(r.table('datadirs').run(conn))
for datadir in selection:
print "Updating datadir %s" % (datadir['name'])
ddir = {}
ddir['i... | #!/usr/bin/env python
import rethinkdb as r
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-p", "--port", dest="port",
help="rethinkdb port", default=30815)
(options, args) = parser.parse_args()
conn = r.connect('localhost', int(op... | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
if __name__ == "__main__":
selection = list(r.table('datadirs').run(conn))
for datadir in selection:
print "Updating datadir %s" % (datadir['name'])
ddir = {}
ddir['id'] = datadir['... | <commit_before>#!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
if __name__ == "__main__":
selection = list(r.table('datadirs').run(conn))
for datadir in selection:
print "Updating datadir %s" % (datadir['name'])
ddir = {}
ddir['i... |
8139a3a49e4ee6d1fc8a2a71becbfd6d625b5c5f | apps/accounts/serializers.py | apps/accounts/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-detail')
class Meta:
model = User
fields =... | from apps.bluebottle_utils.serializers import SorlImageField
from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-de... | Add picture field member detail api. | Add picture field member detail api.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-detail')
class Meta:
model = User
fields =... | from apps.bluebottle_utils.serializers import SorlImageField
from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-de... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-detail')
class Meta:
model = User
... | from apps.bluebottle_utils.serializers import SorlImageField
from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-de... | from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-detail')
class Meta:
model = User
fields =... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.fields import HyperlinkedIdentityField
class MemberDetailSerializer(serializers.ModelSerializer):
url = HyperlinkedIdentityField(view_name='member-detail')
class Meta:
model = User
... |
88d938fc4050ef99180ff364f0a6d27d31ecc16c | lambdautils/metadata.py | lambdautils/metadata.py | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.8'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.9'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | Support for externally produced Kinesis partition keys | Support for externally produced Kinesis partition keys
| Python | mit | humilis/humilis-lambdautils | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.8'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.9'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | <commit_before># -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.8'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copy... | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.9'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | # -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.8'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copyright = '2016 '... | <commit_before># -*- coding: utf-8 -*-
"""Project metadata."""
package = "lambdautils"
project = "lambdautils"
version = '0.2.8'
description = "Simple utilities for AWS Lambda functions"
authors = ["Innovative Travel Ltd"]
authors_string = ', '.join(authors)
emails = ['german@innovativetravel.eu']
license = 'MIT'
copy... |
65b3a7fa7ae7ee467d3e8ef32b9a00b99b095c3e | humblemedia/processing_spooler.py | humblemedia/processing_spooler.py | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
att = Attachment.objects.get(id=resource_id)
... | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
try:
att = Attachment.objects.get(id=res... | Return ok if db object does not exist in spooler | Return ok if db object does not exist in spooler
| Python | mit | vladimiroff/humble-media,vladimiroff/humble-media | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
att = Attachment.objects.get(id=resource_id)
... | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
try:
att = Attachment.objects.get(id=res... | <commit_before>import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
att = Attachment.objects.get(id=r... | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
try:
att = Attachment.objects.get(id=res... | import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
att = Attachment.objects.get(id=resource_id)
... | <commit_before>import uwsgi
import django
django.setup()
from resources.processing import BaseProcessor
from resources.models import Attachment
def content_processing(env):
print (env)
resource_id = int(env.get(b"id"))
processor_name = env.get(b"processor").decode()
att = Attachment.objects.get(id=r... |
b58b270c707b57e9f6c245f1ebb31d68a247471c | mastering-python/ch05/Decorator.py | mastering-python/ch05/Decorator.py | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | Add class method decorator demo. | Add class method decorator demo.
| Python | apache-2.0 | precompiler/python-101 | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | <commit_before>import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wr... | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wrapper
def add... | <commit_before>import functools
def logParams(function):
@functools.wraps(function) # use this to prevent loss of function attributes
def wrapper(*args, **kwargs):
print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs))
return function(*args, **kwargs)
return wr... |
3f39c9d89da004556bcf53fa815f88a3092f600e | syft/frameworks/torch/tensors/native.py | syft/frameworks/torch/tensors/native.py | import random
from syft.frameworks.torch.tensors import PointerTensor
import syft
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = syft.local_worker
def ... | import random
from syft.frameworks.torch.tensors import PointerTensor
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = None
def create_pointer(
se... | Set local worker as default for SyftTensor owner | Undone: Set local worker as default for SyftTensor owner
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | import random
from syft.frameworks.torch.tensors import PointerTensor
import syft
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = syft.local_worker
def ... | import random
from syft.frameworks.torch.tensors import PointerTensor
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = None
def create_pointer(
se... | <commit_before>import random
from syft.frameworks.torch.tensors import PointerTensor
import syft
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = syft.local_w... | import random
from syft.frameworks.torch.tensors import PointerTensor
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = None
def create_pointer(
se... | import random
from syft.frameworks.torch.tensors import PointerTensor
import syft
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = syft.local_worker
def ... | <commit_before>import random
from syft.frameworks.torch.tensors import PointerTensor
import syft
class TorchTensor:
"""
This tensor is simply a more convenient way to add custom functions to
all Torch tensor types.
"""
def __init__(self):
self.id = None
self.owner = syft.local_w... |
ab0141d4ea11e20482bb1ae9d5642ed0e6fc3fac | saleor/product/utils.py | saleor/product/utils.py | from django.core.exceptions import ObjectDoesNotExist
def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
try:
choice = attribute.values.get(pk=value)
except Obj... | def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
choices = attribute.values.all()
if choices:
for choice in attribute.values.all():
if choic... | Reduce number of queries of getting attributes display | Reduce number of queries of getting attributes display
| Python | bsd-3-clause | UITools/saleor,laosunhust/saleor,avorio/saleor,tfroehlich82/saleor,Drekscott/Motlaesaleor,arth-co/saleor,car3oon/saleor,rchav/vinerack,itbabu/saleor,spartonia/saleor,arth-co/saleor,HyperManTT/ECommerceSaleor,car3oon/saleor,taedori81/saleor,Drekscott/Motlaesaleor,josesanch/saleor,maferelo/saleor,taedori81/saleor,HyperMa... | from django.core.exceptions import ObjectDoesNotExist
def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
try:
choice = attribute.values.get(pk=value)
except Obj... | def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
choices = attribute.values.all()
if choices:
for choice in attribute.values.all():
if choic... | <commit_before>from django.core.exceptions import ObjectDoesNotExist
def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
try:
choice = attribute.values.get(pk=value)
... | def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
choices = attribute.values.all()
if choices:
for choice in attribute.values.all():
if choic... | from django.core.exceptions import ObjectDoesNotExist
def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
try:
choice = attribute.values.get(pk=value)
except Obj... | <commit_before>from django.core.exceptions import ObjectDoesNotExist
def get_attributes_display(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
try:
choice = attribute.values.get(pk=value)
... |
4e438122b5715f6a8765f50173c1dca1e18c6f8f | tests/__init__.py | tests/__init__.py | from __future__ import unicode_literals
import gc
import platform
import cffi
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
two last arguments and writes the given ``string`` to ``buffer``.
"""
def func(*args):
... | from __future__ import unicode_literals
import gc
import platform
import cffi
# Import the module so that ffi.verify() is run before cffi.verifier is used
import spotify # noqa
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
... | Make specific test files runnable | tests: Make specific test files runnable
| Python | apache-2.0 | jodal/pyspotify,jodal/pyspotify,felix1m/pyspotify,mopidy/pyspotify,kotamat/pyspotify,mopidy/pyspotify,kotamat/pyspotify,felix1m/pyspotify,felix1m/pyspotify,kotamat/pyspotify,jodal/pyspotify | from __future__ import unicode_literals
import gc
import platform
import cffi
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
two last arguments and writes the given ``string`` to ``buffer``.
"""
def func(*args):
... | from __future__ import unicode_literals
import gc
import platform
import cffi
# Import the module so that ffi.verify() is run before cffi.verifier is used
import spotify # noqa
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
... | <commit_before>from __future__ import unicode_literals
import gc
import platform
import cffi
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
two last arguments and writes the given ``string`` to ``buffer``.
"""
def ... | from __future__ import unicode_literals
import gc
import platform
import cffi
# Import the module so that ffi.verify() is run before cffi.verifier is used
import spotify # noqa
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
... | from __future__ import unicode_literals
import gc
import platform
import cffi
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
two last arguments and writes the given ``string`` to ``buffer``.
"""
def func(*args):
... | <commit_before>from __future__ import unicode_literals
import gc
import platform
import cffi
cffi.verifier.cleanup_tmpdir()
def buffer_writer(string):
"""Creates a function that takes a ``buffer`` and ``buffer_size`` as the
two last arguments and writes the given ``string`` to ``buffer``.
"""
def ... |
9d53af13a1f65370414632cd5a8172248c334ce2 | tca/tca/settings/production.template.py | tca/tca/settings/production.template.py | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | Make DEBUG default to False in production settings | Make DEBUG default to False in production settings
It is dangerous to keep the template file for production settings
without explicitly specifying that DEBUG needs to be False.
| Python | bsd-3-clause | mlalic/TumCampusAppBackend,mlalic/TumCampusAppBackend | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | <commit_before>"""
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings... | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | """
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings/local_settings... | <commit_before>"""
A template for settings which should be used in production.
In order for the settings to be truly useful, they need to be
filled out with corresponding values.
Use the template to create a ``production.py`` file and then create
a symlink to it from a ``local_settings.py`` file, i.e.::
settings... |
5fbf410e0042c82e524b3b08276b2d628d00b3c6 | stickytape/prelude.py | stickytape/prelude.py | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | Undo accidental global leakage of sys | Undo accidental global leakage of sys
| Python | bsd-2-clause | mwilliamson/stickytape | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | <commit_before>#!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stic... | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporar... | <commit_before>#!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stic... |
a253eac5e4d7319a7a31dc33c90ce60fe77dfe60 | bin/commands/upstream.py | bin/commands/upstream.py | """Get the current upstream branch."""
import re
from subprocess import check_output
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_info = check_output(['git', 'status', '--porcelain', '--branch']).splitlines()[0]
regex = '^##\s[-_a-zA-Z0-9]+\.{3}([-_a-zA... | """Get the current upstream branch."""
import re
from subprocess import check_output, PIPE, Popen
_MERGE_CONFIG = 'git config --local branch.{}.merge'
_REMOTE_CONFIG = 'git config --local branch.{}.remote'
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_name =... | Refactor how remote info is retrieved | Refactor how remote info is retrieved
The old way of retrieving remote information was to parse `git status`.
This was brittle and lazy. Now the config values storing the remote
information are used.
| Python | mit | Brickstertwo/git-commands | """Get the current upstream branch."""
import re
from subprocess import check_output
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_info = check_output(['git', 'status', '--porcelain', '--branch']).splitlines()[0]
regex = '^##\s[-_a-zA-Z0-9]+\.{3}([-_a-zA... | """Get the current upstream branch."""
import re
from subprocess import check_output, PIPE, Popen
_MERGE_CONFIG = 'git config --local branch.{}.merge'
_REMOTE_CONFIG = 'git config --local branch.{}.remote'
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_name =... | <commit_before>"""Get the current upstream branch."""
import re
from subprocess import check_output
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_info = check_output(['git', 'status', '--porcelain', '--branch']).splitlines()[0]
regex = '^##\s[-_a-zA-Z0-9... | """Get the current upstream branch."""
import re
from subprocess import check_output, PIPE, Popen
_MERGE_CONFIG = 'git config --local branch.{}.merge'
_REMOTE_CONFIG = 'git config --local branch.{}.remote'
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_name =... | """Get the current upstream branch."""
import re
from subprocess import check_output
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_info = check_output(['git', 'status', '--porcelain', '--branch']).splitlines()[0]
regex = '^##\s[-_a-zA-Z0-9]+\.{3}([-_a-zA... | <commit_before>"""Get the current upstream branch."""
import re
from subprocess import check_output
def upstream(include_remote=False):
"""Get the upstream branch of the current branch."""
branch_info = check_output(['git', 'status', '--porcelain', '--branch']).splitlines()[0]
regex = '^##\s[-_a-zA-Z0-9... |
eba49ba765f0ff64d7415ad84116f7ea0781ad38 | tests/integration/integration/runner.py | tests/integration/integration/runner.py | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs="", cargs=""):
... | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=None, cargs=None)... | Make cargs and gargs truly optional | Make cargs and gargs truly optional
| Python | apache-2.0 | xii/xii,xii/xii | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs="", cargs=""):
... | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=None, cargs=None)... | <commit_before>import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=""... | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=None, cargs=None)... | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs="", cargs=""):
... | <commit_before>import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=""... |
88a04efd1a7aa56a69b76b127908a5eca0c817bd | test/services/tv_remote/test_service.py | test/services/tv_remote/test_service.py | from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
cls.service_manager = ServiceManager(None)
cls.serv... | import os
from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
os.environ["USE_FAKE_REDIS"] = "TRUE"
cl... | Use Fake redis for tests. | Use Fake redis for tests.
| Python | mit | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
cls.service_manager = ServiceManager(None)
cls.serv... | import os
from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
os.environ["USE_FAKE_REDIS"] = "TRUE"
cl... | <commit_before>from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
cls.service_manager = ServiceManager(None)
... | import os
from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
os.environ["USE_FAKE_REDIS"] = "TRUE"
cl... | from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
cls.service_manager = ServiceManager(None)
cls.serv... | <commit_before>from roku import Roku
from app.core.messaging import Receiver
from app.core.servicemanager import ServiceManager
from app.services.tv_remote.service import RokuScanner, RokuTV
class TestRokuScanner(object):
@classmethod
def setup_class(cls):
cls.service_manager = ServiceManager(None)
... |
c4e791ea6175fbefce0ef0671051936a27fc9684 | tests/vec_test.py | tests/vec_test.py | """Tests for vectors."""
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices_ref = (sympify... | """Tests for vectors."""
import pytest
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices... | Add tests for disabled sympification of vectors | Add tests for disabled sympification of vectors
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | """Tests for vectors."""
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices_ref = (sympify... | """Tests for vectors."""
import pytest
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices... | <commit_before>"""Tests for vectors."""
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices... | """Tests for vectors."""
import pytest
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices... | """Tests for vectors."""
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices_ref = (sympify... | <commit_before>"""Tests for vectors."""
from sympy import sympify
from drudge import Vec
def test_vecs_has_basic_properties():
"""Tests the basic properties of vector instances."""
base = Vec('v')
v_ab = Vec('v', indices=['a', 'b'])
v_ab_1 = base['a', 'b']
v_ab_2 = (base['a'])['b']
indices... |
2263ea4ec0322e09db92ae368aa219c4e34125d3 | src/foremast/__init__.py | src/foremast/__init__.py | """Tools for creating infrastructure and Spinnaker Applications."""
| """Tools for creating infrastructure and Spinnaker Applications."""
from . import (app, configs, dns, elb, iam, pipeline, s3, securitygroup, utils,
consts, destroyer, exceptions, runner)
| Bring modules into package level | fix: Bring modules into package level
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | """Tools for creating infrastructure and Spinnaker Applications."""
fix: Bring modules into package level | """Tools for creating infrastructure and Spinnaker Applications."""
from . import (app, configs, dns, elb, iam, pipeline, s3, securitygroup, utils,
consts, destroyer, exceptions, runner)
| <commit_before>"""Tools for creating infrastructure and Spinnaker Applications."""
<commit_msg>fix: Bring modules into package level<commit_after> | """Tools for creating infrastructure and Spinnaker Applications."""
from . import (app, configs, dns, elb, iam, pipeline, s3, securitygroup, utils,
consts, destroyer, exceptions, runner)
| """Tools for creating infrastructure and Spinnaker Applications."""
fix: Bring modules into package level"""Tools for creating infrastructure and Spinnaker Applications."""
from . import (app, configs, dns, elb, iam, pipeline, s3, securitygroup, utils,
consts, destroyer, exceptions, runner)
| <commit_before>"""Tools for creating infrastructure and Spinnaker Applications."""
<commit_msg>fix: Bring modules into package level<commit_after>"""Tools for creating infrastructure and Spinnaker Applications."""
from . import (app, configs, dns, elb, iam, pipeline, s3, securitygroup, utils,
consts, des... |
50e92d3394cfaf1035c6dc29563ce45437efb9c9 | wagtailstartproject/project_template/tests/test_settings.py | wagtailstartproject/project_template/tests/test_settings.py | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | Add comment to test settings to advice disabling search indexing | Add comment to test settings to advice disabling search indexing
| Python | mit | leukeleu/wagtail-startproject,leukeleu/wagtail-startproject | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | <commit_before>import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta ... | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta tag with the re... | <commit_before>import logging
from {{ project_name }}.settings import * # noqa
logging.disable(logging.CRITICAL)
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '{{ project_name }}',
'USER': 'postgres'
},
}
# Add middleware to add a meta ... |
d6c5f3f8ae7a830b49ebb87fdda4b0b1d0bbf916 | easy_thumbnails/migrations/__init__.py | easy_thumbnails/migrations/__init__.py | """
Django migrations for easy_thumbnails app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'easy_thu... | Raise error if migrations imported for old Django | Raise error if migrations imported for old Django
| Python | bsd-3-clause | siovene/easy-thumbnails,Mactory/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,jaddison/easy-thumbnails,SmileyChris/easy-thumbnails,sandow-digital/easy-thumbnails-cropman | Raise error if migrations imported for old Django | """
Django migrations for easy_thumbnails app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'easy_thu... | <commit_before><commit_msg>Raise error if migrations imported for old Django<commit_after> | """
Django migrations for easy_thumbnails app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'easy_thu... | Raise error if migrations imported for old Django"""
Django migrations for easy_thumbnails app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
... | <commit_before><commit_msg>Raise error if migrations imported for old Django<commit_after>"""
Django migrations for easy_thumbnails app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the S... | |
bbe7431736afeae575fb3430437d3a0000d4b653 | collectd_haproxy/__init__.py | collectd_haproxy/__init__.py | try:
import collectd
collectd.register_config
collectd_present = True
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:
HAProxyPlugin.register(collectd)
| try:
import collectd
collectd.register_config # pragma: no cover
collectd_present = True # pragma: no cover
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:... | Exclude init file from coverage reporting. | Exclude init file from coverage reporting.
| Python | mit | wglass/collectd-haproxy | try:
import collectd
collectd.register_config
collectd_present = True
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:
HAProxyPlugin.register(collectd)
Ex... | try:
import collectd
collectd.register_config # pragma: no cover
collectd_present = True # pragma: no cover
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:... | <commit_before>try:
import collectd
collectd.register_config
collectd_present = True
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:
HAProxyPlugin.regist... | try:
import collectd
collectd.register_config # pragma: no cover
collectd_present = True # pragma: no cover
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:... | try:
import collectd
collectd.register_config
collectd_present = True
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:
HAProxyPlugin.register(collectd)
Ex... | <commit_before>try:
import collectd
collectd.register_config
collectd_present = True
except (ImportError, AttributeError):
collectd_present = False
from .plugin import HAProxyPlugin
version_info = (1, 1, 1)
__version__ = ".".join(map(str, version_info))
if collectd_present:
HAProxyPlugin.regist... |
d5f782fc7a8c7835af0d4d2810a923d218dea938 | mplwidget.py | mplwidget.py | from PyQt4 import QtGui
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec as gri... | from PyQt4 import QtGui,QtCore
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec... | Expand figure when window is resized | Expand figure when window is resized
| Python | apache-2.0 | scholi/pyOmicron | from PyQt4 import QtGui
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec as gri... | from PyQt4 import QtGui,QtCore
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec... | <commit_before>from PyQt4 import QtGui
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.... | from PyQt4 import QtGui,QtCore
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec... | from PyQt4 import QtGui
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.gridspec as gri... | <commit_before>from PyQt4 import QtGui
import matplotlib as mpl
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
import matplotlib.... |
6510705d47a035279e1aa0cb6ce52f79935b2d10 | bin/monitor/check_participant_status.py | bin/monitor/check_participant_status.py | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | Add first trip details as well | Add first trip details as well
| Python | bsd-3-clause | e-mission/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | <commit_before>import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadat... | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "backgr... | <commit_before>import emission.core.get_database as edb
for ue in edb.get_uuid_db().find():
trip_count = edb.get_analysis_timeseries_db().count_documents({"user_id": ue["uuid"], "metadata.key": "analysis/confirmed_trip"})
location_count = edb.get_timeseries_db().count_documents({"user_id": ue["uuid"], "metadat... |
1dcbaeca1d487e2eb773580f66600389ffbb1e34 | test/integration/ggrc/converters/test_import_issues.py | test/integration/ggrc/converters/test_import_issues.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from integration.ggrc.models import factories
from integra... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from ggrc.converters import errors
from integration.ggrc.m... | Add tests for audit changes on issue import | Add tests for audit changes on issue import
| Python | apache-2.0 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from integration.ggrc.models import factories
from integra... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from ggrc.converters import errors
from integration.ggrc.m... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from integration.ggrc.models import factori... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from ggrc.converters import errors
from integration.ggrc.m... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from integration.ggrc.models import factories
from integra... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test Issue import and updates."""
from collections import OrderedDict
from ggrc import models
from integration.ggrc.models import factori... |
4ad8b1412be2da07e4713b54741aa22064ff33c5 | gen_settings.py | gen_settings.py | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | Revert "stop reading fonts/input plugins from environ as we now have a working mapnik-config.bat on windows" | Revert "stop reading fonts/input plugins from environ as we now have a working mapnik-config.bat on windows"
This reverts commit d87c71142ba7bcc0d99d84886f3534dea7617b0c.
| Python | bsd-3-clause | mojodna/node-mapnik,mapnik/node-mapnik,mapnik/node-mapnik,Uli1/node-mapnik,tomhughes/node-mapnik,stefanklug/node-mapnik,mapnik/node-mapnik,mojodna/node-mapnik,langateam/node-mapnik,Uli1/node-mapnik,stefanklug/node-mapnik,tomhughes/node-mapnik,stefanklug/node-mapnik,gravitystorm/node-mapnik,Uli1/node-mapnik,CartoDB/node... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | <commit_before>import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',in... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | <commit_before>import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',in... |
6bc5fe6c2ef7cc06436b81150639cf7039b9deeb | flocker/node/functional/test_script.py | flocker/node/functional/test_script.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from os import getuid
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
fr... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
from ... import __versio... | Address review comment: Remove another root check. | Address review comment: Remove another root check.
| Python | apache-2.0 | mbrukman/flocker,moypray/flocker,hackday-profilers/flocker,adamtheturtle/flocker,moypray/flocker,wallnerryan/flocker-profiles,adamtheturtle/flocker,moypray/flocker,wallnerryan/flocker-profiles,Azulinho/flocker,achanda/flocker,AndyHuu/flocker,hackday-profilers/flocker,AndyHuu/flocker,1d4Nf6/flocker,LaynePeng/flocker,Lay... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from os import getuid
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
fr... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
from ... import __versio... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from os import getuid
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest impo... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
from ... import __versio... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from os import getuid
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest import TestCase
fr... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for the ``flocker-changestate`` command line tool.
"""
from os import getuid
from subprocess import check_output
from unittest import skipUnless
from twisted.python.procutils import which
from twisted.trial.unittest impo... |
8aeaac1afa501ddc2a7b7992ceeb42a3f409bac0 | tests/test_default.py | tests/test_default.py | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | Fix failing test w/ incomplete regex | Fix failing test w/ incomplete regex
| Python | mit | elliotweiser/ansible-osx-command-line-tools,elliotweiser/ansible-osx-command-line-tools | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | <commit_before>import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert ... | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert f.is_directory
... | <commit_before>import re
def test_tmp_file_is_gone(host):
tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
f = host.file(tmpfile)
assert not f.exists
def test_command_line_tools_dir(host):
f = host.file('/Library/Developer/CommandLineTools')
assert f.exists
assert ... |
d8fa685640f674b6f22dacc45c5a9b0152115fce | paystackapi/tests/test_tcontrol.py | paystackapi/tests/test_tcontrol.py | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | Add test for transfer control disable otp | Add test for transfer control disable otp
| Python | mit | andela-sjames/paystack-python | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | <commit_before>import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
... | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | <commit_before>import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
... |
628e3cb67fefd32382614af6816d380d36c0b32f | froide/publicbody/migrations/0007_auto_20171224_0744.py | froide/publicbody/migrations/0007_auto_20171224_0744.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification, PublicBody # Use treebeard API
# Classification = apps.get_model('publicbody... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | Use historic PublicBody in data migration | Use historic PublicBody in data migration | Python | mit | stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification, PublicBody # Use treebeard API
# Classification = apps.get_model('publicbody... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification, PublicBody # Use treebeard API
# Classification = apps.get_mo... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification, PublicBody # Use treebeard API
# Classification = apps.get_model('publicbody... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification, PublicBody # Use treebeard API
# Classification = apps.get_mo... |
50d35de34bf6c2f90d0b8a4595c6d1459355d8fa | zakopane/__init__.py | zakopane/__init__.py | version = (0, 0, 1)
DEBUG = False
from zakopane.file import SumFile
| version = (0, 0, 1)
DEBUG = False
import os
from zakopane.file import SumFile, newSumFile
from zakopane.hash import readHashLine, doHashFile, formatHashLine
def main():
if "POSIX_ME_HARDER" in os.environ:
raise OSError("POSIXing you harder.")
return 0
| Expand package and module extents. | Expand package and module extents.
| Python | bsd-3-clause | j39m/zakopane | version = (0, 0, 1)
DEBUG = False
from zakopane.file import SumFile
Expand package and module extents. | version = (0, 0, 1)
DEBUG = False
import os
from zakopane.file import SumFile, newSumFile
from zakopane.hash import readHashLine, doHashFile, formatHashLine
def main():
if "POSIX_ME_HARDER" in os.environ:
raise OSError("POSIXing you harder.")
return 0
| <commit_before>version = (0, 0, 1)
DEBUG = False
from zakopane.file import SumFile
<commit_msg>Expand package and module extents.<commit_after> | version = (0, 0, 1)
DEBUG = False
import os
from zakopane.file import SumFile, newSumFile
from zakopane.hash import readHashLine, doHashFile, formatHashLine
def main():
if "POSIX_ME_HARDER" in os.environ:
raise OSError("POSIXing you harder.")
return 0
| version = (0, 0, 1)
DEBUG = False
from zakopane.file import SumFile
Expand package and module extents.version = (0, 0, 1)
DEBUG = False
import os
from zakopane.file import SumFile, newSumFile
from zakopane.hash import readHashLine, doHashFile, formatHashLine
def main():
if "POSIX_ME_HARDER" in os.environ:
... | <commit_before>version = (0, 0, 1)
DEBUG = False
from zakopane.file import SumFile
<commit_msg>Expand package and module extents.<commit_after>version = (0, 0, 1)
DEBUG = False
import os
from zakopane.file import SumFile, newSumFile
from zakopane.hash import readHashLine, doHashFile, formatHashLine
def main():
... |
37c0eea76d6aba1180f2a3eae90d7f38566bfc3f | packages/mono-master.py | packages/mono-master.py | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = ['git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + Package.profile.prefix,
'--w... | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + ... | Use MONO_REPOSITORY to set the repo URL | Use MONO_REPOSITORY to set the repo URL
| Python | mit | mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = ['git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + Package.profile.prefix,
'--w... | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + ... | <commit_before>import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = ['git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + Package.profile.p... | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + ... | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = ['git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + Package.profile.prefix,
'--w... | <commit_before>import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = ['git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--prefix=' + Package.profile.p... |
ab88748dcd5f48dce753655e0e0802a8b4d7d8b8 | pages/search_indexes.py | pages/search_indexes.py | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | Add a url attribute to the SearchIndex for pages. | Add a url attribute to the SearchIndex for pages.
This is useful when displaying a list of search results because we
can create a link to the result without having to hit the database
for every object in the result list.
| Python | bsd-3-clause | remik/django-page-cms,oliciv/django-page-cms,batiste/django-page-cms,pombredanne/django-page-cms-1,akaihola/django-page-cms,oliciv/django-page-cms,remik/django-page-cms,akaihola/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms,remik/django-page-cms,batiste/django-page-cms,oliciv/django-page-cms,pombr... | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | <commit_before>"""Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
titl... | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | """Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
title = CharField(m... | <commit_before>"""Django haystack `SearchIndex` module."""
from pages.models import Page
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
class PageIndex(SearchIndex):
"""Search index for pages content."""
text = CharField(document=True, use_template=True)
titl... |
bbbeca09a978d26fa2638c21802d9a27e1159b59 | massa/api.py | massa/api.py | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
return 'GET: measurement list'
class MeasurementItem(MethodView):
def get(self, id):
return 'GET: measurement item with ID %s' % id
bp = Blueprint('api',... | # -*- coding: utf-8 -*-
from flask import Blueprint, jsonify, g
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
service = g.sl('measurement_service')
return jsonify(items=service.find_all())
class MeasurementItem(MethodView):
def get(self, id):
s... | Replace dummy response with measurements. | Replace dummy response with measurements. | Python | mit | jaapverloop/massa | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
return 'GET: measurement list'
class MeasurementItem(MethodView):
def get(self, id):
return 'GET: measurement item with ID %s' % id
bp = Blueprint('api',... | # -*- coding: utf-8 -*-
from flask import Blueprint, jsonify, g
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
service = g.sl('measurement_service')
return jsonify(items=service.find_all())
class MeasurementItem(MethodView):
def get(self, id):
s... | <commit_before># -*- coding: utf-8 -*-
from flask import Blueprint
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
return 'GET: measurement list'
class MeasurementItem(MethodView):
def get(self, id):
return 'GET: measurement item with ID %s' % id
bp = B... | # -*- coding: utf-8 -*-
from flask import Blueprint, jsonify, g
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
service = g.sl('measurement_service')
return jsonify(items=service.find_all())
class MeasurementItem(MethodView):
def get(self, id):
s... | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
return 'GET: measurement list'
class MeasurementItem(MethodView):
def get(self, id):
return 'GET: measurement item with ID %s' % id
bp = Blueprint('api',... | <commit_before># -*- coding: utf-8 -*-
from flask import Blueprint
from flask.views import MethodView
class MeasurementList(MethodView):
def get(self):
return 'GET: measurement list'
class MeasurementItem(MethodView):
def get(self, id):
return 'GET: measurement item with ID %s' % id
bp = B... |
91c6c00a16252b2a43a1017ee17b7f6f0302e4be | controlbeast/__init__.py | controlbeast/__init__.py | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
def get_version(*args, **kwargs):
"""
Returns PEP 3... | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
DEFAULTS = {
'scm': 'Git'
}
def get_conf(key):
""... | Implement simple mechanism for configuration handling | Implement simple mechanism for configuration handling
| Python | isc | daemotron/controlbeast,daemotron/controlbeast | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
def get_version(*args, **kwargs):
"""
Returns PEP 3... | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
DEFAULTS = {
'scm': 'Git'
}
def get_conf(key):
""... | <commit_before># -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
def get_version(*args, **kwargs):
"""
... | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
DEFAULTS = {
'scm': 'Git'
}
def get_conf(key):
""... | # -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
def get_version(*args, **kwargs):
"""
Returns PEP 3... | <commit_before># -*- coding: utf-8 -*-
"""
controlbeast
~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
VERSION = (0, 1, 0, 'alpha', 0)
COPYRIGHT = ('2013', 'the ControlBeast team')
def get_version(*args, **kwargs):
"""
... |
6f28e097fb292493c8313854ecc468b491aa562a | getyourdata/getyourdata/dev_settings.py | getyourdata/getyourdata/dev_settings.py | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | Enable in-memory cache backend for development environment, but not tests | Enable in-memory cache backend for development environment, but not tests
| Python | mit | sakset/getyourdata,sakset/getyourdata,sakset/getyourdata,sakset/getyourdata | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | <commit_before>from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
... | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
}
}
CACHES... | <commit_before>from .settings import *
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'getyourdatadevdb',
'USER': 'getyourdatadevuser',
'PASSWORD': 'getyourdatadevpwd',
'HOST': 'localhost',
'PORT': '',
... |
dfe43823c32cf6181ef873095c6cecd13664079d | Algorithmia/errors.py | Algorithmia/errors.py | class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
| class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
class AlgorithmExcepti... | Add new Algorithm Exception class | Add new Algorithm Exception class
| Python | mit | algorithmiaio/algorithmia-python | class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
Add new Algorithm Exce... | class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
class AlgorithmExcepti... | <commit_before>class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
<commit... | class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
class AlgorithmExcepti... | class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
Add new Algorithm Exce... | <commit_before>class ApiError(Exception):
'''General error from the Algorithmia API'''
pass
class ApiInternalError(ApiError):
'''Error representing a server error, typically a 5xx status code'''
pass
class DataApiError(ApiError):
'''Error returned from the Algorithmia data API'''
pass
<commit... |
ec37dae820e49d816014c62f00711eaaeaf64597 | transaction_hooks/test/settings_pg.py | transaction_hooks/test/settings_pg.py | import os
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DATABASES['default'].update(
{
'USER': os.environ['DTC_PG_USERNAME'],
... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DA... | Enable postgresql CFFI compatability if available. | Enable postgresql CFFI compatability if available. | Python | bsd-3-clause | carljm/django-transaction-hooks | import os
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DATABASES['default'].update(
{
'USER': os.environ['DTC_PG_USERNAME'],
... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DA... | <commit_before>import os
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DATABASES['default'].update(
{
'USER': os.environ['DTC_PG_US... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DA... | import os
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DATABASES['default'].update(
{
'USER': os.environ['DTC_PG_USERNAME'],
... | <commit_before>import os
from .settings import * # noqa
DATABASES = {
'default': {
'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
'NAME': 'dtc',
},
}
if 'DTC_PG_USERNAME' in os.environ:
DATABASES['default'].update(
{
'USER': os.environ['DTC_PG_US... |
fa7a96559b1eea8ee7c7c6ec48b5d01e4b3f1b05 | bugle_project/configs/live/settings.py | bugle_project/configs/live/settings.py | from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
| from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
DATABASE_HOST = 'localhost'
| Connect to DB on localhost | Connect to DB on localhost
| Python | bsd-2-clause | devfort/bugle,devfort/bugle,devfort/bugle | from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
Connect to DB on localhost | from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
DATABASE_HOST = 'localhost'
| <commit_before>from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
<commit_msg>Connect to DB on localhost<commit_after> | from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
DATABASE_HOST = 'localhost'
| from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
Connect to DB on localhostfrom bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DA... | <commit_before>from bugle_project.configs.settings import *
FAYE_URL = 'http://bugle.fort:8001/faye'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
DATABASE_PASSWORD = 'bugle'
<commit_msg>Connect to DB on localhost<commit_after>from bugle_project.configs.settings import *
FAY... |
992950cb4e04fc8db8e55924bfe6ea9fdcac3450 | armstrong/apps/series/models.py | armstrong/apps/series/models.py | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | Add in missing default order | Add in missing default order
| Python | apache-2.0 | armstrong/armstrong.apps.series,armstrong/armstrong.apps.series | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | <commit_before>from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Mo... | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Model):
title... | <commit_before>from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
# TODO: Refactor this into a generic utils app to remove the wells dep
from armstrong.core.arm_wells.querysets import GenericForeignKeyQuerySet
class Series(models.Mo... |
12780b68aff0da1c123f3516fc6a020cfddb327d | pywikibot/families/wikidata_family.py | pywikibot/families/wikidata_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
'repo': 'wik... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo': ... | Use www.wikidata.org instead of wikidata.org Rewrite-followup to r11105 | Use www.wikidata.org instead of wikidata.org
Rewrite-followup to r11105
Patch #3605769 by Legoktm
Because of various issues [1], using wikidata.org may cause random problems.
Using www.wikidata.org will fix these.
[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=45005
git-svn-id: 9a050473c2aca1e14f53d73349e19b9... | Python | mit | legoktm/pywikipedia-rewrite | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
'repo': 'wik... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo': ... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo': ... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
'repo': 'wik... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
... |
7e054868d0df4e69c4b23cb1fb966505d559157f | calico_containers/tests/st/__init__.py | calico_containers/tests/st/__init__.py | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | Fix bug in file path. | Fix bug in file path.
Former-commit-id: a1e1f0661331f5bf8faa81210eae2cad0c2ad7b3 | Python | apache-2.0 | alexhersh/libcalico,tomdee/libcalico,TrimBiggs/libnetwork-plugin,plwhite/libcalico,L-MA/libcalico,TrimBiggs/libnetwork-plugin,Symmetric/libcalico,insequent/libcalico,TrimBiggs/libcalico,projectcalico/libnetwork-plugin,caseydavenport/libcalico,djosborne/libcalico,tomdee/libnetwork-plugin,robbrockbank/libcalico,projectca... | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | <commit_before>import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calic... | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calico_containers/ca... | <commit_before>import os
import sh
from sh import docker
def setup_package():
"""
Sets up docker images and host containers for running the STs.
"""
# Pull and save each image, so we can use them inside the host containers.
print sh.bash("./build_node.sh").stdout
docker.save("--output", "calic... |
c50d470492ed38aa05f147ad554c58877e5050ec | Execute/execute.py | Execute/execute.py | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | Check for duplicate instruction handlers | Check for duplicate instruction handlers
| Python | mit | tdpearson/armdecode | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | <commit_before>from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for c... | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for cls in [obj for ... | <commit_before>from importlib import import_module
_modules = ['branching', 'data_processing']
class Execute(object):
def __init__(self, registers, process_mode, memory):
self.instruction = {}
for module_name in _modules:
mod = import_module("Execute." + module_name)
for c... |
96968f9f2d38d45d3154fa3c95860091cc909dd9 | pylibchorus/__init__.py | pylibchorus/__init__.py | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | Store session cookies as a dictionary | Store session cookies as a dictionary
| Python | mit | kennyballou/pylibchorus | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | <commit_before>#!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api impo... | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | #!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api import update_workf... | <commit_before>#!/usr/bin/env python
'''PyLibChorus -- Python Chorus API Library'''
import logging
from pylibchorus.chorus_api import login
from pylibchorus.chorus_api import logout
from pylibchorus.chorus_api import check_login_status
from pylibchorus.chorus_api import create_workfile
from pylibchorus.chorus_api impo... |
9ac496491fccc1bd1ba55d3302608a0fe34957a1 | tests/test_population.py | tests/test_population.py | import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
con... | import os
from neat.population import Population
from neat.config import Config
from neat.statistics import get_average_fitness
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
... | Include statistics usage in existing tests. | Include statistics usage in existing tests.
| Python | bsd-3-clause | drallensmith/neat-python,machinebrains/neat-python,CodeReclaimers/neat-python | import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
con... | import os
from neat.population import Population
from neat.config import Config
from neat.statistics import get_average_fitness
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
... | <commit_before>import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__... | import os
from neat.population import Population
from neat.config import Config
from neat.statistics import get_average_fitness
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
... | import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
con... | <commit_before>import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__... |
9018093933e7f8d04ad5d7f753651e3c77c0cf12 | pushbullet.py | pushbullet.py | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | Fix Nano (m() stuff and add nick name | Fix Nano (m() stuff and add nick name
| Python | mit | sspssp/weechat-pushbullet | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | <commit_before>import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, mes... | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, message):
if(i... | <commit_before>import weechat
from yapbl import PushBullet
apikey = ""
p = PushBullet(apikey)
weechat.register("pushbullet", "kekskurse", "1.0", "GPL3", "Test
Skript", "", "")
weechat.prnt("", "Hallo, von einem python Skript!")
def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
ishilight, prefix, mes... |
572b9e2919b7c1107fafb0871cbc8b0e403eb187 | examples/keyassignedlistview.py | examples/keyassignedlistview.py | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda: print("Called Item {}".format(i)... | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda x=i: print("Called Item {}".forma... | Fix incorrectly captured value in closure in KeyAssignedListView example. | Fix incorrectly captured value in closure in KeyAssignedListView example.
| Python | mit | irskep/clubsandwich | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda: print("Called Item {}".format(i)... | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda x=i: print("Called Item {}".forma... | <commit_before>from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda: print("Called Ite... | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda x=i: print("Called Item {}".forma... | from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda: print("Called Item {}".format(i)... | <commit_before>from clubsandwich.director import DirectorLoop
from clubsandwich.ui import UIScene, WindowView, KeyAssignedListView, ButtonView
class BasicScene(UIScene):
def __init__(self):
button_generator = (ButtonView(
text="Item {}".format(i),
callback=lambda: print("Called Ite... |
5079ef52751288758596e1c9e0ffed119540a05e | framework/sentry/__init__.py | framework/sentry/__init__.py | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | Allow passing extra data to sentry | Allow passing extra data to sentry
| Python | apache-2.0 | TomBaxter/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,adlius/osf.io,caneruguz/osf.io,chrisseto/osf.io,TomBaxter/osf.io,TomBaxter/osf.io,crcresearch/osf.io,felliott/osf.io,icereval/osf.io,caneruguz/osf.io,sloria/osf.io,mfraezz/osf.io,binoculars/osf.io,brianjgeiger/osf.io,icereval/osf.io,felliott/osf.io,saradbowman/osf.io... | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debu... | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | #!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debug mode is on
# ... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
import logging
from raven.contrib.flask import Sentry
from framework.sessions import get_session
from website import settings
logger = logging.getLogger(__name__)
sentry = Sentry(dsn=settings.SENTRY_DSN)
# Nothing in this module should send to Sentry if debu... |
879ea9c4234a5d8435f213c6f9b082a86a794ecc | employees/serializers.py | employees/serializers.py | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk',
'username',
'email',
'first_name',
'last_name',
... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | Add 1 level depth and also categories fields to employee serializer | Add 1 level depth and also categories fields to employee serializer
| Python | apache-2.0 | belatrix/BackendAllStars | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk',
'username',
'email',
'first_name',
'last_name',
... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | <commit_before>from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk',
'username',
'email',
'first_name',
'last_na... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk',
'username',
'email',
'first_name',
'last_name',
... | <commit_before>from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk',
'username',
'email',
'first_name',
'last_na... |
b26bf17154e478ee02e0e2936d7623d71698e1f2 | subprocrunner/_which.py | subprocrunner/_which.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | Modify an error handling when a command not specified for Which | Modify an error handling when a command not specified for Which
| Python | mit | thombashi/subprocrunner,thombashi/subprocrunner | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
... | <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not... |
ae5a8bb000702ee4e0bbce863bc72d603ec6ca3d | polycircles/test/test_exceptions.py | polycircles/test/test_exceptions.py | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | Add nose tests to validate Exception raising. | Add nose tests to validate Exception raising.
| Python | mit | adamatan/polycircles | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | <commit_before>import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=... | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=30,
... | <commit_before>import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
@raises(ValueError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(latitude=30,
longitude=... |
1993a0adad94b0ed22557e2ee87326fc1eca0793 | cumulusci/robotframework/locators_50.py | cumulusci/robotframework/locators_50.py | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | Update all related list locators | Update all related list locators
| Python | bsd-3-clause | SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | <commit_before>from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
... | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
"field_value_... | <commit_before>from cumulusci.robotframework import locators_49
import copy
lex_locators = copy.deepcopy(locators_49.lex_locators)
lex_locators["object"][
"button"
] = "//div[contains(@class, 'slds-page-header')]//*[self::a[@title='{title}'] or self::button[@name='{title}']]"
lex_locators["record"]["header"][
... |
d292a81e95bd558f3902f88fa4d6d5641a4aa388 | tests/io/open_append.py | tests/io/open_append.py | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
# cleanup in case testfile exists
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile... | Make io test cleanup after itself by removing 'testfile'. | tests: Make io test cleanup after itself by removing 'testfile'.
| Python | mit | tobbad/micropython,ahotam/micropython,adafruit/circuitpython,mhoffma/micropython,noahchense/micropython,adamkh/micropython,vitiral/micropython,orionrobots/micropython,adafruit/circuitpython,pozetroninc/micropython,lowRISC/micropython,ernesto-g/micropython,SHA2017-badge/micropython-esp32,ChuckM/micropython,misterdanb/mi... | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
# cleanup in case testfile exists
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile... | <commit_before>import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
... | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
# cleanup in case testfile exists
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile... | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | <commit_before>import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
... |
eb9fa38f2c4c82a5674474f9a535bc8c35f8e38e | tests/test_bookmarks.py | tests/test_bookmarks.py | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
bookmarks.app.config['DATABASE_NAME'] = bookmarks.app.config['TEST_DATABASE_NAME']
bookmarks.app.testing = True
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
... | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
bookmarks.database.init_db()
def tearDown(self):
with bookmarks.app.app_context():
bookmarks.data... | Adjust test file to match new env config options | Adjust test file to match new env config options
| Python | apache-2.0 | byanofsky/bookmarks,byanofsky/bookmarks,byanofsky/bookmarks | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
bookmarks.app.config['DATABASE_NAME'] = bookmarks.app.config['TEST_DATABASE_NAME']
bookmarks.app.testing = True
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
... | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
bookmarks.database.init_db()
def tearDown(self):
with bookmarks.app.app_context():
bookmarks.data... | <commit_before>import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
bookmarks.app.config['DATABASE_NAME'] = bookmarks.app.config['TEST_DATABASE_NAME']
bookmarks.app.testing = True
self.app = bookmarks.app.test_client()
with bookmarks.app.app_co... | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
bookmarks.database.init_db()
def tearDown(self):
with bookmarks.app.app_context():
bookmarks.data... | import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
bookmarks.app.config['DATABASE_NAME'] = bookmarks.app.config['TEST_DATABASE_NAME']
bookmarks.app.testing = True
self.app = bookmarks.app.test_client()
with bookmarks.app.app_context():
... | <commit_before>import bookmarks
import unittest
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
bookmarks.app.config['DATABASE_NAME'] = bookmarks.app.config['TEST_DATABASE_NAME']
bookmarks.app.testing = True
self.app = bookmarks.app.test_client()
with bookmarks.app.app_co... |
45e0605a178c36a4075b59026952ef5a797e09aa | examples/pystray_icon.py | examples/pystray_icon.py | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
if sys.platform == 'darwin':
raise NotImplementedError('This example does not work on macOS.')
from threading import Thread
from queue import Queue
"""
This example demonstrates running pywebview alongside with pystray ... | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
import multiprocessing
if sys.platform == 'darwin':
ctx = multiprocessing.get_context('spawn')
Process = ctx.Process
Queue = ctx.Queue
else:
Process = multiprocessing.Process
Queue = multiprocessing.Queue
"""... | Improve example, start pystray in main thread and webview in new process | Improve example, start pystray in main thread and webview in new process
| Python | bsd-3-clause | r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
if sys.platform == 'darwin':
raise NotImplementedError('This example does not work on macOS.')
from threading import Thread
from queue import Queue
"""
This example demonstrates running pywebview alongside with pystray ... | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
import multiprocessing
if sys.platform == 'darwin':
ctx = multiprocessing.get_context('spawn')
Process = ctx.Process
Queue = ctx.Queue
else:
Process = multiprocessing.Process
Queue = multiprocessing.Queue
"""... | <commit_before>from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
if sys.platform == 'darwin':
raise NotImplementedError('This example does not work on macOS.')
from threading import Thread
from queue import Queue
"""
This example demonstrates running pywebview alongsid... | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
import multiprocessing
if sys.platform == 'darwin':
ctx = multiprocessing.get_context('spawn')
Process = ctx.Process
Queue = ctx.Queue
else:
Process = multiprocessing.Process
Queue = multiprocessing.Queue
"""... | from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
if sys.platform == 'darwin':
raise NotImplementedError('This example does not work on macOS.')
from threading import Thread
from queue import Queue
"""
This example demonstrates running pywebview alongside with pystray ... | <commit_before>from PIL import Image
from pystray import Icon, Menu, MenuItem
import webview
import sys
if sys.platform == 'darwin':
raise NotImplementedError('This example does not work on macOS.')
from threading import Thread
from queue import Queue
"""
This example demonstrates running pywebview alongsid... |
50cff5854983c0235630538ed0b4d909d9cc7890 | memegen/routes/latest.py | memegen/routes/latest.py | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | Set refresh rate to 10 seconds | Set refresh rate to 10 seconds | Python | mit | DanLindeman/memegen,DanLindeman/memegen,DanLindeman/memegen,DanLindeman/memegen | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | <commit_before>from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
... | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
return render... | <commit_before>from flask import Blueprint, render_template
from flask_api.decorators import set_renderers
from flask_api.renderers import HTMLRenderer
from ._common import route, get_tid
blueprint = Blueprint('latest', __name__, url_prefix="/latest")
@blueprint.route("")
@set_renderers(HTMLRenderer)
def get():
... |
5d4572f08c6e65a062fd2f00590f6eeb5e12ce38 | src/zeit/content/article/edit/browser/tests/test_template.py | src/zeit/content/article/edit/browser/tests/test_template.py | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | Update test, the article now starts with a default value for `template` (belongs to commit:95a001d) | ZON-3178: Update test, the article now starts with a default value for `template` (belongs to commit:95a001d)
| Python | bsd-3-clause | ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | <commit_before># coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id... | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | # coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id=options-templa... | <commit_before># coding: utf8
import zeit.content.article.edit.browser.testing
class ArticleTemplateTest(
zeit.content.article.edit.browser.testing.EditorTestCase):
def setUp(self):
super(ArticleTemplateTest, self).setUp()
self.add_article()
self.selenium.waitForElementPresent('id... |
7cc76c2716ce54882b7eced67f4435acd100cd83 | example/src/hello-world/hello-world.py | example/src/hello-world/hello-world.py | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Draw a diagonal blue line with thickness of 5 px
cv2... | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Change background color
img[:] = (49, 52, 49)
# Dra... | Add a nice background color | Add a nice background color
| Python | mit | Dovyski/cvui,Dovyski/cvui,Dovyski/cvui | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Draw a diagonal blue line with thickness of 5 px
cv2... | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Change background color
img[:] = (49, 52, 49)
# Dra... | <commit_before># Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Draw a diagonal blue line with thickn... | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Change background color
img[:] = (49, 52, 49)
# Dra... | # Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Draw a diagonal blue line with thickness of 5 px
cv2... | <commit_before># Include the directory where cvui is so we can load it
import sys
sys.path.append('../../../')
import numpy as np
import cv2
import cvui
cvui.random_number_generator(1, 2)
# Create a black image
img = np.zeros((512,512,3), np.uint8)
cv2.namedWindow('Window')
# Draw a diagonal blue line with thickn... |
3cf4ff417c36dfa6e858265b2a3daea24a1e00f6 | openfisca_country_template/entities.py | openfisca_country_template/entities.py | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
roles = [
{
'key': 'parent',
'plural': 'parent... | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
doc = '''
A group entity.
Contains multiple natural persons with speci... | Add documentation on every entity | Add documentation on every entity | Python | agpl-3.0 | openfisca/country-template,openfisca/country-template | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
roles = [
{
'key': 'parent',
'plural': 'parent... | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
doc = '''
A group entity.
Contains multiple natural persons with speci... | <commit_before># -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
roles = [
{
'key': 'parent',
'p... | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
doc = '''
A group entity.
Contains multiple natural persons with speci... | # -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
roles = [
{
'key': 'parent',
'plural': 'parent... | <commit_before># -*- coding: utf-8 -*-
# This file defines the entities needed by our legislation.
from openfisca_core.entities import build_entity
Household = build_entity(
key = "household",
plural = "households",
label = u'Household',
roles = [
{
'key': 'parent',
'p... |
a7af81244972ae6ac30bd55260af46b7ce25a6e1 | pre_commit_hooks/no_commit_to_branch.py | pre_commit_hooks/no_commit_to_branch.py | from __future__ import print_function
import argparse
import re
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=set()):
# type: (Set[str], Set[str... | from __future__ import print_function
import argparse
import re
from typing import FrozenSet
from typing import Optional
from typing import Sequence
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=frozenset()):
# type: (Froze... | Make optional argument use an immutable set for the default value in no-commit-to-branch. Make other sets immutable to satisfy type-checking and be consistent | Make optional argument use an immutable set for the default value
in no-commit-to-branch. Make other sets immutable to satisfy type-checking
and be consistent
| Python | mit | pre-commit/pre-commit-hooks | from __future__ import print_function
import argparse
import re
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=set()):
# type: (Set[str], Set[str... | from __future__ import print_function
import argparse
import re
from typing import FrozenSet
from typing import Optional
from typing import Sequence
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=frozenset()):
# type: (Froze... | <commit_before>from __future__ import print_function
import argparse
import re
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=set()):
# type: (Se... | from __future__ import print_function
import argparse
import re
from typing import FrozenSet
from typing import Optional
from typing import Sequence
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=frozenset()):
# type: (Froze... | from __future__ import print_function
import argparse
import re
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=set()):
# type: (Set[str], Set[str... | <commit_before>from __future__ import print_function
import argparse
import re
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(protected, patterns=set()):
# type: (Se... |
df24541dc5fff6098c3d3c0d920359c34910221c | tests/test_ratelimit.py | tests/test_ratelimit.py | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(e)
return []
def ru... | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
from disco.events import Status
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(... | Add rate-limit test case for internal messages. | Add rate-limit test case for internal messages.
| Python | bsd-3-clause | pavlobaron/disco_playground,simudream/disco,pombredanne/disco,pavlobaron/disco_playground,pooya/disco,simudream/disco,ktkt2009/disco,discoproject/disco,pombredanne/disco,simudream/disco,pavlobaron/disco_playground,beni55/disco,mwilliams3/disco,ErikDubbelboer/disco,oldmantaiter/disco,seabirdzh/disco,mozilla/disco,ErikDu... | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(e)
return []
def ru... | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
from disco.events import Status
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(... | <commit_before>from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(e)
return... | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
from disco.events import Status
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(... | from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(e)
return []
def ru... | <commit_before>from disco.test import DiscoJobTestFixture, DiscoTestCase
from disco.error import JobError
class RateLimitTestCase(DiscoJobTestFixture, DiscoTestCase):
inputs = [1]
def getdata(self, path):
return 'badger\n' * 1000
@staticmethod
def map(e, params):
msg(e)
return... |
0fa0d792bfc8ea22cd807b3b822edeb67a97943a | examples/connection.py | examples/connection.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Enable occ cloud region for example | Enable occ cloud region for example
Change-Id: I4f6fb7840b684e024ceca37bc5b7e2c858574665
| Python | apache-2.0 | dtroyer/python-openstacksdk,dudymas/python-openstacksdk,mtougeron/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,briancurtin/python-openstacksdk,mtougeron/python-openstacksdk,dudymas/python-openstacksdk,dtroyer/python-opens... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... |
f0c1c078e7edd76b418940f3cbddef405440b5d4 | GPflowOpt/_version.py | GPflowOpt/_version.py | # Copyright 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Exclude version file from test coverage | Exclude version file from test coverage
| Python | apache-2.0 | GPflow/GPflowOpt | # Copyright 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | <commit_before># Copyright 2017 Joachim van der Herten
#
# 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 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2017 Joachim van der Herten
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | <commit_before># Copyright 2017 Joachim van der Herten
#
# 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 ... |
d4b32d8f1beb16f9f7309d1cceb16b37e491bea3 | controllers/event_wizard_controller.py | controllers/event_wizard_controller.py | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | Fix event wizard cache keys | Fix event wizard cache keys
| Python | mit | fangeugene/the-blue-alliance,jaredhasenklein/the-blue-alliance,bdaroz/the-blue-alliance,bdaroz/the-blue-alliance,phil-lopreiato/the-blue-alliance,bdaroz/the-blue-alliance,the-blue-alliance/the-blue-alliance,jaredhasenklein/the-blue-alliance,the-blue-alliance/the-blue-alliance,the-blue-alliance/the-blue-alliance,jaredha... | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | <commit_before>import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, ... | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, **kw)
s... | <commit_before>import os
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
class EventWizardHandler(CacheableHandler):
CACHE_VERSION = 1
CACHE_KEY_FORMAT = "event_wizard"
def __init__(self, *args, **kw):
super(EventWizardHandler, self).__init__(*args, ... |
b4e29b5e63e4cd93d4244e7a52f772a40f9a7772 | testing/util.py | testing/util.py | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | Use newline='' to avoid automatic newline translation | Use newline='' to avoid automatic newline translation
| Python | mit | pre-commit/pre-commit-hooks,Harwood/pre-commit-hooks,Coverfox/pre-commit-hooks | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
... | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import io
import os.path
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@contextlib.contextmanager
def cwd(path):
pwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
... |
27fde5a910c5274e6f56bbb0b46dbb375822296d | server/lib/python/cartodb_services/cartodb_services/google/client_factory.py | server/lib/python/cartodb_services/cartodb_services/google/client_factory.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
client = cls.clients.get(client_id)
if not client:
... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
cache_key = "{}:{}".format(client_id, client_secret)
client = ... | Use "{id}:{secret}" as caching key | Use "{id}:{secret}" as caching key
| Python | bsd-3-clause | CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/dataservices-api | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
client = cls.clients.get(client_id)
if not client:
... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
cache_key = "{}:{}".format(client_id, client_secret)
client = ... | <commit_before>#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
client = cls.clients.get(client_id)
if not clie... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
cache_key = "{}:{}".format(client_id, client_secret)
client = ... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
client = cls.clients.get(client_id)
if not client:
... | <commit_before>#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import googlemaps
import base64
from exceptions import InvalidGoogleCredentials
class GoogleMapsClientFactory():
clients = {}
@classmethod
def get(cls, client_id, client_secret):
client = cls.clients.get(client_id)
if not clie... |
c057f4865052c893af9abcae2c2f37ec02d56118 | example_test_set/tests/test_set_root.py | example_test_set/tests/test_set_root.py | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | Tweak some example fixture ids | Tweak some example fixture ids
| Python | mit | tgoodlet/pytest-interactive | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | <commit_before># test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
... | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | # test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
self._mode = v... | <commit_before># test set for plugin testing
# from IPython import embed
import pytest
class Dut(object):
'fake a device under test'
_allowed = ('a', 'b', 'c')
def __init__(self, mode=None):
self._mode = mode
def get_mode(self):
return self._mode
def set_mode(self, val):
... |
d05db8b8074503d927847272f53b32edc42fe043 | geotrek/trekking/apps.py | geotrek/trekking/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
| from django.apps import AppConfig
from django.core.checks import register, Tags
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
def ready(self):
from .forms import TrekForm
def check_hidden_fie... | Add system checks for Trek form | Add system checks for Trek form
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
Add system checks for Trek form | from django.apps import AppConfig
from django.core.checks import register, Tags
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
def ready(self):
from .forms import TrekForm
def check_hidden_fie... | <commit_before>from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
<commit_msg>Add system checks for Trek form<commit_after> | from django.apps import AppConfig
from django.core.checks import register, Tags
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
def ready(self):
from .forms import TrekForm
def check_hidden_fie... | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
Add system checks for Trek formfrom django.apps import AppConfig
from django.core.checks import register, Tags
from django.utils.tran... | <commit_before>from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TrekkingConfig(AppConfig):
name = 'geotrek.trekking'
verbose_name = _("Trekking")
<commit_msg>Add system checks for Trek form<commit_after>from django.apps import AppConfig
from django.core.checks imp... |
8402244112dfbd45f6d05ba5f89c7311a019fbe7 | web/portal/views/home.py | web/portal/views/home.py | from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index'))
| from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index', _external=True))
| Fix incorrect protocol being using when behin reverse proxy | Fix incorrect protocol being using when behin reverse proxy
| Python | mit | LCBRU/genvasc_portal,LCBRU/genvasc_portal,LCBRU/genvasc_portal,LCBRU/genvasc_portal | from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index'))
Fix incorrect protocol being using when behin reverse proxy | from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index', _external=True))
| <commit_before>from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index'))
<commit_msg>Fix incorrect protocol being using when behin reverse proxy<commit_after> | from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index', _external=True))
| from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index'))
Fix incorrect protocol being using when behin reverse proxyfrom flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
ret... | <commit_before>from flask import redirect, url_for
from portal import app
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('practices_index'))
<commit_msg>Fix incorrect protocol being using when behin reverse proxy<commit_after>from flask import redirect, url_for
from portal import app
@app.rout... |
affae124162f03ce8783ced01916c11777cff25f | flocker/cli/test/test_deploy_script.py | flocker/cli/test/test_deploy_script.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | Test that DeployOptions sets two options | Test that DeployOptions sets two options
| Python | apache-2.0 | mbrukman/flocker,runcom/flocker,LaynePeng/flocker,w4ngyi/flocker,LaynePeng/flocker,AndyHuu/flocker,hackday-profilers/flocker,runcom/flocker,achanda/flocker,achanda/flocker,Azulinho/flocker,1d4Nf6/flocker,lukemarsden/flocker,runcom/flocker,AndyHuu/flocker,hackday-profilers/flocker,agonzalezro/flocker,Azulinho/flocker,mo... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, Dep... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, Dep... |
ba10a22c47ec2f6a27ddbc1cbddbfe8ec31e9955 | netdumplings/__init__.py | netdumplings/__init__.py | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version import __version__
# Workaround to avoid F401 "imported but unused" linter errors.
(
Dumpli... | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .exceptions import (
InvalidDumpling, InvalidDumplingPayload, NetDumplingsError,
)
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version impo... | Make exceptions available at top-level netdumplings module | Make exceptions available at top-level netdumplings module
| Python | mit | mjoblin/netdumplings,mjoblin/netdumplings,mjoblin/netdumplings | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version import __version__
# Workaround to avoid F401 "imported but unused" linter errors.
(
Dumpli... | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .exceptions import (
InvalidDumpling, InvalidDumplingPayload, NetDumplingsError,
)
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version impo... | <commit_before>from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version import __version__
# Workaround to avoid F401 "imported but unused" linter error... | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .exceptions import (
InvalidDumpling, InvalidDumplingPayload, NetDumplingsError,
)
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version impo... | from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version import __version__
# Workaround to avoid F401 "imported but unused" linter errors.
(
Dumpli... | <commit_before>from .dumpling import Dumpling, DumplingDriver
from .dumplingchef import DumplingChef
from .dumplingeater import DumplingEater
from .dumplinghub import DumplingHub
from .dumplingkitchen import DumplingKitchen
from ._version import __version__
# Workaround to avoid F401 "imported but unused" linter error... |
5564ed32acd3baae009096b2240190ff485a0431 | cms/admin/utils.py | cms/admin/utils.py | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | Allow other characters in placeholder name | Allow other characters in placeholder name
| Python | bsd-3-clause | ojii/django-cms,dhorelik/django-cms,intip/django-cms,iddqd1/django-cms,bittner/django-cms,petecummings/django-cms,stefanfoulis/django-cms,benzkji/django-cms,leture/django-cms,selecsosi/django-cms,mkoistinen/django-cms,robmagee/django-cms,vad/django-cms,driesdesmet/django-cms,wuzhihui1123/django-cms,evildmp/django-cms,t... | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | <commit_before>from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_pla... | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_placeholders(reque... | <commit_before>from django.template import loader, Context, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from cms.utils import get_template_from_request
import re
# must be imported like this for isinstance
from django.templatetags.cms_tags import PlaceholderNode #do not remove
def get_pla... |
82700c4a5d11f01b971b8c031d8864cff2737f0e | accounts/models.py | accounts/models.py | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True)
USERNAME_FIELD = 'email'
def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs)
... | from django.db import models
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self, email):
if not email:
raise ValueError('Users must have an email address')
user = self.model(
... | Add user manager to pass token tests | Add user manager to pass token tests
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True)
USERNAME_FIELD = 'email'
def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs)
... | from django.db import models
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self, email):
if not email:
raise ValueError('Users must have an email address')
user = self.model(
... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True)
USERNAME_FIELD = 'email'
def __init__(self, *args, **kwargs):
super(User, self).__init__(*a... | from django.db import models
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self, email):
if not email:
raise ValueError('Users must have an email address')
user = self.model(
... | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True)
USERNAME_FIELD = 'email'
def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs)
... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(unique=True)
USERNAME_FIELD = 'email'
def __init__(self, *args, **kwargs):
super(User, self).__init__(*a... |
12b6814e558402032e0c12170c678657f1455d08 | kpi/deployment_backends/mock_backend.py | kpi/deployment_backends/mock_backend.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | Add `get_enketo_survey_links` to mock backend | Add `get_enketo_survey_links` to mock backend
| Python | agpl-3.0 | onaio/kpi,onaio/kpi,kobotoolbox/kpi,onaio/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,onaio/kpi | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None,... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None, active=False):... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from base_backend import BaseDeploymentBackend
class MockDeploymentBackend(BaseDeploymentBackend):
'''
only used for unit testing and interface testing.
defines the interface for a deployment backend.
'''
def connect(self, identifier=None,... |
4d4148ea831d425327a3047ebb9be8c3129eaff6 | health_check/contrib/celery/backends.py | health_check/contrib/celery/backends.py | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | Clean results task Health Check | Clean results task Health Check | Python | mit | KristianOellegaard/django-health-check,KristianOellegaard/django-health-check | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | <commit_before>from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout... | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout = getattr(sett... | <commit_before>from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_status(self):
timeout... |
d87491bbc8262b6d448e946d99cb523689f8ef5a | vesper/external_urls.py | vesper/external_urls.py | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = False
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = True
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | Change doc setting for development. | Change doc setting for development. | Python | mit | HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = False
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = True
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | <commit_before>"""
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = False
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTAT... | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = True
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | """
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = False
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTATION_VERSION:
... | <commit_before>"""
Functions that return external URLs, for example for the Vesper documentation.
"""
import vesper.version as vesper_version
_USE_LATEST_DOCUMENTATION_VERSION = False
"""Set this `True` during development, `False` for release."""
def _create_documentation_url():
if _USE_LATEST_DOCUMENTAT... |
7a3ee543960495ed720cfcaccbbe7a8afcfed0dd | l10n_br_coa_generic/hooks.py | l10n_br_coa_generic/hooks.py | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | Use admin user to create COA | [FIX] l10n_br_coa_generic: Use admin user to create COA
| Python | agpl-3.0 | akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | <commit_before># Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
... | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
'l10n_br_c... | <commit_before># Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_generic_tmpl = env.ref(
... |
fefd2ed137c59830fb3f8872beec8cac8c8e5cc7 | aiohttp/signals.py | aiohttp/signals.py | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | Rename AsyncSignal to CoroutineSignal for clarity of purpose | Rename AsyncSignal to CoroutineSignal for clarity of purpose
| Python | apache-2.0 | rutsky/aiohttp,rutsky/aiohttp,z2v/aiohttp,esaezgil/aiohttp,pfreixes/aiohttp,decentfox/aiohttp,AraHaanOrg/aiohttp,panda73111/aiohttp,panda73111/aiohttp,playpauseandstop/aiohttp,hellysmile/aiohttp,jashandeep-sohi/aiohttp,elastic-coders/aiohttp,jashandeep-sohi/aiohttp,singulared/aiohttp,Eyepea/aiohttp,vaskalas/aiohttp,esa... | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | <commit_before>from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
... | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
if __debug__:... | <commit_before>from inspect import signature
import asyncio
class Signal(object):
def __init__(self, parameters):
self._parameters = frozenset(parameters)
self._receivers = set()
def connect(self, receiver):
# Check that the callback can be called with the given parameter names
... |
9efe4325e685b040a4af87a65e0885b950b0cc5a | pa11ycrawler/settings.py | pa11ycrawler/settings.py | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | Increase max depth to 6 | Increase max depth to 6
At 2, it only has enough depth to log in.
| Python | apache-2.0 | singingwolfboy/pa11ycrawler,singingwolfboy/pa11ycrawler,singingwolfboy/pa11ycrawler | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | <commit_before># -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/lat... | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | # -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/latest/topics/down... | <commit_before># -*- coding: utf-8 -*-
"""
Scrapy settings for a11y project
For simplicity, this file contains only settings considered important or
commonly used. You can find more settings consulting the documentation:
http://doc.scrapy.org/en/latest/topics/settings.html
http://scrapy.readthedocs.org/en/lat... |
93057b0bf30e1d4c4449fb5f3322042bf74d76e5 | satchmo/shop/management/commands/satchmo_copy_static.py | satchmo/shop/management/commands/satchmo_copy_static.py | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | Add an error check to static copying | Add an error check to static copying
| Python | bsd-3-clause | grengojbo/satchmo,grengojbo/satchmo | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | <commit_before>from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0]... | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
... | <commit_before>from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0]... |
5d5d2e90e821a7d377e23d63bc0c7fbba223a1d7 | easy_thumbnails/signals.py | easy_thumbnails/signals.py | import django.dispatch
saved_file = django.dispatch.Signal(providing_args=['fieldfile'])
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_creat... | import django.dispatch
saved_file = django.dispatch.Signal()
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_created = django.dispatch.Signal(... | Fix RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement | Fix RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement
| Python | bsd-3-clause | SmileyChris/easy-thumbnails | import django.dispatch
saved_file = django.dispatch.Signal(providing_args=['fieldfile'])
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_creat... | import django.dispatch
saved_file = django.dispatch.Signal()
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_created = django.dispatch.Signal(... | <commit_before>import django.dispatch
saved_file = django.dispatch.Signal(providing_args=['fieldfile'])
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
... | import django.dispatch
saved_file = django.dispatch.Signal()
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_created = django.dispatch.Signal(... | import django.dispatch
saved_file = django.dispatch.Signal(providing_args=['fieldfile'])
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
thumbnail_creat... | <commit_before>import django.dispatch
saved_file = django.dispatch.Signal(providing_args=['fieldfile'])
"""
A signal sent for each ``FileField`` saved when a model is saved.
* The ``sender`` argument will be the model class.
* The ``fieldfile`` argument will be the instance of the field's file that was
saved.
"""
... |
47e27693788eb84baaabcc4a374e2e8cd6cb1101 | image_cropping/thumbnail_processors.py | image_cropping/thumbnail_processors.py | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
box = (
int(values[0]),
int(values[1]),
int(values[2]),
int(values[3]),
... | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
width = abs(values[2] - values[0])
height = abs(values[3] - values[1])
if width != image.size[0] or height != im... | Scale image only if necessary to avoid compression artefacts | Scale image only if necessary to avoid compression artefacts
| Python | bsd-3-clause | henriquechehad/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
box = (
int(values[0]),
int(values[1]),
int(values[2]),
int(values[3]),
... | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
width = abs(values[2] - values[0])
height = abs(values[3] - values[1])
if width != image.size[0] or height != im... | <commit_before>def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
box = (
int(values[0]),
int(values[1]),
int(values[2]),
int(value... | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
width = abs(values[2] - values[0])
height = abs(values[3] - values[1])
if width != image.size[0] or height != im... | def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
box = (
int(values[0]),
int(values[1]),
int(values[2]),
int(values[3]),
... | <commit_before>def crop_corners(image, box=None, **kwargs):
"""
Crop corners to the selection defined by image_cropping
"""
if box:
values = [int(x) for x in box.split(',')]
box = (
int(values[0]),
int(values[1]),
int(values[2]),
int(value... |
e380d669bc09e047282be1d91cc95a7651300141 | farms/tests/test_models.py | farms/tests/test_models.py | """Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.... | """Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
asse... | Add integration test for Address model | Add integration test for Address model
| Python | mit | FlowFX/sturdy-potato,FlowFX/sturdy-potato,FlowFX/sturdy-potato | """Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.... | """Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
asse... | <commit_before>"""Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = ... | """Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
asse... | """Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.... | <commit_before>"""Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = ... |
bcaa91b14cd852b88c348aa47ab97b6dc8cde42c | knesset/browser_cases.py | knesset/browser_cases.py | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | Update test case for current state | Update test case for current state
| Python | bsd-3-clause | MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,OriHoch/Open-Knesset,MeirKriheli/Open-Knesset,alonisser/Open-Knesset,daonb/Open-Knesset,alonisser/Open-Knesset,daonb/Open-Knesset,MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,alonisser/Open-Knesset,MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,daonb/Open-Knesset,daonb/Open... | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | <commit_before># encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different... | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | # encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different browser and pl... | <commit_before># encoding: utf-8
from knesset.browser_test_case import BrowserTestCase, on_platforms
# All browser test cases must inherit from BrowserTestCase which initializes the selenium framework
# also, they must use the @on_platforms decorator. This decorator can run the test case several times - for different... |
01347b2725c67ba57aff3b48f69907cb2fcd95d0 | pinchangeserver/setup.py | pinchangeserver/setup.py | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | Add in dependency for flask cors | Add in dependency for flask cors | Python | mit | nh-99/UMaine-Service-API,nh-99/UMaine-Service-API | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | <commit_before>from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
... | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
install_r... | <commit_before>from setuptools import find_packages, setup
setup(name="umaineapi_pinchangeserver",
version = "0.1",
description = "A service for connecting to myHousing using a Maine ID and ",
author = "Noah Howard",
platforms = ["any"],
license = "BSD",
packages = find_packages(),
... |
777e567c74ce037fb8de89c64d798d3aa1211da2 | courriers/tasks.py | courriers/tasks.py | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | Fix the delay for subscription and unsubscription retry | Fix the delay for subscription and unsubscription retry
| Python | mit | ulule/django-courriers,ulule/django-courriers | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | <commit_before>from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
... | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | <commit_before>from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
... |
ea9dcbed73a2cec0135a54cd093b42bc04364818 | test/unit_test/test_cut_number.py | test/unit_test/test_cut_number.py | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | Test how cut_by_number handles whitespace | Test how cut_by_number handles whitespace
| Python | mit | WheatonCS/Lexos,WheatonCS/Lexos,WheatonCS/Lexos | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | <commit_before>from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
... | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert s... | <commit_before>from lexos.processors.prepare.cutter import split_keep_whitespace, \
count_words, cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
... |
075d6f1b8f232c1ae7cb7d288da8f8d1040f49c9 | hooks/pre_gen_project.py | hooks/pre_gen_project.py | repo_name = '{{ cookiecutter.repo_name }}'
assert_msg = 'Repo name should be valid Python identifier!'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), assert_msg
else:
import re
identifier_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
assert bool(identifier_re.match(repo_name)), a... | import sys
import cookiecutter
# Ensure cookiecutter is recent enough
cookiecutter_min_version = '1.3.0'
if cookiecutter.__version__ < cookiecutter_min_version:
print("--------------------------------------------------------------")
print("!! Your cookiecutter is too old, at least %s is required !!" % cookie... | Add check for cookiecutter version - at least 1.3.0 is required now | Add check for cookiecutter version - at least 1.3.0 is required now
| Python | isc | thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template | repo_name = '{{ cookiecutter.repo_name }}'
assert_msg = 'Repo name should be valid Python identifier!'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), assert_msg
else:
import re
identifier_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
assert bool(identifier_re.match(repo_name)), a... | import sys
import cookiecutter
# Ensure cookiecutter is recent enough
cookiecutter_min_version = '1.3.0'
if cookiecutter.__version__ < cookiecutter_min_version:
print("--------------------------------------------------------------")
print("!! Your cookiecutter is too old, at least %s is required !!" % cookie... | <commit_before>repo_name = '{{ cookiecutter.repo_name }}'
assert_msg = 'Repo name should be valid Python identifier!'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), assert_msg
else:
import re
identifier_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
assert bool(identifier_re.match... | import sys
import cookiecutter
# Ensure cookiecutter is recent enough
cookiecutter_min_version = '1.3.0'
if cookiecutter.__version__ < cookiecutter_min_version:
print("--------------------------------------------------------------")
print("!! Your cookiecutter is too old, at least %s is required !!" % cookie... | repo_name = '{{ cookiecutter.repo_name }}'
assert_msg = 'Repo name should be valid Python identifier!'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), assert_msg
else:
import re
identifier_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
assert bool(identifier_re.match(repo_name)), a... | <commit_before>repo_name = '{{ cookiecutter.repo_name }}'
assert_msg = 'Repo name should be valid Python identifier!'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), assert_msg
else:
import re
identifier_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
assert bool(identifier_re.match... |
a41c8b8f9d3901e8d2794981c6cec050bf086e92 | conjureup/controllers/clouds/common.py | conjureup/controllers/clouds/common.py | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | Make sure _set_lxd_dir_env is always called in monitor loop | Make sure _set_lxd_dir_env is always called in monitor loop
Signed-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>
| Python | mit | Ubuntu-Solutions-Engineering/conjure,ubuntu/conjure-up,ubuntu/conjure-up,conjure-up/conjure-up,Ubuntu-Solutions-Engineering/conjure,conjure-up/conjure-up | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | <commit_before>import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks tha... | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks that localhost/lxd... | <commit_before>import asyncio
from juju.utils import run_with_interrupt
from conjureup import events
from conjureup.models.provider import LocalhostError, LocalhostJSONError
class BaseCloudController:
cancel_monitor = asyncio.Event()
async def _monitor_localhost(self, provider, cb):
""" Checks tha... |
99d0dc6a77144f39fce80b81247575d7c92ee4ac | footynews/db/models.py | footynews/db/models.py | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | Define repr for Article model | Define repr for Article model
| Python | apache-2.0 | footynews/fn_backend | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | <commit_before>from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_... | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_id = Column(Int... | <commit_before>from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Article(Base):
"""Model for Articles"""
__tablename__ = 'articles'
_... |
48884e305609e7c17eb3906c22ce509191f0d00e | passeplat.py | passeplat.py | from flask import Flask, request
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path>", method... | from flask import Flask, request, Response
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path... | Add more complete flask.Response object as return object | Add more complete flask.Response object as return object
Also, selects a couple of specific headers to pass along to Requests. To improve in the future :) | Python | mit | Timothee/Passeplat | from flask import Flask, request
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path>", method... | from flask import Flask, request, Response
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path... | <commit_before>from flask import Flask, request
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path... | from flask import Flask, request, Response
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path... | from flask import Flask, request
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path:path>", method... | <commit_before>from flask import Flask, request
import requests
app = Flask(__name__)
API_ROOT_URL = "https://api.heroku.com/"
# uses ~./netrc otherwise which might interfere with your requests
requests.defaults.defaults['trust_env'] = False
@app.route("/", methods=['GET', 'POST', 'DELETE', 'PUT'])
@app.route("/<path... |
50d0806e2826a5691f1f2ce8fac27c74d98b51c7 | environments/default/bin/convertmp3.py | environments/default/bin/convertmp3.py | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | Use variable instead of concatenating string directly | Use variable instead of concatenating string directly | Python | mit | perdian/dotfiles,perdian/dotfiles,perdian/dotfiles | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | <commit_before>#!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
... | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | #!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
print "Conve... | <commit_before>#!/usr/bin/python
import glob
import os
import subprocess
import sys
files = sys.argv[1:] if len(sys.argv) > 1 else glob.glob('*')
for file in files:
if os.path.isfile(file):
fileWithoutExtension = os.path.splitext(file)[0]
fileWithMp3Extension = fileWithoutExtension + ".mp3";
... |
54b8d77fed6bc59f7e8926b9f1a8e08f25b26eac | corner_cubes_3d_laser/cut_generator.py | corner_cubes_3d_laser/cut_generator.py | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | Set up the basic parameters | Set up the basic parameters
| Python | mit | agupta231/fractal_prints | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | <commit_before># Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | # Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | <commit_before># Program by Ankur Gupta
# www.github.com/agupta231
# Jan 2017
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... |
4a7b48b29b0a2e476b21e27bda8d7122f9982dae | mica/report/tests/test_write_report.py | mica/report/tests/test_write_report.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_AC... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='jeanconn', database='axafvv') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_ACC... | Change sybase skip test to check for more restrictive vv creds | Change sybase skip test to check for more restrictive vv creds
This should let the report-writing test that uses the axafvv query
run as jeanconn user, but skip for other users.
| Python | bsd-3-clause | sot/mica,sot/mica | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_AC... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='jeanconn', database='axafvv') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_ACC... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
HAS_SYBASE_ACCESS = True
except:
... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='jeanconn', database='axafvv') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_ACC... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
HAS_SYBASE_ACCESS = True
except:
HAS_SYBASE_AC... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
HAS_SYBASE_ACCESS = True
except:
... |
ef285377df575e101dd59d11bfec9f5b5d12ab2e | gears/asset_handler.py | gears/asset_handler.py | from functools import wraps
class BaseAssetHandler(object):
def __call__(self, asset):
raise NotImplementedError
@classmethod
def as_handler(cls, **initkwargs):
@wraps(cls, updated=())
def handler(asset):
return handler.handler_class(**initkwargs)(asset)
handl... | # -*- coding: utf-8 -*-
from functools import wraps
class BaseAssetHandler(object):
"""Base class for all asset handlers (processors, compilers and
compressors). A subclass has to implement :meth:`__call__` which is called
with asset as argument.
"""
def __call__(self, asset):
"""Subclas... | Add docstrings to AssetHandler class | Add docstrings to AssetHandler class
| Python | isc | gears/gears,gears/gears,gears/gears | from functools import wraps
class BaseAssetHandler(object):
def __call__(self, asset):
raise NotImplementedError
@classmethod
def as_handler(cls, **initkwargs):
@wraps(cls, updated=())
def handler(asset):
return handler.handler_class(**initkwargs)(asset)
handl... | # -*- coding: utf-8 -*-
from functools import wraps
class BaseAssetHandler(object):
"""Base class for all asset handlers (processors, compilers and
compressors). A subclass has to implement :meth:`__call__` which is called
with asset as argument.
"""
def __call__(self, asset):
"""Subclas... | <commit_before>from functools import wraps
class BaseAssetHandler(object):
def __call__(self, asset):
raise NotImplementedError
@classmethod
def as_handler(cls, **initkwargs):
@wraps(cls, updated=())
def handler(asset):
return handler.handler_class(**initkwargs)(asset... | # -*- coding: utf-8 -*-
from functools import wraps
class BaseAssetHandler(object):
"""Base class for all asset handlers (processors, compilers and
compressors). A subclass has to implement :meth:`__call__` which is called
with asset as argument.
"""
def __call__(self, asset):
"""Subclas... | from functools import wraps
class BaseAssetHandler(object):
def __call__(self, asset):
raise NotImplementedError
@classmethod
def as_handler(cls, **initkwargs):
@wraps(cls, updated=())
def handler(asset):
return handler.handler_class(**initkwargs)(asset)
handl... | <commit_before>from functools import wraps
class BaseAssetHandler(object):
def __call__(self, asset):
raise NotImplementedError
@classmethod
def as_handler(cls, **initkwargs):
@wraps(cls, updated=())
def handler(asset):
return handler.handler_class(**initkwargs)(asset... |
089bce7ec9df43cc526342ba84e37fe87203ca11 | gemini/gemini_amend.py | gemini/gemini_amend.py | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | Extend samples table with new columns when amending. | Extend samples table with new columns when amending.
This allows you to add phenotype fields to your samples after
you have already created the database.
| Python | mit | xuzetan/gemini,brentp/gemini,heuermh/gemini,xuzetan/gemini,udp3f/gemini,bpow/gemini,heuermh/gemini,arq5x/gemini,brentp/gemini,arq5x/gemini,heuermh/gemini,bw2/gemini,bgruening/gemini,brentp/gemini,arq5x/gemini,heuermh/gemini,bw2/gemini,udp3f/gemini,brentp/gemini,bw2/gemini,bgruening/gemini,xuzetan/gemini,udp3f/gemini,ar... | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | <commit_before>import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend... | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend needs a databa... | <commit_before>import GeminiQuery
from gemini_subjects import get_subjects
from ped import load_ped_file, get_ped_fields
from gemini_utils import quote_string
import sqlite3
from database import database_transaction
def amend(parser, args):
if args.db is None:
parser.print_help()
exit("ERROR: amend... |
c33aa32b868a33422f79103474cece38131a93c3 | src/oscar/apps/customer/migrations/0005_auto_20170413_1857.py | src/oscar/apps/customer/migrations/0005_auto_20170413_1857.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model("auth", "User")
for user in User.objects.all():
user.emails.update(email=user.email)
class... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
from oscar.core.compat import get_user_model
User = get_user_model()
def forwards_func(apps, schema_editor):
for user in User.objects.all():
user.emails.upda... | Load current User model for customer email migration. | Load current User model for customer email migration.
| Python | bsd-3-clause | solarissmoke/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,sasha0/django-oscar,sonofatailor/django-oscar,solarissmoke/django-oscar,django-oscar/django-oscar,sonofatailor/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,sasha0/django-oscar,sasha0/django-oscar,django-oscar/django-oscar,... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model("auth", "User")
for user in User.objects.all():
user.emails.update(email=user.email)
class... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
from oscar.core.compat import get_user_model
User = get_user_model()
def forwards_func(apps, schema_editor):
for user in User.objects.all():
user.emails.upda... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model("auth", "User")
for user in User.objects.all():
user.emails.update(email=user... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
from oscar.core.compat import get_user_model
User = get_user_model()
def forwards_func(apps, schema_editor):
for user in User.objects.all():
user.emails.upda... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model("auth", "User")
for user in User.objects.all():
user.emails.update(email=user.email)
class... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-13 17:57
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model("auth", "User")
for user in User.objects.all():
user.emails.update(email=user... |
b776a97f6f12f7b424c45d73b1c975748c4c30ae | tasks/check_einstein.py | tasks/check_einstein.py | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | Remove debugging statement from CheckPermSetLicenses | Remove debugging statement from CheckPermSetLicenses
| Python | bsd-3-clause | SalesforceFoundation/HEDAP,SalesforceFoundation/HEDAP,SalesforceFoundation/HEDAP | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | <commit_before>import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True... | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True,
}
... | <commit_before>import json
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class CheckPermSetLicenses(BaseSalesforceApiTask):
task_options = {
"permission_sets": {
"description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)",
"required": True... |
efe1417ad049e4bb78bf1f111db6b2ea9c603461 | rapt/util.py | rapt/util.py | import sys
import yaml
import click
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER + footer,
extension='.yaml')
if message i... | import sys
import yaml
import click
def load_yaml(fh_or_string):
return yaml.safe_load(fh_or_string)
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER... | Add a load yaml helper | Add a load yaml helper
| Python | bsd-3-clause | yougov/rapt,yougov/rapt | import sys
import yaml
import click
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER + footer,
extension='.yaml')
if message i... | import sys
import yaml
import click
def load_yaml(fh_or_string):
return yaml.safe_load(fh_or_string)
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER... | <commit_before>import sys
import yaml
import click
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER + footer,
extension='.yaml')
... | import sys
import yaml
import click
def load_yaml(fh_or_string):
return yaml.safe_load(fh_or_string)
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER... | import sys
import yaml
import click
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER + footer,
extension='.yaml')
if message i... | <commit_before>import sys
import yaml
import click
def dump_yaml(obj):
return yaml.dump(obj, default_flow_style=False)
def edit_yaml(content='', footer=''):
MARKER = '# Everything below is ignored\n\n'
message = click.edit(content + '\n\n' + MARKER + footer,
extension='.yaml')
... |
90b2c2b546aa6c4707273be29fe83c2ea36e0ad5 | panoptes/state_machine/states/parked.py | panoptes/state_machine/states/parked.py | from . import PanState
""" Parked State
The Parked state occurs in the following conditions:
* Daytime
* Bad Weather
* System error
As such, the state needs to check for a number of conditions.
"""
class State(PanState):
def main(self):
return 'exit'
| from . import PanState
class State(PanState):
def main(self):
next_state = 'shutdown'
# mount = self.panoptes.observatory.mount
self.logger.info("I'm parked now.")
return next_state
| Change Parked state to something silly | Change Parked state to something silly
| Python | mit | AstroHuntsman/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,panoptes/POCS,panoptes/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,joshwalawender/POCS,joshwalawender/POCS | from . import PanState
""" Parked State
The Parked state occurs in the following conditions:
* Daytime
* Bad Weather
* System error
As such, the state needs to check for a number of conditions.
"""
class State(PanState):
def main(self):
return 'exit'
Change Parked state to somethin... | from . import PanState
class State(PanState):
def main(self):
next_state = 'shutdown'
# mount = self.panoptes.observatory.mount
self.logger.info("I'm parked now.")
return next_state
| <commit_before>from . import PanState
""" Parked State
The Parked state occurs in the following conditions:
* Daytime
* Bad Weather
* System error
As such, the state needs to check for a number of conditions.
"""
class State(PanState):
def main(self):
return 'exit'
<commit_msg>Chan... | from . import PanState
class State(PanState):
def main(self):
next_state = 'shutdown'
# mount = self.panoptes.observatory.mount
self.logger.info("I'm parked now.")
return next_state
| from . import PanState
""" Parked State
The Parked state occurs in the following conditions:
* Daytime
* Bad Weather
* System error
As such, the state needs to check for a number of conditions.
"""
class State(PanState):
def main(self):
return 'exit'
Change Parked state to somethin... | <commit_before>from . import PanState
""" Parked State
The Parked state occurs in the following conditions:
* Daytime
* Bad Weather
* System error
As such, the state needs to check for a number of conditions.
"""
class State(PanState):
def main(self):
return 'exit'
<commit_msg>Chan... |
b4e874b752b072565effce1534c58067ee0ac1dc | trader/cli.py | trader/cli.py | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | Update default value for backtesting clock | Update default value for backtesting clock
| Python | mit | jmelett/pyfx,jmelett/pyfx,jmelett/pyFxTrader | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | <commit_before>import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'i... | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'instruments', mu... | <commit_before>import decimal
from datetime import datetime
import click
from .controller import Controller, SimulatedClock
from .broker import OandaBacktestBroker
from .instruments import InstrumentParamType
from .lib import oandapy
from .conf import settings
@click.command()
@click.option('--instrument', '-i', 'i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.