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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2bb7f0461599cc7624b8d844be93b6912fc0b1d | examples/test_filter_strings.py | examples/test_filter_strings.py |
def test_filter_strings(wish):
accept_names = wish
names = ['has MARK', 'does not have']
accept_pattern = '.*MARK.*' |
def test_filter_strings_basic(wish):
filter_strings = wish
input = ['has MARK', 'does not have']
expected_ouput = ['has MARK']
accept_pattern = '.*MARK.*'
assert list(filter_strings(input, accept_pattern)) == expected_ouput
| Complete unfinished code committed by mistake. | Complete unfinished code committed by mistake.
| Python | mit | nodev-io/pytest-nodev,alexamici/pytest-wish,alexamici/pytest-nodev |
def test_filter_strings(wish):
accept_names = wish
names = ['has MARK', 'does not have']
accept_pattern = '.*MARK.*'Complete unfinished code committed by mistake. |
def test_filter_strings_basic(wish):
filter_strings = wish
input = ['has MARK', 'does not have']
expected_ouput = ['has MARK']
accept_pattern = '.*MARK.*'
assert list(filter_strings(input, accept_pattern)) == expected_ouput
| <commit_before>
def test_filter_strings(wish):
accept_names = wish
names = ['has MARK', 'does not have']
accept_pattern = '.*MARK.*'<commit_msg>Complete unfinished code committed by mistake.<commit_after> |
def test_filter_strings_basic(wish):
filter_strings = wish
input = ['has MARK', 'does not have']
expected_ouput = ['has MARK']
accept_pattern = '.*MARK.*'
assert list(filter_strings(input, accept_pattern)) == expected_ouput
|
def test_filter_strings(wish):
accept_names = wish
names = ['has MARK', 'does not have']
accept_pattern = '.*MARK.*'Complete unfinished code committed by mistake.
def test_filter_strings_basic(wish):
filter_strings = wish
input = ['has MARK', 'does not have']
expected_ouput = ['has MARK']
a... | <commit_before>
def test_filter_strings(wish):
accept_names = wish
names = ['has MARK', 'does not have']
accept_pattern = '.*MARK.*'<commit_msg>Complete unfinished code committed by mistake.<commit_after>
def test_filter_strings_basic(wish):
filter_strings = wish
input = ['has MARK', 'does not have'... |
dcecdbae798e0a83afb17911ec459224790e51cd | launch_control/dashboard_app/tests.py | launch_control/dashboard_app/tests.py | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase):
def test_creation_1(self):
sw_package = SoftwarePackage.obj... | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.utils.call_helper import ObjectFactoryMixIn
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase, ObjectFac... | Update SoftwarePackageTestCase to use ObjectFactoryMixIn | Update SoftwarePackageTestCase to use ObjectFactoryMixIn
| Python | agpl-3.0 | OSSystems/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase):
def test_creation_1(self):
sw_package = SoftwarePackage.obj... | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.utils.call_helper import ObjectFactoryMixIn
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase, ObjectFac... | <commit_before>"""
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase):
def test_creation_1(self):
sw_package = Soft... | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.utils.call_helper import ObjectFactoryMixIn
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase, ObjectFac... | """
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase):
def test_creation_1(self):
sw_package = SoftwarePackage.obj... | <commit_before>"""
Unit tests of the Dashboard application
"""
from django.test import TestCase
from django.db import IntegrityError
from launch_control.dashboard_app.models import (
SoftwarePackage,
)
class SoftwarePackageTestCase(TestCase):
def test_creation_1(self):
sw_package = Soft... |
057ca5e187b2f8e7604318a4e82efed76548e0f8 | falmer/studentgroups/queries.py | falmer/studentgroups/queries.py | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, groupId=graphene.In... | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, group_id=graphene.I... | Fix group id query case | Fix group id query case
| Python | mit | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, groupId=graphene.In... | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, group_id=graphene.I... | <commit_before>import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, grou... | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, group_id=graphene.I... | import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, groupId=graphene.In... | <commit_before>import graphene
from falmer.schema.schema import DjangoConnectionField
from falmer.studentgroups.types import StudentGroup
from . import types
from . import models
class Query(graphene.ObjectType):
all_groups = DjangoConnectionField(StudentGroup)
group = graphene.Field(types.StudentGroup, grou... |
210a1a2387a048f8ff6ac650ce66543923ece860 | pythonforandroid/recipes/pymunk/__init__.py | pythonforandroid/recipes/pymunk/__init__.py | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | Fix Pymunk crash on older versions of Android | Fix Pymunk crash on older versions of Android
Seems to be required to link -lm on at least 5.1, but not on 8.0
| Python | mit | kronenpj/python-for-android,PKRoma/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kronenpj/python-for-android,kivy/python-for-android,PKRoma/python-for-android,PKRoma/python-for-android,PKRoma/python-for-android,kivy/python-for-android,kronenpj/python-for-android,PKRoma/python-for-android,kivy/p... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | <commit_before>from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | <commit_before>from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via... |
0e754fe4ea8ddee4bb952b483c4da2d8bf5970ed | core/context_processors.py | core/context_processors.py | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | Remove the hardcode from the settings. | Remove the hardcode from the settings.
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | <commit_before>from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TW... | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TWITTER": django_... | <commit_before>from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _
def settings(request):
if not getattr(django_settings, "SOCIAL", None):
return {}
return {
"SOCIAL_FACEBOOK": django_settings.SOCIAL.get("FACEBOOK", ""),
"SOCIAL_TW... |
970d296cd4344fbbde28552dbf2aa5fbbb329c9d | gh_user_download.py | gh_user_download.py | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | Add option to download via SSH | Add option to download via SSH
| Python | mit | JackMc/git_tools | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | <commit_before># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# ... | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... | <commit_before># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# ... |
6039fd841bdddaa8fc35dcf11c2e1c71d95da66d | evaluation/packages/io.py | evaluation/packages/io.py | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | Add new method to read correspondances files | Add new method to read correspondances files
| Python | apache-2.0 | amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | <commit_before>"""@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
els... | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | """@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
else:
... | <commit_before>"""@package IO
Generic input/output functions
"""
import numpy as np
def readPointCloudFromPly(path):
f = open(path, 'r')
points = []
headerSkipped = False
for line in f:
if headerSkipped:
points.append(np.float32(np.array(line.split(' ')[0:3])))
els... |
cbc681933fd6e2899f38dd9759bb9a188b66bbd4 | tests/run.py | tests/run.py | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
'django.contrib.contenttypes',... | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
# Core environmental settings
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
... | Add environmental settings for basic authentication. | Add environmental settings for basic authentication.
| Python | bsd-2-clause | ghickman/incuna-auth,incuna/incuna-auth,incuna/incuna-auth,ghickman/incuna-auth | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
'django.contrib.contenttypes',... | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
# Core environmental settings
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
... | <commit_before>import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
'django.contrib... | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
# Core environmental settings
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
... | import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
'django.contrib.contenttypes',... | <commit_before>import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comment:12
'django.contrib... |
bb11252c277d40c8ec8c579100c04a6a676accfe | tests/run.py | tests/run.py | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: htt... | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comme... | Reorder imports to dodge a settings problem. | Reorder imports to dodge a settings problem.
| Python | bsd-2-clause | incuna/incuna-auth,ghickman/incuna-auth,incuna/incuna-auth,ghickman/incuna-auth | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: htt... | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comme... | <commit_before>#! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
... | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: https://code.djangoproject.com/ticket/10827#comme... | #! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
# See: htt... | <commit_before>#! /usr/bin/env python3
from os import path
import sys
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
INSTALLED_APPS=(
# Put contenttypes before auth to work around test issue.
... |
7821681829008dfe1c933551656c1604a24b491b | cla_frontend/apps/status/views.py | cla_frontend/apps/status/views.py | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | Clarify docstring from previous PR suggestion | Clarify docstring from previous PR suggestion
| Python | mit | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | <commit_before>import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, cu... | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | <commit_before>import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, cu... |
b47821b4fce6ab969fab3c7c5a1ef1a8fb58764c | jacquard/storage/tests/test_dummy.py | jacquard/storage/tests/test_dummy.py | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
| import pytest
import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
def test_transaction_raises_error_for_bad_commit(self):
... | Cover this exception with a test | Cover this exception with a test
| Python | mit | prophile/jacquard,prophile/jacquard | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
Cover this exception with a test | import pytest
import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
def test_transaction_raises_error_for_bad_commit(self):
... | <commit_before>import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
<commit_msg>Cover this exception with a test<commit_after> | import pytest
import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
def test_transaction_raises_error_for_bad_commit(self):
... | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
Cover this exception with a testimport pytest
import unittest
from jacquard.... | <commit_before>import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
<commit_msg>Cover this exception with a test<commit_after>impo... |
3cee41ff8a7af405fe3a6bfda214e4fe1a6d3c0f | oneflow/settings/snippets/db_production.py | oneflow/settings/snippets/db_production.py |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS_HOST = MAIN_SERVE... |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
REDIS_TEST_DB = 9
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS... | Add the test REDIS database. | Add the test REDIS database. | Python | agpl-3.0 | 1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS_HOST = MAIN_SERVE... |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
REDIS_TEST_DB = 9
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS... | <commit_before>
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS_HO... |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
REDIS_TEST_DB = 9
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS... |
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS_HOST = MAIN_SERVE... | <commit_before>
DATABASES['default'] = dj_database_url.config(
default='postgres://oneflow:8jxcWaAfPJT3mV@{0}'
'/oneflow'.format(MAIN_SERVER))
mongoengine.connect('oneflow', host=MAIN_SERVER)
REDIS_DB = 0
CONSTANCE_REDIS_CONNECTION = 'redis://{0}:6379/{1}'.format(
MAIN_SERVER, REDIS_DB)
SESSION_REDIS_HO... |
3ede283ed3f656dc8f73c962eb452ce4b849dfd9 | guardhouse/main/forms.py | guardhouse/main/forms.py | from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('verified',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
| from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('belongs_to', 'verification_state',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
| Remove internal fields form from | Remove internal fields form from | Python | bsd-3-clause | ulope/guardhouse,ulope/guardhouse | from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('verified',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
Remove internal fields for... | from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('belongs_to', 'verification_state',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
| <commit_before>from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('verified',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
<commit_msg... | from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('belongs_to', 'verification_state',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
| from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('verified',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
Remove internal fields for... | <commit_before>from django.forms import ModelForm
from .models import Account, Site
class SiteForm(ModelForm):
class Meta(object):
model = Site
exclude = ('verified',)
class AccountForm(ModelForm):
class Meta(object):
model = Account
exclude = ('owner', 'delegates')
<commit_msg... |
033e017d05807b0b827e54c722a9f9a98327af87 | kolibri/__init__.py | kolibri/__init__.py | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | Update VERSION to 0.12.6 final | Update VERSION to 0.12.6 final
| Python | mit | learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | <commit_before>"""
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from ... | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | <commit_before>"""
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from ... |
2784738167145ef0226679df21b205d033737b29 | optimization/simple.py | optimization/simple.py | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | Use classes to create constraints. | Use classes to create constraints.
| Python | apache-2.0 | MiddelkoopT/CompOpt-2014-Fall,MiddelkoopT/CompOpt-2014-Fall | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | <commit_before>#!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x... | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | #!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x2, GRB.MAXIMIZE... | <commit_before>#!/usr/bin/python3
"""
Maximize
1 x1 + 2 x2
Subject To
C1: x1 + x2 <= 40
Nickel: 2 x1 + 1 x2 <= 60
Bounds
x1 >= 0
x2 >= 0
End
"""
from gurobipy import *
m = Model("simple")
x1 = m.addVar(name="x1")
x2 = m.addVar(name="x2")
m.update()
print("x1:%s x2:%s" % (x1,x2))
#m.setObjective(x1 + 2*x... |
8869eba1f74e677d1802aad0cc2592344ab81000 | podium/talks/models.py | podium/talks/models.py | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | Use a filter field lookup | Use a filter field lookup
Looks like I forgot to do this when JR suggested it.
| Python | mit | pyatl/podium-django,pyatl/podium-django,pyatl/podium-django | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | <commit_before>from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_l... | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
... | <commit_before>from django.db import models
from django.urls import reverse
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_l... |
9c34c9cfca30104d5bd17b38df5fa50cb24ee9ae | tests/write_abort_test.py | tests/write_abort_test.py | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | Handle the possibility of other tests failing in Python code called from C | Handle the possibility of other tests failing in Python code called from C
| Python | lgpl-2.1 | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | <commit_before>#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
... | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
def write... | <commit_before>#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
... |
bf2cc432261394a2134c0fe889f28085e9679771 | requests_cache/__init__.py | requests_cache/__init__.py | #!/usr/bin/env python
# flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_c... | # flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_cache,
install_... | Remove shebang from top-level init file | Remove shebang from top-level init file
| Python | bsd-2-clause | reclosedev/requests-cache | #!/usr/bin/env python
# flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_c... | # flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_cache,
install_... | <commit_before>#!/usr/bin/env python
# flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled... | # flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_cache,
install_... | #!/usr/bin/env python
# flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled,
get_c... | <commit_before>#!/usr/bin/env python
# flake8: noqa: E402,F401
__version__ = '0.6.1'
try:
from .response import AnyResponse, CachedHTTPResponse, CachedResponse, ExpirationTime
from .session import ALL_METHODS, CachedSession, CacheMixin
from .patcher import (
clear,
disabled,
enabled... |
ef55de7907fa84ccc9da7bee7aae650a8c82eecf | fileupload/serialize.py | fileupload/serialize.py | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub (r'^.*/', '', name)
if len(name)>20:
ret... | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub(r'^.*/', '', name)
if len(name)>20:
retu... | Remove extra space for method call. | Remove extra space for method call.
| Python | mit | sigurdga/django-jquery-file-upload,extremoburo/django-jquery-file-upload,Imaginashion/cloud-vision,vaniakov/django-jquery-file-upload,minhlongdo/django-jquery-file-upload,minhlongdo/django-jquery-file-upload,vaniakov/django-jquery-file-upload,Imaginashion/cloud-vision,extremoburo/django-jquery-file-upload,sigurdga/djan... | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub (r'^.*/', '', name)
if len(name)>20:
ret... | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub(r'^.*/', '', name)
if len(name)>20:
retu... | <commit_before># encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub (r'^.*/', '', name)
if len(name)>... | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub(r'^.*/', '', name)
if len(name)>20:
retu... | # encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub (r'^.*/', '', name)
if len(name)>20:
ret... | <commit_before># encoding: utf-8
import mimetypes
import re
from django.core.urlresolvers import reverse
def order_name(name):
"""order_name -- Limit the name to 20 chars length, and convert to a
ellipsed string.
name -- text to be limited.
"""
name = re.sub (r'^.*/', '', name)
if len(name)>... |
2e2a0f403b748015574cdbb96a6135ac28c074c0 | fortdepend/smartopen.py | fortdepend/smartopen.py | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | Fix syntax warning in `smart_open` | Fix syntax warning in `smart_open`
Fixes #20
| Python | mit | ZedThree/fort_depend.py,ZedThree/fort_depend.py | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | <commit_before>import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str):... | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str): usual mode str... | <commit_before>import sys
import contextlib
@contextlib.contextmanager
def smart_open(filename, mode="Ur"):
"""Open stdin or stdout using a contextmanager
From: http://stackoverflow.com/a/29824059/2043465
Args:
filename (str): name of file to open. Can be '-' for stdin/stdout
mode (str):... |
ca20aacb5a862fa46fbdf5b8de1c6c77dc6cbb18 | problems/problem_22.py | problems/problem_22.py | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | Add whitespace on problem 22 | Add whitespace on problem 22
| Python | mit | edmondkotowski/project-euler | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | <commit_before># Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "... | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | # Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "")
name... | <commit_before># Names scores
# Total names scores from names.txt
def get_names():
f = open('files/names.txt', 'r')
names = f.read()
return sorted(names.split(','))
def names_scores():
total_name_score = 0
count = 1
names = get_names()
for name in names:
name = name.replace('"', "... |
dd31ff9372f587cf2fd7e634f3c6886fa9beedc0 | examples/pywapi-example.py | examples/pywapi-example.py | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text']) + " and " + ... | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + weather_com_result['current_conditions']['text'].lower() + " and " + weathe... | Fix error in example script | Fix error in example script | Python | mit | kheuton/python-weather-api | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text']) + " and " + ... | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + weather_com_result['current_conditions']['text'].lower() + " and " + weathe... | <commit_before>#!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text'... | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + weather_com_result['current_conditions']['text'].lower() + " and " + weathe... | #!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text']) + " and " + ... | <commit_before>#!/usr/bin/env python
import pywapi
weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')
print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text'... |
3b7ec69c538da079d3a30db7f518aff32e20d614 | coffeeraspi/coffeeraspi.py | coffeeraspi/coffeeraspi.py | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server():
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=name,
id=None, #... | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server(server, name, coffee_queue):
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=na... | Add drink order passing in Raspberry Pi code | Add drink order passing in Raspberry Pi code
| Python | apache-2.0 | umbc-hackafe/htcpcp,umbc-hackafe/htcpcp,umbc-hackafe/htcpcp,umbc-hackafe/htcpcp | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server():
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=name,
id=None, #... | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server(server, name, coffee_queue):
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=na... | <commit_before>#!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server():
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=name,
... | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server(server, name, coffee_queue):
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=na... | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server():
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=name,
id=None, #... | <commit_before>#!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server():
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=name,
... |
54ee71dbc3526886f0fd44fa182c18c1fb1e3ffb | mysite/missions/irc/ircmissionbot.py | mysite/missions/irc/ircmissionbot.py | from django.conf import settings
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
settings.IRC_MISSIONBOT_NICK, settings.IRC_MISSIONBOT_REALNAME)
self.channel = settings.... | from django.conf import settings
from mysite.missions.models import IrcMissionSession
from mysite.missions.base import controllers
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
... | Make the bot track nicks in the channel and maintain exactly one IrcMissionSession per nick. | Make the bot track nicks in the channel and maintain exactly one IrcMissionSession per nick.
| Python | agpl-3.0 | sudheesh001/oh-mainline,willingc/oh-mainline,moijes12/oh-mainline,waseem18/oh-mainline,nirmeshk/oh-mainline,openhatch/oh-mainline,openhatch/oh-mainline,vipul-sharma20/oh-mainline,sudheesh001/oh-mainline,willingc/oh-mainline,openhatch/oh-mainline,nirmeshk/oh-mainline,ojengwa/oh-mainline,Changaco/oh-mainline,SnappleCap/o... | from django.conf import settings
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
settings.IRC_MISSIONBOT_NICK, settings.IRC_MISSIONBOT_REALNAME)
self.channel = settings.... | from django.conf import settings
from mysite.missions.models import IrcMissionSession
from mysite.missions.base import controllers
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
... | <commit_before>from django.conf import settings
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
settings.IRC_MISSIONBOT_NICK, settings.IRC_MISSIONBOT_REALNAME)
self.chan... | from django.conf import settings
from mysite.missions.models import IrcMissionSession
from mysite.missions.base import controllers
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
... | from django.conf import settings
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
settings.IRC_MISSIONBOT_NICK, settings.IRC_MISSIONBOT_REALNAME)
self.channel = settings.... | <commit_before>from django.conf import settings
from ircbot import SingleServerIRCBot
class IrcMissionBot(SingleServerIRCBot):
def __init__(self):
SingleServerIRCBot.__init__(self, [settings.IRC_MISSION_SERVER],
settings.IRC_MISSIONBOT_NICK, settings.IRC_MISSIONBOT_REALNAME)
self.chan... |
796d74c5b666ee237afa95a18e1dc91a51b0cc7c | django_cron/management/commands/cronjobs.py | django_cron/management/commands/cronjobs.py | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be executed from a cron job)"
def... | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from datetime import datetime
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be exec... | Change crontab finished message to include the current time. | Change crontab finished message to include the current time. | Python | mit | Ixxy-Open-Source/django-cron,peterbe/django-cron | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be executed from a cron job)"
def... | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from datetime import datetime
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be exec... | <commit_before>#
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be executed from a cron... | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from datetime import datetime
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be exec... | #
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be executed from a cron job)"
def... | <commit_before>#
# run the cron service (intended to be executed from a cron job)
#
# usage: manage.py cronjobs
from django.conf import settings
from django.core.management.base import NoArgsCommand
import django_cron
class Command(NoArgsCommand):
help = "run the cron services (intended to be executed from a cron... |
a1f9399657c3b874e53d2c7e54df8960350c83f1 | lib/reinteract/custom_result.py | lib/reinteract/custom_result.py | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | Attach custom result popup menu to widget | Attach custom result popup menu to widget
Call gtk.Menu.attach_to_widget() on the popup menu for custom results.
This should have little practical result one way or the other, though
it is theoretically "right", but it has the useful side-effect of getting
the menu into the right GtkWindowGroup. Again that should have... | Python | bsd-2-clause | alexey4petrov/reinteract,rschroll/reinteract,johnrizzo1/reinteract,jbaayen/reinteract,johnrizzo1/reinteract,alexey4petrov/reinteract,jbaayen/reinteract,jbaayen/reinteract,rschroll/reinteract,rschroll/reinteract,johnrizzo1/reinteract,alexey4petrov/reinteract | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | <commit_before># Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object)... | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | # Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object):
def creat... | <commit_before># Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import gtk
class CustomResult(object)... |
ee4ebc441927a4060d38d702891c1a171bd3932c | pytask/urls.py | pytask/urls.py | from django.conf.urls.defaults import *
from registration.views import register
from registration.backends.default import DefaultBackend
import pytask.profile.regbackend
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.shortcuts import redirect
# Uncomment the n... | from django.conf import settings
from django.conf.urls.defaults import *
from registration.views import register
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^pytas... | Add a DEVELOPMENT settings for URL mapping for static and media files. | Add a DEVELOPMENT settings for URL mapping for static and media files.
| Python | agpl-3.0 | madhusudancs/pytask,madhusudancs/pytask,madhusudancs/pytask | from django.conf.urls.defaults import *
from registration.views import register
from registration.backends.default import DefaultBackend
import pytask.profile.regbackend
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.shortcuts import redirect
# Uncomment the n... | from django.conf import settings
from django.conf.urls.defaults import *
from registration.views import register
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^pytas... | <commit_before>from django.conf.urls.defaults import *
from registration.views import register
from registration.backends.default import DefaultBackend
import pytask.profile.regbackend
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.shortcuts import redirect
# ... | from django.conf import settings
from django.conf.urls.defaults import *
from registration.views import register
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^pytas... | from django.conf.urls.defaults import *
from registration.views import register
from registration.backends.default import DefaultBackend
import pytask.profile.regbackend
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.shortcuts import redirect
# Uncomment the n... | <commit_before>from django.conf.urls.defaults import *
from registration.views import register
from registration.backends.default import DefaultBackend
import pytask.profile.regbackend
from pytask.profile.forms import CustomRegistrationForm
from pytask.views import home_page
from django.shortcuts import redirect
# ... |
a9176b1fc9116601a98c53a84cff57d9692e1fa4 | query/forms.py | query/forms.py | """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(max_length=100)
| """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(
label='',
max_length=100,
widget=forms.TextInput(attrs={'placeholder': 'IPv4/6 address'})
)
| Remove label and add placeholder to Query field. | Remove label and add placeholder to Query field.
| Python | mit | cdubz/rdap-explorer,cdubz/rdap-explorer | """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(max_length=100)
Remove label and add placeholder to Query field. | """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(
label='',
max_length=100,
widget=forms.TextInput(attrs={'placeholder': 'IPv4/6 address'})
)
| <commit_before>"""
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(max_length=100)
<commit_msg>Remove label and add placeholder to Query field.<commit_after> | """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(
label='',
max_length=100,
widget=forms.TextInput(attrs={'placeholder': 'IPv4/6 address'})
)
| """
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(max_length=100)
Remove label and add placeholder to Query field."""
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
... | <commit_before>"""
Forms for the rdap_explorer project, query app.
"""
from django import forms
class QueryForm(forms.Form):
query = forms.CharField(max_length=100)
<commit_msg>Remove label and add placeholder to Query field.<commit_after>"""
Forms for the rdap_explorer project, query app.
"""
from django impor... |
5d90dfc56423ccd65a7123b6c37e9ec869010d4b | django_foodbot/api/serializers.py | django_foodbot/api/serializers.py | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerializer(man... | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'rate', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerial... | Add rating to api serializer | Add rating to api serializer
| Python | mit | andela-kanyanwu/food-bot-review | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerializer(man... | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'rate', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerial... | <commit_before>from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = Ratin... | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'rate', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerial... | from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = RatingSerializer(man... | <commit_before>from rest_framework import serializers
from api.models import Menu, Rating
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'date', 'user_id', 'menu', 'comment')
class MenuSerializer(serializers.ModelSerializer):
rating = Ratin... |
183d6ac13a38877a9b7b1396d98529f0ecf5e5a5 | pocs/state/states/default/analyzing.py | pocs/state/states/default/analyzing.py | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | Fix the scheduling / tracking check | Fix the scheduling / tracking check
| Python | mit | panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,joshwalawender/POCS,panoptes/POCS,panoptes/POCS,AstroHuntsman/POCS,joshwalawender/POCS | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | <commit_before>def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
... | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
pocs.logger.d... | <commit_before>def on_enter(event_data):
""" """
pocs = event_data.model
pocs.say("Analyzing image...")
try:
observation = pocs.observatory.current_observation
image_info = pocs.observatory.analyze_recent()
pocs.logger.debug("Image information: {}".format(image_info))
... |
21c1cf2d920aebe704c478380e4e8e8974dc148e | python2.7libs/CacheManager/define.py | python2.7libs/CacheManager/define.py | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | Include "filecache" and "alembicarchive" selection. | Include "filecache" and "alembicarchive" selection.
| Python | mit | takavfx/Bento | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | <commit_before># -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES =... | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES = [
"file",
... | <commit_before># -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Define file for Cache Manager Tool.
"""
#-------------------------------------------------------------------------------
# Define Cache Nodes to deal with this script
CACHE_NODES =... |
c932b8ff7b48c30c6fae70d22f16a551c50ffd6b | regserver/regulations/views/utils.py | regserver/regulations/views/utils.py | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import get_script_prefix
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
... | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import reverse
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
la... | Fix error with app prefix. We will assume all urls fall under the same root as the landing page | Fix error with app prefix. We will assume all urls fall under the same root as the landing page
| Python | cc0-1.0 | 18F/regulations-site,grapesmoker/regulations-site,grapesmoker/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,willbarton/regulations-site,jeremiak/regulations-site,18F/regulations-site,eregs/regulations-site,EricSchles/regulations-site,18F/regulations-site,ascott1/regulations-site,adderall/regulat... | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import get_script_prefix
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
... | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import reverse
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
la... | <commit_before>from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import get_script_prefix
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_spe... | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import reverse
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
la... | from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import get_script_prefix
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_specified_layers(
... | <commit_before>from django.conf import settings
from regulations.generator import generator
from django.core.urlresolvers import get_script_prefix
def get_layer_list(names):
layer_names = generator.LayerCreator.LAYERS
return set(l.lower() for l in names.split(',') if l.lower() in layer_names)
def handle_spe... |
b9dfbb17512b270103444d972af17c43ddbba26b | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create documentation of DataSource Settings | 8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
134bc5f48fd8a80f84ae91531b40263fcbaedfe1 | serrano/urls.py | serrano/urls.py | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | Remove intentional unused import to clean branch | Remove intentional unused import to clean branch
| Python | bsd-2-clause | chop-dbhi/serrano,rv816/serrano_night,chop-dbhi/serrano,rv816/serrano_night | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | <commit_before>import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
... | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | <commit_before>import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
... |
2c0b25a4d978999617a22f33c8109fd35cfe657a | natasha/data/__init__.py | natasha/data/__init__.py | # coding: utf-8
from __future__ import unicode_literals
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rstrip()
return line
def load_lines(filename):
... | # coding: utf-8
from __future__ import unicode_literals
from yargy.compat import RUNNING_ON_PYTHON_2_VERSION
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rs... | Fix encoding problems with py2 | Fix encoding problems with py2
| Python | mit | natasha/natasha | # coding: utf-8
from __future__ import unicode_literals
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rstrip()
return line
def load_lines(filename):
... | # coding: utf-8
from __future__ import unicode_literals
from yargy.compat import RUNNING_ON_PYTHON_2_VERSION
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rs... | <commit_before># coding: utf-8
from __future__ import unicode_literals
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rstrip()
return line
def load_line... | # coding: utf-8
from __future__ import unicode_literals
from yargy.compat import RUNNING_ON_PYTHON_2_VERSION
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rs... | # coding: utf-8
from __future__ import unicode_literals
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rstrip()
return line
def load_lines(filename):
... | <commit_before># coding: utf-8
from __future__ import unicode_literals
import os
def get_path(filename):
return os.path.join(os.path.dirname(__file__), filename)
def maybe_strip_comment(line):
if '#' in line:
line = line[:line.index('#')]
line = line.rstrip()
return line
def load_line... |
1e601fb99259c346497db1b5392d3d79ad6dbd8e | gmt/utils.py | gmt/utils.py | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_mod}`` where you want the
link to ... | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_module_docs}`` where you
want the ... | Fix issue with spacing when inserting gmt link | Fix issue with spacing when inserting gmt link
Make the entry a single line to avoid leading white space problems.
| Python | bsd-3-clause | GenericMappingTools/gmt-python,GenericMappingTools/gmt-python | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_mod}`` where you want the
link to ... | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_module_docs}`` where you
want the ... | <commit_before>"""
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_mod}`` where you want t... | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_module_docs}`` where you
want the ... | """
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_mod}`` where you want the
link to ... | <commit_before>"""
Utilities and common tasks for wrapping the GMT modules.
"""
GMT_DOCS = 'http://gmt.soest.hawaii.edu/doc/latest'
def gmt_docs_link(module_func):
"""
Add to a module docstring a link to the GMT docs for that module.
The docstring must have the placeholder ``{gmt_mod}`` where you want t... |
207af9278a6e1ee54d640e24eee8bd35ced0920e | byceps/services/newsletter/transfer/models.py | byceps/services/newsletter/transfer/models.py | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import NewType
from ....typing import UserID
ListID =... | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import NewType
ListID = NewType('ListID', str)
@dataclass(frozen=True)
class List:... | Remove unused newsletter DTO `Subscription` | Remove unused newsletter DTO `Subscription`
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import NewType
from ....typing import UserID
ListID =... | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import NewType
ListID = NewType('ListID', str)
@dataclass(frozen=True)
class List:... | <commit_before>"""
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import NewType
from ....typing import Us... | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import NewType
ListID = NewType('ListID', str)
@dataclass(frozen=True)
class List:... | """
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import NewType
from ....typing import UserID
ListID =... | <commit_before>"""
byceps.services.newsletter.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import NewType
from ....typing import Us... |
c6aaa9b09c58cc964c5ec4877b43d014d1ae4566 | examples/jinja_example.py | examples/jinja_example.py | ## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000
from sanic import Sanic
from sanic import response
from jinja2 import Template
template = Template('Hello {{ name }}!')
app = Sanic(__name__)
@app.route('/')
async def test(request):
data = request.json
return response.html(template.ren... | # Render templates in a Flask like way from a "template" directory in the project
from sanic import Sanic
from sanic import response
from jinja2 import Evironment, PackageLoader, select_autoescape
app = Sanic(__name__)
# Load the template environment with async support
template_env = Environment(
loader=jinja2.P... | Use render_async and a template env with jinja2 | Use render_async and a template env with jinja2
| Python | mit | lixxu/sanic,ashleysommer/sanic,lixxu/sanic,channelcat/sanic,jrocketfingers/sanic,yunstanford/sanic,r0fls/sanic,ashleysommer/sanic,yunstanford/sanic,ashleysommer/sanic,lixxu/sanic,channelcat/sanic,jrocketfingers/sanic,yunstanford/sanic,channelcat/sanic,yunstanford/sanic,r0fls/sanic,lixxu/sanic,Tim-Erwin/sanic,channelcat... | ## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000
from sanic import Sanic
from sanic import response
from jinja2 import Template
template = Template('Hello {{ name }}!')
app = Sanic(__name__)
@app.route('/')
async def test(request):
data = request.json
return response.html(template.ren... | # Render templates in a Flask like way from a "template" directory in the project
from sanic import Sanic
from sanic import response
from jinja2 import Evironment, PackageLoader, select_autoescape
app = Sanic(__name__)
# Load the template environment with async support
template_env = Environment(
loader=jinja2.P... | <commit_before>## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000
from sanic import Sanic
from sanic import response
from jinja2 import Template
template = Template('Hello {{ name }}!')
app = Sanic(__name__)
@app.route('/')
async def test(request):
data = request.json
return response.ht... | # Render templates in a Flask like way from a "template" directory in the project
from sanic import Sanic
from sanic import response
from jinja2 import Evironment, PackageLoader, select_autoescape
app = Sanic(__name__)
# Load the template environment with async support
template_env = Environment(
loader=jinja2.P... | ## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000
from sanic import Sanic
from sanic import response
from jinja2 import Template
template = Template('Hello {{ name }}!')
app = Sanic(__name__)
@app.route('/')
async def test(request):
data = request.json
return response.html(template.ren... | <commit_before>## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000
from sanic import Sanic
from sanic import response
from jinja2 import Template
template = Template('Hello {{ name }}!')
app = Sanic(__name__)
@app.route('/')
async def test(request):
data = request.json
return response.ht... |
7a8b041ce9e0f115f3c5daad159a03c13c5cd72d | python/pycandela/pycandela/__init__.py | python/pycandela/pycandela/__init__.py | import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | import IPython.core.displaypub as displaypub
import json
from pandas import DataFrame
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | Fix import and call render() on vis | Fix import and call render() on vis
| Python | apache-2.0 | Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela | import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | import IPython.core.displaypub as displaypub
import json
from pandas import DataFrame
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | <commit_before>import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_d... | import IPython.core.displaypub as displaypub
import json
from pandas import DataFrame
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | <commit_before>import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_d... |
e37aa73f998e17c707d3c288ccc989f49aeeab3c | input_mask/contrib/localflavor/br/fields.py | input_mask/contrib/localflavor/br/fields.py | from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = value.replace('.', '', value.count('.')-1)
return Decim... | from django.forms import ValidationError
from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal, DecimalException
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = valu... | Fix a bug while handling invalid values | Fix a bug while handling invalid values
| Python | mit | caioariede/django-input-mask,luzfcb/django-input-mask,caioariede/django-input-mask,luzfcb/django-input-mask,caioariede/django-input-mask,luzfcb/django-input-mask | from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = value.replace('.', '', value.count('.')-1)
return Decim... | from django.forms import ValidationError
from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal, DecimalException
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = valu... | <commit_before>from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = value.replace('.', '', value.count('.')-1)
... | from django.forms import ValidationError
from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal, DecimalException
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = valu... | from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = value.replace('.', '', value.count('.')-1)
return Decim... | <commit_before>from ....fields import DecimalField
from .widgets import BRDecimalInput
from decimal import Decimal
class BRDecimalField(DecimalField):
widget = BRDecimalInput
def to_python(self, value):
value = value.replace(',', '.')
value = value.replace('.', '', value.count('.')-1)
... |
40fa309ebf1cd56bc7846f007f186cf7f94cadde | osfoffline/settings/defaults.py | osfoffline/settings/defaults.py | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | Use max polling delay to avoid OSErrors | Use max polling delay to avoid OSErrors
| Python | apache-2.0 | chennan47/OSF-Offline,chennan47/OSF-Offline | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | <commit_before># Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = '... | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | # Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = 'osf.full_write'... | <commit_before># Just to insure requirement
import colorlog # noqa
# Development mode: use a local OSF dev version and more granular logging
DEV_MODE = False # TODO (abought): auto-set flag when using `inv start_for_tests`
# General settings
PROJECT_NAME = 'osf-offline'
PROJECT_AUTHOR = 'cos'
APPLICATION_SCOPES = '... |
212ce8f67495be81d5ecdc97b6765d2759e56d8d | streamparse/storm/component.py | streamparse/storm/component.py | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additio... | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:iva... | Make Component.spec calls raise TypeError directly | Make Component.spec calls raise TypeError directly
| Python | apache-2.0 | codywilbourn/streamparse,Parsely/streamparse,codywilbourn/streamparse,Parsely/streamparse | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additio... | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:iva... | <commit_before>"""
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-s... | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:iva... | """
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additio... | <commit_before>"""
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-s... |
a6d8b7b6592cb8b7f49584817e13f7a55f679960 | project/library/models.py | project/library/models.py | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | Fix error where book id wasn't cast to string | Fix error where book id wasn't cast to string
| Python | mit | DUCSS/ducss-site-old,DUCSS/ducss-site-old,DUCSS/ducss-site-old | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | <commit_before>from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(... | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(models.Model):
... | <commit_before>from datetime import datetime
from django.db import models
class Author(models.Model):
'''Object for book author'''
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
def __unicode__(self):
return self.last_name + ", " + self.first_name
class Book(... |
8298f0b04380f7391e613a758576e4093fc9f09c | symposion/proposals/lookups.py | symposion/proposals/lookups.py | from django.contrib.auth.models import User
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'email__icontains',
)
def get_item_value... | import operator
from django.contrib.auth.models import User
from django.db.models import Q
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'... | Customize lookup get_query to account for looking up a portion of User.get_full_name | Customize lookup get_query to account for looking up a portion of User.get_full_name
| Python | bsd-3-clause | smellman/sotmjp-website,smellman/sotmjp-website,pyconjp/pyconjp-website,osmfj/sotmjp-website,pyconjp/pyconjp-website,njl/pycon,osmfj/sotmjp-website,pyconjp/pyconjp-website,PyCon/pycon,smellman/sotmjp-website,Diwahars/pycon,njl/pycon,Diwahars/pycon,PyCon/pycon,osmfj/sotmjp-website,pyconjp/pyconjp-website,Diwahars/pycon,... | from django.contrib.auth.models import User
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'email__icontains',
)
def get_item_value... | import operator
from django.contrib.auth.models import User
from django.db.models import Q
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'... | <commit_before>from django.contrib.auth.models import User
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'email__icontains',
)
def... | import operator
from django.contrib.auth.models import User
from django.db.models import Q
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'... | from django.contrib.auth.models import User
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'email__icontains',
)
def get_item_value... | <commit_before>from django.contrib.auth.models import User
from selectable.base import ModelLookup
from selectable.registry import registry
class UserLookup(ModelLookup):
model = User
search_fields = (
'first_name__icontains',
'last_name__icontains',
'email__icontains',
)
def... |
472325bdb9ad46ae2466d5be7ecfae009b8518ae | test/copies/gyptest-attribs.py | test/copies/gyptest-attribs.py | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | Disable new test from r1779 for the android generator. | Disable new test from r1779 for the android generator.
BUG=gyp:379
TBR=torne@chromium.org
Review URL: https://codereview.chromium.org/68333002 | Python | bsd-3-clause | old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_... |
6bbafa2e9102840768ee875407be1878f2aa05ca | tests/pytests/unit/engines/test_script.py | tests/pytests/unit/engines/test_script.py | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | Test iteration stops at empty bytes | Test iteration stops at empty bytes
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | <commit_before>"""
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {s... | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | """
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {script: {"__opts... | <commit_before>"""
unit tests for the script engine
"""
import pytest
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
opts = salt.config.DEFAULT_MASTER_OPTS
return {s... |
68a61404105bff4e08a7d20a148da1107a8f27f0 | learnwithpeople/urls.py | learnwithpeople/urls.py | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^', include('studygroups.urls')),
url(r'^interest/', include... | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^interest/', incl... | Fix custom URLs masking admin URL | Fix custom URLs masking admin URL
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^', include('studygroups.urls')),
url(r'^interest/', include... | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^interest/', incl... | <commit_before>from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^', include('studygroups.urls')),
url(r'^inte... | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^interest/', incl... | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^', include('studygroups.urls')),
url(r'^interest/', include... | <commit_before>from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = i18n_patterns('',
url(r'^', include('studygroups.urls')),
url(r'^inte... |
9658033dab279828975183f94f8c8641891f4ea9 | froide/helper/api_utils.py | froide/helper/api_utils.py | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | Add max limit to api pagination | Add max limit to api pagination | Python | mit | fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | <commit_before>from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffse... | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffsetPagination):
... | <commit_before>from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import ReturnDict
class CustomLimitOffsetPagination(LimitOffse... |
592c6550255793772add694cb941a0db0883713b | kamboo/core.py | kamboo/core.py | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Fix the issue: "session" shared in different connections | Fix the issue: "session" shared in different connections
| Python | apache-2.0 | henrysher/kamboo,henrysher/kamboo | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | <commit_before># Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | <commit_before># Copyright (c) 2014, Henry Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
b80607d0f5cff2d05bf607d4ff4847f14777130f | sieve/sieve.py | sieve/sieve.py | 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+1, 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:
not_prime.update(range(i*i, n+1, i))
yield i
| Revert back to a generator - it's actually slight faster | Revert back to a generator - it's actually slight faster
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | 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+1, i))
return prime
Revert back to a generator - it's actually slight faster | 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:
not_prime.update(range(i*i, n+1, i))
yield i
| <commit_before>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+1, i))
return prime
<commit_msg>Revert back to a generator - it's actually slight fas... | 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:
not_prime.update(range(i*i, n+1, i))
yield 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+1, i))
return prime
Revert back to a generator - it's actually slight fasterdef sieve(n):
return... | <commit_before>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+1, i))
return prime
<commit_msg>Revert back to a generator - it's actually slight fas... |
35a413ecdc83578a0ef63d0865a4fe7bae6f1e99 | scipy/interpolate/generate_interpnd.py | scipy/interpolate/generate_interpnd.py | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
# Run templating engine
fn = os.path.join(tmp_dir, 'interpnd.pyx')
f = open... | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
dotnet = False
if len(sys.argv) > 1 and sys.argv[1] == '--dotnet':
dotnet = True
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
... | Modify the interpnd cython generator to allow .NET output | Modify the interpnd cython generator to allow .NET output
| Python | bsd-3-clause | jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
# Run templating engine
fn = os.path.join(tmp_dir, 'interpnd.pyx')
f = open... | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
dotnet = False
if len(sys.argv) > 1 and sys.argv[1] == '--dotnet':
dotnet = True
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
... | <commit_before>#!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
# Run templating engine
fn = os.path.join(tmp_dir, 'interpnd.pyx... | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
dotnet = False
if len(sys.argv) > 1 and sys.argv[1] == '--dotnet':
dotnet = True
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
... | #!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
# Run templating engine
fn = os.path.join(tmp_dir, 'interpnd.pyx')
f = open... | <commit_before>#!/usr/bin/env python
import tempfile
import subprocess
import os
import sys
import re
import shutil
from mako.template import Template
f = open('interpnd.pyx', 'r')
template = f.read()
f.close()
tmp_dir = tempfile.mkdtemp()
try:
# Run templating engine
fn = os.path.join(tmp_dir, 'interpnd.pyx... |
88cd50a331c20fb65c495e92cc93867f03cd3826 | lib/exp/featx/__init__.py | lib/exp/featx/__init__.py | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | Load feats with zero length | Load feats with zero length
| Python | agpl-3.0 | speed-of-light/pyslider | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | <commit_before>__all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = ... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | <commit_before>__all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = ... |
4a24d8dc7123bd5ea0a34b35ea3c9880462075a1 | entrypoint.py | entrypoint.py | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | Debug Google Cloud Run support | Debug Google Cloud Run support
| Python | mit | diodesign/diosix | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | <commit_before>#!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to st... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | <commit_before>#!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to st... |
f24d3bbd9bd5bdfdfaf939bf795f5c4ad490e8dd | src/waypoints_reader/scripts/yaml_reader.py | src/waypoints_reader/scripts/yaml_reader.py | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher('goal_sequence'... | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.srv import ApplyGoals
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def get_waypo... | Change goals passage with service (from message) | Change goals passage with service (from message)
| Python | bsd-3-clause | CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher('goal_sequence'... | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.srv import ApplyGoals
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def get_waypo... | <commit_before>#!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher(... | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.srv import ApplyGoals
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def get_waypo... | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher('goal_sequence'... | <commit_before>#!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher(... |
56bbd1eac61421b57d8576b233fcfe86644009d6 | probe/sources/tcpdump.py | probe/sources/tcpdump.py | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | Fix trouble about the output filename | Fix trouble about the output filename
| Python | mit | laulin/network-safety,laulin/network-safety | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | <commit_before>import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_... | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_timeout
... | <commit_before>import logging
import subprocess
class Tcpdump:
def __init__(self, interface, buffer_size, pcap_size, pcap_timeout, output_filename, post_process=None):
self._interface = interface
self._buffer_size = buffer_size
self._pcap_size = pcap_size
self._pcap_timeout = pcap_... |
a671952f498d9a355d15ec332d4e01e621bf1e6d | flask_admin/model/typefmt.py | flask_admin/model/typefmt.py | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | Change bool_formatter() to be backward compatible with bootstrap2 | Change bool_formatter() to be backward compatible with bootstrap2
| Python | bsd-3-clause | litnimax/flask-admin,flabe81/flask-admin,marrybird/flask-admin,marrybird/flask-admin,plaes/flask-admin,phantomxc/flask-admin,wangjun/flask-admin,jamesbeebop/flask-admin,jschneier/flask-admin,flask-admin/flask-admin,ibushong/test-repo,ondoheer/flask-admin,flask-admin/flask-admin,HermasT/flask-admin,quokkaproject/flask-a... | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | <commit_before>from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
... | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
Return em... | <commit_before>from jinja2 import Markup
from flask.ext.admin._compat import text_type
def null_formatter(view, value):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
return Markup('<i>NULL</i>')
def empty_formatter(view, value):
"""
... |
aa4db7a84f117b577f74a355c160889cf334f227 | lingcod/bookmarks/forms.py | lingcod/bookmarks/forms.py | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | Hide IP from input form | Hide IP from input form
| Python | bsd-3-clause | Ecotrust/madrona_addons,Ecotrust/madrona_addons | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | <commit_before>from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=for... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | <commit_before>from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=for... |
ceceada705d8e98329f67d9ca6c8cba6cebb01cc | lingcod/bookmarks/forms.py | lingcod/bookmarks/forms.py | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | Allow IP to be blank in form | Allow IP to be blank in form
--HG--
branch : bookmarks
| Python | bsd-3-clause | underbluewaters/marinemap,underbluewaters/marinemap,underbluewaters/marinemap | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | <commit_before>from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=for... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | <commit_before>from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=for... |
faebc6cc528255659e7798c3754395eb91a5d5f5 | website/db_create.py | website/db_create.py | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from app import db
from import_data import import_data
prin... | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from database import db
from import_data import import_data
... | Update import in db creation script | Update import in db creation script
| Python | lgpl-2.1 | reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualisti... | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from app import db
from import_data import import_data
prin... | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from database import db
from import_data import import_data
... | <commit_before>""""
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from app import db
from import_data import im... | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from database import db
from import_data import import_data
... | """"
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from app import db
from import_data import import_data
prin... | <commit_before>""""
In case of exception:
InvalidRequestError: Table '(some name)' is
already defined for this MetaData instance
just comment out part of app.py where import of views (and what comes
along - models) occurs - it has to be the very end of the file.
"""
from app import db
from import_data import im... |
905a08bf59f6a7d51218aaa4559e7f4efa6244a9 | thunderdome/tests/groovy/test_scanner.py | thunderdome/tests/groovy/test_scanner.py | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | Add Unit-Test For Scanner Problem | Add Unit-Test For Scanner Problem
| Python | mit | StartTheShift/thunderdome,StartTheShift/thunderdome | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | <commit_before>import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
re... | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
result = parse(gr... | <commit_before>import os
from unittest import TestCase
from thunderdome.gremlin import parse
class GroovyScannerTest(TestCase):
"""
Test Groovy language scanner
"""
def test_parsing_complicated_function(self):
groovy_file = os.path.join(os.path.dirname(__file__), 'test.groovy')
re... |
f560e2352cc06ce7e0f8bd2db0fd991d8d0ca73c | scalymongo/__init__.py | scalymongo/__init__.py | # -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
| # -*- coding: utf-8 -*-
from bson.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
| Use ObjectId from bson instead of pymongo | import: Use ObjectId from bson instead of pymongo
pymongo >= 2.2 stops importing ObjectId from bson
so it need to be pulled in directly. | Python | bsd-3-clause | allancaffee/scaly-mongo | # -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
import: Use ObjectId from bson instead of pymongo
pymongo >= 2.2 stops importing ObjectId from bson
so it need to be pulle... | # -*- coding: utf-8 -*-
from bson.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
| <commit_before># -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
<commit_msg>import: Use ObjectId from bson instead of pymongo
pymongo >= 2.2 stops importing ObjectId from ... | # -*- coding: utf-8 -*-
from bson.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
| # -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
import: Use ObjectId from bson instead of pymongo
pymongo >= 2.2 stops importing ObjectId from bson
so it need to be pulle... | <commit_before># -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId
from scalymongo.document import Document
from scalymongo.connection import Connection
from scalymongo.schema_operators import OR, IS
<commit_msg>import: Use ObjectId from bson instead of pymongo
pymongo >= 2.2 stops importing ObjectId from ... |
35d207c6760404cfd8802227d4926aed2ac9a7ae | cards/bjcard.py | cards/bjcard.py | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, *args, **kwarg):
super().__init__(*args, **kwarg)
@property
def value(self):
""" ... | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, suit, rank):
super().__init__(suit, rank)
@property
def value(self):
""" Returns ... | Change params to suit and rank | Change params to suit and rank
| Python | mit | johnpapa2/twenty-one,johnpapa2/twenty-one | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, *args, **kwarg):
super().__init__(*args, **kwarg)
@property
def value(self):
""" ... | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, suit, rank):
super().__init__(suit, rank)
@property
def value(self):
""" Returns ... | <commit_before>"""
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, *args, **kwarg):
super().__init__(*args, **kwarg)
@property
def value(self... | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, suit, rank):
super().__init__(suit, rank)
@property
def value(self):
""" Returns ... | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, *args, **kwarg):
super().__init__(*args, **kwarg)
@property
def value(self):
""" ... | <commit_before>"""
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
from .card import Card
class BjCard(Card):
def __init__(self, *args, **kwarg):
super().__init__(*args, **kwarg)
@property
def value(self... |
a9e24dc8444f24ee9be0987f9dc5fbe96b5c3408 | money_conversion/money.py | money_conversion/money.py |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
|
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
| Add reprensation method for Money class | Add reprensation method for Money class
| Python | mit | mdsrosa/money-conversion-py |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
Add reprensation method for Money class |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
| <commit_before>
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
<commit_msg>Add reprensation method for Money class<commit_after> |
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def __repr__(self):
return "%.2f %s" % (self.amount, self.currency)
|
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
Add reprensation method for Money class
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
def _... | <commit_before>
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency.upper()
<commit_msg>Add reprensation method for Money class<commit_after>
class Money(object):
def __init__(self, amount, currency):
self.amount = amount
se... |
7fbcbaed02233eed41781adf665c0027d7b0e05f | src/geoserver/workspace.py | src/geoserver/workspace.py | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
a... | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
s... | Call superclass constructor for Workspace | Call superclass constructor for Workspace
| Python | mit | cristianzamar/gsconfig,boundlessgeo/gsconfig,Geode/gsconfig,afabiani/gsconfig,garnertb/gsconfig.py,scottp-dpaw/gsconfig | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
a... | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
s... | <commit_before>from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, n... | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
s... | from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, name):
a... | <commit_before>from geoserver.support import atom_link, xml_property, write_bool, ResourceInfo
import string
def workspace_from_index(catalog, node):
name = node.find("name")
return Workspace(catalog, name.text)
class Workspace(ResourceInfo):
resource_type = "workspace"
def __init__(self, catalog, n... |
43978f8c709d5f195229deb6ec7817a1815a4db6 | sass_processor/storage.py | sass_processor/storage.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | Fix in case s3boto is not installed | Fix in case s3boto is not installed
| Python | mit | jrief/django-sass-processor,jrief/django-sass-processor | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | <commit_before># -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if locatio... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
... | <commit_before># -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class SassFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if locatio... |
142e361d2bcfbdc15939ad33c600bf943025f7b1 | api/v1/serializers/no_project_serializer.py | api/v1/serializers/no_project_serializer.py | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .application_serializer import ApplicationSerializer
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSeria... | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSerializer(serializers.ModelSerializer):
instances = serial... | Remove final references to application | Remove final references to application
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .application_serializer import ApplicationSerializer
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSeria... | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSerializer(serializers.ModelSerializer):
instances = serial... | <commit_before>from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .application_serializer import ApplicationSerializer
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class... | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSerializer(serializers.ModelSerializer):
instances = serial... | from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .application_serializer import ApplicationSerializer
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class NoProjectSeria... | <commit_before>from core.models.user import AtmosphereUser
from core.query import only_current, only_current_source
from rest_framework import serializers
from .application_serializer import ApplicationSerializer
from .instance_serializer import InstanceSerializer
from .volume_serializer import VolumeSerializer
class... |
ef8e99bb487cde437b5f669f662a0787b2047efa | src/penn_chime/settings.py | src/penn_chime/settings.py | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | Move n_days back to 60 so social distancing can be seen in the plots | Move n_days back to 60 so social distancing can be seen in the plots
| Python | mit | CodeForPhilly/chime,CodeForPhilly/chime,CodeForPhilly/chime | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | <commit_before>#!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
... | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | #!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
date_first_... | <commit_before>#!/usr/bin/env python
from datetime import date
from .parameters import Parameters, Regions, RateLos
DEFAULTS = Parameters(
region=Regions(
delaware=564696,
chester=519293,
montgomery=826075,
bucks=628341,
philly=1581000,
),
current_hospitalized=32,
... |
f100adc7991f894eac40ebe8ea6b9b67c89df00c | rackattack/common/globallock.py | rackattack/common/globallock.py | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | Increase global lock holding duration due to new network transactions | Increase global lock holding duration due to new network transactions
| Python | apache-2.0 | eliran-stratoscale/rackattack-virtual,eliran-stratoscale/rackattack-virtual,Stratoscale/rackattack-virtual,Stratoscale/rackattack-virtual | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | <commit_before>import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | <commit_before>import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
... |
50ad6dedb64c8e74b8d27375b9320f9fd9126c9c | registration/__init__.py | registration/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | Add utility function for retrieving the active registration backend. | Add utility function for retrieving the active registration backend.
| Python | bsd-3-clause | alawnchen/django-registration,memnonila/django-registration,furious-luke/django-registration,furious-luke/django-registration,tanjunyen/django-registration,yorkedork/django-registration,imgmix/django-registration,arpitremarkable/django-registration,PSU-OIT-ARC/django-registration,erinspace/django-registration,rulz/djan... | Add utility function for retrieving the active registration backend. | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | <commit_before><commit_msg>Add utility function for retrieving the active registration backend.<commit_after> | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | Add utility function for retrieving the active registration backend.from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determ... | <commit_before><commit_msg>Add utility function for retrieving the active registration backend.<commit_after>from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration ba... | |
37da65953471b5dd0930e102b861878012938701 | registration/__init__.py | registration/__init__.py | from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
| VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems. | Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.
| Python | bsd-3-clause | lubosz/django-registration,lubosz/django-registration | from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems. | VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| <commit_before>from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
<commit_msg>Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.<co... | VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.VERSION = (0, 9, 0, 'beta', 1)... | <commit_before>from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
<commit_msg>Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.<co... |
c02c3f4603c967c4e8df8314bfe0f4759cb0bca4 | openprescribing/manage.py | openprescribing/manage.py | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | Set settings for e2e tests correctly | Set settings for e2e tests correctly
| Python | mit | annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | <commit_before>#!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirn... | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirname(os.path.rea... | <commit_before>#!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
# We can't do read_dotenv('../environment') because that assumes that when
# manage.py we are in its current directory, which isn't the case for cron
# jobs.
env_path = os.path.join(
os.path.dirn... |
13a25d26dc53f7a3c2f1a8706de26339035bea39 | lib/bx/misc/bgzf_tests.py | lib/bx/misc/bgzf_tests.py | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "../test_data/bgzf_tests/test.txt.gz" )
print f.read( 10 )
print f.seek( 0 )
print f.read( 10 )
test_bgzf() | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "test_data/bgzf_tests/test.txt.gz" )
assert f.read( 10 ) == "begin 644 "
print f.seek( 0 )
assert f.read( 10 ) == "begin 644 " | Make BGZF test a real unittest | Make BGZF test a real unittest
| Python | mit | uhjish/bx-python,uhjish/bx-python,uhjish/bx-python | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "../test_data/bgzf_tests/test.txt.gz" )
print f.read( 10 )
print f.seek( 0 )
print f.read( 10 )
test_bgzf()Make BGZF test a real unittest | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "test_data/bgzf_tests/test.txt.gz" )
assert f.read( 10 ) == "begin 644 "
print f.seek( 0 )
assert f.read( 10 ) == "begin 644 " | <commit_before>import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "../test_data/bgzf_tests/test.txt.gz" )
print f.read( 10 )
print f.seek( 0 )
print f.read( 10 )
test_bgzf()<commit_msg>Make BGZF test a real unittest<commit_after> | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "test_data/bgzf_tests/test.txt.gz" )
assert f.read( 10 ) == "begin 644 "
print f.seek( 0 )
assert f.read( 10 ) == "begin 644 " | import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "../test_data/bgzf_tests/test.txt.gz" )
print f.read( 10 )
print f.seek( 0 )
print f.read( 10 )
test_bgzf()Make BGZF test a real unittestimport bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "test_data/bgzf_tests/test.t... | <commit_before>import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bgzf.BGZFFile( "../test_data/bgzf_tests/test.txt.gz" )
print f.read( 10 )
print f.seek( 0 )
print f.read( 10 )
test_bgzf()<commit_msg>Make BGZF test a real unittest<commit_after>import bx.misc.bgzf
def test_bgzf():
f = bx.misc.bg... |
de1988304714b44e641a4c4ac50fa650887621d6 | geoportail/geonames/views.py | geoportail/geonames/views.py | import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
resp... | import json
import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
... | Return JSON in the autocomplete view | Return JSON in the autocomplete view
| Python | bsd-3-clause | brutasse/geoportail,brutasse/geoportail,brutasse/geoportail | import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
resp... | import json
import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
... | <commit_before>import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse... | import json
import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
... | import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse()
resp... | <commit_before>import unicodedata
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from .models import Town
def autocomplete(request):
if not 'q' in request.GET or len(request.GET['q']) < 3:
response = HttpResponse... |
44d1623e8b7c0922cb9138d5e589a7a9e51f7610 | enactiveagents/model/perceptionhandler.py | enactiveagents/model/perceptionhandler.py | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | Add food to the perception handler | Add food to the perception handler
| Python | mit | Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | <commit_before>"""
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a... | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | <commit_before>"""
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a... |
877d13f1ef433c99bf61e0a3eaa0228240997eca | nanomon/probe/__init__.py | nanomon/probe/__init__.py | import time
import logging
from nanomon.queue import QueueWorker
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
while True:
last_did_task = did_task
did_... | import time
import logging
from nanomon.queue import QueueWorker
from nanomon.resources import MonitoringGroup, Node, Monitor, Command
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
... | Make the probe actually do something with monitors | Make the probe actually do something with monitors
Uses the execute_monitors method of the nodes now, which doesn't really
do much, but will in the future.
| Python | bsd-2-clause | cloudtools/nymms | import time
import logging
from nanomon.queue import QueueWorker
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
while True:
last_did_task = did_task
did_... | import time
import logging
from nanomon.queue import QueueWorker
from nanomon.resources import MonitoringGroup, Node, Monitor, Command
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
... | <commit_before>import time
import logging
from nanomon.queue import QueueWorker
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
while True:
last_did_task = did_task
... | import time
import logging
from nanomon.queue import QueueWorker
from nanomon.resources import MonitoringGroup, Node, Monitor, Command
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
... | import time
import logging
from nanomon.queue import QueueWorker
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
while True:
last_did_task = did_task
did_... | <commit_before>import time
import logging
from nanomon.queue import QueueWorker
logger = logging.getLogger(__name__)
class Probe(QueueWorker):
def run(self, max_sleep=2, min_sleep=1):
did_task = False
max_sleep = sleep = float(max_sleep)
while True:
last_did_task = did_task
... |
01e8e212768bb80476b9ce7da938fc04aa306f3e | tensorflow_datasets/dataset_collections/xtreme/xtreme_test.py | tensorflow_datasets/dataset_collections/xtreme/xtreme_test.py | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Solve typo in xtreme testing | Solve typo in xtreme testing
PiperOrigin-RevId: 477195014
| Python | apache-2.0 | tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | <commit_before># coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | <commit_before># coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
c598306bd1f323f62167c6be33205019b53296b9 | tests/test_vector2_negation.py | tests/test_vector2_negation.py | from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
| from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
@given(vector=vecto... | Test that negation is the additive inverse | tests/negation: Test that negation is the additive inverse
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
tests/negation: Test... | from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
@given(vector=vecto... | <commit_before>from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
<comm... | from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
@given(vector=vecto... | from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
tests/negation: Test... | <commit_before>from hypothesis import given
from ppb_vector import Vector2
from utils import vectors
@given(vector=vectors())
def test_negation_scalar(vector: Vector2):
assert - vector == (-1) * vector
@given(vector=vectors())
def test_negation_involutive(vector: Vector2):
assert vector == - (- vector)
<comm... |
dfb11ba136359e9624b05af2e065eac8d8cd5111 | plankton/lcg/lcg.py | plankton/lcg/lcg.py | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | Use seed function in constructor since some LCGs might overwrite it. | Use seed function in constructor since some LCGs might overwrite it.
| Python | mit | SpacePlant/Plankton | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | <commit_before>from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
... | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
self._state ... | <commit_before>from collections import namedtuple
from ..prng import PRNG
class LCG(PRNG):
LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier
'c', # Increment
'm']) # Modulus
def __init__(self):
... |
0bd82f80279348f101d09b8aa0955c8ab934533c | tests/window/WINDOW_CAPTION.py | tests/window/WINDOW_CAPTION.py | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | Make windows bigger in this test so the captions can be read. | Make windows bigger in this test so the captions can be read.
Index: tests/window/WINDOW_CAPTION.py
===================================================================
--- tests/window/WINDOW_CAPTION.py (revision 777)
+++ tests/window/WINDOW_CAPTION.py (working copy)
@@ -19,8 +19,8 @@
class WINDOW_CAPTION(unittest.... | Python | bsd-3-clause | mpasternak/pyglet-fix-issue-552,kmonsoor/pyglet,odyaka341/pyglet,cledio66/pyglet,arifgursel/pyglet,cledio66/pyglet,shaileshgoogler/pyglet,gdkar/pyglet,arifgursel/pyglet,kmonsoor/pyglet,cledio66/pyglet,Austin503/pyglet,Austin503/pyglet,Alwnikrotikz/pyglet,mpasternak/michaldtz-fixes-518-522,arifgursel/pyglet,odyaka341/py... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | <commit_before>#!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window t... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | <commit_before>#!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window t... |
d03250e1af17a40be3b9aa70fef67e50ab556a87 | numba2/compiler/layout.py | numba2/compiler/layout.py | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | Remove some object representation clobbering code | Remove some object representation clobbering code
| Python | bsd-2-clause | flypy/flypy,flypy/flypy | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | <commit_before># -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#==... | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | # -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#===--------------... | <commit_before># -*- coding: utf-8 -*-
"""
Object layout.
"""
from __future__ import print_function, division, absolute_import
from numba2 import conversion
from pykit import types as ptypes
from pykit.utils import ctypes_support
#===------------------------------------------------------------------===
# Types
#==... |
df25af8c12f824ee46a7bbf676f9adfcef5b1624 | grazer/run.py | grazer/run.py | import click
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
def main(env, config):
load_dotenv(env)
cfg = Config(config)
for record, link in crawler.creat... | import click
import logging
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
@click.option("--log_level", default="INFO")
def main(env, config, log_level):
logging.... | Allow to config log level | Allow to config log level
| Python | mit | CodersOfTheNight/verata | import click
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
def main(env, config):
load_dotenv(env)
cfg = Config(config)
for record, link in crawler.creat... | import click
import logging
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
@click.option("--log_level", default="INFO")
def main(env, config, log_level):
logging.... | <commit_before>import click
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
def main(env, config):
load_dotenv(env)
cfg = Config(config)
for record, link i... | import click
import logging
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
@click.option("--log_level", default="INFO")
def main(env, config, log_level):
logging.... | import click
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
def main(env, config):
load_dotenv(env)
cfg = Config(config)
for record, link in crawler.creat... | <commit_before>import click
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
def main(env, config):
load_dotenv(env)
cfg = Config(config)
for record, link i... |
86cbea3478837ca2c1804f2068b497ee957e6f95 | pyvista/_version.py | pyvista/_version.py | """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 2
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| Bump version: 0.21.1 → 0.21.2 | Bump version: 0.21.1 → 0.21.2
| Python | mit | akaszynski/vtkInterface | """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
Bump version: 0.21.1 → 0.21.2 | """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 2
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| <commit_before>""" version info for pyvista """
# major, minor, patch
version_info = 0, 21, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
<commit_msg>Bump version: 0.21.1 → 0.21.2<commit_after> | """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 2
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| """ version info for pyvista """
# major, minor, patch
version_info = 0, 21, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
Bump version: 0.21.1 → 0.21.2""" version info for pyvista """
# major, minor, patch
version_info = 0, 21, 2
# Nice string for the version
__version__ = '.'.join(m... | <commit_before>""" version info for pyvista """
# major, minor, patch
version_info = 0, 21, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
<commit_msg>Bump version: 0.21.1 → 0.21.2<commit_after>""" version info for pyvista """
# major, minor, patch
version_info = 0, 21, 2
# Nice string... |
b5fa5ed84b8427d052c0e1f494384e9fd06bfe6a | onadata/libs/mixins/mfa.py | onadata/libs/mixins/mfa.py | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | Use new translated string placeholder style | Use new translated string placeholder style
| Python | bsd-2-clause | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | <commit_before># coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
R... | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | # coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
Raise an excepti... | <commit_before># coding: utf-8
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import exceptions
from onadata.apps.main.models.user_profile import UserProfile
class MFABlockerMixin:
def validate_mfa_not_active(self, user: 'auth.User'):
"""
R... |
c6071093c35c2a83a683fe55788946ae99b38256 | contacts/api.py | contacts/api.py | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
class ContactCard(object):
"""
A :class:`Contact Card <ContactCard>` object.
:param name: Full Name (required).
:param firs... | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
from .exceptions import ContactCreationException
from .rules import ALLOWED_FIELDS
class ContactCard(object):
"""
A :class:`Contact ... | Update CC Object to limit fields, use custom exception and rules | Update CC Object to limit fields, use custom exception and rules
| Python | mit | heimann/contacts | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
class ContactCard(object):
"""
A :class:`Contact Card <ContactCard>` object.
:param name: Full Name (required).
:param firs... | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
from .exceptions import ContactCreationException
from .rules import ALLOWED_FIELDS
class ContactCard(object):
"""
A :class:`Contact ... | <commit_before>"""
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
class ContactCard(object):
"""
A :class:`Contact Card <ContactCard>` object.
:param name: Full Name (required).
... | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
from .exceptions import ContactCreationException
from .rules import ALLOWED_FIELDS
class ContactCard(object):
"""
A :class:`Contact ... | """
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
class ContactCard(object):
"""
A :class:`Contact Card <ContactCard>` object.
:param name: Full Name (required).
:param firs... | <commit_before>"""
contacts.api
~~~~~~~~~~~~
This module implements the Contacts 📕 API.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
import vobject
class ContactCard(object):
"""
A :class:`Contact Card <ContactCard>` object.
:param name: Full Name (required).
... |
e00140c1488fd17f44932dee3eb320e2ae697b90 | tests/list_match.py | tests/list_match.py | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil()))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | Fix actual type error in test code | Fix actual type error in test code
| Python | mit | pshc/archipelago,pshc/archipelago,pshc/archipelago | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil()))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | <commit_before>from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pa... | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil()))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | <commit_before>from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pa... |
f76015fdf37db44a54ce0e0038b4b85978c39839 | tests/test_utils.py | tests/test_utils.py | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import my_module # noqa: F401
from my_module.util... | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting
along with the code formatter.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import click # noqa... | Add import statements breaking linter | Add import statements breaking linter
| Python | apache-2.0 | BastiTee/bastis-python-toolbox | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import my_module # noqa: F401
from my_module.util... | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting
along with the code formatter.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import click # noqa... | <commit_before># -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import my_module # noqa: F401
from... | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting
along with the code formatter.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import click # noqa... | # -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import my_module # noqa: F401
from my_module.util... | <commit_before># -*- coding: utf-8 -*-
"""Basic test suite.
There are some 'noqa: F401' in this file to just test the isort import sorting.
"""
import __future__ # noqa: F401
import json # noqa: F401
from os import path # noqa: F401
from re import IGNORECASE, sub # noqa: F401
import my_module # noqa: F401
from... |
6c9640cf0e9e8e187a61fc81f6c0eed0988601e1 | apps/accounts/views.py | apps/accounts/views.py | from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
model = UserProfile
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserProfileBase, DetailView):
pass
| from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
queryset = UserProfile.objects.all().select_related('user')
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserP... | Make sure the 'user' object is available in the UserProfile queryset in the view. | Make sure the 'user' object is available in the UserProfile queryset in the view.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
model = UserProfile
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserProfileBase, DetailView):
pass
Make s... | from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
queryset = UserProfile.objects.all().select_related('user')
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserP... | <commit_before>from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
model = UserProfile
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserProfileBase, DetailView):
... | from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
queryset = UserProfile.objects.all().select_related('user')
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserP... | from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
model = UserProfile
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserProfileBase, DetailView):
pass
Make s... | <commit_before>from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import UserProfile
class UserProfileBase(object):
model = UserProfile
class UserProfileList(UserProfileBase, ListView):
pass
class UserProfileDetail(UserProfileBase, DetailView):
... |
62705d28c826a213a42de504c041d56d72bd64df | examples/sparkfun_redbot/sparkfun_experiments/Exp2_DriveForward.py | examples/sparkfun_redbot/sparkfun_experiments/Exp2_DriveForward.py | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | Add a log to Exp2 | Add a log to Exp2
| Python | agpl-3.0 | MrYsLab/pymata-aio | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | <commit_before>#!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pyma... | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | #!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pymata3 import PyMa... | <commit_before>#!/usr/bin/python3.4
"""
Exp2_DriveForward -- RedBot Experiment 2
Drive forward and stop.
Hardware setup:
The Power switch must be on, the motors must be connected, and the board must be receiving power
from the battery. The motor switch must also be switched to RUN.
"""
from pymata_aio.pyma... |
b9c3404550273e4b0af68ebe9da27c4bf405de9b | rohrpost/message.py | rohrpost/message.py | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | Remove superflous line, remove duplicate data | Remove superflous line, remove duplicate data
| Python | mit | axsemantics/rohrpost,axsemantics/rohrpost | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | <commit_before>import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
... | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
content... | <commit_before>import json
def _send_message(message, content: dict, close: bool):
message.reply_channel.send({
'text': json.dumps(content),
'close': close,
})
def send_message(message, message_id, handler, close=False, error=None, **additional_data):
content = dict()
if message_id:
... |
6cb0a6f35f4722f5e0b5e9b7c2028bbb6f278402 | operation.py | operation.py | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job is the set of operations needed to fully build a radiator
... | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- name improves readability when printing
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job_model is the rad... | Update str() and add comments | Update str() and add comments
| Python | mit | Irvel/JSSP-Genetic-Algorithm | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job is the set of operations needed to fully build a radiator
... | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- name improves readability when printing
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job_model is the rad... | <commit_before>"""
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job is the set of operations needed to fully bui... | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- name improves readability when printing
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job_model is the rad... | """
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job is the set of operations needed to fully build a radiator
... | <commit_before>"""
operation.py
~~~~~~~~~~~~~
This stores the information of each individual operation in the
production line.
- machine is the machine in which that operation will be executed
- duration is the amount of time in which the operation will be completed
- job is the set of operations needed to fully bui... |
6df115b41d18f7e74a0220550a04459d83d391d0 | pox/lib/packet/__init__.py | pox/lib/packet/__init__.py | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | Add all submodules to import * | packet: Add all submodules to import *
You can now access pox.lib.packet.icmp as pox.lib.packet.ICMP if
you import the whole package (e.g., import pox.lib.packet as pkg).
--HG--
extra : rebase_source : b48d05949977468a669bdd55caab7ac898689441
| Python | apache-2.0 | adusia/pox,diogommartins/pox,waltznetworks/pox,VamsikrishnaNallabothu/pox,PrincetonUniversity/pox,kulawczukmarcin/mypox,MurphyMc/pox,noxrepo/pox,carlye566/IoT-POX,kpengboy/pox-exercise,noxrepo/pox,chenyuntc/pox,denovogroup/pox,andiwundsam/_of_normalize,jacobq/csci5221-viro-project,carlye566/IoT-POX,kulawczukmarcin/mypo... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | <commit_before>"""
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | <commit_before>"""
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it... |
1f40edb5c567d85c621339a28d2b20c8f5406460 | jacquard/service/commands.py | jacquard/service/commands.py | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(object):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
ty... | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(BaseCommand):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
... | Make this derive from the correct type | Make this derive from the correct type
| Python | mit | prophile/jacquard,prophile/jacquard | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(object):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
ty... | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(BaseCommand):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
... | <commit_before>import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(object):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',... | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(BaseCommand):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
... | import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(object):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',
ty... | <commit_before>import werkzeug.debug
import werkzeug.serving
from jacquard.commands import BaseCommand
from jacquard.service import get_wsgi_app
class RunServer(object):
help = "run a (local, debug) server"
def add_arguments(self, parser):
parser.add_argument(
'-p',
'--port',... |
29a1c8f4eab13b5b17fffbd18a720b0ae5ab04b3 | handoverservice/mail_draft/tests_ddsutil.py | handoverservice/mail_draft/tests_ddsutil.py | from django.test import TestCase
from handover_api.models import User
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteStore):
user_id = 'abcd-1234-efgh-8876'
... | from django.test import TestCase
from handover_api.models import User
from django.core.exceptions import ObjectDoesNotExist
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteS... | Add test for user does not exist | Add test for user does not exist
| Python | mit | Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService | from django.test import TestCase
from handover_api.models import User
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteStore):
user_id = 'abcd-1234-efgh-8876'
... | from django.test import TestCase
from handover_api.models import User
from django.core.exceptions import ObjectDoesNotExist
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteS... | <commit_before>from django.test import TestCase
from handover_api.models import User
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteStore):
user_id = 'abcd-1234-efg... | from django.test import TestCase
from handover_api.models import User
from django.core.exceptions import ObjectDoesNotExist
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteS... | from django.test import TestCase
from handover_api.models import User
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteStore):
user_id = 'abcd-1234-efgh-8876'
... | <commit_before>from django.test import TestCase
from handover_api.models import User
import mock
import mail_draft
from mail_draft.dds_util import DDSUtil
class DDSUtilTestCase(TestCase):
@mock.patch('ddsc.core.remotestore.RemoteStore')
def testGetEmail(self, mockRemoteStore):
user_id = 'abcd-1234-efg... |
60bf4d1457059b3cd53e5b37eab6d428ff4df511 | src/artgraph/plugins/infobox.py | src/artgraph/plugins/infobox.py | from artgraph.plugins.plugin import Plugin
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
wikicode = self.get_wikicode(self._node.get_tit... | from artgraph.plugins.plugin import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
wikicode = self.get_wi... | Fix imports to be able to import properly from the worker nodes | Fix imports to be able to import properly from the worker nodes | Python | mit | dMaggot/ArtistGraph | from artgraph.plugins.plugin import Plugin
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
wikicode = self.get_wikicode(self._node.get_tit... | from artgraph.plugins.plugin import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
wikicode = self.get_wi... | <commit_before>from artgraph.plugins.plugin import Plugin
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
wikicode = self.get_wikicode(sel... | from artgraph.plugins.plugin import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
wikicode = self.get_wi... | from artgraph.plugins.plugin import Plugin
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
wikicode = self.get_wikicode(self._node.get_tit... | <commit_before>from artgraph.plugins.plugin import Plugin
from artgraph.node import Node, NodeTypes
from artgraph.relationship import AssociatedActRelationship
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
def get_nodes(self):
wikicode = self.get_wikicode(sel... |
b2f51817d2182e3074cb679ead963e4a07514a54 | importer/management/commands/import_list.py | importer/management/commands/import_list.py | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | Fix invalid access to CachedObject | Fix invalid access to CachedObject
| Python | mit | meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | <commit_before>import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def ... | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def add_arguments(s... | <commit_before>import logging
from importer.management.commands._import_base_command import ImportBaseCommand
from importer.models import ExternalList, CachedObject
logger = logging.getLogger(__name__)
class Command(ImportBaseCommand):
help = "Import the objects from an external list of an oparl body"
def ... |
c544c0d2b8356125d1a5465b44617aaaaeab0ea1 | scrapy/utils/ftp.py | scrapy/utils/ftp.py | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | Use context management with `FTP` | Use context management with `FTP`
| Python | bsd-3-clause | eLRuLL/scrapy,scrapy/scrapy,dangra/scrapy,elacuesta/scrapy,pablohoffman/scrapy,pawelmhm/scrapy,pablohoffman/scrapy,eLRuLL/scrapy,starrify/scrapy,pawelmhm/scrapy,elacuesta/scrapy,scrapy/scrapy,elacuesta/scrapy,starrify/scrapy,scrapy/scrapy,dangra/scrapy,starrify/scrapy,pablohoffman/scrapy,pawelmhm/scrapy,eLRuLL/scrapy,d... | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | <commit_before>import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist.... | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist. The ftplib.FTP... | <commit_before>import posixpath
from ftplib import error_perm, FTP
from posixpath import dirname
def ftp_makedirs_cwd(ftp, path, first_call=True):
"""Set the current directory of the FTP connection given in the ``ftp``
argument (as a ftplib.FTP object), creating all parent directories if they
don't exist.... |
3483933b7e5709ef79a3f632bae09d24b22f4a44 | pygp/likelihoods/__base.py | pygp/likelihoods/__base.py | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ = ['Likelihood', 'R... | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ ... | Fix bug in RealLikelihood due to not importing numpy. | Fix bug in RealLikelihood due to not importing numpy.
| Python | bsd-2-clause | mwhoffman/pygp | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ = ['Likelihood', 'R... | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ ... | <commit_before>"""
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ = ['... | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ ... | """
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ = ['Likelihood', 'R... | <commit_before>"""
Implementation of the squared-exponential kernels.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import abc
# local imports
from ..utils.models import Parameterized
# exported symbols
__all__ = ['... |
e164a50432f4f133e07d864a1923852754924f34 | byceps/services/authentication/service.py | byceps/services/authentication/service.py | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | Check for account activity before password verification | Check for account activity before password verification
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | <commit_before>"""
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
... | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password ... | <commit_before>"""
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
... |
cc0fe75312fe5eb7cdfbb56942632a66730c71d6 | src/opencmiss/neon/settings/mainsettings.py | src/opencmiss/neon/settings/mainsettings.py | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | Reset Neon version to 0.1.0 | Reset Neon version to 0.1.0
| Python | apache-2.0 | alan-wu/neon | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | <commit_before>'''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | '''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | <commit_before>'''
Copyright 2015 University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
c5fb6fc400e19cdeac3b2cf21ec94893b1c2e92d | srw/plotting.py | srw/plotting.py | import matplotlib.pyplot as plt
def plot_transiting(lc, period, epoch, ax=None, unit='mjd', colour=None):
if unit.lower() == 'jd':
epoch -= 2400000.5
lc.compute_phase(period, epoch)
if ax is None:
ax = plt.gca()
phase = lc.phase.copy()
phase[phase > 0.8] -= 1.0
ax.errorbar(... | import matplotlib.pyplot as plt
from astropy import units as u
from .logs import get_logger
logger = get_logger(__name__)
try:
import ds9
except ImportError:
logger.warning('No ds9 package available. '
'Related functions are not available')
no_ds9 = True
else:
no_ds9 = False
def p... | Add show on image function | Add show on image function
| Python | mit | mindriot101/srw | import matplotlib.pyplot as plt
def plot_transiting(lc, period, epoch, ax=None, unit='mjd', colour=None):
if unit.lower() == 'jd':
epoch -= 2400000.5
lc.compute_phase(period, epoch)
if ax is None:
ax = plt.gca()
phase = lc.phase.copy()
phase[phase > 0.8] -= 1.0
ax.errorbar(... | import matplotlib.pyplot as plt
from astropy import units as u
from .logs import get_logger
logger = get_logger(__name__)
try:
import ds9
except ImportError:
logger.warning('No ds9 package available. '
'Related functions are not available')
no_ds9 = True
else:
no_ds9 = False
def p... | <commit_before>import matplotlib.pyplot as plt
def plot_transiting(lc, period, epoch, ax=None, unit='mjd', colour=None):
if unit.lower() == 'jd':
epoch -= 2400000.5
lc.compute_phase(period, epoch)
if ax is None:
ax = plt.gca()
phase = lc.phase.copy()
phase[phase > 0.8] -= 1.0
... | import matplotlib.pyplot as plt
from astropy import units as u
from .logs import get_logger
logger = get_logger(__name__)
try:
import ds9
except ImportError:
logger.warning('No ds9 package available. '
'Related functions are not available')
no_ds9 = True
else:
no_ds9 = False
def p... | import matplotlib.pyplot as plt
def plot_transiting(lc, period, epoch, ax=None, unit='mjd', colour=None):
if unit.lower() == 'jd':
epoch -= 2400000.5
lc.compute_phase(period, epoch)
if ax is None:
ax = plt.gca()
phase = lc.phase.copy()
phase[phase > 0.8] -= 1.0
ax.errorbar(... | <commit_before>import matplotlib.pyplot as plt
def plot_transiting(lc, period, epoch, ax=None, unit='mjd', colour=None):
if unit.lower() == 'jd':
epoch -= 2400000.5
lc.compute_phase(period, epoch)
if ax is None:
ax = plt.gca()
phase = lc.phase.copy()
phase[phase > 0.8] -= 1.0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.