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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a62d038885dcf0b97c544f3b091f2bfba7cc23d7 | kitsune/sumo/widgets.py | kitsune/sumo/widgets.py | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):
o... | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None, renderer=N... | Add required renderer argument to Widget.render() call | Add required renderer argument to Widget.render() call
mozilla/sumo-project#136
| Python | bsd-3-clause | mozilla/kitsune,mozilla/kitsune,mozilla/kitsune,mozilla/kitsune | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):
o... | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None, renderer=N... | <commit_before># Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=N... | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None, renderer=N... | # Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):
o... | <commit_before># Based on http://djangosnippets.org/snippets/1580/
from django import forms
class ImageWidget(forms.FileInput):
"""
A ImageField Widget that shows a thumbnail.
"""
def __init__(self, attrs={}):
super(ImageWidget, self).__init__(attrs)
def render(self, name, value, attrs=N... |
00bcddfaf4d64ac76256a50f13fbdcb9dc7a58bd | projects/urls.py | projects/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add-project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | Change url namespace underscore with - | Change url namespace underscore with -
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add-project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | <commit_before>from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
... | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add-project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
url(r'^archive... | <commit_before>from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'),
url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'),
... |
c8cfce2cd4820d937d10dced4472055921342582 | cyder/core/ctnr/forms.py | cyder/core/ctnr/forms.py | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users',)
def filter_by_ctnr_all(self, ctnr):
... | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users', 'domains', 'ranges', 'workgroups')
def f... | Remove m2m fields from ctnr edit form | Remove m2m fields from ctnr edit form
| Python | bsd-3-clause | akeym/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,OSU-Net/cyder,OSU-Net/cyder,murrown/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,drkitty/cyder,murrown/cyder,murrown/cyder,drkitty/cyder,akeym/cyder | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users',)
def filter_by_ctnr_all(self, ctnr):
... | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users', 'domains', 'ranges', 'workgroups')
def f... | <commit_before>from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users',)
def filter_by_ctnr_all(s... | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users', 'domains', 'ranges', 'workgroups')
def f... | from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users',)
def filter_by_ctnr_all(self, ctnr):
... | <commit_before>from django import forms
from cyder.base.constants import LEVELS
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.ctnr.models import Ctnr
class CtnrForm(forms.ModelForm, UsabilityFormMixin):
class Meta:
model = Ctnr
exclude = ('users',)
def filter_by_ctnr_all(s... |
dd4015874d6e7ab377795177876fe46a934bf741 | testinfra/mon/test_ossec_ruleset.py | testinfra/mon/test_ossec_ruleset.py | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | Add test to reproduce overloaded Tor guard OSSEC alert | Add test to reproduce overloaded Tor guard OSSEC alert
A Tor log event indicating that a Tor guard in use is overloaded
currently produces an OSSEC alert. While this alert is an
excellent candidate to be sent upstream to FPF for analysis,
there is no action that a SecureDrop administrator is expected
to take, making t... | Python | agpl-3.0 | garrettr/securedrop,ehartsuyker/securedrop,micahflee/securedrop,heartsucker/securedrop,conorsch/securedrop,garrettr/securedrop,micahflee/securedrop,conorsch/securedrop,ehartsuyker/securedrop,micahflee/securedrop,conorsch/securedrop,conorsch/securedrop,micahflee/securedrop,heartsucker/securedrop,conorsch/securedrop,garr... | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | <commit_before>import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <... | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <anonymous mappi... | <commit_before>import re
alert_level_regex = re.compile(r"Level: '(\d+)'")
def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo):
"""Check that a denied RWX mmaping produces an OSSEC alert"""
test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied "
"RWX mmap of <... |
50621ef5b141470879a786088391a516b4f63d52 | note/models.py | note/models.py | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(User)
value = models.IntegerField(max_length=255)
def __str__(self):
... | from django.db import models
from django.conf import settings
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(settings.AUTH_USER_MODEL)
value = models.IntegerField(max_length=255)
def __str__... | Migrate to a custom User class. | Migrate to a custom User class.
Step1: reference the User class, using the AUTH_USER_MODEL setting.
| Python | bsd-2-clause | LeMeteore/boomer2 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(User)
value = models.IntegerField(max_length=255)
def __str__(self):
... | from django.db import models
from django.conf import settings
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(settings.AUTH_USER_MODEL)
value = models.IntegerField(max_length=255)
def __str__... | <commit_before>from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(User)
value = models.IntegerField(max_length=255)
def _... | from django.db import models
from django.conf import settings
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(settings.AUTH_USER_MODEL)
value = models.IntegerField(max_length=255)
def __str__... | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(User)
value = models.IntegerField(max_length=255)
def __str__(self):
... | <commit_before>from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Create your models here.
class Note(models.Model):
# always reference the User class using setting conf
author = models.ForeignKey(User)
value = models.IntegerField(max_length=255)
def _... |
3b28a1fa47d4e2339f2219eaf688b88b5901afea | migrations/versions/0074_update_sms_rate.py | migrations/versions/0074_update_sms_rate.py | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0072_add_dvla_orgs
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT INTO provider_rates (id, val... | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0073_add_international_sms_flag
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0073_add_international_sms_flag'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT IN... | Fix db migration merge conflicts | Fix db migration merge conflicts
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0072_add_dvla_orgs
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT INTO provider_rates (id, val... | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0073_add_international_sms_flag
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0073_add_international_sms_flag'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT IN... | <commit_before>"""empty message
Revision ID: 0074_update_sms_rate
Revises: 0072_add_dvla_orgs
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT INTO provider... | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0073_add_international_sms_flag
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0073_add_international_sms_flag'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT IN... | """empty message
Revision ID: 0074_update_sms_rate
Revises: 0072_add_dvla_orgs
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT INTO provider_rates (id, val... | <commit_before>"""empty message
Revision ID: 0074_update_sms_rate
Revises: 0072_add_dvla_orgs
Create Date: 2017-04-24 12:10:02.116278
"""
import uuid
revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'
from alembic import op
def upgrade():
op.get_bind()
op.execute("INSERT INTO provider... |
529ab85ac8a25b05690f507ed67ba767d4fb53db | pyEchosign/utils/handle_response.py | pyEchosign/utils/handle_response.py | from requests import Response
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
response_json = response.json()
code = response_json.get('code', None)
if response.status_code == 401:
raise Per... | from requests import Response
from exceptions.internal_exceptions import ApiError
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
if response.status_code == 401:
raise PermissionError('Echosign API... | Check for json() ValueError with requests when raising an ApiError in check_error() | Check for json() ValueError with requests when raising an ApiError in check_error()
| Python | mit | JensAstrup/pyEchosign | from requests import Response
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
response_json = response.json()
code = response_json.get('code', None)
if response.status_code == 401:
raise Per... | from requests import Response
from exceptions.internal_exceptions import ApiError
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
if response.status_code == 401:
raise PermissionError('Echosign API... | <commit_before>from requests import Response
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
response_json = response.json()
code = response_json.get('code', None)
if response.status_code == 401:
... | from requests import Response
from exceptions.internal_exceptions import ApiError
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
if response.status_code == 401:
raise PermissionError('Echosign API... | from requests import Response
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
response_json = response.json()
code = response_json.get('code', None)
if response.status_code == 401:
raise Per... | <commit_before>from requests import Response
def check_error(response: Response):
""" Takes a requests package response object and checks the error code and raises the proper exception """
response_json = response.json()
code = response_json.get('code', None)
if response.status_code == 401:
... |
42e4e5e78779b4c683fc42fb4c45bb600e96afe3 | probe/controllers/braintasks.py | probe/controllers/braintasks.py | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | Fix new name for scan tasks | Fix new name for scan tasks
| Python | apache-2.0 | hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,quarkslab/irma,hirokihamasaki/irma,quarkslab/irma,quarkslab/irma,quarkslab/irma | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | <commit_before># Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:... | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http://... | <commit_before># Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:... |
b9cf2f0daf2ca360c64d1268d50cab9c07020222 | test_engine.py | test_engine.py | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | Add test_is_coord_on_board() to assert the function returns True if the coordinate is on the board and False otherwise | Add test_is_coord_on_board() to assert the function returns True if the coordinate is on the board and False otherwise
| Python | mit | EyuelAbebe/gamer,EyuelAbebe/gamer | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | <commit_before>import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(4... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | <commit_before>import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(4... |
0cecbabd2d594bfc2ca57e522658d13eda2bc6a8 | pipdiff/pipdiff.py | pipdiff/pipdiff.py | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
from xmlrpclib import ServerProxy
pypi = ServerProxy("http://pypi.python.org/pypi")
d... | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
try:
from xmlrpclib import ServerProxy
except ImportError:
import xmlrpc.client
... | Add support for Python 3 | Add support for Python 3
| Python | bsd-3-clause | ogt/pipdiff | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
from xmlrpclib import ServerProxy
pypi = ServerProxy("http://pypi.python.org/pypi")
d... | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
try:
from xmlrpclib import ServerProxy
except ImportError:
import xmlrpc.client
... | <commit_before>#!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
from xmlrpclib import ServerProxy
pypi = ServerProxy("http://pypi.python... | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
try:
from xmlrpclib import ServerProxy
except ImportError:
import xmlrpc.client
... | #!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
from xmlrpclib import ServerProxy
pypi = ServerProxy("http://pypi.python.org/pypi")
d... | <commit_before>#!/usr/bin/env python
# Original author : Jonathan Zempel, https://github.com/jzempel
# Copied from https://gist.github.com/jzempel/4624227
# Copied here for the purpose of adding it to PyPI
from pkg_resources import parse_version
from xmlrpclib import ServerProxy
pypi = ServerProxy("http://pypi.python... |
8f4c5b6a4c609e5154dfee432c567e382f69ee88 | src/geoserver/layer.py | src/geoserver/layer.py | from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
... | from urllib2 import HTTPError
from geoserver.support import ResourceInfo, atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer(ResourceInfo):
resource_type = "layers"
def __init__(self, node):
self.name = node.find("name").text
self.href = ... | Update Layer to use ResourceInfo support class | Update Layer to use ResourceInfo support class
| Python | mit | boundlessgeo/gsconfig,garnertb/gsconfig.py,Geode/gsconfig,cristianzamar/gsconfig,scottp-dpaw/gsconfig,afabiani/gsconfig | from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
... | from urllib2 import HTTPError
from geoserver.support import ResourceInfo, atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer(ResourceInfo):
resource_type = "layers"
def __init__(self, node):
self.name = node.find("name").text
self.href = ... | <commit_before>from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def ... | from urllib2 import HTTPError
from geoserver.support import ResourceInfo, atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer(ResourceInfo):
resource_type = "layers"
def __init__(self, node):
self.name = node.find("name").text
self.href = ... | from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
... | <commit_before>from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def ... |
edf465bd80b20f151064ac39ba4d0c1cd9643e1d | stix2/test/v21/test_base.py | stix2/test/v21/test_base.py | import datetime as dt
import json
import pytest
import pytz
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dumps(test_dict, cls=STIXJSO... | import datetime as dt
import json
import uuid
import pytest
import pytz
import stix2
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dum... | Add a unit test for deterministic ID, with unicode | Add a unit test for deterministic ID, with unicode
| Python | bsd-3-clause | oasis-open/cti-python-stix2 | import datetime as dt
import json
import pytest
import pytz
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dumps(test_dict, cls=STIXJSO... | import datetime as dt
import json
import uuid
import pytest
import pytz
import stix2
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dum... | <commit_before>import datetime as dt
import json
import pytest
import pytz
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dumps(test_di... | import datetime as dt
import json
import uuid
import pytest
import pytz
import stix2
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dum... | import datetime as dt
import json
import pytest
import pytz
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dumps(test_dict, cls=STIXJSO... | <commit_before>import datetime as dt
import json
import pytest
import pytz
from stix2.base import STIXJSONEncoder
def test_encode_json_datetime():
now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC)
test_dict = {'now': now}
expected = '{"now": "2017-03-22T00:00:00Z"}'
assert json.dumps(test_di... |
3ec4b43e0665e940be9460788fa2d5bfb44b2929 | portal/main.py | portal/main.py | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | Add more messages to commandline output | Add more messages to commandline output
| Python | mit | josecolella/Dynatrace-Resources | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | <commit_before>import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--use... | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--username", help="T... | <commit_before>import argparse
import logging
import Portal
import tqdm
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog="Dynatrace Synthetic Screenshot Automation")
parser.add_argument(
"-u", "--use... |
a9a121d5fe595f54ed482ec162dc7a9703a65c13 | tp/__init__.py | tp/__init__.py | __import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| try:
__import__('pkg_resources').declare_namespace(__name__)
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| Fix for people without setuptools. | Fix for people without setuptools.
| Python | lgpl-2.1 | thousandparsec/libtpproto-py,thousandparsec/libtpproto-py | __import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
Fix for people without setuptools. | try:
__import__('pkg_resources').declare_namespace(__name__)
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| <commit_before>__import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
<commit_msg>Fix for people without setuptools.<commit_after> | try:
__import__('pkg_resources').declare_namespace(__name__)
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| __import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
Fix for people without setuptools.try:
__import__('pkg_resources').declare_namespace(__name__)
import... | <commit_before>__import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
<commit_msg>Fix for people without setuptools.<commit_after>try:
__import__('pkg_resour... |
1d07bcd8a953b477275175b754d054a584dcdbcf | redditcrawl.py | redditcrawl.py |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... | Modify crawler to save name of user who contributed an entry | Modify crawler to save name of user who contributed an entry
| Python | agpl-3.0 | RolandR/place-atlas,RolandR/place-atlas,RolandR/place-atlas,RolandR/place-atlas |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... | <commit_before>
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secr... |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... |
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secret=client_secre... | <commit_before>
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
import praw
outfile = open('temp.js', 'w')
credentials = open('credentials', 'r')
client_id = credentials.readline().strip(' \t\n\r')
client_secret = credentials.readline().strip(' \t\n\r')
startId = 466
reddit = praw.Reddit(client_id=client_id, client_secr... |
7ebadc3a1befa265dfc65e78dfbe98041b96d076 | serial_com_test/raspberry_pi/test.py | serial_com_test/raspberry_pi/test.py | import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/tty.usbmodem1421"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
| import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/ttyACM0"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
| Update SERIAL_DEVICE to match the Raspberry Pi | Update SERIAL_DEVICE to match the Raspberry Pi | Python | mit | zacharylawrence/ENEE408I-Team-9,zacharylawrence/ENEE408I-Team-9,zacharylawrence/ENEE408I-Team-9 | import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/tty.usbmodem1421"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
Update SERIAL_DEVICE to match the Raspberry Pi | import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/ttyACM0"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
| <commit_before>import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/tty.usbmodem1421"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
<commit_msg>Update SERIAL_DEVICE to match t... | import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/ttyACM0"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
| import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/tty.usbmodem1421"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
Update SERIAL_DEVICE to match the Raspberry Piimport seria... | <commit_before>import serial
import time
# Define Constants
SERIAL_DEVICE = "/dev/tty.usbmodem1421"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established");
# Send Data to Pi
ser.write('h')
time.sleep(5);
ser.write('l')
<commit_msg>Update SERIAL_DEVICE to match t... |
ba842af48c1d137584811d75d15c3b7ceddc2372 | pychecker2/File.py | pychecker2/File.py | from pychecker2.util import type_filter
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | from pychecker2.util import parents
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | Add more ways to suck line numbers from nodes | Add more ways to suck line numbers from nodes
| Python | bsd-3-clause | mitar/pychecker,mitar/pychecker | from pychecker2.util import type_filter
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | from pychecker2.util import parents
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | <commit_before>from pychecker2.util import type_filter
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.nam... | from pychecker2.util import parents
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | from pychecker2.util import type_filter
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.name, other.name)
... | <commit_before>from pychecker2.util import type_filter
from compiler import ast
class File:
def __init__(self, name):
self.name = name
self.parseTree = None
self.scopes = {}
self.root_scope = None
self.warnings = []
def __cmp__(self, other):
return cmp(self.nam... |
9c339d28ae899740281b085cbb2b8fd73425249c | democracy/views/label.py | democracy/views/label.py | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label
... | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label... | Add empty line for PEP8 | Add empty line for PEP8
| Python | mit | City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label
... | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label... | <commit_before>from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
... | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label... | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label
... | <commit_before>from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
... |
9ec35300975a141162749cba015cedbe900f97eb | idiotscript/Collector.py | idiotscript/Collector.py | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._current_group.append(new_input)
def finalise_group(self):
self._group... | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._groups.append(self._current_group)
self._current_group.append(new_inpu... | Fix bug with collector losing last group of input | Fix bug with collector losing last group of input
This means the script runner doesn't have to manually finalise the last
input, which was always a bit silly. In fact, the whole metaphor is
rather silly. I should change it to be "start new group" instead.
| Python | unlicense | djmattyg007/IdiotScript | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._current_group.append(new_input)
def finalise_group(self):
self._group... | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._groups.append(self._current_group)
self._current_group.append(new_inpu... | <commit_before>class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._current_group.append(new_input)
def finalise_group(self):
... | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._groups.append(self._current_group)
self._current_group.append(new_inpu... | class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._current_group.append(new_input)
def finalise_group(self):
self._group... | <commit_before>class Collector(object):
def __init__(self):
self._groups = []
self._current_group = None
def add_input(self, new_input):
if self._current_group is None:
self._current_group = []
self._current_group.append(new_input)
def finalise_group(self):
... |
6d5e80771f04fe2aa7cb83c89bdb4e16178b219b | DB.py | DB.py | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | Drop existing products table before creation | Drop existing products table before creation
| Python | mit | joykuotw/python-endpoints,joykuotw/python-endpoints,joykuotw/python-endpoints | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | <commit_before># Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
... | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
cur = ... | <commit_before># Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
try:
conn = sqlite3.connect('databaseForTest.db')
print 'DB Creation Successful!'
... |
8e0afc06d221d86677a172fdb7d1388225504ba6 | resp/__main__.py | resp/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')
parser.add... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from Parser import Parser
def main():
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True)
parser.add_argument('-i', '--input', type=str, default='', required=False... | Add specific required-property to all arguments | Add specific required-property to all arguments
| Python | mit | nok/resp,nok/resp | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')
parser.add... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from Parser import Parser
def main():
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True)
parser.add_argument('-i', '--input', type=str, default='', required=False... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from Parser import Parser
def main():
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True)
parser.add_argument('-i', '--input', type=str, default='', required=False... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')
parser.add... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')... |
8e603328ff08888a1236e6b8ca0adbeb8bae819b | ckanext/ckanext-apply_permissions_for_service/ckanext/apply_permissions_for_service/logic.py | ckanext/ckanext-apply_permissions_for_service/ckanext/apply_permissions_for_service/logic.py | from ckan.plugins import toolkit as tk
import model
import ckan.model as ckan_model
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
organization = data_dict.get('organization')
vat_id = data_dict.get('vat_id')
... | from ckan.plugins import toolkit as tk
import model
_ = tk._
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
errors = {}
error_summary = {}
organization = data_dict.get('organization')
if organization is... | Add validation to api for missing required values | LIKA-106: Add validation to api for missing required values
| Python | mit | vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog | from ckan.plugins import toolkit as tk
import model
import ckan.model as ckan_model
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
organization = data_dict.get('organization')
vat_id = data_dict.get('vat_id')
... | from ckan.plugins import toolkit as tk
import model
_ = tk._
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
errors = {}
error_summary = {}
organization = data_dict.get('organization')
if organization is... | <commit_before>from ckan.plugins import toolkit as tk
import model
import ckan.model as ckan_model
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
organization = data_dict.get('organization')
vat_id = data_dict.get... | from ckan.plugins import toolkit as tk
import model
_ = tk._
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
errors = {}
error_summary = {}
organization = data_dict.get('organization')
if organization is... | from ckan.plugins import toolkit as tk
import model
import ckan.model as ckan_model
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
organization = data_dict.get('organization')
vat_id = data_dict.get('vat_id')
... | <commit_before>from ckan.plugins import toolkit as tk
import model
import ckan.model as ckan_model
def service_permission_application_create(context, data_dict):
tk.check_access('service_permission_application_create', context, data_dict)
organization = data_dict.get('organization')
vat_id = data_dict.get... |
56441d42ed87e2adad8b36c25cf695b0747a8c16 | tests/djworkflows/models.py | tests/djworkflows/models.py | from django.db import models as djmodels
import xworkflows
from django_xworkflows import models
class MyWorkflow(xworkflows.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_... | from django.db import models as djmodels
from django_xworkflows import models
class MyWorkflow(models.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_state = 'foo'
class ... | Use imports from django_xworkflows instead of imports from xworkflows in tests | Use imports from django_xworkflows instead of imports from xworkflows in tests
Signed-off-by: Raphaël Barrois <[email protected]>
| Python | bsd-2-clause | rbarrois/django_xworkflows | from django.db import models as djmodels
import xworkflows
from django_xworkflows import models
class MyWorkflow(xworkflows.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_... | from django.db import models as djmodels
from django_xworkflows import models
class MyWorkflow(models.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_state = 'foo'
class ... | <commit_before>from django.db import models as djmodels
import xworkflows
from django_xworkflows import models
class MyWorkflow(xworkflows.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
... | from django.db import models as djmodels
from django_xworkflows import models
class MyWorkflow(models.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_state = 'foo'
class ... | from django.db import models as djmodels
import xworkflows
from django_xworkflows import models
class MyWorkflow(xworkflows.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
)
initial_... | <commit_before>from django.db import models as djmodels
import xworkflows
from django_xworkflows import models
class MyWorkflow(xworkflows.Workflow):
states = ('foo', 'bar', 'baz')
transitions = (
('foobar', 'foo', 'bar'),
('gobaz', ('foo', 'bar'), 'baz'),
('bazbar', 'baz', 'bar'),
... |
83a16ba4485f3e483adc20352cb0cef7c02f8ef2 | tests/test_config_schema.py | tests/test_config_schema.py | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from flexget import plugin
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_plugin_schemas_are_valid(self):
for p in plugin.plugins.values():
i... | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_registered_schemas_are_valid(self):
for path in config_schema.schema_paths:
schema = config_sc... | Convert unit test to test all registered schemas instead of plugins directly. | Convert unit test to test all registered schemas instead of plugins directly.
| Python | mit | vfrc2/Flexget,poulpito/Flexget,jacobmetrick/Flexget,ibrahimkarahan/Flexget,Danfocus/Flexget,oxc/Flexget,ibrahimkarahan/Flexget,asm0dey/Flexget,qvazzler/Flexget,dsemi/Flexget,crawln45/Flexget,thalamus/Flexget,tsnoam/Flexget,patsissons/Flexget,tsnoam/Flexget,vfrc2/Flexget,Danfocus/Flexget,drwyrm/Flexget,v17al/Flexget,grr... | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from flexget import plugin
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_plugin_schemas_are_valid(self):
for p in plugin.plugins.values():
i... | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_registered_schemas_are_valid(self):
for path in config_schema.schema_paths:
schema = config_sc... | <commit_before>from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from flexget import plugin
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_plugin_schemas_are_valid(self):
for p in plugin.plugins.values()... | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_registered_schemas_are_valid(self):
for path in config_schema.schema_paths:
schema = config_sc... | from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from flexget import plugin
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_plugin_schemas_are_valid(self):
for p in plugin.plugins.values():
i... | <commit_before>from __future__ import unicode_literals, division, absolute_import
import jsonschema
from flexget import config_schema
from flexget import plugin
from tests import FlexGetBase
class TestSchemaValidator(FlexGetBase):
def test_plugin_schemas_are_valid(self):
for p in plugin.plugins.values()... |
bc071a524d1695e6d95b42709442dddaf4185cd9 | account_invoice_start_end_dates/__manifest__.py | account_invoice_start_end_dates/__manifest__.py | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | FIX visibility of forecast button | FIX visibility of forecast button
Default value for cutoff date is end date of previous fiscal year
| Python | agpl-3.0 | OCA/account-closing,OCA/account-closing | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | <commit_before># Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Fi... | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | # Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"li... | <commit_before># Copyright 2016-2019 Akretion France
# Copyright 2018-2019 Camptocamp
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Start End Dates",
"version": "13.0.1.0.0",
"category": "Accounting & Fi... |
f8dd1fd8ee899c0147a9a88149097e9b7cd68f01 | tests/generic_views/views.py | tests/generic_views/views.py | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | Remove unecessary attribute from test | Remove unecessary attribute from test | Python | mit | BradWhittington/django-templated-email,BradWhittington/django-templated-email,vintasoftware/django-templated-email,vintasoftware/django-templated-email | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | <commit_before>from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fi... | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fields = ['name',... | <commit_before>from django.views.generic.edit import CreateView
from templated_email.generic_views import TemplatedEmailFormViewMixin
from tests.generic_views.models import Author
# This view send a welcome email to the author
class AuthorCreateView(TemplatedEmailFormViewMixin, CreateView):
model = Author
fi... |
05ba498867ff16c4221dcd758d5cdef9ee884b27 | modules/test_gitdata.py | modules/test_gitdata.py | from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nexson)
except... | import unittest
import os
import sys
from gitdata import GitData
import simplejson as json
class TestGitData(unittest.TestCase):
def test_fetch(self):
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loa... | Convert GitData tests to a unittest suite | Convert GitData tests to a unittest suite
| Python | bsd-2-clause | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nexson)
except... | import unittest
import os
import sys
from gitdata import GitData
import simplejson as json
class TestGitData(unittest.TestCase):
def test_fetch(self):
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loa... | <commit_before>from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nex... | import unittest
import os
import sys
from gitdata import GitData
import simplejson as json
class TestGitData(unittest.TestCase):
def test_fetch(self):
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loa... | from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nexson)
except... | <commit_before>from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nex... |
a05372ad910900ec2ef89bb10d4a0759c9bcd437 | app.py | app.py | import os
from flask import Flask, request, redirect, session
import twilio.twiml
from twilio.rest import TwilioRestClient
from charity import Charity
SECRET_KEY = os.environ['DONATION_SECRET_KEY']
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.values.get('From'... | import os
from flask import Flask, request
import twilio.twiml
from twilio.rest import TwilioRestClient
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.args.get('From')
text_content = request.args.get('Body').lower()
client = TwilioRestClient(os.environ... | Test sending a fresh message | Test sending a fresh message
| Python | mit | DanielleSucher/Text-Donation | import os
from flask import Flask, request, redirect, session
import twilio.twiml
from twilio.rest import TwilioRestClient
from charity import Charity
SECRET_KEY = os.environ['DONATION_SECRET_KEY']
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.values.get('From'... | import os
from flask import Flask, request
import twilio.twiml
from twilio.rest import TwilioRestClient
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.args.get('From')
text_content = request.args.get('Body').lower()
client = TwilioRestClient(os.environ... | <commit_before>import os
from flask import Flask, request, redirect, session
import twilio.twiml
from twilio.rest import TwilioRestClient
from charity import Charity
SECRET_KEY = os.environ['DONATION_SECRET_KEY']
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.va... | import os
from flask import Flask, request
import twilio.twiml
from twilio.rest import TwilioRestClient
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.args.get('From')
text_content = request.args.get('Body').lower()
client = TwilioRestClient(os.environ... | import os
from flask import Flask, request, redirect, session
import twilio.twiml
from twilio.rest import TwilioRestClient
from charity import Charity
SECRET_KEY = os.environ['DONATION_SECRET_KEY']
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.values.get('From'... | <commit_before>import os
from flask import Flask, request, redirect, session
import twilio.twiml
from twilio.rest import TwilioRestClient
from charity import Charity
SECRET_KEY = os.environ['DONATION_SECRET_KEY']
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
from_number = request.va... |
94e0e31a8329cbbdc1545fa5c12b04600422627f | main.py | main.py | # Must be named "plugins_"
# because sublime_plugin claims a plugin module's `plugin` attribute for itself.
from .plugins_ import * # noqa
| try:
from package_control import events
except ImportError:
pass
else:
if events.post_upgrade(__package__):
# clean up sys.modules to ensure all submodules are reloaded
import sys
modules_to_clear = set()
for module_name in sys.modules:
if module_name.startswith(_... | Add code to remove cached sub-modules on upgrade | Add code to remove cached sub-modules on upgrade
This is untested because I'm too lazy to simulate a package updating
situation, but I generally believe it should work. It shouldn't break
anything, at least.
| Python | mit | SublimeText/AAAPackageDev,SublimeText/PackageDev,SublimeText/AAAPackageDev | # Must be named "plugins_"
# because sublime_plugin claims a plugin module's `plugin` attribute for itself.
from .plugins_ import * # noqa
Add code to remove cached sub-modules on upgrade
This is untested because I'm too lazy to simulate a package updating
situation, but I generally believe it should work. It should... | try:
from package_control import events
except ImportError:
pass
else:
if events.post_upgrade(__package__):
# clean up sys.modules to ensure all submodules are reloaded
import sys
modules_to_clear = set()
for module_name in sys.modules:
if module_name.startswith(_... | <commit_before># Must be named "plugins_"
# because sublime_plugin claims a plugin module's `plugin` attribute for itself.
from .plugins_ import * # noqa
<commit_msg>Add code to remove cached sub-modules on upgrade
This is untested because I'm too lazy to simulate a package updating
situation, but I generally believ... | try:
from package_control import events
except ImportError:
pass
else:
if events.post_upgrade(__package__):
# clean up sys.modules to ensure all submodules are reloaded
import sys
modules_to_clear = set()
for module_name in sys.modules:
if module_name.startswith(_... | # Must be named "plugins_"
# because sublime_plugin claims a plugin module's `plugin` attribute for itself.
from .plugins_ import * # noqa
Add code to remove cached sub-modules on upgrade
This is untested because I'm too lazy to simulate a package updating
situation, but I generally believe it should work. It should... | <commit_before># Must be named "plugins_"
# because sublime_plugin claims a plugin module's `plugin` attribute for itself.
from .plugins_ import * # noqa
<commit_msg>Add code to remove cached sub-modules on upgrade
This is untested because I'm too lazy to simulate a package updating
situation, but I generally believ... |
35a2e4ecfc7c39ca477279a49d1a49bb4395b7ad | main.py | main.py | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | Make a better error message for ValidationError | Make a better error message for ValidationError
| Python | unlicense | elwinar/chronicler | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | <commit_before>"""Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(option... | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | """Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(options['--chronicle'... | <commit_before>"""Usage: chronicler [-c CHRONICLE]
The Chronicler remembers…
Options:
-c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson]
"""
import docopt
import hjson
import jsonschema
import chronicle
def main():
options = docopt.docopt(__doc__)
try:
c = open(option... |
968274deace1aa16d45df350c437eab699d02b16 | byceps/services/brand/transfer/models.py | byceps/services/brand/transfer/models.py | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: BrandID
title: str
im... | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: B... | Fix type hints of brand DTO image fields | Fix type hints of brand DTO image fields
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: BrandID
title: str
im... | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: B... | <commit_before>"""
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: BrandID
ti... | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: B... | """
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: BrandID
title: str
im... | <commit_before>"""
byceps.services.brand.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from ....typing import BrandID
@dataclass(frozen=True)
class Brand:
id: BrandID
ti... |
7d7c732f0a2d4f326b7bd760c3c02814848914e5 | setup.py | setup.py | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.0',
... | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.1',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.1',
... | Bump version due to PyPI submit error caused by server outage. | Bump version due to PyPI submit error caused by server outage.
| Python | mit | BlasiusVonSzerencsi/pagerduty-events-api | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.0',
... | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.1',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.1',
... | <commit_before>from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tar... | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.1',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.1',
... | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.0',
... | <commit_before>from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tar... |
425056e6196dbce50f08d94f1578a2984b8a1c21 | setup.py | setup.py | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | Read in README.md as long description | Read in README.md as long description | Python | apache-2.0 | forseti-security/resource-policy-evaluation-library | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | <commit_before># Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | # Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | <commit_before># Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... |
237abb4204821e6e90f17a438b8945d7b47b3406 | setup.py | setup.py | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | Remove six from dependency list. | Remove six from dependency list.
| Python | mit | al45tair/dmgbuild | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | <commit_before># -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.... | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.1.0',
... | <commit_before># -*- coding: utf-8 -*-
import sys
from setuptools import setup
with open('README.rst', 'rb') as f:
long_desc = f.read().decode('utf-8')
# We have to be able to install on Linux to build the docs, even though
# dmgbuild presently won't work there because there's no SetFile
requires=['ds_store >= 1.... |
e9046cd97c1deba9ba70bf60cfdba81eba6e0210 | setup.py | setup.py | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
}
extras_require['complet... | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'imperative': ['toolz >... | Add dep on toolz 0.7.2 for imperative extra | Add dep on toolz 0.7.2 for imperative extra
| Python | bsd-3-clause | dask/dask,jcrist/dask,cowlicks/dask,dask/dask,ContinuumIO/dask,blaze/dask,mraspaud/dask,gameduell/dask,cpcloud/dask,mikegraham/dask,chrisbarber/dask,jakirkham/dask,blaze/dask,mraspaud/dask,jcrist/dask,ContinuumIO/dask,mrocklin/dask,jakirkham/dask,mrocklin/dask | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
}
extras_require['complet... | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'imperative': ['toolz >... | <commit_before>#!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
}
extras_r... | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'imperative': ['toolz >... | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
}
extras_require['complet... | <commit_before>#!/usr/bin/env python
from os.path import exists
from setuptools import setup
import dask
extras_require = {
'array': ['numpy', 'toolz >= 0.7.2'],
'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'],
}
extras_r... |
1dbaae42645a4b5873a603f3ed9ce8c08a1467ec | setup.py | setup.py | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
install_re... | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
download_u... | Add back download url :/ | Add back download url :/
| Python | mit | VonStruddle/PyHunter | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
install_re... | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
download_u... | <commit_before>from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',... | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
download_u... | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',
install_re... | <commit_before>from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.1',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='[email protected]',
url='https://github.com/VonStruddle/PyHunter',... |
2433f8f3249b46e39a3dc9f036720eb80702df6e | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.1'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.2'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | Increase version 3.1.1 -> 3.1.2 | PRJ: Increase version 3.1.1 -> 3.1.2
| Python | mit | SiLab-Bonn/pixel_clusterizer | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.1'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.2'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.1'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for c... | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.2'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | #!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.1'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for core functionali... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages # This setup relies on setuptools since distutils is insufficient and badly hacked code
version = '3.1.1'
author = 'David-Leon Pohl, Jens Janssen'
author_email = '[email protected], [email protected]'
# requirements for c... |
f1254e6116b22923ab6f988c6cf5dca91623c678 | setup.py | setup.py | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Development Status :: 1 - Planning',
'I... | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'stepstool = step_stool:main',
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Deve... | Allow users to run Step Stool as either `step-stool` or `stepstool`. | Allow users to run Step Stool as either `step-stool` or `stepstool`.
| Python | mit | chriskrycho/step-stool,chriskrycho/step-stool | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Development Status :: 1 - Planning',
'I... | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'stepstool = step_stool:main',
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Deve... | <commit_before>from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Development Status :: 1 - Pl... | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'stepstool = step_stool:main',
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Deve... | from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Development Status :: 1 - Planning',
'I... | <commit_before>from setuptools import setup
requires = ['Markdown', 'PyRSS2Gen', 'Pygments', 'PyYAML >= 3.10', 'typogrify']
packages = ['step_stool']
entry_points = {
'console_scripts': [
'step-stool = step_stool:main'
]
}
classifiers = [
'Environment :: Console',
'Development Status :: 1 - Pl... |
ae97d45456854c2e584840bcefe598f889dcb737 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | Add spaces around equal signs. | Add spaces around equal signs.
| Python | apache-2.0 | rqelibari/sirup | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... |
395db381f6ad38465666efd2c56a261bcfdf38b9 | common/djangoapps/track/backends/logger.py | common/djangoapps/track/backends/logger.py | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | Raise UnicodeDecodeError exception after logging the exception | Raise UnicodeDecodeError exception after logging the exception
| Python | agpl-3.0 | wwj718/edx-platform,appsembler/edx-platform,zhenzhai/edx-platform,lduarte1991/edx-platform,raccoongang/edx-platform,kmoocdev2/edx-platform,edx/edx-platform,msegado/edx-platform,alu042/edx-platform,amir-qayyum-khan/edx-platform,Stanford-Online/edx-platform,tanmaykm/edx-platform,defance/edx-platform,kmoocdev2/edx-platfor... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | <commit_before>"""Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
app... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | <commit_before>"""Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
app... |
c6917a2f439b99078e67310230f1d0cfa0de8a7b | tests/builder_tests.py | tests/builder_tests.py | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import NullPool
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_b... | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_builder_args(self):
model = se... | Add test helper for creating users | Add test helper for creating users
| Python | mit | numberoverzero/jsonquery | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import NullPool
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_b... | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_builder_args(self):
model = se... | <commit_before>import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import NullPool
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
... | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_builder_args(self):
model = se... | import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import NullPool
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
def valid_b... | <commit_before>import ujson
import unittest
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import NullPool
from interrogate import Builder
class InterrogateTestCase(unittest.TestCase):
... |
0b741c89ea19759f25526256ee039707cb423cef | aldryn_faq/tests/test_menu.py | aldryn_faq/tests/test_menu.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(se... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 ... | Fix tests to now include the questions, which are now in the menu | Fix tests to now include the questions, which are now in the menu
| Python | bsd-3-clause | czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(se... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def te... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(se... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def te... |
57dfe42d957214d23e1ad28595db5af5adf1a5d6 | Orange/regression/__init__.py | Orange/regression/__init__.py | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | Include simple tree in regression package | SimpleTree: Include simple tree in regression package
| Python | bsd-2-clause | qPCR4vir/orange3,marinkaz/orange3,qPCR4vir/orange3,kwikadi/orange3,cheral/orange3,marinkaz/orange3,cheral/orange3,qPCR4vir/orange3,kwikadi/orange3,cheral/orange3,kwikadi/orange3,kwikadi/orange3,marinkaz/orange3,cheral/orange3,cheral/orange3,kwikadi/orange3,qPCR4vir/orange3,qPCR4vir/orange3,qPCR4vir/orange3,kwikadi/oran... | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | <commit_before>from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
... | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
from .simple_ra... | <commit_before>from .base_regression import (ModelRegression as Model,
LearnerRegression as Learner,
SklModelRegression as SklModel,
SklLearnerRegression as SklLearner)
from .linear import *
from .mean import *
from .knn import *
... |
518df76dcc14895f4555451194f64a98ccc814ef | pymco/utils.py | pymco/utils.py | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__` with the module ... | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
import importlib
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__`... | Use importlib.import_module instead of __import__ | Use importlib.import_module instead of __import__
| Python | bsd-3-clause | rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__` with the module ... | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
import importlib
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__`... | <commit_before>"""
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__` w... | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
import importlib
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__`... | """
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__` with the module ... | <commit_before>"""
:py:mod:`pymco.utils`
---------------------
python-mcollective utils.
"""
def import_class(import_path):
"""Import a class based on given dotted import path string.
It just splits the import path in order to geth the module and class names,
then it just calls to :py:func:`__import__` w... |
4fe72ff427290e845c0259cd1aadf21dd29b9872 | kivy/tests/test_video.py | kivy/tests/test_video.py |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... | Fix path and avi -> mpg. | Fix path and avi -> mpg.
| Python | mit | el-ethan/kivy,angryrancor/kivy,janssen/kivy,rafalo1333/kivy,cbenhagen/kivy,inclement/kivy,Farkal/kivy,jffernandez/kivy,manthansharma/kivy,youprofit/kivy,darkopevec/kivy,jegger/kivy,xiaoyanit/kivy,bob-the-hamster/kivy,Cheaterman/kivy,manthansharma/kivy,LogicalDash/kivy,aron-bordin/kivy,vipulroxx/kivy,andnovar/kivy,iamut... |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... | <commit_before>
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Cloc... |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... |
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Clock
from ... | <commit_before>
import unittest
class AnimationTestCase(unittest.TestCase):
def test_video_unload(self):
# fix issue https://github.com/kivy/kivy/issues/2275
# AttributeError: 'NoneType' object has no attribute 'texture'
from kivy.uix.video import Video
from kivy.clock import Cloc... |
0728a5b64ec9a871267d3b0b6ea6c3390b7a8e1f | clowder/clowder/cli/status_controller.py | clowder/clowder/cli/status_controller.py | from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class StatusController(AbstractBaseController):
class Meta:
label = 'status'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Print project status'
... | from cement.ext.ext_argparse import expose
import clowder.util.formatting as fmt
from clowder.cli.abstract_base_controller import AbstractBaseController
from clowder.commands.util import run_group_command
from clowder.util.decorators import network_connection_required
class StatusController(AbstractBaseController):
... | Add `clowder status` logic to Cement controller | Add `clowder status` logic to Cement controller
| Python | mit | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class StatusController(AbstractBaseController):
class Meta:
label = 'status'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Print project status'
... | from cement.ext.ext_argparse import expose
import clowder.util.formatting as fmt
from clowder.cli.abstract_base_controller import AbstractBaseController
from clowder.commands.util import run_group_command
from clowder.util.decorators import network_connection_required
class StatusController(AbstractBaseController):
... | <commit_before>from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class StatusController(AbstractBaseController):
class Meta:
label = 'status'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Print project s... | from cement.ext.ext_argparse import expose
import clowder.util.formatting as fmt
from clowder.cli.abstract_base_controller import AbstractBaseController
from clowder.commands.util import run_group_command
from clowder.util.decorators import network_connection_required
class StatusController(AbstractBaseController):
... | from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class StatusController(AbstractBaseController):
class Meta:
label = 'status'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Print project status'
... | <commit_before>from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class StatusController(AbstractBaseController):
class Meta:
label = 'status'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Print project s... |
e00e821c9984038c15d9cb9a6db3d4e13a770cb6 | src/cclib/bridge/cclib2openbabel.py | src/cclib/bridge/cclib2openbabel.py | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | Convert atomno to int in case it is a different numpy dtype. | Convert atomno to int in case it is a different numpy dtype.
| Python | bsd-3-clause | gaursagar/cclib,andersx/cclib,ghutchis/cclib,cclib/cclib,Clyde-fare/cclib,berquist/cclib,jchodera/cclib,Schamnad/cclib,ATenderholt/cclib,langner/cclib,jchodera/cclib,ghutchis/cclib,langner/cclib,cclib/cclib,berquist/cclib,Clyde-fare/cclib,ben-albrecht/cclib,andersx/cclib,gaursagar/cclib,ATenderholt/cclib,ben-albrecht/c... | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | <commit_before>"""
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> i... | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> import numpy, op... | <commit_before>"""
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import openbabel as ob
def makeopenbabel(atomcoords, atomnos, charge=0, mult=1):
"""Create an Open Babel molecule.
>>> i... |
56c5ba27ecb4324e4c137e9e1595f95ffd58b73a | lesscpy/plib/deferred.py | lesscpy/plib/deferred.py | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | Add post process stage for stray mixin calls | Add post process stage for stray mixin calls
| Python | mit | joequery/lesscpy,lesscpy/lesscpy,robotis/lesscpy,fivethreeo/lesscpy | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | <commit_before># -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This ... | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This node represents... | <commit_before># -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.deferred
:synopsis: Deferred mixin call.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <[email protected]>
"""
from .node import Node
class Deferred(Node):
def __init__(self, mixin, args):
"""This ... |
b5454286a2cfce07f4971b7bc56dd131402f8fe3 | iati/__init__.py | iati/__init__.py | """A top-level namespace package for IATI."""
__import__('pkg_resources').declare_namespace(__name__)
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoM... | """A top-level namespace package for IATI."""
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoMoreThanOne, RuleRegexMatches, RuleRegexNoMatches, RuleSta... | Fix pylint error after iati.core -> iati | Fix pylint error after iati.core -> iati
| Python | mit | IATI/iati.core,IATI/iati.core | """A top-level namespace package for IATI."""
__import__('pkg_resources').declare_namespace(__name__)
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoM... | """A top-level namespace package for IATI."""
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoMoreThanOne, RuleRegexMatches, RuleRegexNoMatches, RuleSta... | <commit_before>"""A top-level namespace package for IATI."""
__import__('pkg_resources').declare_namespace(__name__)
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDep... | """A top-level namespace package for IATI."""
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoMoreThanOne, RuleRegexMatches, RuleRegexNoMatches, RuleSta... | """A top-level namespace package for IATI."""
__import__('pkg_resources').declare_namespace(__name__)
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDependent, RuleNoM... | <commit_before>"""A top-level namespace package for IATI."""
__import__('pkg_resources').declare_namespace(__name__)
from .codelists import Code, Codelist # noqa: F401
from .data import Dataset # noqa: F401
from .rulesets import Rule, Ruleset # noqa: F401
from .rulesets import RuleAtLeastOne, RuleDateOrder, RuleDep... |
08a2220bdacb3e49050a7c223e5c1d8109ae434f | ipython-magic.py | ipython-magic.py | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | Disable the effect of %%bohrium if bohrium cannot be imported. | Disable the effect of %%bohrium if bohrium cannot be imported.
The first time the user attempts to use %%bohrium a warning will be
shown. From this point onwards all %%bohrium statements will have no
effect silently.
| Python | apache-2.0 | bh107/bohrium,madsbk/bohrium,madsbk/bohrium,bh107/bohrium,bh107/bohrium,bh107/bohrium,madsbk/bohrium,madsbk/bohrium | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | <commit_before>####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.co... | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | ####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.core.magic import... | <commit_before>####################################
# This file was created by Bohrium.
# It allows you to run NumPy code (cells) as Bohrium, by using the magic command
# `%%bohrium` in your cells, e.g.:
#
# %%bohrium
# print(numpy)
# print(numpy.arange(10))
####################################
from IPython.co... |
c2fb467626d586bfb5ddef60fd4d1447515ad161 | fpsd/evaluation.py | fpsd/evaluation.py | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | Add function for plotting feature importances | Add function for plotting feature importances
| Python | agpl-3.0 | freedomofpress/fingerprint-securedrop,freedomofpress/FingerprintSecureDrop,freedomofpress/fingerprint-securedrop,freedomofpress/fingerprint-securedrop,freedomofpress/FingerprintSecureDrop | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | <commit_before>def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
p... | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
pass
return ... | <commit_before>def get_feature_importances(model):
try:
return model.feature_importances_
except:
pass
try:
# Must be 1D for feature importance plot
if len(model.coef_) <= 1:
return model.coef_[0]
else:
return model.coef_
except:
p... |
11529d7ad4d428bdd9f5a58adc1085a665d4f222 | uconnrcmpy/__init__.py | uconnrcmpy/__init__.py | from .ignitiondelayexp import ExperimentalIgnitionDelay
from .compare_to_sim import compare_to_sim
from .volume_trace import VolumeTraceBuilder
from .nonreactive import NonReactiveExperiments
__all__ = [
'ExperimentalIgnitionDelay',
'compare_to_sim',
'VolumeTraceBuilder',
'NonReactiveExperiments',
]
| Load the external interface on package import | Load the external interface on package import
Set __init__.py so that the useful classes are loaded when the package
is loaded
| Python | bsd-3-clause | bryanwweber/UConnRCMPy | Load the external interface on package import
Set __init__.py so that the useful classes are loaded when the package
is loaded | from .ignitiondelayexp import ExperimentalIgnitionDelay
from .compare_to_sim import compare_to_sim
from .volume_trace import VolumeTraceBuilder
from .nonreactive import NonReactiveExperiments
__all__ = [
'ExperimentalIgnitionDelay',
'compare_to_sim',
'VolumeTraceBuilder',
'NonReactiveExperiments',
]
| <commit_before><commit_msg>Load the external interface on package import
Set __init__.py so that the useful classes are loaded when the package
is loaded<commit_after> | from .ignitiondelayexp import ExperimentalIgnitionDelay
from .compare_to_sim import compare_to_sim
from .volume_trace import VolumeTraceBuilder
from .nonreactive import NonReactiveExperiments
__all__ = [
'ExperimentalIgnitionDelay',
'compare_to_sim',
'VolumeTraceBuilder',
'NonReactiveExperiments',
]
| Load the external interface on package import
Set __init__.py so that the useful classes are loaded when the package
is loadedfrom .ignitiondelayexp import ExperimentalIgnitionDelay
from .compare_to_sim import compare_to_sim
from .volume_trace import VolumeTraceBuilder
from .nonreactive import NonReactiveExperiments
... | <commit_before><commit_msg>Load the external interface on package import
Set __init__.py so that the useful classes are loaded when the package
is loaded<commit_after>from .ignitiondelayexp import ExperimentalIgnitionDelay
from .compare_to_sim import compare_to_sim
from .volume_trace import VolumeTraceBuilder
from .no... | |
1ac105b7efa3ae4c531fdcc8a626ab47d86e0192 | tests/test_gen_schema_reading_and_writing.py | tests/test_gen_schema_reading_and_writing.py | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
pass
@pytes... | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
import json
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
... | Write parameterized test for gen schema read function. | Write parameterized test for gen schema read function.
| Python | mit | becketta/ctip | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
pass
@pytes... | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
import json
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
... | <commit_before># -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
... | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
import json
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
... | # -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
pass
@pytes... | <commit_before># -*- coding: utf-8 -*-
"""
Test parsing genfiles and writing GenSchema to genfiles.
Created on Sun Jul 10 19:54:47 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def gather_test_files():
"""Search the tests/resources directory for pairs of gen and config files."""
... |
78d520b88e13a35ac20a0eeea1385f35b17383d2 | sieve/sieve.py | sieve/sieve.py | def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
yield i
not_prime.update(range(i*i, n, i))
| def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n, i))
return prime
| Switch to more optimal non-generator solution | Switch to more optimal non-generator solution
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
yield i
not_prime.update(range(i*i, n, i))
Switch to more optimal non-generator solution | def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n, i))
return prime
| <commit_before>def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
yield i
not_prime.update(range(i*i, n, i))
<commit_msg>Switch to more optimal non-generat... | def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n, i))
return prime
| def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
yield i
not_prime.update(range(i*i, n, i))
Switch to more optimal non-generator solutiondef sieve(n):
... | <commit_before>def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
yield i
not_prime.update(range(i*i, n, i))
<commit_msg>Switch to more optimal non-generat... |
9cb249fc2f7bc1043d50f7d9424026a3a68e4f2a | python/ql/test/query-tests/Security/CWE-295-RequestWithoutValidation/make_request.py | python/ql/test/query-tests/Security/CWE-295-RequestWithoutValidation/make_request.py | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | Add test we don't handle for `py/request-without-cert-validation` | Python: Add test we don't handle for `py/request-without-cert-validation`
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | <commit_before>import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semml... | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semmle.com', verify=... | <commit_before>import requests
#Simple cases
requests.get('https://semmle.com', verify=True) # GOOD
requests.get('https://semmle.com', verify=False) # BAD
requests.post('https://semmle.com', verify=True) # GOOD
requests.post('https://semmle.com', verify=False) # BAD
# Simple flow
put = requests.put
put('https://semml... |
55f8bce3a4d1232f2b7ffbdfa2c1cf741686a33f | lots/migrations/0002_auto_20170717_2115.py | lots/migrations/0002_auto_20170717_2115.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations, connection
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", ... | Make reverse migration for lot_type run | Make reverse migration for lot_type run
| Python | mpl-2.0 | jackbravo/condorest-django,jackbravo/condorest-django,jackbravo/condorest-django | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations, connection
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", ... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations, connection
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", ... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType, Lot
from revenue.models import Fee, Receipt
def load_data(apps, schema_editor):
LotType = apps.get_model("lots... |
9ffe8a195af0a2504728e4764d093152959474e8 | mrp_product_variants/models/procurement.py | mrp_product_variants/models/procurement.py | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | Fix MTO configurator not filled | [FIX] mrp_product_variants: Fix MTO configurator not filled
| Python | agpl-3.0 | Eficent/odoomrp-wip,oihane/odoomrp-wip,odoomrp/odoomrp-wip,jobiols/odoomrp-wip,esthermm/odoomrp-wip,esthermm/odoomrp-wip,Eficent/odoomrp-wip,jobiols/odoomrp-wip,Daniel-CA/odoomrp-wip-public,diagramsoftware/odoomrp-wip,diagramsoftware/odoomrp-wip,sergiocorato/odoomrp-wip,sergiocorato/odoomrp-wip,factorlibre/odoomrp-wip,... | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | <commit_before># -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
... | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _prepare... | <commit_before># -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
... |
ce6c4cb4bcac22fecd0a4a00624c7bc7eca325d0 | saltapi/cli.py | saltapi/cli.py | '''
CLI entry-point for salt-api
'''
# Import salt libs
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api libs
import saltapi.client
import saltapi.config
import saltapi.version
cl... | '''
CLI entry-point for salt-api
'''
# Import python libs
import sys
import logging
# Import salt libs
import salt.utils.verify
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api lib... | Enforce verify file on the log file and actually setup the log file logger. | Enforce verify file on the log file and actually setup the log file logger.
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
CLI entry-point for salt-api
'''
# Import salt libs
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api libs
import saltapi.client
import saltapi.config
import saltapi.version
cl... | '''
CLI entry-point for salt-api
'''
# Import python libs
import sys
import logging
# Import salt libs
import salt.utils.verify
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api lib... | <commit_before>'''
CLI entry-point for salt-api
'''
# Import salt libs
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api libs
import saltapi.client
import saltapi.config
import salta... | '''
CLI entry-point for salt-api
'''
# Import python libs
import sys
import logging
# Import salt libs
import salt.utils.verify
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api lib... | '''
CLI entry-point for salt-api
'''
# Import salt libs
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api libs
import saltapi.client
import saltapi.config
import saltapi.version
cl... | <commit_before>'''
CLI entry-point for salt-api
'''
# Import salt libs
from salt.utils.parsers import (
ConfigDirMixIn,
DaemonMixIn,
LogLevelMixIn,
MergeConfigMixIn,
OptionParser,
OptionParserMeta,
PidfileMixin)
# Import salt-api libs
import saltapi.client
import saltapi.config
import salta... |
257afb0046c4af30bbfe0d46c36f0ec3257051b6 | glooey/__init__.py | glooey/__init__.py | #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
| #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
from . import themes
| Make the themes module available by default. | Make the themes module available by default.
| Python | mit | kxgames/glooey,kxgames/glooey | #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
Make the themes module available by default. | #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
from . import themes
| <commit_before>#!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
<commit_msg>Make the themes module available by default.<commit_after> | #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
from . import themes
| #!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
Make the themes module available by default.#!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers imp... | <commit_before>#!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *
from .root import *
from .containers import *
from .miscellaneous import *
from . import drawing
<commit_msg>Make the themes module available by default.<commit_after>#!/usr/bin/env python3
__version__ = '0.1.0'
from .widget import *... |
bea2e64d8ed8ab2a368d660a15ed2f8485fdc29a | set_offline.py | set_offline.py | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.channelupdater as ChannelUpdater
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
cf.load_configs... | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
if not os.path.isfile(user_config):
print("Could not find c... | Add EQ related links in offline bot message | Add EQ related links in offline bot message
| Python | mit | EsqWiggles/SLA-bot,EsqWiggles/SLA-bot | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.channelupdater as ChannelUpdater
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
cf.load_configs... | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
if not os.path.isfile(user_config):
print("Could not find c... | <commit_before>import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.channelupdater as ChannelUpdater
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
... | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
if not os.path.isfile(user_config):
print("Could not find c... | import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.channelupdater as ChannelUpdater
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
cf.load_configs... | <commit_before>import asyncio
import os
import discord
from discord.ext import commands
import SLA_bot.channelupdater as ChannelUpdater
import SLA_bot.config as cf
curr_dir = os.path.dirname(__file__)
default_config = os.path.join(curr_dir, 'default_config.ini'),
user_config = os.path.join(curr_dir, 'config.ini')
... |
45116fc996b097176bcfa2dcd7fb8c9710f6d66e | tests/test_basics.py | tests/test_basics.py |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... | Remove debug printing from test case | Remove debug printing from test case
| Python | apache-2.0 | t4ngo/sphinxcontrib-traceables |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... | <commit_before>
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = E... |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... |
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = ElementTree.pars... | <commit_before>
import os
from xml.etree import ElementTree
from utils import with_app, pretty_print_xml
#=============================================================================
# Tests
@with_app(buildername="xml", srcdir="basics")
def test_basics(app, status, warning):
app.build()
tree = E... |
00712888b761bce556b73e36c9c7270829d3a1d4 | tests/test_entity.py | tests/test_entity.py | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | Test the failure branch in BaseEntityJSONDecoder | Test the failure branch in BaseEntityJSONDecoder
| Python | mit | spaceboats/busbus | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | <commit_before>from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(... | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(agency):
wi... | <commit_before>from test_provider_gtfs import provider
from busbus.entity import BaseEntityJSONEncoder
import json
import pytest
@pytest.fixture(scope='module')
def agency(provider):
return next(provider.agencies)
def test_entity_repr(agency):
assert 'DTA' in repr(agency)
def test_entity_failed_getattr(... |
6c2d8d3b2a5e148085e65df66b9c66c543c2dcb0 | spacy/about.py | spacy/about.py | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | Use shortcuts-nightly.json to resolve model shortcuts | Use shortcuts-nightly.json to resolve model shortcuts
| Python | mit | aikramer2/spaCy,honnibal/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,aikramer2/spaCy,honnibal/spa... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | <commit_before># inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Py... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython... | <commit_before># inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a18'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Py... |
f0d87f1979ace66f530bb8f7f00cdc71ac8f549c | chainer/datasets/__init__.py | chainer/datasets/__init__.py | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | Add LabeledImageDataset to datasets module | Add LabeledImageDataset to datasets module
| Python | mit | chainer/chainer,kiyukuta/chainer,wkentaro/chainer,tkerola/chainer,kikusu/chainer,ysekky/chainer,wkentaro/chainer,delta2323/chainer,chainer/chainer,okuta/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,okuta/chainer,cupy/cupy,ktnyt/chainer,jnishi/chainer,kikusu/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,aon... | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | <commit_before>from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.Dict... | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.DictDataset
ImageDa... | <commit_before>from chainer.datasets import cifar
from chainer.datasets import dict_dataset
from chainer.datasets import image_dataset
from chainer.datasets import mnist
from chainer.datasets import ptb
from chainer.datasets import sub_dataset
from chainer.datasets import tuple_dataset
DictDataset = dict_dataset.Dict... |
4051794670ec252cb972ed0c8cd1a5203e8a8de4 | amplpy/amplpython/__init__.py | amplpy/amplpython/__init__.py | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
... | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
from glob import glob
try:
if ctypes.si... | Fix 'ImportError: DLL load failed' | Fix 'ImportError: DLL load failed'
| Python | bsd-3-clause | ampl/amplpy,ampl/amplpy,ampl/amplpy | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
... | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
from glob import glob
try:
if ctypes.si... | <commit_before># -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
try:
if ctypes.sizeof(ctypes.c_voi... | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
from glob import glob
try:
if ctypes.si... | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
... | <commit_before># -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
try:
if ctypes.sizeof(ctypes.c_voi... |
31bb7c86a65dffb44a2950659da9f9299bb4023f | tests/fixtures/water_supply_exec.py | tests/fixtures/water_supply_exec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from . water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Ar... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Argu... | Revert "Used relative import for water_supply fixture" | Revert "Used relative import for water_supply fixture"
This reverts commit 8615f9c9d8a254dc6a43229e0ec8fc68ebe12e08.
| Python | mit | willu47/smif,tomalrussell/smif,willu47/smif,nismod/smif,willu47/smif,nismod/smif,willu47/smif,nismod/smif,tomalrussell/smif,tomalrussell/smif,tomalrussell/smif,nismod/smif | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from . water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Ar... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Argu... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from . water_supply import ExampleWaterSupplySimulation
def argparse():
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Argu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from . water_supply import ExampleWaterSupplySimulation
def argparse():
parser = Ar... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements example simulation model which can be run from the command line
Arguments
=========
raininess : int
Sets the amount of rain
"""
from argparse import ArgumentParser
from . water_supply import ExampleWaterSupplySimulation
def argparse():
... |
0d0e354627441daf33ea8c5702c3977de992cc7a | tests/unit/utils/test_yamldumper.py | tests/unit/utils/test_yamldumper.py | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock imp... | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.ext.six
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from te... | Fix yamldumper test for both py2/py3 | Fix yamldumper test for both py2/py3
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock imp... | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.ext.six
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from te... | <commit_before># -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.s... | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.ext.six
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from te... | # -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock imp... | <commit_before># -*- coding: utf-8 -*-
'''
Unit tests for salt.utils.yamldumper
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.utils.yamldumper
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.s... |
8b0bccf5dbe86accd967bfc8cb0ee6db049ea23c | service/posts/serializers.py | service/posts/serializers.py | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | Update visible_to reference to visible_to_author | Update visible_to reference to visible_to_author
| Python | apache-2.0 | TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | <commit_before>from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but mak... | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but makes testing a li... | <commit_before>from rest_framework import serializers
from service.authors.serializers import SimpleAuthorSerializer
from service.comments.serializers import CommentSerializer
from social.app.models.post import Post
class PostSerializer(serializers.HyperlinkedModelSerializer):
# Not required by the spec, but mak... |
8555f6c4076a485d7615b8caef861536096c0ac1 | scripts/app.py | scripts/app.py | from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.setTransformer(1)
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
| from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
| Load source dataset and save transformed dataset | Load source dataset and save transformed dataset
| Python | mit | rsk-mind/rsk-mind-framework | from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.setTransformer(1)
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
Load source dataset and save transformed dataset | from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
| <commit_before>from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.setTransformer(1)
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
<commit_msg>Load source dataset and save transformed dataset<commit_afte... | from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
| from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.setTransformer(1)
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
Load source dataset and save transformed datasetfrom rsk_mind.datasource import CSVData... | <commit_before>from rsk_mind.datasource import CSVDatasource
datasource = CSVDatasource('in.csv')
dataset = datasource.read()
dataset.setTransformer(1)
dataset.applyTransformations()
datasource = CSVDatasource('out.csv')
datasource.write(dataset)
<commit_msg>Load source dataset and save transformed dataset<commit_afte... |
586fab3cdc9e059c082bf209a6113b6bb06f2119 | knox/settings.py | knox/settings.py | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import api_settings, APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'LOGIN_AUTHENTICATION_CLASSES': api_settings.DEFAULT_AUTHENTICATION_CLASSE... | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512',
'AUTH_TOKEN... | Revert "separate default authentication from the DRF's one" | Revert "separate default authentication from the DRF's one"
This reverts commit 73aef41ffd2be2fbed11cf75f75393a80322bdcb.
| Python | mit | James1345/django-rest-knox,James1345/django-rest-knox | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import api_settings, APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'LOGIN_AUTHENTICATION_CLASSES': api_settings.DEFAULT_AUTHENTICATION_CLASSE... | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512',
'AUTH_TOKEN... | <commit_before>from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import api_settings, APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'LOGIN_AUTHENTICATION_CLASSES': api_settings.DEFAULT_AUTHEN... | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512',
'AUTH_TOKEN... | from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import api_settings, APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'LOGIN_AUTHENTICATION_CLASSES': api_settings.DEFAULT_AUTHENTICATION_CLASSE... | <commit_before>from datetime import timedelta
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import api_settings, APISettings
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)
DEFAULTS = {
'LOGIN_AUTHENTICATION_CLASSES': api_settings.DEFAULT_AUTHEN... |
151f05738d760909d5c3eba6b6d7c182aa77e8d4 | opps/core/admin.py | opps/core/admin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | Add child_class on list filter PublishableAdmin | Add child_class on list filter PublishableAdmin
| Python | mit | williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,jeanmask/opps,jeanmask/opps,williamroot/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
... |
b3ff448c44af0a7d342364fb482d629e80b6ee40 | sipa/model/pycroft/schema.py | sipa/model/pycroft/schema.py | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | # -*- coding: utf-8 -*-
from __future__ import annotations
from decimal import Decimal
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
... | Fix pycroft backend displaying wrong finance balance | Fix pycroft backend displaying wrong finance balance
| Python | mit | agdsn/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa,MarauderXtreme/sipa | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | # -*- coding: utf-8 -*-
from __future__ import annotations
from decimal import Decimal
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: boo... | # -*- coding: utf-8 -*-
from __future__ import annotations
from decimal import Decimal
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | <commit_before># -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: boo... |
48ffcca081ab1d143e9941e67e6cc5c6a2844d23 | pygotham/admin/talks.py | pygotham/admin/talks.py | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | Add filters to the talk admin | Add filters to the talk admin
@logston is reviewing talks and wanted to see the talk duration. He also
thought it would be useful to be able to filter by the duration and
status of the talk.
| Python | bsd-3-clause | djds23/pygotham-1,pathunstrom/pygotham,djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,pathunstrom/pygotham,pathunstrom/pygotham,PyGotham/pygotham,PyGotham/pygotham,pathunstrom/pygotham,pathunstrom/pygotham | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | <commit_before>"""Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slu... | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | """Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slug'),
)
TalkMod... | <commit_before>"""Admin for talk-related models."""
from pygotham.admin.utils import model_view
from pygotham.talks import models
__all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView')
CategoryModelView = model_view(
models.Category,
'Categories',
'Talks',
form_columns=('name', 'slu... |
ad3173b5f701cc27532103fcffe52deca67432b7 | user_profile/models.py | user_profile/models.py | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/profiles/thum... | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(blank=True, upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/p... | Change user_profile so picture can be null | Change user_profile so picture can be null
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/profiles/thum... | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(blank=True, upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/p... | <commit_before>from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='medi... | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(blank=True, upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/p... | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='media/profiles/thum... | <commit_before>from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
thumbnail = models.ImageField(
upload_to='medi... |
175ffb66a58d8f05150a50b2a6dce30663f5999c | user_profile/models.py | user_profile/models.py | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/') | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
follows = models.ManyToManyField("self", blank=True, null=True) | Add following into user profile | Add following into user profile
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')Add following into user profile | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
follows = models.ManyToManyField("self", blank=True, null=True) | <commit_before>from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')<commit_msg>Add following into user profile<commit_aft... | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')
follows = models.ManyToManyField("self", blank=True, null=True) | from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')Add following into user profilefrom django.db import models
from djan... | <commit_before>from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
description = models.TextField(max_length=3000)
picture = models.ImageField(upload_to='media/profiles/')<commit_msg>Add following into user profile<commit_aft... |
8a7be30e2847f6d50f401dedc616d667cb36a6c6 | rx/linq/observable/average.py | rx/linq/observable/average.py | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | Rename from select to map | Rename from select to map
| Python | mit | dbrattli/RxPY,ReactiveX/RxPY,ReactiveX/RxPY | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | <commit_before>from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta clas... | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta class to extend Obs... | <commit_before>from six import add_metaclass
from rx import Observable
from rx.internal import ExtensionMethod
class AverageValue(object):
def __init__(self, sum, count):
self.sum = sum
self.count = count
@add_metaclass(ExtensionMethod)
class ObservableAverage(Observable):
"""Uses a meta clas... |
d7f80b24f37ffb5e5cd1f7b2ccfa83c144a79c4d | ironic/tests/__init__.py | ironic/tests/__init__.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | Remove broken workaround code for old mock. | Remove broken workaround code for old mock.
Mock <= 1.0.1 was indeed broken on 3.4, but unittest.mock from 3.4 is
just as (or more) broken. Mock is now fixed, so don't play games with
the global state of the import system.
Change-Id: I5e04b773d33c63d5cf06ff60c321de70de453b69
Closes-Bug: #1488252
Partial-Bug: #1463867... | Python | apache-2.0 | openstack/ironic,bacaldwell/ironic,pshchelo/ironic,ionutbalutoiu/ironic,NaohiroTamura/ironic,devananda/ironic,bacaldwell/ironic,pshchelo/ironic,naterh/ironic,ionutbalutoiu/ironic,redhat-openstack/ironic,SauloAislan/ironic,openstack/ironic,hpproliant/ironic,dims/ironic,dims/ironic,SauloAislan/ironic,NaohiroTamura/ironic | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | <commit_before># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | <commit_before># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may... |
059e5afd9b0bf81e70be177e60b37d21a557be4f | kivy/tests/test_fonts.py | kivy/tests/test_fonts.py | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), 'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.joi... | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), u'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.jo... | Fix font test to use unicode font filename for proper loading to allow passing test on windows (and other os's). | Fix font test to use unicode font filename for proper loading to allow passing test on windows (and other os's).
| Python | mit | tony/kivy,jegger/kivy,xpndlabs/kivy,rnixx/kivy,CuriousLearner/kivy,manthansharma/kivy,janssen/kivy,bliz937/kivy,jehutting/kivy,bionoid/kivy,xpndlabs/kivy,cbenhagen/kivy,JohnHowland/kivy,LogicalDash/kivy,jkankiewicz/kivy,yoelk/kivy,jegger/kivy,dirkjot/kivy,arcticshores/kivy,Farkal/kivy,angryrancor/kivy,jffernandez/kivy,... | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), 'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.joi... | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), u'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.jo... | <commit_before>#-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), 'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipF... | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), u'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.jo... | #-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), 'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipFile(os.path.joi... | <commit_before>#-*- coding: utf-8 -*-
import unittest
class FontTestCase(unittest.TestCase):
def setUp(self):
import os
self.font_name = os.path.join(os.path.dirname(__file__), 'कीवी.ttf')
if not os.path.exists(self.font_name):
from zipfile import ZipFile
with ZipF... |
a7c3b4266fe4688ffdf91b9c85a93bea3660957e | statzlogger.py | statzlogger.py | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class Collection(logging.Handler):
def __init__(self, level=logging.NOTSE... | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class StatzHandler(logging.Handler):
def emit(self, record):
pass... | Create and use a new base class. | Create and use a new base class.
Since all handlers need to implement emit(), this is probably the best route
forward.
| Python | isc | whilp/statzlogger | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class Collection(logging.Handler):
def __init__(self, level=logging.NOTSE... | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class StatzHandler(logging.Handler):
def emit(self, record):
pass... | <commit_before>import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class Collection(logging.Handler):
def __init__(self, leve... | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class StatzHandler(logging.Handler):
def emit(self, record):
pass... | import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class Collection(logging.Handler):
def __init__(self, level=logging.NOTSE... | <commit_before>import logging
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger("statzlogger")
log.addHandler(NullHandler())
class Collection(logging.Handler):
def __init__(self, leve... |
6de96ef01d24d01e704b35864d5a687f60063f7e | kirppu/app/urls.py | kirppu/app/urls.py | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)', 'get_commands', name='co... | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)$', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)$', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)$', 'get_commands', name=... | Add line-ends to terminal url regexps. | Add line-ends to terminal url regexps.
- This ensures that parameters are not ignored if they do not match the
regexp.
Conflicts:
kirppu/app/urls.py
| Python | mit | jlaunonen/kirppu,mniemela/kirppu,mniemela/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,mniemela/kirppu,jlaunonen/kirppu | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)', 'get_commands', name='co... | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)$', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)$', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)$', 'get_commands', name=... | <commit_before>from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)', 'get_comm... | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)$', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)$', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)$', 'get_commands', name=... | from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)', 'get_commands', name='co... | <commit_before>from django.conf.urls import patterns, url
__author__ = 'jyrkila'
urlpatterns = patterns('kirppu.app.views',
url(r'^page/(?P<sid>\d+)/(?P<eid>\d+)', 'get_items', name='page'),
url(r'^code/(?P<iid>\w+?)\.(?P<ext>\w+)', 'get_item_image', name='image'),
url(r'^commands/(?P<eid>\d+)', 'get_comm... |
d9d051b7a80025d76cfe0827f0bf632cfbd18972 | app/handlers.py | app/handlers.py | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path) or os.pat... | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path):
... | Remove extra check of symlinks. | Remove extra check of symlinks.
| Python | apache-2.0 | pcinkh/fake-useragent-cache-server | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path) or os.pat... | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path):
... | <commit_before>import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_... | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path):
... | import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_path) or os.pat... | <commit_before>import os
import io
import json
from aiohttp import web
class Handler:
def __init__(self, *, loop):
self.loop = loop
self.files = {}
def lookup_files(self, path):
for obj in os.listdir(path):
_path = os.path.join(path, obj)
if os.path.isfile(_... |
64bf087f818e58bec8c39c03fb51b62f4253b2ad | settings.py | settings.py | import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = '/home/pieter/projects/factors/data'
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
| import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
| Make DATADIR absolute path agnostic | Make DATADIR absolute path agnostic
| Python | mit | Oxylo/factors | import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = '/home/pieter/projects/factors/data'
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
Make DATADIR absolute path agnostic | import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
| <commit_before>import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = '/home/pieter/projects/factors/data'
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
<commit_msg>Make DATADIR absolute path agnosti... | import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
| import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = '/home/pieter/projects/factors/data'
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
Make DATADIR absolute path agnosticimport os
LOWAGE = 15
UP... | <commit_before>import os
LOWAGE = 15
UPAGE = 70
MAXAGE = 120
DATADIR = '/home/pieter/projects/factors/data'
INFILE = 'lifedb.xls'
XLSWB = os.path.join(DATADIR, INFILE)
INSURANCE_IDS = ['OPLL', 'NPLL-B', 'NPLL-O',
'NPLLRS', 'NPTL-B', 'NPTL-O', 'ay_avg']
<commit_msg>Make DATADIR absolute path agnosti... |
d39d922168a0918bce572049cd93844060a79b9a | awseed/test_iam_credentials_envar.py | awseed/test_iam_credentials_envar.py | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=AKIAJOVZ2DVGJ... | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=acb \
# A... | Remove AWS credential (IAM user have already been deleted from AWS) | Remove AWS credential (IAM user have already been deleted from AWS)
| Python | mit | nyue/awseed,nyue/awseed | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=AKIAJOVZ2DVGJ... | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=acb \
# A... | <commit_before># AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_I... | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=acb \
# A... | # AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_ID=AKIAJOVZ2DVGJ... | <commit_before># AWS_ACCESS_KEY_ID - AWS access key.
# AWS_SECRET_ACCESS_KEY - AWS secret key. Access and secret key variables override credentials stored in credential and config files.
# AWS_DEFAULT_REGION - AWS region. This variable overrides the default region of the in-use profile, if set.
#
# env AWS_ACCESS_KEY_I... |
7fab2f02ddea20a790c4e6065b38229776c6b763 | spam/tests/test_preprocess.py | spam/tests/test_preprocess.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | Add empty tests with descriptions. | Add empty tests with descriptions.
| Python | mit | benigls/spam,benigls/spam | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
par... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
params.DATASET_PAT... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from spam.preprocess import PreProcess
from spam.common import params
class TestPreProcess(unittest.TestCase):
"""
Class for testing the preprocces.
"""
def setUp(self):
self.preprocess = PreProcess(
par... |
95a72d1f06c740b933983c2446b36bb450c4730e | ona_migration_script/migrate_toilet_codes.py | ona_migration_script/migrate_toilet_codes.py | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | Add dryrun command line argument | Add dryrun command line argument
| Python | bsd-3-clause | praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | <commit_before>import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', t... | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', type=str, help='... | <commit_before>import argparse
parser = argparse.ArgumentParser(description='Migrate toilet codes')
parser.add_argument(
'url', type=str,
help='The base URL for the django toilet database')
parser.add_argument(
'username', type=str, help='The username used to log in')
parser.add_argument(
'password', t... |
cdb3a6f1a467c317817818a7df921dc168cacb4c | astropy/time/setup_package.py | astropy/time/setup_package.py | import os
from distutils.extension import Extension
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
time_ext = Extension(
name="astropy.time.sofa_time",
sources=[os.path.join(TIMEROOT, "sofa_time.pyx"), "cextern/sofa/sofa.c"],
include_dirs=['numpy', 'cextern/sofa'],
la... | import os
from distutils.extension import Extension
from astropy import setup_helpers
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = [os.path.join(TIMEROOT, "sofa_time.pyx")]
include_dirs = ['numpy']
libraries = []
if setup_helpers.use_system_library('sofa'):
... | Update astropy.time setup to allow using system sofa_c library | Update astropy.time setup to allow using system sofa_c library
| Python | bsd-3-clause | lpsinger/astropy,saimn/astropy,tbabej/astropy,stargaser/astropy,lpsinger/astropy,DougBurke/astropy,StuartLittlefair/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,funbaker/astropy,pllim/astropy,kelle/astropy,mhvk/astropy,mhvk/astropy,kelle/astropy,tbabej/astropy,larrybradley/astropy,larrybradley/astropy,stargas... | import os
from distutils.extension import Extension
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
time_ext = Extension(
name="astropy.time.sofa_time",
sources=[os.path.join(TIMEROOT, "sofa_time.pyx"), "cextern/sofa/sofa.c"],
include_dirs=['numpy', 'cextern/sofa'],
la... | import os
from distutils.extension import Extension
from astropy import setup_helpers
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = [os.path.join(TIMEROOT, "sofa_time.pyx")]
include_dirs = ['numpy']
libraries = []
if setup_helpers.use_system_library('sofa'):
... | <commit_before>import os
from distutils.extension import Extension
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
time_ext = Extension(
name="astropy.time.sofa_time",
sources=[os.path.join(TIMEROOT, "sofa_time.pyx"), "cextern/sofa/sofa.c"],
include_dirs=['numpy', 'cextern... | import os
from distutils.extension import Extension
from astropy import setup_helpers
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = [os.path.join(TIMEROOT, "sofa_time.pyx")]
include_dirs = ['numpy']
libraries = []
if setup_helpers.use_system_library('sofa'):
... | import os
from distutils.extension import Extension
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
time_ext = Extension(
name="astropy.time.sofa_time",
sources=[os.path.join(TIMEROOT, "sofa_time.pyx"), "cextern/sofa/sofa.c"],
include_dirs=['numpy', 'cextern/sofa'],
la... | <commit_before>import os
from distutils.extension import Extension
TIMEROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
time_ext = Extension(
name="astropy.time.sofa_time",
sources=[os.path.join(TIMEROOT, "sofa_time.pyx"), "cextern/sofa/sofa.c"],
include_dirs=['numpy', 'cextern... |
bb02ac7340fc939e1b2527cc079985a2eb021b3a | project/settings_prod.py | project/settings_prod.py | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | Debug in prod for a moment | Debug in prod for a moment
| Python | mit | AxisPhilly/lobbying.ph-django,AxisPhilly/lobbying.ph-django,AxisPhilly/lobbying.ph-django | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | <commit_before>from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.j... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | <commit_before>from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.j... |
a3f5e1338cc84c60b867fc04175253f7ab460912 | relay_api/api/backend.py | relay_api/api/backend.py | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | Add indent in json to improve debugging | Add indent in json to improve debugging
| Python | mit | pahumadad/raspi-relay-api | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | <commit_before>import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_d... | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_dict()
retur... | <commit_before>import json
from relay_api.core.relay import relay
from relay_api.conf.config import relays
def init_relays():
for r in relays:
relays[r]["object"] = relay(relays[r]["gpio"])
relays[r]["state"] = relays[r]["object"].get_state()
def get_all_relays():
relays_dict = __get_relay_d... |
ffc7cd05ce824b8ec0aeee4e8f428a1c93710b08 | db/db.py | db/db.py | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir,username), password)
def save():
aesjsonfile.du... | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir, self.username), self.password)
def save(self):
... | Fix bugs, add accountstodo method. | Fix bugs, add accountstodo method.
| Python | agpl-3.0 | vincebusam/pyWebCash,vincebusam/pyWebCash,vincebusam/pyWebCash | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir,username), password)
def save():
aesjsonfile.du... | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir, self.username), self.password)
def save(self):
... | <commit_before>import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir,username), password)
def save():
... | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir, self.username), self.password)
def save(self):
... | import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir,username), password)
def save():
aesjsonfile.du... | <commit_before>import sys
import aesjsonfile
sys.path.append("../")
import config
class DB(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.db = aesjsonfile.load("%s/%s.json"%(config.dbdir,username), password)
def save():
... |
2d98e2b738ffed183e8b5ec2e4e17753e6cf60c9 | test/skills/scheduled_skills.py | test/skills/scheduled_skills.py | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | Correct test criteria for time format for scheduled skill. | Correct test criteria for time format for scheduled skill.
Now matches current behaviour, previous behaviour is not a good idea since it depended on Locale.
| Python | apache-2.0 | forslund/mycroft-core,aatchison/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,linuxipho/mycroft-core,MycroftAI/mycroft-core,Dark5ide/mycroft-core | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | <commit_before>from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTes... | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTest')
def te... | <commit_before>from datetime import datetime, timedelta
import unittest
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class ScheduledSkillTest(unittest.TestCase):
skill = ScheduledSkill(name='ScheduledSkillTes... |
c908c943f66468f91cb8abb450bca36ead731885 | test_app.py | test_app.py | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for, session
from app import app
class BucketListTest(TestCase):
def setUp(self):
app.config['SECRET_KEY'] = 'seasasaskrit!'
# creates a test client
self.cli... | Add test for signup success | Add test for signup success
| Python | mit | mkiterian/bucket-list-app,mkiterian/bucket-list-app,mkiterian/bucket-list-app | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for, session
from app import app
class BucketListTest(TestCase):
def setUp(self):
app.config['SECRET_KEY'] = 'seasasaskrit!'
# creates a test client
self.cli... | <commit_before>import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.... | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for, session
from app import app
class BucketListTest(TestCase):
def setUp(self):
app.config['SECRET_KEY'] = 'seasasaskrit!'
# creates a test client
self.cli... | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | <commit_before>import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.... |
71cc3cf500a9db7a96aa5f1a6c19c387cf0ad4ec | fickle/backend.py | fickle/backend.py | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = dataset['data']
... | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.random_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._d... | Validate with sequential random state | Validate with sequential random state
| Python | mit | norbert/fickle | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = dataset['data']
... | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.random_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._d... | <commit_before>import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = datase... | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.random_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._d... | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = dataset['data']
... | <commit_before>import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = datase... |
06dc2190d64e312b3b8285e69a0d50342bc55b46 | tests/integration/test_proxy.py | tests/integration/test_proxy.py | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
requests = pytest.importorskip("requests")
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
class Proxy(SimpleHTTPServer.SimpleHTT... | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
# Conditional imports
requests = pytest.importorskip("requests")
class Proxy(Sim... | Fix format string for Python 2.6 | Fix format string for Python 2.6
| Python | mit | kevin1024/vcrpy,graingert/vcrpy,kevin1024/vcrpy,graingert/vcrpy | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
requests = pytest.importorskip("requests")
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
class Proxy(SimpleHTTPServer.SimpleHTT... | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
# Conditional imports
requests = pytest.importorskip("requests")
class Proxy(Sim... | <commit_before># -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
requests = pytest.importorskip("requests")
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
class Proxy(SimpleHTTPS... | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
# Conditional imports
requests = pytest.importorskip("requests")
class Proxy(Sim... | # -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
requests = pytest.importorskip("requests")
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
class Proxy(SimpleHTTPServer.SimpleHTT... | <commit_before># -*- coding: utf-8 -*-
'''Test using a proxy.'''
# External imports
import multiprocessing
import pytest
requests = pytest.importorskip("requests")
from six.moves import socketserver, SimpleHTTPServer
from six.moves.urllib.request import urlopen
# Internal imports
import vcr
class Proxy(SimpleHTTPS... |
fce1b1bdb5a39bbe57b750cd453a9697b8447d6b | chat.py | chat.py | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
# if chat... | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
storage =... | Correct position of comment :) | Correct position of comment :)
| Python | bsd-3-clause | arturosevilla/notification-server-example,arturosevilla/notification-server-example | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
# if chat... | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
storage =... | <commit_before>import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return Non... | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
storage =... | import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return None
# if chat... | <commit_before>import re
from redis import Redis
import json
from datetime import datetime
def is_valid_chatroom(chatroom):
return re.match('[A-Za-z_\\d]+$', chatroom) is not None
def get_redis():
return Redis()
def get_conversation(chatroom):
if chatroom is None or len(chatroom) == 0:
return Non... |
2c90b0ca03c79cbba476897b8a2068e99cc6b2b1 | restaurant/urls.py | restaurant/urls.py | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | Change view for login url. Add url for index page | Change view for login url. Add url for index page
| Python | mit | Social-projects-Rivne/Rv-025.Python,Social-projects-Rivne/Rv-025.Python,Social-projects-Rivne/Rv-025.Python | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... |
f6a382a9a52ef2321c18ba63a2ece6930dadcf62 | src/pybel/manager/__init__.py | src/pybel/manager/__init__.py | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | Add citation utils to init | Add citation utils to init
| Python | mit | pybel/pybel,pybel/pybel,pybel/pybel | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | <commit_before># -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""... | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | # -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""
from . import... | <commit_before># -*- coding: utf-8 -*-
"""
The :mod:`pybel.manager` module serves as an interface between the BEL graph data structure and underlying relational
databases. Its inclusion allows for the caching of namespaces and annotations for much faster lookup than
downloading and parsing upon each compilation.
"""... |
1c9b0185b98d1bfe06fb7bd565d255a1b4f23f96 | test_output.py | test_output.py | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | Add a test for the tidy-url command | Add a test for the tidy-url command
| Python | mit | alexwlchan/safari.rs,alexwlchan/safari.rs | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
d... | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | #!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
def test_urls_al... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
"""
These are tests of the external behaviour -- feature tests, if you like.
They run the compiled binaries, and make assertions about the return code,
stdout and stderr.
"""
import unittest
from conftest import BaseTest
class TestSafariRS(BaseTest):
d... |
f9fbb8331d6dc91773f686c57d41128edc6b80f9 | f5_openstack_agent/lbaasv2/drivers/bigip/test/test__common_service_handler.py | f5_openstack_agent/lbaasv2/drivers/bigip/test/test__common_service_handler.py | import copy
import json
import mock
import os
from pprint import pprint as pp
import pytest
from pytest import symbols
import requests
from oslo_config import cfg
from f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver import\
iControlDriver
requests.packages.urllib3.disable_warnings()
opd = os.path.dirna... | import copy
import json
import os
from pprint import pprint as pp
from pytest import symbols
import requests
requests.packages.urllib3.disable_warnings()
opd = os.path.dirname
DISTRIBUTIONROOT = opd(opd(opd(opd(opd(opd(__file__))))))
del opd
SERVICELIBDIR = os.path.join(DISTRIBUTIONROOT,
... | Fix flake8 violations in test | Fix flake8 violations in test
| Python | apache-2.0 | F5Networks/f5-openstack-agent,richbrowne/f5-openstack-agent,richbrowne/f5-openstack-agent,richbrowne/f5-openstack-agent,F5Networks/f5-openstack-agent,F5Networks/f5-openstack-agent | import copy
import json
import mock
import os
from pprint import pprint as pp
import pytest
from pytest import symbols
import requests
from oslo_config import cfg
from f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver import\
iControlDriver
requests.packages.urllib3.disable_warnings()
opd = os.path.dirna... | import copy
import json
import os
from pprint import pprint as pp
from pytest import symbols
import requests
requests.packages.urllib3.disable_warnings()
opd = os.path.dirname
DISTRIBUTIONROOT = opd(opd(opd(opd(opd(opd(__file__))))))
del opd
SERVICELIBDIR = os.path.join(DISTRIBUTIONROOT,
... | <commit_before>import copy
import json
import mock
import os
from pprint import pprint as pp
import pytest
from pytest import symbols
import requests
from oslo_config import cfg
from f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver import\
iControlDriver
requests.packages.urllib3.disable_warnings()
opd ... | import copy
import json
import os
from pprint import pprint as pp
from pytest import symbols
import requests
requests.packages.urllib3.disable_warnings()
opd = os.path.dirname
DISTRIBUTIONROOT = opd(opd(opd(opd(opd(opd(__file__))))))
del opd
SERVICELIBDIR = os.path.join(DISTRIBUTIONROOT,
... | import copy
import json
import mock
import os
from pprint import pprint as pp
import pytest
from pytest import symbols
import requests
from oslo_config import cfg
from f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver import\
iControlDriver
requests.packages.urllib3.disable_warnings()
opd = os.path.dirna... | <commit_before>import copy
import json
import mock
import os
from pprint import pprint as pp
import pytest
from pytest import symbols
import requests
from oslo_config import cfg
from f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver import\
iControlDriver
requests.packages.urllib3.disable_warnings()
opd ... |
bdb46e88fb9ee14b6c12d2b9aa5087cfe973492c | pontoon/base/__init__.py | pontoon/base/__init__.py | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-aur... | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/',... | Make Mozilla Beta repositories special | Make Mozilla Beta repositories special
| Python | bsd-3-clause | yfdyh000/pontoon,jotes/pontoon,participedia/pontoon,m8ttyB/pontoon,m8ttyB/pontoon,mastizada/pontoon,jotes/pontoon,mathjazz/pontoon,mozilla/pontoon,jotes/pontoon,yfdyh000/pontoon,mathjazz/pontoon,mastizada/pontoon,yfdyh000/pontoon,jotes/pontoon,sudheesh001/pontoon,yfdyh000/pontoon,mastizada/pontoon,sudheesh001/pontoon,m... | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-aur... | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/',... | <commit_before>"""Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/... | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/',... | """Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-aur... | <commit_before>"""Application base, containing global templates."""
default_app_config = 'pontoon.base.apps.BaseConfig'
MOZILLA_REPOS = (
'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/',
'ssh://hg.mozilla.org/users/m_owca.info/... |
ed34dac136af052c849b35adacc7c95b2d82e00a | tests/test_content_type.py | tests/test_content_type.py | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | Check media_type instead of class type | Check media_type instead of class type
The `parsers` list should contain instances, not classes.
| Python | mit | hzdg/drf-url-content-type-override | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | <commit_before>import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation i... | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | <commit_before>import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.