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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f9a8e5107cc3f9d94f43bd5ce60054f849be2c15 | tests/utils.py | tests/utils.py | import copy
import os
from django.conf import settings
from django.template import Context
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator t... | import copy
import os
from django.conf import settings
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator to specify the template path.
"""... | Fix use of Context for dj1.11 | Fix use of Context for dj1.11
| Python | mit | funkybob/django-sniplates,funkybob/django-sniplates | import copy
import os
from django.conf import settings
from django.template import Context
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator t... | import copy
import os
from django.conf import settings
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator to specify the template path.
"""... | <commit_before>import copy
import os
from django.conf import settings
from django.template import Context
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Conveni... | import copy
import os
from django.conf import settings
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator to specify the template path.
"""... | import copy
import os
from django.conf import settings
from django.template import Context
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Convenient decorator t... | <commit_before>import copy
import os
from django.conf import settings
from django.template import Context
from django.test import override_settings
HERE = os.path.dirname(__file__)
def template_path(path):
return os.path.join(HERE, 'templates', path, '')
def template_dirs(*relative_dirs):
"""
Conveni... |
8095c37e0ab99e9827acbe4621f2fcb9334e1426 | games/management/commands/autocreate_steamdb_installers.py | games/management/commands/autocreate_steamdb_installers.py | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | Update installer autocreate for games with no icon | Update installer autocreate for games with no icon
| Python | agpl-3.0 | Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,lutris/website,lutris/website,lutris/website,Turupawn/website | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | <commit_before>import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
... | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
steam_runner = ... | <commit_before>import json
from django.core.management.base import BaseCommand
from games import models
from accounts.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open("steamdb.json") as steamdb_file:
steamdb = json.loads(steamdb_file.read())
... |
f87b9dd4674031aceb7e47de37a57ea190ec264d | tmc/exercise_tests/check.py | tmc/exercise_tests/check.py | import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
def te... | import re
import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
... | Use a bit better regex for XML error workaround, actually failable compile | Use a bit better regex for XML error workaround, actually failable compile
| Python | mit | JuhaniImberg/tmc.py,JuhaniImberg/tmc.py | import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
def te... | import re
import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
... | <commit_before>import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile... | import re
import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
... | import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
def te... | <commit_before>import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile... |
b0ed850da2573cd8a99fc9f628f2da8a3bc97c71 | greenmine/base/monkey.py | greenmine/base/monkey.py | # -*- coding: utf-8 -*-
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
views._APIView = views.APIView
views._patched ... | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
v... | Send print message to sys.stderr | Smallfix: Send print message to sys.stderr
| Python | agpl-3.0 | EvgeneOskin/taiga-back,taigaio/taiga-back,rajiteh/taiga-back,Zaneh-/bearded-tribble-back,gauravjns/taiga-back,obimod/taiga-back,dycodedev/taiga-back,WALR/taiga-back,joshisa/taiga-back,bdang2012/taiga-back-casting,Rademade/taiga-back,CMLL/taiga-back,crr0004/taiga-back,taigaio/taiga-back,obimod/taiga-back,dayatz/taiga-ba... | # -*- coding: utf-8 -*-
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
views._APIView = views.APIView
views._patched ... | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
v... | <commit_before># -*- coding: utf-8 -*-
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
views._APIView = views.APIView
... | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
v... | # -*- coding: utf-8 -*-
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
views._APIView = views.APIView
views._patched ... | <commit_before># -*- coding: utf-8 -*-
from rest_framework import views
from rest_framework import status, exceptions
from rest_framework.response import Response
def patch_api_view():
from django.views.generic import View
if hasattr(views, "_patched"):
return
views._APIView = views.APIView
... |
6611153650b697d56f14be347946f4a814d7fc72 | src/urllib3/_version.py | src/urllib3/_version.py | # This file is protected via CODEOWNERS
__version__ = "1.26.0.dev0"
| # This file is protected via CODEOWNERS
__version__ = "2.0.0.dev0"
| Mark master branch as 2.0.0 development branch | Mark master branch as 2.0.0 development branch | Python | mit | urllib3/urllib3,sigmavirus24/urllib3,sigmavirus24/urllib3,urllib3/urllib3 | # This file is protected via CODEOWNERS
__version__ = "1.26.0.dev0"
Mark master branch as 2.0.0 development branch | # This file is protected via CODEOWNERS
__version__ = "2.0.0.dev0"
| <commit_before># This file is protected via CODEOWNERS
__version__ = "1.26.0.dev0"
<commit_msg>Mark master branch as 2.0.0 development branch<commit_after> | # This file is protected via CODEOWNERS
__version__ = "2.0.0.dev0"
| # This file is protected via CODEOWNERS
__version__ = "1.26.0.dev0"
Mark master branch as 2.0.0 development branch# This file is protected via CODEOWNERS
__version__ = "2.0.0.dev0"
| <commit_before># This file is protected via CODEOWNERS
__version__ = "1.26.0.dev0"
<commit_msg>Mark master branch as 2.0.0 development branch<commit_after># This file is protected via CODEOWNERS
__version__ = "2.0.0.dev0"
|
fee78440de784bee91669e6c4f1d2c301202e29d | apps/blogs/serializers.py | apps/blogs/serializers.py | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | Add main_image to BlogPost API response. | Add main_image to BlogPost API response.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | <commit_before>from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Fie... | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Field):
def t... | <commit_before>from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from fluent_contents.rendering import render_placeholder
from rest_framework import serializers
from .models import BlogPost
class BlogPostContentsField(serializers.Fie... |
ddd5adaa1023bc30753fa7ef893ddc8e2ae186d8 | clowder_server/management/commands/send_alerts.py | clowder_server/management/commands/send_alerts.py | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | Store more pings per transaction | Store more pings per transaction
| Python | agpl-3.0 | keithhackbarth/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | <commit_before>import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self... | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self, *args, **opti... | <commit_before>import datetime
from django.core.management.base import BaseCommand, CommandError
from clowder_account.models import Company
from clowder_server.emailer import send_alert
from clowder_server.models import Alert, Ping
class Command(BaseCommand):
help = 'Checks and sends alerts'
def handle(self... |
8fd5c5c8c7aec1cc045f7f2fcbecb16be129c19b | jobs/templatetags/jobs_tags.py | jobs/templatetags/jobs_tags.py | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
try:
root = context['page'].get_root()
listing_pages = JobPostingLis... | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
if 'page' not in context:
return None
try:
root = context['page... | Add fix for non pages like search. | Add fix for non pages like search.
| Python | mit | OpenCanada/website,OpenCanada/website,OpenCanada/website,OpenCanada/website | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
try:
root = context['page'].get_root()
listing_pages = JobPostingLis... | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
if 'page' not in context:
return None
try:
root = context['page... | <commit_before>from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
try:
root = context['page'].get_root()
listing_pages ... | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
if 'page' not in context:
return None
try:
root = context['page... | from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
try:
root = context['page'].get_root()
listing_pages = JobPostingLis... | <commit_before>from django import template
from django.db.models import ObjectDoesNotExist
from jobs.models import JobPostingListPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_active_posting_page(context):
try:
root = context['page'].get_root()
listing_pages ... |
e1a27161621038cc3bdfd4030aef130ee09e92ec | troposphere/dax.py | troposphere/dax.py | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | Update DAX per 2021-06-24 changes | Update DAX per 2021-06-24 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | <commit_before># Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSOb... | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSObject):
reso... | <commit_before># Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class SSESpecification(AWSProperty):
props = {
"SSEEnabled": (boolean, False),
}
class Cluster(AWSOb... |
31a0d75b573421dbc05aad95df8b3c74a7154057 | tx_highered/api.py | tx_highered/api.py | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | Return name instead of unicode in autocomplete API | Return name instead of unicode in autocomplete API
| Python | apache-2.0 | texastribune/the-dp,texastribune/the-dp,texastribune/the-dp,texastribune/the-dp | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | <commit_before>import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
... | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | <commit_before>import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
... |
815891deabea40d3c38f84ab16047a67972889d6 | simplesqlite/loader/error.py | simplesqlite/loader/error.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(Exception):
"""
Raised when data is invalid to load.
"""
class ... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(ValueError):
"""
Raised when data is invalid to load.
"""
class... | Modify super class of InvalidDataError | Modify super class of InvalidDataError
| Python | mit | thombashi/SimpleSQLite,thombashi/SimpleSQLite | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(Exception):
"""
Raised when data is invalid to load.
"""
class ... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(ValueError):
"""
Raised when data is invalid to load.
"""
class... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(Exception):
"""
Raised when data is invalid to load.
... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(ValueError):
"""
Raised when data is invalid to load.
"""
class... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(Exception):
"""
Raised when data is invalid to load.
"""
class ... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
class ValidationError(Exception):
"""
Raised data is not properly formatted.
"""
class InvalidDataError(Exception):
"""
Raised when data is invalid to load.
... |
94ad884a245dea36110718577e47eb0c7b0c2b0a | skyfield/tests/test_topos.py | skyfield/tests/test_topos.py | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (15, 25, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large elev... | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (-15, 15, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large ele... | Add test for subpoint() longitude correctness | Add test for subpoint() longitude correctness
| Python | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (15, 25, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large elev... | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (-15, 15, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large ele... | <commit_before>from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (15, 25, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a ... | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (-15, 15, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large ele... | from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (15, 25, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a very large elev... | <commit_before>from numpy import abs
from skyfield.api import load
from skyfield.toposlib import Topos
angle = (15, 25, 35, 45)
def ts():
yield load.timescale()
def test_beneath(ts, angle):
t = ts.utc(2018, 1, 19, 14, 37, 55)
# An elevation of 0 is more difficult for the routine's accuracy
# than a ... |
88a5a74ee1e3d3f3fe9e6a43bacd73b2f3f5bb96 | tests/test_mongo.py | tests/test_mongo.py | import unittest
import logging
logging.basicConfig()
logger = logging.getLogger()
from checks.db.mongo import MongoDb
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logger)
def testCheck(self):
r = self.c.check({"MongoDBServer": "blah"})
self.assertEquals(r["con... | import unittest
import logging
logging.basicConfig()
import subprocess
from tempfile import mkdtemp
from checks.db.mongo import MongoDb
PORT1 = 27017
PORT2 = 37017
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logging.getLogger())
# Start 1 instances of Mongo
dir1 ... | Test does start a mongo instance. | Test does start a mongo instance.
| Python | bsd-3-clause | jshum/dd-agent,mderomph-coolblue/dd-agent,AniruddhaSAtre/dd-agent,remh/dd-agent,lookout/dd-agent,PagerDuty/dd-agent,Mashape/dd-agent,indeedops/dd-agent,GabrielNicolasAvellaneda/dd-agent,AntoCard/powerdns-recursor_check,citrusleaf/dd-agent,benmccann/dd-agent,gphat/dd-agent,mderomph-coolblue/dd-agent,zendesk/dd-agent,huh... | import unittest
import logging
logging.basicConfig()
logger = logging.getLogger()
from checks.db.mongo import MongoDb
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logger)
def testCheck(self):
r = self.c.check({"MongoDBServer": "blah"})
self.assertEquals(r["con... | import unittest
import logging
logging.basicConfig()
import subprocess
from tempfile import mkdtemp
from checks.db.mongo import MongoDb
PORT1 = 27017
PORT2 = 37017
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logging.getLogger())
# Start 1 instances of Mongo
dir1 ... | <commit_before>import unittest
import logging
logging.basicConfig()
logger = logging.getLogger()
from checks.db.mongo import MongoDb
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logger)
def testCheck(self):
r = self.c.check({"MongoDBServer": "blah"})
self.asse... | import unittest
import logging
logging.basicConfig()
import subprocess
from tempfile import mkdtemp
from checks.db.mongo import MongoDb
PORT1 = 27017
PORT2 = 37017
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logging.getLogger())
# Start 1 instances of Mongo
dir1 ... | import unittest
import logging
logging.basicConfig()
logger = logging.getLogger()
from checks.db.mongo import MongoDb
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logger)
def testCheck(self):
r = self.c.check({"MongoDBServer": "blah"})
self.assertEquals(r["con... | <commit_before>import unittest
import logging
logging.basicConfig()
logger = logging.getLogger()
from checks.db.mongo import MongoDb
class TestMongo(unittest.TestCase):
def setUp(self):
self.c = MongoDb(logger)
def testCheck(self):
r = self.c.check({"MongoDBServer": "blah"})
self.asse... |
31c60902c7e09fd01b6b89550df342e5431de961 | mysite/profile/search_indexes.py | mysite/profile/search_indexes.py | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
def prepare_null_document(self, person_insta... | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
all_public_projects_exact = indexes.MultiValu... | Add a column in the search index for the list of projects. | Add a column in the search index for the list of projects.
| Python | agpl-3.0 | SnappleCap/oh-mainline,campbe13/openhatch,SnappleCap/oh-mainline,mzdaniel/oh-mainline,nirmeshk/oh-mainline,onceuponatimeforever/oh-mainline,sudheesh001/oh-mainline,heeraj123/oh-mainline,onceuponatimeforever/oh-mainline,sudheesh001/oh-mainline,vipul-sharma20/oh-mainline,heeraj123/oh-mainline,openhatch/oh-mainline,willin... | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
def prepare_null_document(self, person_insta... | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
all_public_projects_exact = indexes.MultiValu... | <commit_before>import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
def prepare_null_document(sel... | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
all_public_projects_exact = indexes.MultiValu... | import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
def prepare_null_document(self, person_insta... | <commit_before>import datetime
from haystack import indexes
from haystack import site
import mysite.profile.models
from django.db.models import Q
class PersonIndex(indexes.SearchIndex):
null_document = indexes.CharField(document=True)
all_tag_texts = indexes.MultiValueField()
def prepare_null_document(sel... |
d2bec26a63877e31e2d887e0879a8fd197741147 | thinc/t2t.py | thinc/t2t.py | # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
| # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
from .neural._classes.multiheaded_attention import MultiHeaded... | Add import links for MultiHeadedAttention and prepare_self_attention | Add import links for MultiHeadedAttention and prepare_self_attention
| Python | mit | spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
Add import links for MultiHeadedAttention and prepare_self_att... | # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
from .neural._classes.multiheaded_attention import MultiHeaded... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
<commit_msg>Add import links for MultiHeadedAtt... | # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
from .neural._classes.multiheaded_attention import MultiHeaded... | # coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
Add import links for MultiHeadedAttention and prepare_self_att... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .neural._classes.convolution import ExtractWindow # noqa: F401
from .neural._classes.attention import ParametricAttention # noqa: F401
from .neural._classes.rnn import LSTM, BiLSTM # noqa: F401
<commit_msg>Add import links for MultiHeadedAtt... |
830ac1f89950c34a6f691d2a55b5e0044861066c | neuroimaging/testing/__init__.py | neuroimaging/testing/__init__.py | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | Add some nose.tools to testing imports. | Add some nose.tools to testing imports. | Python | bsd-3-clause | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | <commit_before>"""The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.cor... | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.core.image import ... | <commit_before>"""The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from neuroimaging.testing import funcfile
>>> from neuroimaging.cor... |
310005d0e22b071c1b5ed69cdf2a38371f2f7ec5 | cloudenvy/commands/envy_list.py | cloudenvy/commands/envy_list.py | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | Print out ENVys with newlines for envy list | Print out ENVys with newlines for envy list
| Python | apache-2.0 | cloudenvy/cloudenvy | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | <commit_before>from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help... | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help')
subp... | <commit_before>from cloudenvy.envy import Envy
class EnvyList(object):
"""List all ENVys in context of your current project"""
def __init__(self, argparser):
self._build_subparser(argparser)
def _build_subparser(self, subparsers):
subparser = subparsers.add_parser('list', help='list help... |
cb7170785af4bf853ff8495aaade520d3b133332 | casexml/apps/stock/admin.py | casexml/apps/stock/admin.py | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
list_display = ['report_date', 'sec... | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
search_fields = ['form_id']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
l... | Add search fields to stock models | Add search fields to stock models
| Python | bsd-3-clause | dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsof... | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
list_display = ['report_date', 'sec... | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
search_fields = ['form_id']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
l... | <commit_before>from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
list_display = ['rep... | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
search_fields = ['form_id']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
l... | from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
list_display = ['report_date', 'sec... | <commit_before>from django.contrib import admin
from .models import *
class StockReportAdmin(admin.ModelAdmin):
model = StockReport
list_display = ['date', 'type', 'form_id']
list_filter = ['date', 'type']
class StockTransactionAdmin(admin.ModelAdmin):
model = StockTransaction
list_display = ['rep... |
1821577ca19bb05847c37d856896d8e1ce8b3acb | plugins/religion.py | plugins/religion.py | from util import hook, http
@hook.command('god')
@hook.command
def bible(inp):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('http://www.esvapi.org/v2/rest/passageQuery?key=IP&'
'output-format=plain-text&include-heading-horizontal-lines&'
'include-headi... | from util import hook, http
# https://api.esv.org/account/create-application/
@hook.api_key('bible')
@hook.command('god')
@hook.command
def bible(inp, api_key=None):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('https://api.esv.org/v3/passage/text/?'
'include-headings=... | Fix .bible: v2 was deprecated, the v3 API requires a key. | Fix .bible: v2 was deprecated, the v3 API requires a key.
| Python | unlicense | parkrrr/skybot,TeamPeggle/ppp-helpdesk,crisisking/skybot,jmgao/skybot,rmmh/skybot | from util import hook, http
@hook.command('god')
@hook.command
def bible(inp):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('http://www.esvapi.org/v2/rest/passageQuery?key=IP&'
'output-format=plain-text&include-heading-horizontal-lines&'
'include-headi... | from util import hook, http
# https://api.esv.org/account/create-application/
@hook.api_key('bible')
@hook.command('god')
@hook.command
def bible(inp, api_key=None):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('https://api.esv.org/v3/passage/text/?'
'include-headings=... | <commit_before>from util import hook, http
@hook.command('god')
@hook.command
def bible(inp):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('http://www.esvapi.org/v2/rest/passageQuery?key=IP&'
'output-format=plain-text&include-heading-horizontal-lines&'
... | from util import hook, http
# https://api.esv.org/account/create-application/
@hook.api_key('bible')
@hook.command('god')
@hook.command
def bible(inp, api_key=None):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('https://api.esv.org/v3/passage/text/?'
'include-headings=... | from util import hook, http
@hook.command('god')
@hook.command
def bible(inp):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('http://www.esvapi.org/v2/rest/passageQuery?key=IP&'
'output-format=plain-text&include-heading-horizontal-lines&'
'include-headi... | <commit_before>from util import hook, http
@hook.command('god')
@hook.command
def bible(inp):
".bible <passage> -- gets <passage> from the Bible (ESV)"
base_url = ('http://www.esvapi.org/v2/rest/passageQuery?key=IP&'
'output-format=plain-text&include-heading-horizontal-lines&'
... |
3496efef40acc9e204ea9d3129b974ac3e482ca2 | direnaj/direnaj_api/celery_app/server_endpoint.py | direnaj/direnaj_api/celery_app/server_endpoint.py | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | Fix for periodic task scheduler (3) | Fix for periodic task scheduler (3)
| Python | mit | boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | <commit_before>__author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
... | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | __author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... | <commit_before>__author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
... |
9166d51badaca7502638b630b4d0457aaee66142 | django_cache_manager/models.py | django_cache_manager/models.py | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .backends.sharing.types import ModelCacheInfo
from .backends.sharing import sharing_backend
from .cache_manager import CacheManager
"""
Signal receivers for django model post_save and post_delete. Used... | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .model_cache_sharing.types import ModelCacheInfo
from .model_cache_sharing import model_cache_backend
"""
Signal receivers for django model post_save and post_delete. Used to evict a model cache when
a... | Update to use signals as use_for_related_fields does not work for all cases | Update to use signals as use_for_related_fields does not work for all cases
| Python | mit | vijaykatam/django-cache-manager | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .backends.sharing.types import ModelCacheInfo
from .backends.sharing import sharing_backend
from .cache_manager import CacheManager
"""
Signal receivers for django model post_save and post_delete. Used... | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .model_cache_sharing.types import ModelCacheInfo
from .model_cache_sharing import model_cache_backend
"""
Signal receivers for django model post_save and post_delete. Used to evict a model cache when
a... | <commit_before># -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .backends.sharing.types import ModelCacheInfo
from .backends.sharing import sharing_backend
from .cache_manager import CacheManager
"""
Signal receivers for django model post_save and po... | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .model_cache_sharing.types import ModelCacheInfo
from .model_cache_sharing import model_cache_backend
"""
Signal receivers for django model post_save and post_delete. Used to evict a model cache when
a... | # -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .backends.sharing.types import ModelCacheInfo
from .backends.sharing import sharing_backend
from .cache_manager import CacheManager
"""
Signal receivers for django model post_save and post_delete. Used... | <commit_before># -*- coding: utf-8 -*-
import logging
import uuid
from django.db.models.signals import post_save, post_delete
from .backends.sharing.types import ModelCacheInfo
from .backends.sharing import sharing_backend
from .cache_manager import CacheManager
"""
Signal receivers for django model post_save and po... |
b3f2735923e48958d238e3e20c86ce3090a5eea0 | app.py | app.py | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
resp = handle_twilio_message(body)
twil... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
res... | Add handling for basic twitch controls | Add handling for basic twitch controls
| Python | mit | tforrest/twilio-plays-roomba-flask | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
resp = handle_twilio_message(body)
twil... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
res... | <commit_before>from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
resp = handle_twilio_messa... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
res... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
resp = handle_twilio_message(body)
twil... | <commit_before>from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
app = Flask(__name__)
load_dotenv(find_dotenv())
@app.route('/message', methods=['POST'])
def roomba_command():
# twilio text message
body = request.form['Body']
resp = handle_twilio_messa... |
9649b145bdb6177de203f575762d3ee9ca70d7e1 | bot.py | bot.py | import praw
import urllib
r = praw.Reddit('/u/powderblock Glasses Bot')
for post in r.get_subreddit('all').get_new(limit=5):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
urllib.urlretrieve(str(post.url), "image.jp... | import praw
import urllib
import cv2, numpy as np
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
... | Save Image to File, Open Image if found | Save Image to File, Open Image if found
Add image checking using urllib and opencv.
| Python | mit | porglezomp/PyDankReddit,powderblock/DealWithItReddit,powderblock/PyDankReddit | import praw
import urllib
r = praw.Reddit('/u/powderblock Glasses Bot')
for post in r.get_subreddit('all').get_new(limit=5):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
urllib.urlretrieve(str(post.url), "image.jp... | import praw
import urllib
import cv2, numpy as np
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
... | <commit_before>import praw
import urllib
r = praw.Reddit('/u/powderblock Glasses Bot')
for post in r.get_subreddit('all').get_new(limit=5):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
urllib.urlretrieve(str(post.... | import praw
import urllib
import cv2, numpy as np
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
... | import praw
import urllib
r = praw.Reddit('/u/powderblock Glasses Bot')
for post in r.get_subreddit('all').get_new(limit=5):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
urllib.urlretrieve(str(post.url), "image.jp... | <commit_before>import praw
import urllib
r = praw.Reddit('/u/powderblock Glasses Bot')
for post in r.get_subreddit('all').get_new(limit=5):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
urllib.urlretrieve(str(post.... |
b73556be31864eca862618d6f0d5dd5d39c70677 | lobster/cmssw/actions.py | lobster/cmssw/actions.py | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | Fix overlooked use case for workdir. | Fix overlooked use case for workdir.
| Python | mit | matz-e/lobster,matz-e/lobster,matz-e/lobster | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | <commit_before>import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self,... | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self, config):
... | <commit_before>import datetime
import multiprocessing
from lobster.cmssw.plotting import Plotter
logger = multiprocessing.get_logger()
class DummyQueue(object):
def start(*args):
pass
def put(*args):
pass
def get(*args):
return None
class Actions(object):
def __init__(self,... |
402035dd56261bce17a63b64bed810efdf14869e | exponent/substore.py | exponent/substore.py | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | Document exception raised when a store does not exist | Document exception raised when a store does not exist
| Python | isc | lvh/exponent | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | <commit_before>from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
... | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
Gets a substore... | <commit_before>from axiom import substore
def createStore(rootStore, pathSegments):
"""
Creates amd returns substore under the given root store with the given
path segments.
"""
return substore.SubStore.createNew(rootStore, pathSegments).open()
def getStore(rootStore, pathSegments):
"""
... |
f622e11536c4ebf8f82985329d06efc58c2fe60e | blog/tests/test_views.py | blog/tests/test_views.py | from django.test import TestCase
class BlogViewsTestCase(TestCase):
def setUp(self):
| from django import test
from django.core.urlresolvers import reverse
from blog.models import Post, Category
class BlogViewsTestCase(test.TestCase):
def setUp(self):
# Add parent category and post category
parent = Category(name='Writing', parent=None)
parent.save()
category = Cate... | Add tests for blog index view and post view | Add tests for blog index view and post view
| Python | mit | ajoyoommen/weblog,ajoyoommen/weblog | from django.test import TestCase
class BlogViewsTestCase(TestCase):
def setUp(self):
Add tests for blog index view and post view | from django import test
from django.core.urlresolvers import reverse
from blog.models import Post, Category
class BlogViewsTestCase(test.TestCase):
def setUp(self):
# Add parent category and post category
parent = Category(name='Writing', parent=None)
parent.save()
category = Cate... | <commit_before>from django.test import TestCase
class BlogViewsTestCase(TestCase):
def setUp(self):
<commit_msg>Add tests for blog index view and post view<commit_after> | from django import test
from django.core.urlresolvers import reverse
from blog.models import Post, Category
class BlogViewsTestCase(test.TestCase):
def setUp(self):
# Add parent category and post category
parent = Category(name='Writing', parent=None)
parent.save()
category = Cate... | from django.test import TestCase
class BlogViewsTestCase(TestCase):
def setUp(self):
Add tests for blog index view and post viewfrom django import test
from django.core.urlresolvers import reverse
from blog.models import Post, Category
class BlogViewsTestCase(test.TestCase):
def setUp(self):
# Add ... | <commit_before>from django.test import TestCase
class BlogViewsTestCase(TestCase):
def setUp(self):
<commit_msg>Add tests for blog index view and post view<commit_after>from django import test
from django.core.urlresolvers import reverse
from blog.models import Post, Category
class BlogViewsTestCase(test.TestC... |
aabbed10e2ed744db71da3f8bb97e7605e315f07 | mass/scheduler/worker.py | mass/scheduler/worker.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker:
"""Base class of mass worker.
"""
role_functions = {}
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker(object):
"""Base class of mass worker.
"""
role_functions... | Change BaseWorker to new style class. | Change BaseWorker to new style class.
| Python | apache-2.0 | badboy99tw/mass,KKBOX/mass,KKBOX/mass,badboy99tw/mass,KKBOX/mass,badboy99tw/mass | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker:
"""Base class of mass worker.
"""
role_functions = {}
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker(object):
"""Base class of mass worker.
"""
role_functions... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker:
"""Base class of mass worker.
"""
role_fu... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker(object):
"""Base class of mass worker.
"""
role_functions... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker:
"""Base class of mass worker.
"""
role_functions = {}
... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module define base class of mass worker.
"""
# built-in modules
from functools import wraps
import sys
import traceback
# local modules
from mass.exception import TaskError
class BaseWorker:
"""Base class of mass worker.
"""
role_fu... |
2022c5485289712b8de22fe551d65cf005442826 | massa/domain/__init__.py | massa/domain/__init__.py | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | Change error message of the weight validator. | Change error message of the weight validator. | Python | mit | jaapverloop/massa | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | <commit_before># -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weigh... | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | # -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weight_validator(val... | <commit_before># -*- coding: utf-8 -*-
from schematics.exceptions import ConversionError, ValidationError
def validate(schema, data):
try:
schema.import_data(data)
schema.validate()
except (ConversionError, ValidationError) as e:
raise InvalidInputError(details=e.messages)
def weigh... |
a4808284731ebcc7ae9c29bfeee4db7e943e1b2a | pyinfra/__init__.py | pyinfra/__init__.py | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # no... | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noq... | Add default for `is_cli` to pyinfra. | Add default for `is_cli` to pyinfra.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # no... | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noq... | <commit_before># pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseud... | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noq... | # pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # no... | <commit_before># pyinfra
# File: pyinfra/__init__.py
# Desc: some global state for pyinfra
'''
Welcome to pyinfra.
'''
import logging
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseud... |
27ce88988f22bfb1b3a6ba584da6162b9037b0fa | pony/thirdparty/compiler/__init__.py | pony/thirdparty/compiler/__init__.py | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | Remove deprecation warning from compiler package | Remove deprecation warning from compiler package
| Python | apache-2.0 | gwecho/pony,gwecho/pony,ponyorm/pony,ponyorm/pony,ponyorm/pony,gwecho/pony,ponyorm/pony | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | <commit_before>"""Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defi... | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | """Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defined in compiler... | <commit_before>"""Package for parsing and compiling Python source code
There are several functions defined at the top level that are imported
from modules contained in the package.
parse(buf, mode="exec") -> AST
Converts a string containing Python source code to an abstract
syntax tree (AST). The AST is defi... |
768470b75c0256c933f16856a9754302e5c43bc2 | db/sql_server/pyodbc.py | db/sql_server/pyodbc.py | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
# Tweak stuff a... | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
add_column_string = 'ALTER TABLE %s ADD %s;'
def create_ta... | Add column support for sql server | Add column support for sql server
| Python | apache-2.0 | matthiask/south,matthiask/south | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
# Tweak stuff a... | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
add_column_string = 'ALTER TABLE %s ADD %s;'
def create_ta... | <commit_before>from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
... | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
add_column_string = 'ALTER TABLE %s ADD %s;'
def create_ta... | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
# Tweak stuff a... | <commit_before>from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
... |
7f98aaeda38d7a30ab20ddc1d6ce7ae17d42f358 | dduplicated/commands.py | dduplicated/commands.py | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
fileManager.delete(files)
exit(0)
# Make the link to first file
def link(files):
fileManager.link(files)
exit(0)
# Print the help menu
def help():
print("dduplicate is a simple scr... | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
return fileManager.delete(files)
# Make the link to first file
def link(files):
return fileManager.link(files)
# Print the help menu
def help():
help = """
dduplicate is a simple sc... | Update the print help and add returns to delete and link methods. | Update the print help and add returns to delete and link methods.
Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>
| Python | mit | messiasthi/dduplicated-cli | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
fileManager.delete(files)
exit(0)
# Make the link to first file
def link(files):
fileManager.link(files)
exit(0)
# Print the help menu
def help():
print("dduplicate is a simple scr... | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
return fileManager.delete(files)
# Make the link to first file
def link(files):
return fileManager.link(files)
# Print the help menu
def help():
help = """
dduplicate is a simple sc... | <commit_before>from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
fileManager.delete(files)
exit(0)
# Make the link to first file
def link(files):
fileManager.link(files)
exit(0)
# Print the help menu
def help():
print("dduplicate ... | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
return fileManager.delete(files)
# Make the link to first file
def link(files):
return fileManager.link(files)
# Print the help menu
def help():
help = """
dduplicate is a simple sc... | from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
fileManager.delete(files)
exit(0)
# Make the link to first file
def link(files):
fileManager.link(files)
exit(0)
# Print the help menu
def help():
print("dduplicate is a simple scr... | <commit_before>from dduplicated import scans, fileManager
def detect(paths):
return scans.scan(paths)
# Remove all duplicates
def delete(files):
fileManager.delete(files)
exit(0)
# Make the link to first file
def link(files):
fileManager.link(files)
exit(0)
# Print the help menu
def help():
print("dduplicate ... |
b8387222662e54da9c1cabbe5a9df698d25c594f | debug_toolbar/models.py | debug_toolbar/models.py | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
loaded = False
def is_toolbar(cls):
return (issubclass(cls, DebugTool... | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
# Replace this wit... | Simplify code introduced in 7f7ea810. | Simplify code introduced in 7f7ea810.
| Python | bsd-3-clause | ChristosChristofidis/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,barseghyanartur/django-debug-toolbar,barseghyanartur/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,jazzband/django-debug-toolbar,sidja/django-debug-toolbar,spookylukey/django-debug-toolbar,guilhermetavares/django-debug-... | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
loaded = False
def is_toolbar(cls):
return (issubclass(cls, DebugTool... | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
# Replace this wit... | <commit_before>from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
loaded = False
def is_toolbar(cls):
return (issubclass... | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
# Replace this wit... | from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
loaded = False
def is_toolbar(cls):
return (issubclass(cls, DebugTool... | <commit_before>from __future__ import unicode_literals
from django.conf import settings
from django.utils.importlib import import_module
from debug_toolbar.toolbar.loader import load_panel_classes
from debug_toolbar.middleware import DebugToolbarMiddleware
loaded = False
def is_toolbar(cls):
return (issubclass... |
27b9bd22bb43b8b86ae1c40a90c1fae7157dcb86 | app/tests.py | app/tests.py | from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
| from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
def test_login_required(self):
self.check_login_required('/scores/add', '/login?next=%2Fscores%2Fadd')
self.... | Add test to verify login required for protected pages | Add test to verify login required for protected pages
| Python | mit | rtfoley/scorepy,rtfoley/scorepy,rtfoley/scorepy | from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
Add test to verify login required for protected pages | from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
def test_login_required(self):
self.check_login_required('/scores/add', '/login?next=%2Fscores%2Fadd')
self.... | <commit_before>from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
<commit_msg>Add test to verify login required for protected pages<commit_after> | from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
def test_login_required(self):
self.check_login_required('/scores/add', '/login?next=%2Fscores%2Fadd')
self.... | from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
Add test to verify login required for protected pagesfrom app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTest... | <commit_before>from app.test_base import BaseTestCase
class TestTopLevelFunctions(BaseTestCase):
def test_index_response(self):
response = self.client.get('/')
self.assert200(response)
<commit_msg>Add test to verify login required for protected pages<commit_after>from app.test_base import BaseTestC... |
d0374f256b58ed3cb8194e4b46a62b97aee990e1 | tests/test_core_lexer.py | tests/test_core_lexer.py | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | Add tests for reindenting line | Add tests for reindenting line
| Python | mit | 9seconds/concierge,9seconds/sshrc | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | <commit_before># -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x... | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | # -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x xxxxxxx # sdfs... | <commit_before># -*- coding: utf-8 -*-
import sshrc.core.lexer as lexer
import pytest
@pytest.mark.parametrize("input_, output_", (
("", ""),
(" ", ""),
(" #", ""),
("# ", ""),
(" # dsfsdfsdf sdfsdfsd", ""),
(" a", " a"),
(" a# sdfsfdf", " a"),
(" a # sdfsfsd x... |
2e691cbe1c5ef545968d3b7574b81ce4d55a1dd8 | ci/scripts/testserver.py | ci/scripts/testserver.py | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | Update method call for test server | Update method call for test server
| Python | mit | AO-StreetArt/0-Meter,AO-StreetArt/0-Meter | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | <commit_before>#
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from cli... | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from client
message... | <commit_before>#
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import logging
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:1234")
while True:
# Wait for next request from cli... |
4f2c3df24a59a7c287e59ec7d9b11922e7c49412 | tests/test_search.py | tests/test_search.py | from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
| from sharepa.search import ShareSearch
from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
def test_no_title_search():
my_search = ShareSearch()
my_search = my_search.query(
'query_string',
... | Add test for no title search | Add test for no title search
| Python | mit | CenterForOpenScience/sharepa,erinspace/sharepa,fabianvf/sharepa,samanehsan/sharepa | from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
Add test for no title search | from sharepa.search import ShareSearch
from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
def test_no_title_search():
my_search = ShareSearch()
my_search = my_search.query(
'query_string',
... | <commit_before>from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
<commit_msg>Add test for no title search<commit_after> | from sharepa.search import ShareSearch
from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
def test_no_title_search():
my_search = ShareSearch()
my_search = my_search.query(
'query_string',
... | from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
Add test for no title searchfrom sharepa.search import ShareSearch
from sharepa.search import basic_search
def test_basic_search():
results = basic_search... | <commit_before>from sharepa.search import basic_search
def test_basic_search():
results = basic_search.execute()
assert results.hits
assert results.aggregations
<commit_msg>Add test for no title search<commit_after>from sharepa.search import ShareSearch
from sharepa.search import basic_search
def test_b... |
62f96cc41d6a1aca912889664392d30531805a4f | setup.py | setup.py | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.13',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | Fix bugs in item and user knn | Fix bugs in item and user knn
| Python | mit | ArthurFortes/CaseRecommender | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.13',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | <commit_before>from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',... | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.13',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | <commit_before>from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',... |
e2d8737f70e973712d9ee2b958f4e45bf4528791 | setup.py | setup.py | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | Fix required Django version (doesnt support 1.8 yet) | Fix required Django version (doesnt support 1.8 yet)
| Python | mit | saulshanabrook/django-simpleimages | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | <commit_before>from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https:/... | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https://www.github.com... | <commit_before>from setuptools import setup
setup(
name='django-simpleimages',
version='1.2.0',
author='Saul Shanabrook',
author_email='s.shanabrook@gmail.com',
packages=[
'simpleimages',
'simpleimages.management',
'simpleimages.management.commands',
],
url='https:/... |
2640566b45736229cab347b9482a7372488ec53b | eccodes/highlevel/message.py | eccodes/highlevel/message.py |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get_array(self, name):
return eccodes.codes_get_array(self.handle, name)
def set_array(self, name, value):
return eccod... |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get(self, name):
return eccodes.codes_get(self.handle, name)
def set(self, name, value):
return eccodes.codes_set(self.... | Add get/set methods to the Message class | Add get/set methods to the Message class
| Python | apache-2.0 | ecmwf/eccodes-python,ecmwf/eccodes-python |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get_array(self, name):
return eccodes.codes_get_array(self.handle, name)
def set_array(self, name, value):
return eccod... |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get(self, name):
return eccodes.codes_get(self.handle, name)
def set(self, name, value):
return eccodes.codes_set(self.... | <commit_before>
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get_array(self, name):
return eccodes.codes_get_array(self.handle, name)
def set_array(self, name, value):
... |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get(self, name):
return eccodes.codes_get(self.handle, name)
def set(self, name, value):
return eccodes.codes_set(self.... |
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get_array(self, name):
return eccodes.codes_get_array(self.handle, name)
def set_array(self, name, value):
return eccod... | <commit_before>
import io
import eccodes
class Message:
def __init__(self, handle):
self.handle = handle
def __del__(self):
eccodes.codes_release(self.handle)
def get_array(self, name):
return eccodes.codes_get_array(self.handle, name)
def set_array(self, name, value):
... |
d8375d3e3a4a00598ac0cdc38861be9f56fb58c0 | edison/tests/sanity_tests.py | edison/tests/sanity_tests.py | from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
| from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
self.assertFalse(False)
| Add another inane test to trigger Landscape | Add another inane test to trigger Landscape
| Python | mit | briancline/edison | from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
Add another inane test to trigger Landscape | from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
self.assertFalse(False)
| <commit_before>from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
<commit_msg>Add another inane test to trigger Landscape<commit_after> | from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
self.assertFalse(False)
| from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
Add another inane test to trigger Landscapefrom edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
self.asse... | <commit_before>from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
self.assertTrue(True)
<commit_msg>Add another inane test to trigger Landscape<commit_after>from edison.tests import unittest
class SanityTests(unittest.TestCase):
def test_psych(self):
... |
2bbb93a44b76949e34bce3a696a0ad3e3222ad9c | jsonsempai.py | jsonsempai.py | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | Raise AttributeError instead of None | Raise AttributeError instead of None
| Python | mit | kragniz/json-sempai | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | <commit_before>import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, ... | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | <commit_before>import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in d.iteritems():
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, ... |
027500ce86d838bae1927fe2590a9ce88cb61db4 | troposphere/utils.py | troposphere/utils.py | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | Add "include_initial" kwarg to support tailing stack updates | Add "include_initial" kwarg to support tailing stack updates
`get_events` will return all events that have occurred for a stack. This
is useless if we're tailing an update to a stack.
| Python | bsd-2-clause | ikben/troposphere,inetCatapult/troposphere,micahhausler/troposphere,ptoraskar/troposphere,johnctitus/troposphere,cloudtools/troposphere,johnctitus/troposphere,pas256/troposphere,horacio3/troposphere,dmm92/troposphere,craigbruce/troposphere,LouTheBrew/troposphere,xxxVxxx/troposphere,pas256/troposphere,cloudtools/troposp... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | <commit_before>import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | <commit_before>import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(... |
eeac557b77a3a63a3497791a2716706801b20e37 | kodos/main.py | kodos/main.py |
def run(args=None):
"""Main entry point of the application."""
pass
| import sys
from PyQt4.QtGui import QApplication, QMainWindow
from kodos.ui.ui_main import Ui_MainWindow
class KodosMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(KodosMainWindow, self).__init__(parent)
self.setupUi(self)
self.connectActions()
# Tr... | Connect the UI to the code and start to connect slots to actions. | Connect the UI to the code and start to connect slots to actions.
| Python | bsd-2-clause | multani/kodos-qt4 |
def run(args=None):
"""Main entry point of the application."""
pass
Connect the UI to the code and start to connect slots to actions. | import sys
from PyQt4.QtGui import QApplication, QMainWindow
from kodos.ui.ui_main import Ui_MainWindow
class KodosMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(KodosMainWindow, self).__init__(parent)
self.setupUi(self)
self.connectActions()
# Tr... | <commit_before>
def run(args=None):
"""Main entry point of the application."""
pass
<commit_msg>Connect the UI to the code and start to connect slots to actions.<commit_after> | import sys
from PyQt4.QtGui import QApplication, QMainWindow
from kodos.ui.ui_main import Ui_MainWindow
class KodosMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(KodosMainWindow, self).__init__(parent)
self.setupUi(self)
self.connectActions()
# Tr... |
def run(args=None):
"""Main entry point of the application."""
pass
Connect the UI to the code and start to connect slots to actions.import sys
from PyQt4.QtGui import QApplication, QMainWindow
from kodos.ui.ui_main import Ui_MainWindow
class KodosMainWindow(QMainWindow, Ui_MainWindow):
def __init__(... | <commit_before>
def run(args=None):
"""Main entry point of the application."""
pass
<commit_msg>Connect the UI to the code and start to connect slots to actions.<commit_after>import sys
from PyQt4.QtGui import QApplication, QMainWindow
from kodos.ui.ui_main import Ui_MainWindow
class KodosMainWindow(QMain... |
c2a69c18085d4f9ee932465e143fe051037d98db | util/output_pipe.py | util/output_pipe.py | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | Fix bug where previous instances would populate the new OutputPipe | Fix bug where previous instances would populate the new OutputPipe
| Python | mit | JBarberU/strawberry_py | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | <commit_before>import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command outpu... | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command output, rather than
... | <commit_before>import sys
import re
from xc_exception import TestFailureError
from colors import Colors
from meta_line import MetaLine
from line import Line
class OutputPipe:
meta_lines = []
verbose = True
pretty = True
unacceptable_output = []
# unacceptable_output is usful for failing based on command outpu... |
5c3c681d60a3d747728d337358455cf00b905e43 | utils/message_parsing.py | utils/message_parsing.py | from typing import Tuple, List
import shlex
import discord
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if s... | from typing import Tuple, List
import shlex
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if string.startswit... | Change message parsing to not break on prefixes with spaces. May find a way to bring back clean suffix and clean args. | Change message parsing to not break on prefixes with spaces. May find a way to bring back clean suffix and clean args.
| Python | mit | HexadecimalPython/Xeili,awau/Amethyst | from typing import Tuple, List
import shlex
import discord
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if s... | from typing import Tuple, List
import shlex
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if string.startswit... | <commit_before>from typing import Tuple, List
import shlex
import discord
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixe... | from typing import Tuple, List
import shlex
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if string.startswit... | from typing import Tuple, List
import shlex
import discord
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixes:
if s... | <commit_before>from typing import Tuple, List
import shlex
import discord
def get_cmd(string: str) -> str:
'''Gets the command name from a string.'''
return string.split(' ')[0]
def parse_prefixes(string: str, prefixes: List[str]) -> str:
'''Cleans the prefixes off a string.'''
for prefix in prefixe... |
46573f40e841141e2aa3f813a6938460a92511c1 | devtools/scripts/build_cookiecutter_json.py | devtools/scripts/build_cookiecutter_json.py | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": python_version,
"platform": platform_mapping[ci_os]... | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": [python_version],
"platform": [platform_mapping[ci_... | Change platform and python fields to lists | Change platform and python fields to lists
| Python | mit | open-forcefield-group/openforcefield,open-forcefield-group/openforcefield,openforcefield/openff-toolkit,open-forcefield-group/openforcefield,openforcefield/openff-toolkit | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": python_version,
"platform": platform_mapping[ci_os]... | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": [python_version],
"platform": [platform_mapping[ci_... | <commit_before>import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": python_version,
"platform": platform... | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": [python_version],
"platform": [platform_mapping[ci_... | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": python_version,
"platform": platform_mapping[ci_os]... | <commit_before>import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openforcefield",
"channel": "omnia",
"python": python_version,
"platform": platform... |
c4feb85d3f1f0151b7a64705a555d98221d6d857 | setup-utils/data_upgrade_from_0.4.py | setup-utils/data_upgrade_from_0.4.py | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | Add new WHOWAS keys when upgrading the data to 0.5 | Add new WHOWAS keys when upgrading the data to 0.5
| Python | bsd-3-clause | Heufneutje/txircd | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | <commit_before># This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile",... | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | # This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile", help="The loca... | <commit_before># This file upgrades data.db from the 0.4 format data to 0.5 format data.
# SETUP: Open data.db
import argparse, shelve, sys
argumentParser = argparse.ArgumentParser(description="Upgrades txircd's data.db from the 0.4 format to the 0.5 format.")
argumentParser.add_argument("--datafile", dest="datafile",... |
08b1f3f64580f99ffb18261ab0e9fc691bc3dd67 | rpifake/__init__.py | rpifake/__init__.py | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | Make override more global, not just within patch scope | Make override more global, not just within patch scope
| Python | mit | rfarley3/lcd-restful,rfarley3/lcd-restful | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | <commit_before># After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
impor... | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | # After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
import mock
from... | <commit_before># After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
print('Warning, not in RPi, using mock GPIO')
# Idea taken from RPLCD who commented it as being from:
# reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio
impor... |
5beba531b85d719039c2faf371d83d2957cea5c3 | rpifake/__init__.py | rpifake/__init__.py | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | Fix bad logic for missing RPi package | Fix bad logic for missing RPi package
| Python | mit | rfarley3/lcd-restful,rfarley3/lcd-restful | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | <commit_before>from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, ... | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, not in RPi, usi... | <commit_before>from __future__ import print_function
import sys
is_active = False
# After this function, any futher calls to import RPi.GPIO
# will instead import .gpio.Gpio instead
def patch_fake_gpio():
import sys
import mock
from .gpio import Gpio as FakeGpio
global is_active
print('Warning, ... |
1d0ac568776798a032906d91c913240dabfd403b | twitter_streaming.py | twitter_streaming.py | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
from tweepy.streaming import StreamListener
from tweepy im... | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
# The details of using Tweepy with the Twitter streaming A... | Stop on error from streaming API | Stop on error from streaming API
| Python | mit | 0x7df/twitter2pocket | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
from tweepy.streaming import StreamListener
from tweepy im... | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
# The details of using Tweepy with the Twitter streaming A... | <commit_before># Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
from tweepy.streaming import StreamListener... | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
# The details of using Tweepy with the Twitter streaming A... | # Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
from tweepy.streaming import StreamListener
from tweepy im... | <commit_before># Pipe the output of this to file, e.g.:
#
# `python twitter_streaming.py > twitter_data.txt`
#
# The output is in JSON format.
# This uses Tweepy, a Python library for accessing the Twitter API:
# http://www.tweepy.org. Install with `pip install tweepy`.
from tweepy.streaming import StreamListener... |
a147d7cdd8ff3141ceea0f6902c2f664928f7b65 | vocab.py | vocab.py | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | Allow reading word list from stdin. | Allow reading word list from stdin.
| Python | mit | zqureshi/vocab | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | <commit_before>import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
... | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
if pretty:
... | <commit_before>import fire
import json
import sys
from source import VocabularyCom
from airtable import Airtable
class CLI:
class source:
"""Import word lists from various sources"""
def vocabulary_com(self, list_url, pretty=False):
result = VocabularyCom().collect(list_url)
... |
82a473b6b807a35cafd81d85e2c0bac71f51cb3c | src/sas/qtgui/Plotting/PlotHelper.py | src/sas/qtgui/Plotting/PlotHelper.py | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]
this._plots =... | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
import weakref
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]... | Allow plots to be disposed of sooner | Allow plots to be disposed of sooner
| Python | bsd-3-clause | SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]
this._plots =... | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
import weakref
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]... | <commit_before>"""
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]... | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
import weakref
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]... | """
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]
this._plots =... | <commit_before>"""
`Singleton` plot helper module
All its variables are bound to the module,
which can not be instantiated repeatedly so IDs are session-specific.
"""
import sys
# TODO Refactor to allow typing without circular import
#from sas.qtgui.Plotting.PlotterBase import PlotterBase
this = sys.modules[__name__]... |
e70e6c1cccb235efdd426fcf3cfb7b0be8b9efed | fjord/heartbeat/management/commands/hbhealthcheck.py | fjord/heartbeat/management/commands/hbhealthcheck.py | from django.core.management.base import BaseCommand, CommandError
from fjord.heartbeat.healthchecks import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())... | from django.core.management.base import BaseCommand
from fjord.heartbeat.healthcheck import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())
print ... | Fix imports after renaming healthcheck module | Fix imports after renaming healthcheck module
| Python | bsd-3-clause | mozilla/fjord,hoosteeno/fjord,hoosteeno/fjord,mozilla/fjord,mozilla/fjord,mozilla/fjord,hoosteeno/fjord,hoosteeno/fjord | from django.core.management.base import BaseCommand, CommandError
from fjord.heartbeat.healthchecks import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())... | from django.core.management.base import BaseCommand
from fjord.heartbeat.healthcheck import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())
print ... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from fjord.heartbeat.healthchecks import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_... | from django.core.management.base import BaseCommand
from fjord.heartbeat.healthcheck import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())
print ... | from django.core.management.base import BaseCommand, CommandError
from fjord.heartbeat.healthchecks import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_healthchecks())... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from fjord.heartbeat.healthchecks import run_healthchecks, email_healthchecks
class Command(BaseCommand):
help = 'Runs heartbeat health checks and sends email'
def handle(self, *args, **options):
email_healthchecks(run_... |
0e1425b9246ae85dbd8bd37244a442662dd205bb | server/auvsi_suas/views/index.py | server/auvsi_suas/views/index.py | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
logger = logging.getLogger(__name__)
class Index(View):
"""Main view for users co... | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
logger = logging.getLogger(__name__)
class Index(TemplateView):
"""Main view for users connecting via web bro... | Use TemplateView to simplify Index view. | Use TemplateView to simplify Index view.
| Python | apache-2.0 | auvsi-suas/interop,auvsi-suas/interop,auvsi-suas/interop,auvsi-suas/interop | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
logger = logging.getLogger(__name__)
class Index(View):
"""Main view for users co... | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
logger = logging.getLogger(__name__)
class Index(TemplateView):
"""Main view for users connecting via web bro... | <commit_before>"""Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
logger = logging.getLogger(__name__)
class Index(View):
"""Main vi... | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
logger = logging.getLogger(__name__)
class Index(TemplateView):
"""Main view for users connecting via web bro... | """Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
logger = logging.getLogger(__name__)
class Index(View):
"""Main view for users co... | <commit_before>"""Index page admin view."""
import logging
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
logger = logging.getLogger(__name__)
class Index(View):
"""Main vi... |
5837df594f9c18ffe62e90dd4d6ba30fdde98dde | flaskbb/utils/database.py | flaskbb/utils/database.py | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | Use the naive datetime format for MySQL as well | Use the naive datetime format for MySQL as well
See the SQLAlchemy docs for more information:
http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#sqlalchemy.dial
ects.mysql.DATETIME
| Python | bsd-3-clause | realityone/flaskbb,realityone/flaskbb,realityone/flaskbb | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | <commit_before># -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
... | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | <commit_before># -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
... |
6b89bf340c7afd6f3fff680287e9f2156fe6cfdc | xylem/specs/__init__.py | xylem/specs/__init__.py | from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
| from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .plugins.rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
| Fix type causing import error. | Fix type causing import error.
| Python | apache-2.0 | catkin/xylem,catkin/xylem | from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
Fix type causing import error. | from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .plugins.rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
| <commit_before>from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
<commit_msg>Fix type causing import ... | from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .plugins.rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
| from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
Fix type causing import error.from __future__ impor... | <commit_before>from __future__ import unicode_literals
from .impl import verify_spec_name
from .impl import get_spec_plugin_list
from .impl import Spec
from .rules import SpecParsingError
__all__ = ['get_spec_plugin_list', 'SpecParsingError', 'verify_spec_name',
'Spec']
<commit_msg>Fix type causing import ... |
1ed5a4fc595031099c44c2ade3dfe2d5610308c8 | plugins/lock_the_chat.py | plugins/lock_the_chat.py | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | Update lock plugin so admins could write messages | Update lock plugin so admins could write messages
| Python | mit | ProtoxiDe22/Octeon | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | <commit_before>"""
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update... | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | <commit_before>"""
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update... |
7f411fd01c931b73f717b114934662ebb2739555 | spacy/sv/tokenizer_exceptions.py | spacy/sv/tokenizer_exceptions.py | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"ca",
"cm",
"dl",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc."... | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc.",
"exkl.",
"f.d.",
... | Remove exceptions containing whitespace / no special chars | Remove exceptions containing whitespace / no special chars | Python | mit | honnibal/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,raphael0202/spaCy,explosion/spaCy,Gregory-Howard/spaCy,explosion/spaCy,aikramer2/spaCy,banglakit/spaCy,Gregory-Howard/spaCy,honnibal/spaCy,raphael0202/spaCy,banglakit/spaCy,explosion/spaCy,explosion/spaCy,oroszgy/spaCy.hu,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,Gre... | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"ca",
"cm",
"dl",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc."... | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc.",
"exkl.",
"f.d.",
... | <commit_before># encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"ca",
"cm",
"dl",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"en... | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc.",
"exkl.",
"f.d.",
... | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"ca",
"cm",
"dl",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"eng.",
"etc."... | <commit_before># encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
TOKENIZER_EXCEPTIONS = {
}
ORTH_ONLY = [
"ang.",
"anm.",
"bil.",
"bl.a.",
"ca",
"cm",
"dl",
"dvs.",
"e.Kr.",
"el.",
"e.d.",
"en... |
b4498f6dfe26dc0e858d4af5e26cfff9fab3f0cb | prompt_toolkit/layout/dummy.py | prompt_toolkit/layout/dummy.py | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | Fix for DummyLayout: pass 'focussed_element' instead of 'focussed_window'. | Fix for DummyLayout: pass 'focussed_element' instead of 'focussed_window'.
| Python | bsd-3-clause | jonathanslenders/python-prompt-toolkit | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | <commit_before>"""
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextCo... | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextControl
from .dim... | <commit_before>"""
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from __future__ import unicode_literals
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from .containers import Window
from .controls import FormattedTextCo... |
e1efe5d9c07799c7ddb666b06782589dff791f23 | kpi/utils/ss_structure_to_mdtable.py | kpi/utils/ss_structure_to_mdtable.py | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) is 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) == 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | Resolve `SyntaxWarning: "is" with a literal` | Resolve `SyntaxWarning: "is" with a literal`
| Python | agpl-3.0 | kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) is 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) == 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | <commit_before># coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) is 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
... | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) == 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | # coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) is 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
if isinstance(... | <commit_before># coding: utf-8
from collections import OrderedDict
def _convert_sheets_to_lists(content):
cols = OrderedDict()
if not content or len(content) is 0:
return [], None
if isinstance(content[0], list):
cols.update(OrderedDict.fromkeys(content[0]))
for row in content:
... |
497d82e353bfc2db1246982616bf39ec26ba27f8 | utilities/__init__.py | utilities/__init__.py | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | Add function to get just stderr from subprocess command | Add function to get just stderr from subprocess command
| Python | mit | IanLee1521/utilities | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | <commit_before>#! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, retu... | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | #! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, returning stdout
... | <commit_before>#! /usr/bin/env python
from subprocess import Popen, PIPE
def launch(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
def get_stdout(cmd):
"""
Fork the specified command, retu... |
fa9f4ca0bae63b17937c676800fcf80889c70030 | cura/CuraSplashScreen.py | cura/CuraSplashScreen.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QColor, QFont
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Application
class CuraSplashScreen(QSpl... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt, QCoreApplication
from PyQt5.QtGui import QPixmap, QColor, QFont, QFontMetrics
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Applicat... | Fix splashscreen size on HiDPI (windows) screens | Fix splashscreen size on HiDPI (windows) screens
| Python | agpl-3.0 | fieldOfView/Cura,ynotstartups/Wanhao,ynotstartups/Wanhao,Curahelper/Cura,totalretribution/Cura,Curahelper/Cura,totalretribution/Cura,senttech/Cura,fieldOfView/Cura,hmflash/Cura,senttech/Cura,hmflash/Cura | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QColor, QFont
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Application
class CuraSplashScreen(QSpl... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt, QCoreApplication
from PyQt5.QtGui import QPixmap, QColor, QFont, QFontMetrics
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Applicat... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QColor, QFont
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Application
class CuraSp... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt, QCoreApplication
from PyQt5.QtGui import QPixmap, QColor, QFont, QFontMetrics
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Applicat... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QColor, QFont
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Application
class CuraSplashScreen(QSpl... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QColor, QFont
from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources
from UM.Application import Application
class CuraSp... |
29cde856d41fc8654735aa5233e5983178a8e08e | wp2github/_version.py | wp2github/_version.py | __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
| Replace Markdown README with reStructured text | Replace Markdown README with reStructured text
| Python | mit | r8/wp2github.py | __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
Replace Markdown README with reStructured text | __version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
| <commit_before>__version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
<commit_msg>Replace Markdown README with reStructured text<commit_after> | __version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
Replace Markdown README with reStructured text__version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
| <commit_before>__version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
<commit_msg>Replace Markdown README with reStructured text<commit_after>__version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
|
629333cc6e302ef19330a459b787bcce7e9f2fa8 | bartercheckout/models.py | bartercheckout/models.py | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | Change 'patron' to 'customer' in BarterAccount | Change 'patron' to 'customer' in BarterAccount
| Python | agpl-3.0 | codeforgoodconf/sisters-of-the-road-admin,codeforgoodconf/sisters-of-the-road-admin,codeforgoodconf/sisters-of-the-road-admin | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | <commit_before>from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, '... | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, 'Note'),
)
eve... | <commit_before>from django.db import models
# Create your models here.
class BarterEvent(models.Model):
barter_account = models.ForeignKey(
'BarterAccount',
#on_delete=models.CASCADE,
)
ADD = 'Add'
SUBTRACT = 'Subtract'
NOTE = 'Note'
EVENT_TYPE_CHOICES = (
(ADD, 'Add'),
(SUBTRACT, 'Subtract'),
(NOTE, '... |
b8feefe615457809e3583782d5d3a202e63974af | ksurobot/process_setup.py | ksurobot/process_setup.py | import logging.config
from setproctitle import setproctitle
def process_setup():
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatters': {
'long': {
'format':
'%(relativeCreated)d %(threadName)-12s %(levelname)-5s %(... | import logging.config
from setproctitle import setproctitle
import signal
def process_setup():
exitcmd = lambda *_: exit(0)
signal.signal(signal.SIGINT, exitcmd)
signal.signal(signal.SIGTERM, exitcmd)
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatter... | Add signal handler for sigterm. | Add signal handler for sigterm.
| Python | apache-2.0 | ksurct/MercuryRoboticsEmbedded2016,ksurct/MercuryRoboticsEmbedded2016,ksurct/MercuryRoboticsEmbedded2016 | import logging.config
from setproctitle import setproctitle
def process_setup():
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatters': {
'long': {
'format':
'%(relativeCreated)d %(threadName)-12s %(levelname)-5s %(... | import logging.config
from setproctitle import setproctitle
import signal
def process_setup():
exitcmd = lambda *_: exit(0)
signal.signal(signal.SIGINT, exitcmd)
signal.signal(signal.SIGTERM, exitcmd)
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatter... | <commit_before>import logging.config
from setproctitle import setproctitle
def process_setup():
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatters': {
'long': {
'format':
'%(relativeCreated)d %(threadName)-12s %(l... | import logging.config
from setproctitle import setproctitle
import signal
def process_setup():
exitcmd = lambda *_: exit(0)
signal.signal(signal.SIGINT, exitcmd)
signal.signal(signal.SIGTERM, exitcmd)
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatter... | import logging.config
from setproctitle import setproctitle
def process_setup():
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatters': {
'long': {
'format':
'%(relativeCreated)d %(threadName)-12s %(levelname)-5s %(... | <commit_before>import logging.config
from setproctitle import setproctitle
def process_setup():
setproctitle('ksurctrobot')
logging.config.dictConfig({
'version': 1,
'formatters': {
'long': {
'format':
'%(relativeCreated)d %(threadName)-12s %(l... |
181318bbb9f2e4458b1188bfc8a8ada7f3b4b196 | moderation_queue/urls.py | moderation_queue/urls.py | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/success/(?P<popit_person_id>\d+)$',
PhotoUploadSuccess.as_vi... | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/(?P<popit_person_id>\d+)/success$',
PhotoUploadSuccess.as_vi... | Rearrange the photo upload success URL for consistency | Rearrange the photo upload success URL for consistency
| Python | agpl-3.0 | datamade/yournextmp-popit,neavouli/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextmp-popit,datamade/yournextmp-popit,DemocracyClub/yournextrepresentative,openstate/yournextrepresentative,YoQuieroSaber/yournextrepresentative,mysociety/yourn... | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/success/(?P<popit_person_id>\d+)$',
PhotoUploadSuccess.as_vi... | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/(?P<popit_person_id>\d+)/success$',
PhotoUploadSuccess.as_vi... | <commit_before>from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/success/(?P<popit_person_id>\d+)$',
PhotoUplo... | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/(?P<popit_person_id>\d+)/success$',
PhotoUploadSuccess.as_vi... | from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/success/(?P<popit_person_id>\d+)$',
PhotoUploadSuccess.as_vi... | <commit_before>from django.conf.urls import patterns, url
from .views import upload_photo, PhotoUploadSuccess
urlpatterns = patterns('',
url(r'^photo/upload/(?P<popit_person_id>\d+)$',
upload_photo,
name="photo-upload"),
url(r'^photo/upload/success/(?P<popit_person_id>\d+)$',
PhotoUplo... |
34f83765d850fbc97cc3512eac4c2ebab551b5f7 | db_logger.py | db_logger.py | import mysql.connector
import config
import threading
enabled = False
db_lock = threading.Lock()
conn = mysql.connector.connect(host=config.get('db_logger.host'), user=config.get('db_logger.username'), password=config.get('db_logger.password'), database=config.get('db_logger.database'))
cur = conn.cursor()
def log(m... | import mysql.connector
import config
import threading
enabled = False
connected = False
db_lock = threading.Lock()
def log(message, kind):
if enabled:
with db_lock:
global conn, cur, connected
if not connected:
conn = mysql.connector.connect(host=config.get('db_lo... | Connect to MySQL only when needed | Connect to MySQL only when needed
| Python | mit | kalinochkind/vkbot,kalinochkind/vkbot,kalinochkind/vkbot | import mysql.connector
import config
import threading
enabled = False
db_lock = threading.Lock()
conn = mysql.connector.connect(host=config.get('db_logger.host'), user=config.get('db_logger.username'), password=config.get('db_logger.password'), database=config.get('db_logger.database'))
cur = conn.cursor()
def log(m... | import mysql.connector
import config
import threading
enabled = False
connected = False
db_lock = threading.Lock()
def log(message, kind):
if enabled:
with db_lock:
global conn, cur, connected
if not connected:
conn = mysql.connector.connect(host=config.get('db_lo... | <commit_before>import mysql.connector
import config
import threading
enabled = False
db_lock = threading.Lock()
conn = mysql.connector.connect(host=config.get('db_logger.host'), user=config.get('db_logger.username'), password=config.get('db_logger.password'), database=config.get('db_logger.database'))
cur = conn.curs... | import mysql.connector
import config
import threading
enabled = False
connected = False
db_lock = threading.Lock()
def log(message, kind):
if enabled:
with db_lock:
global conn, cur, connected
if not connected:
conn = mysql.connector.connect(host=config.get('db_lo... | import mysql.connector
import config
import threading
enabled = False
db_lock = threading.Lock()
conn = mysql.connector.connect(host=config.get('db_logger.host'), user=config.get('db_logger.username'), password=config.get('db_logger.password'), database=config.get('db_logger.database'))
cur = conn.cursor()
def log(m... | <commit_before>import mysql.connector
import config
import threading
enabled = False
db_lock = threading.Lock()
conn = mysql.connector.connect(host=config.get('db_logger.host'), user=config.get('db_logger.username'), password=config.get('db_logger.password'), database=config.get('db_logger.database'))
cur = conn.curs... |
39b6bec6159d147be802e8975ae68fef904d8d19 | logger/__init__.py | logger/__init__.py | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = ["logger... | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = []
from... | Remove redundant import and fix package's __all__ | Remove redundant import and fix package's __all__
| Python | bsd-2-clause | Vgr255/logging | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = ["logger... | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = []
from... | <commit_before>#!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__a... | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = []
from... | #!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__all__ = ["logger... | <commit_before>#!/usr/bin/env python3
"""Logging package for specific and general needs.
This exposes all the defined loggers, and a generic ready-to-use Logger
for general needs, which can be used right away.
"""
__author__ = "Emanuel 'Vgr' Barry"
__version__ = "0.2.3"
__status__ = "Mass Refactor [Unstable]"
__a... |
3418b1ef4ade19ccddef92ec059d1629969d8cef | src/lander/ext/parser/_parser.py | src/lander/ext/parser/_parser.py | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.normalize import read_tex_file
if TYPE_CHECKING:
from pathlib import Path
__all__ = ["Parser"]
class Parser(met... | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.extract import get_macros
from lander.ext.parser.texutils.normalize import read_tex_file, replace_macros
if TYPE_CHECKI... | Add normalize_source hook for parsers | Add normalize_source hook for parsers
By default, this hook will replace macros (such as \newcommand) with
their content. Parser implementations can do additional work to
normalize/resolve TeX content.
| Python | mit | lsst-sqre/lander,lsst-sqre/lander | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.normalize import read_tex_file
if TYPE_CHECKING:
from pathlib import Path
__all__ = ["Parser"]
class Parser(met... | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.extract import get_macros
from lander.ext.parser.texutils.normalize import read_tex_file, replace_macros
if TYPE_CHECKI... | <commit_before>from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.normalize import read_tex_file
if TYPE_CHECKING:
from pathlib import Path
__all__ = ["Parser"]
c... | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.extract import get_macros
from lander.ext.parser.texutils.normalize import read_tex_file, replace_macros
if TYPE_CHECKI... | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.normalize import read_tex_file
if TYPE_CHECKING:
from pathlib import Path
__all__ = ["Parser"]
class Parser(met... | <commit_before>from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING
from lander.ext.parser._datamodel import DocumentMetadata
from lander.ext.parser.texutils.normalize import read_tex_file
if TYPE_CHECKING:
from pathlib import Path
__all__ = ["Parser"]
c... |
668f175fcff4414c6c01de31b8f8d703e9588c5f | Optimization.py | Optimization.py | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | Fix to handle case where parameters are not passed-in as a KL | Fix to handle case where parameters are not passed-in as a KL
| Python | bsd-3-clause | GutenkunstLab/SloppyCell,GutenkunstLab/SloppyCell | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | <commit_before>import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
... | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
*args, *... | <commit_before>import copy
import sys
import scipy
import SloppyCell.KeyedList_mod as KeyedList_mod
KeyedList = KeyedList_mod.KeyedList
def fmin_powell_log_params(m, params, *args, **kwargs):
func = m.cost_log_params
pmin = scipy.optimize.fmin_powell(func, scipy.log(params),
... |
c9553679d64ea9fe3db40c4c12ca5833c504ab91 | mainapp/documents/file.py | mainapp/documents/file.py | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | Put parsed_text into the full-text search index | Put parsed_text into the full-text search index
| 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 | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | <commit_before>from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
... | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
'id',
... | <commit_before>from django_elasticsearch_dsl import DocType, GeoPointField
from mainapp.documents.utils import mainIndex
from mainapp.models import File
@mainIndex.doc_type
class FileDocument(DocType):
coordinates = GeoPointField(attr="coordinates")
class Meta:
model = File
fields = [
... |
8280b9d2f9a88e3b52e76405a6a978e85da2b680 | oscar/apps/customer/auth_backends.py | oscar/apps/customer/auth_backends.py | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if not email:
if not 'username' in kwargs:
return None
email = kwa... | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if email is None:
if not 'username' in kwargs or kwargs['username'] is None:
r... | Correct bug in auth where username=None | Correct bug in auth where username=None
| Python | bsd-3-clause | kapt/django-oscar,bschuon/django-oscar,lijoantony/django-oscar,bnprk/django-oscar,pdonadeo/django-oscar,jinnykoo/wuyisj.com,jinnykoo/christmas,monikasulik/django-oscar,machtfit/django-oscar,sonofatailor/django-oscar,marcoantoniooliveira/labweb,spartonia/django-oscar,spartonia/django-oscar,Jannes123/django-oscar,bschuon... | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if not email:
if not 'username' in kwargs:
return None
email = kwa... | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if email is None:
if not 'username' in kwargs or kwargs['username'] is None:
r... | <commit_before>from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if not email:
if not 'username' in kwargs:
return None
... | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if email is None:
if not 'username' in kwargs or kwargs['username'] is None:
r... | from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if not email:
if not 'username' in kwargs:
return None
email = kwa... | <commit_before>from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
class Emailbackend(ModelBackend):
def authenticate(self, email=None, password=None, *args, **kwargs):
if not email:
if not 'username' in kwargs:
return None
... |
d99cedc62dc0e424d676e791eb0d43d92112587a | app/status/views.py | app/status/views.py | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | Change variable name & int comparison. | Change variable name & int comparison.
| Python | mit | alphagov/digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,mtekel/digitalmar... | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | <commit_before>from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response... | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response_from_api_statu... | <commit_before>from flask import jsonify, current_app
import json
from . import status
from . import utils
from .. import models
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
models.get_api_status
)
search_api_response = utils.return_response... |
9c2bee9fe8442cad0761d196d78baaff37c9cb08 | mff_rams_plugin/config.py | mff_rams_plugin/config.py | from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
c.DEALER_BADGE_PRICE = c.BADGE_PRICE | from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
@Config.mixin
class ExtraConfig:
@property
def DEALER_BADGE_PRICE(self):
return self.get_attendee_price()
| Fix DB errors on stop/re-up Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the server for the first time. It took a little bit to track down, but this is the correct way to override this variable. | Fix DB errors on stop/re-up
Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the server for the first time. It took a little bit to track down, but this is the correct way to override this variable.
| Python | agpl-3.0 | MidwestFurryFandom/mff-rams-plugin,MidwestFurryFandom/mff-rams-plugin | from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
c.DEALER_BADGE_PRICE = c.BADGE_PRICEFix DB errors on stop/re-up
Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the server for the first time. ... | from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
@Config.mixin
class ExtraConfig:
@property
def DEALER_BADGE_PRICE(self):
return self.get_attendee_price()
| <commit_before>from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
c.DEALER_BADGE_PRICE = c.BADGE_PRICE<commit_msg>Fix DB errors on stop/re-up
Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the ... | from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
@Config.mixin
class ExtraConfig:
@property
def DEALER_BADGE_PRICE(self):
return self.get_attendee_price()
| from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
c.DEALER_BADGE_PRICE = c.BADGE_PRICEFix DB errors on stop/re-up
Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the server for the first time. ... | <commit_before>from uber.common import *
config = parse_config(__file__)
c.include_plugin_config(config)
c.DEALER_BADGE_PRICE = c.BADGE_PRICE<commit_msg>Fix DB errors on stop/re-up
Due to the fact that this code was being run before everything else, it would cause server-stopping errors -- but only when starting the ... |
31a9afb135cc5ffcf634e638e88232b71444d975 | modules/raycast/config.py | modules/raycast/config.py | def can_build(env, platform):
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
return True
def configure(env):
pass
| def can_build(env, platform):
# Depends on Embree library, which supports only x86_64 (originally)
# and aarch64 (thanks to the embree-aarch64 fork).
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86_64"]
if platform == "javascript":
return False # No SIMD suppo... | Disable embree-based modules on x86 (32-bit) | SCons: Disable embree-based modules on x86 (32-bit)
Fixes #48482.
(cherry picked from commit e53422c8f96770c9a9b7497955c84f4b742fdd73)
| Python | mit | vkbsb/godot,guilhermefelipecgs/godot,ZuBsPaCe/godot,akien-mga/godot,vkbsb/godot,pkowal1982/godot,godotengine/godot,BastiaanOlij/godot,BastiaanOlij/godot,Zylann/godot,Faless/godot,ZuBsPaCe/godot,ZuBsPaCe/godot,godotengine/godot,josempans/godot,akien-mga/godot,Faless/godot,Valentactive/godot,pkowal1982/godot,godotengine/... | def can_build(env, platform):
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
return True
def configure(env):
pass
SCons: Disable embree-based modules on x86 (32-bit)
Fixes #48482.
... | def can_build(env, platform):
# Depends on Embree library, which supports only x86_64 (originally)
# and aarch64 (thanks to the embree-aarch64 fork).
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86_64"]
if platform == "javascript":
return False # No SIMD suppo... | <commit_before>def can_build(env, platform):
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
return True
def configure(env):
pass
<commit_msg>SCons: Disable embree-based modules on x... | def can_build(env, platform):
# Depends on Embree library, which supports only x86_64 (originally)
# and aarch64 (thanks to the embree-aarch64 fork).
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86_64"]
if platform == "javascript":
return False # No SIMD suppo... | def can_build(env, platform):
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
return True
def configure(env):
pass
SCons: Disable embree-based modules on x86 (32-bit)
Fixes #48482.
... | <commit_before>def can_build(env, platform):
if platform == "android":
return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
return True
def configure(env):
pass
<commit_msg>SCons: Disable embree-based modules on x... |
4f9e70866e688ce29096586c8abcf23ef633084f | mqtt/tests/test_client.py | mqtt/tests/test_client.py | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | Add more time to mqtt.test.client | Add more time to mqtt.test.client
| Python | bsd-3-clause | EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | <commit_before>import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermis... | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermission, HospitalP... | <commit_before>import time
from django.test import TestCase
from django.contrib.auth.models import User
from django.conf import settings
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from login.models import Profile, AmbulancePermis... |
9fb89f885dd26b530b4cc95427373f06ddc7d13d | emptiness.py | emptiness.py | #!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=True, help="The t... | #!/bin/python
import argparse
import requests
import timetable
import datetime
import time
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=False, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='... | Use current time if no arguments given | Use current time if no arguments given
| Python | mit | egeldenhuys/emptiness,egeldenhuys/emptiness,egeldenhuys/emptiness | #!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=True, help="The t... | #!/bin/python
import argparse
import requests
import timetable
import datetime
import time
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=False, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='... | <commit_before>#!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=Tr... | #!/bin/python
import argparse
import requests
import timetable
import datetime
import time
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=False, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='... | #!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=True, help="The t... | <commit_before>#!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=Tr... |
37b426a869d1dad5d3ad8c83fc8d3cb3c655dbbd | src/olympia/discovery/serializers.py | src/olympia/discovery/serializers.py | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | Add back guid in the discovery pane API | Add back guid in the discovery pane API
| Python | bsd-3-clause | harry-7/addons-server,kumar303/olympia,harry-7/addons-server,eviljeff/olympia,harikishen/addons-server,mstriemer/addons-server,aviarypl/mozilla-l10n-addons-server,wagnerand/olympia,mozilla/olympia,wagnerand/addons-server,wagnerand/olympia,psiinon/addons-server,atiqueahmedziad/addons-server,mstriemer/olympia,Revanth47/a... | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | <commit_before>from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', '... | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', 'files',)
... | <commit_before>from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.versions.models import Version
class DiscoveryVersionSerializer(VersionSerializer):
class Meta:
fields = ('compatibility', '... |
bf7f2c90f171efb3a631956a15f2c3ed50b5202e | lc0172_factorial_trailing_zeroes.py | lc0172_factorial_trailing_zeroes.py | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | Refactor codes and revise main | Refactor codes and revise main
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | <commit_before>"""Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one t... | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | <commit_before>"""Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one t... |
072774a36c82c3654cdabc6ebfd677b8603db49f | src/models/image.py | src/models/image.py | from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = limit_file_name(imag... | import datetime
from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = l... | Add a timestamp to the filename to allow for chronological ordering in the filesystem | Add a timestamp to the filename to allow for chronological ordering in the filesystem
| Python | apache-2.0 | CharlieCorner/pymage_downloader | from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = limit_file_name(imag... | import datetime
from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = l... | <commit_before>from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = limit... | import datetime
from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = l... | from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = limit_file_name(imag... | <commit_before>from utils.utils import limit_file_name
class Image():
_file_name_pattern = "reddit_%s_%s_album_%s_%s_%s"
def __init__(self, url, post, image_file):
self.post_id = post.id
self.url = url
self.sub_display_name = post.subreddit.display_name
self.image_file = limit... |
aaa0f03a91f3326dc893175510a4ad35649ec371 | pltpreview/view.py | pltpreview/view.py | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | Create new figure in plot command | Create new figure in plot command
| Python | mit | tfarago/pltpreview | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | <commit_before>"""Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. Thi... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. This command
a... | <commit_before>"""Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking.
*kwargs* are passed to matplotlib's ``imshow`` function. Thi... |
48087c2cc8cd9d0bb84014ea4b91fe2f68f958c4 | gant/utils/docker_helper.py | gant/utils/docker_helper.py | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | Add docker helper to get ip | Add docker helper to get ip
| Python | bsd-2-clause | kshlm/gant | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | <commit_before># Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init... | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | # Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init__ (self):
... | <commit_before># Helper functions for docker
import docker
import os
DEFAULT_DOCKER_API_VERSION = '1.10'
BASEIMAGETAG = "glusterbase:latest"
GLUSTERIMAGENAME = "gluster:latest"
BASEDIR=os.getcwd()
class DockerHelper (docker.Client):
"""
Extended docker client with some helper functions
"""
def __init... |
512ae6bd0ce42dc659f7cf4766fdc80587718909 | go/apps/jsbox/definition.py | go/apps/jsbox/definition.py | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | Remove ancient TODO that was resolved a long time ago. | Remove ancient TODO that was resolved a long time ago.
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | <commit_before>import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(Convers... | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(ConversationDefinition... | <commit_before>import json
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class ViewLogsAction(ConversationAction):
action_name = 'view_logs'
action_display_name = 'View Sandbox Logs'
redirect_to = 'jsbox_logs'
class ConversationDefinition(Convers... |
1a211c264de52fbd4719aaa130129f73388a5dd4 | fore/hotswap.py | fore/hotswap.py | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
self.args =... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | Remove all references to actually swapping | Hotswap: Remove all references to actually swapping
| Python | artistic-2.0 | Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
self.args =... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | <commit_before>import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
self.args =... | <commit_before>import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
... |
0d5072aea49ed5c34bc3c140a5019e59506135a4 | menus/database_setup.py | menus/database_setup.py | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | Remove description from Restaurant class | bug: Remove description from Restaurant class
| Python | mit | gsbullmer/restaurant-menu-directory,gsbullmer/restaurant-menu-directory | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | <commit_before>import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Col... | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Column(String(80),... | <commit_before>import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
class Restaurant(Base):
__tablename__ = 'restaurant'
name = Col... |
756a405bb4f84e819f0a10387355c48acb13a6bb | cogbot/cog_bot_state.py | cogbot/cog_bot_state.py | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | Return a copy of extension state | Return a copy of extension state
| Python | mit | 0-0-1/cogbot,Arcensoth/cogbot | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | <commit_before>import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
... | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
log.warning(f'B... | <commit_before>import json
import logging
log = logging.getLogger(__name__)
# TODO persist state to file
class CogBotState:
def __init__(self, state_file: str):
with open(state_file) as fp:
try:
raw_state = json.load(fp)
except FileNotFoundError:
... |
d1b7753fd29cb5c1f68b5ee121a511e43c99b5de | pmix/ppp/odkcalculate.py | pmix/ppp/odkcalculate.py | class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self):
return ""
def to_text(self):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
| class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self, *args, **kwargs):
return ""
def to_text(self, *args, **kwargs):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
| Update signature of to_text and to_html | Update signature of to_text and to_html
| Python | mit | jkpr/pmix | class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self):
return ""
def to_text(self):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
Update signature of to_text and to_html | class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self, *args, **kwargs):
return ""
def to_text(self, *args, **kwargs):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
| <commit_before>class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self):
return ""
def to_text(self):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
<commit_msg>Update signature of to_text and to_html<commit_after... | class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self, *args, **kwargs):
return ""
def to_text(self, *args, **kwargs):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
| class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self):
return ""
def to_text(self):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
Update signature of to_text and to_htmlclass OdkCalculate:
def __init__(sel... | <commit_before>class OdkCalculate:
def __init__(self, row):
self.row = row
def to_html(self):
return ""
def to_text(self):
return ""
def __repr__(self):
return '<OdkCalculate {}>'.format(self.row['name'])
<commit_msg>Update signature of to_text and to_html<commit_after... |
d7e2f05d60aaba3d13337fd53add9fd50aafd6ee | tests/test_python_solutions.py | tests/test_python_solutions.py | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution_files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | Add ids to parametrized tests | Add ids to parametrized tests
| Python | mit | project-lovelace/lovelace-engine,project-lovelace/lovelace-engine,project-lovelace/lovelace-engine | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution_files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | <commit_before>import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pyt... | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution_files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python... | <commit_before>import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pyt... |
d4e87e4e5401fa105b5ed974271e160f364a69f8 | 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... | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# TODO: When Python 2.7 is released this becomes a try/except falling
# back to Django's implementation.
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backe... | Add reminder to myself to to importlib fallback. | Add reminder to myself to to importlib fallback.
| Python | bsd-3-clause | dinie/django-registration,Avenza/django-registration,FundedByMe/django-registration,dinie/django-registration,FundedByMe/django-registration | 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... | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# TODO: When Python 2.7 is released this becomes a try/except falling
# back to Django's implementation.
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backe... | <commit_before>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
... | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# TODO: When Python 2.7 is released this becomes a try/except falling
# back to Django's implementation.
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backe... | 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>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
... |
deee916f45ed569c232cef9bf80d5113e9cf5e8e | mahjong/meld.py | mahjong/meld.py | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | Initialize empty tiles array for Meld object | Initialize empty tiles array for Meld object
| Python | mit | MahjongRepository/mahjong | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | <commit_before># -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opene... | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | # -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opened and closed ka... | <commit_before># -*- coding: utf-8 -*-
from mahjong.tile import TilesConverter
class Meld(object):
CHI = 'chi'
PON = 'pon'
KAN = 'kan'
CHANKAN = 'chankan'
NUKI = 'nuki'
who = None
tiles = None
type = None
from_who = None
called_tile = None
# we need it to distinguish opene... |
53b519c4912d7b3cc32f000eea73bc4d9693967e | tests/test_basic.py | tests/test_basic.py | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | Add in more unit tests. | Add in more unit tests.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com>
| Python | lgpl-2.1 | clalancette/pycdlib,clalancette/pyiso | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | <commit_before>import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, a... | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | <commit_before>import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, a... |
f71dd9055ba04d8aa0024d66d0782107a4b1ca08 | lmod_proxy/tests/test_web.py | lmod_proxy/tests/test_web.py | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup commonly needed objects like the flask test client"""... | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
import mock
from passlib.apache import HtpasswdFile
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup ... | Verify we handle null HTPasswd files | Verify we handle null HTPasswd files
| Python | agpl-3.0 | mitodl/lmod_proxy,mitodl/lmod_proxy,mitodl/lmod_proxy | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup commonly needed objects like the flask test client"""... | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
import mock
from passlib.apache import HtpasswdFile
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup ... | <commit_before># -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup commonly needed objects like the flask... | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
import mock
from passlib.apache import HtpasswdFile
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup ... | # -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup commonly needed objects like the flask test client"""... | <commit_before># -*- coding: utf-8 -*-
"""
Test the root Web application
"""
import imp
from lmod_proxy.tests.common import CommonTest
class TestWeb(CommonTest):
"""Verify the root Web app. Currently it just redirects to edx_grades"""
def setUp(self):
"""Setup commonly needed objects like the flask... |
557e94f9407c0f2d3d6b8faba70209a3d13f3280 | zou/event_stream.py | zou/event_stream.py | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='/... | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='... | Use right env variable to build redis url | Use right env variable to build redis url
It is for the events stream daemon.
| Python | agpl-3.0 | cgwire/zou | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='/... | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='... | <commit_before>import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse... | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='... | import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse, url_prefix='/... | <commit_before>import os
from flask import Flask
from flask_sse import sse
app = Flask(__name__)
redis_host = os.environ.get("KV_HOST", "localhost")
redis_port = os.environ.get("KV_PORT", "6379")
redis_url = "redis://%s:%s/2" % (redis_host, redis_port)
app.config["REDIS_URL"] = redis_url
app.register_blueprint(sse... |
f44630714ce1c20c88919a1ce8d9e4ad49ec9fde | nodeconductor/cloud/perms.py | nodeconductor/cloud/perms.py | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | Fix permission path for customer role lookup | Fix permission path for customer role lookup
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCo... | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCollaboratorsPerm... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole
User = get_user_model()
PERMISSION_LOGICS = (
('cloud.Cloud', FilteredCo... |
f743fec77e7090e3e0e7749ec8615fbf5523dbda | __/urls.py | __/urls.py | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'^', include('pages.urls', namespace='pages')),
)
| from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'', include('pages.urls', namespace='pages')),
)
| Fix URL pattern in new versions of Django | Fix URL pattern in new versions of Django
| Python | mit | djangogirlstaipei/djangogirlstaipei,djangogirlstaipei/djangogirlstaipei,djangogirlstaipei/djangogirlstaipei | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'^', include('pages.urls', namespace='pages')),
)
Fix URL pattern in new versions of Django | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'', include('pages.urls', namespace='pages')),
)
| <commit_before>from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'^', include('pages.urls', namespace='pages')),
)
<commit_msg>Fix URL pattern in new versions of Django<commit_after> | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'', include('pages.urls', namespace='pages')),
)
| from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'^', include('pages.urls', namespace='pages')),
)
Fix URL pattern in new versions of Djangofrom django.conf.urls import patterns, include, url
urlpatterns = patterns... | <commit_before>from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^ajax/', include('ajax.urls', namespace='ajax')),
url(r'^', include('pages.urls', namespace='pages')),
)
<commit_msg>Fix URL pattern in new versions of Django<commit_after>from django.conf.urls import patte... |
c56e490d81e9ad35f1373adf333a452766f56729 | storage/elasticsearch_storage.py | storage/elasticsearch_storage.py | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | Fix bug in no sha use case | Fix bug in no sha use case
| Python | mpl-2.0 | awest1339/multiscanner,awest1339/multiscanner,jmlong1027/multiscanner,awest1339/multiscanner,mitre/multiscanner,jmlong1027/multiscanner,jmlong1027/multiscanner,MITRECND/multiscanner,jmlong1027/multiscanner,MITRECND/multiscanner,mitre/multiscanner,awest1339/multiscanner,mitre/multiscanner | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | <commit_before>from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['us... | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['username']
... | <commit_before>from elasticsearch import Elasticsearch
from storage import Storage
class ElasticSearchStorage(Storage):
def __init__(self, config_dict):
self.db = config_dict['database']
self.host = config_dict['host']
self.port = config_dict['port']
self.username = config_dict['us... |
aaa8743c8610eb4b5ae7d08167715f3c1181d4d5 | app/sessions.py | app/sessions.py | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | Remove development auto admin user creation | Remove development auto admin user creation
| Python | mit | tjgavlick/whiskey-blog,tjgavlick/whiskey-blog,tjgavlick/whiskey-blog,tjgavlick/whiskey-blog | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | <commit_before>from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required... | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required function for f... | <commit_before>from functools import wraps
from flask import request, abort, redirect, url_for, render_template
from flask.ext.login import LoginManager, login_user, logout_user, login_required
from app import app, db
from app.models import User
login_manager = LoginManager()
login_manager.init_app(app)
# required... |
28b067ab7fc7385ac5462eb6c9f9371cef9eb496 | ritter/dataprocessors/annotators.py | ritter/dataprocessors/annotators.py | import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens']:
... | import re
class ArtifactAnnotator:
excluded_types = set(['heading', 'code'])
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
... | Improve annotating of code segements | feat: Improve annotating of code segements
| Python | mit | ErikGartner/ghostdoc-ritter | import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens']:
... | import re
class ArtifactAnnotator:
excluded_types = set(['heading', 'code'])
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
... | <commit_before>import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens... | import re
class ArtifactAnnotator:
excluded_types = set(['heading', 'code'])
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
... | import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens']:
... | <commit_before>import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens... |
8806f70fc5d38d5aa8a49fbe096deb778df3c247 | schemas.py | schemas.py | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation):
user = self.context
if user.admin or reservation.user == user:
return reservation.user.id
... | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation, **kwargs):
user = self.context['user']
if user.admin or reservation.user == user:
return res... | Fix user in reservations responses | Fix user in reservations responses
| Python | agpl-3.0 | CMU-Senate/tcc-room-reservation,CMU-Senate/tcc-room-reservation,CMU-Senate/tcc-room-reservation | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation):
user = self.context
if user.admin or reservation.user == user:
return reservation.user.id
... | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation, **kwargs):
user = self.context['user']
if user.admin or reservation.user == user:
return res... | <commit_before>from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation):
user = self.context
if user.admin or reservation.user == user:
return reserv... | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation, **kwargs):
user = self.context['user']
if user.admin or reservation.user == user:
return res... | from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation):
user = self.context
if user.admin or reservation.user == user:
return reservation.user.id
... | <commit_before>from models import Reservation
from setup import ma
from marshmallow import fields
class ReservationSchema(ma.ModelSchema):
user = fields.Method('get_user')
def get_user(self, reservation):
user = self.context
if user.admin or reservation.user == user:
return reserv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.