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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ba0f715a0730dbc575bd1998f2edc69fab60fc5 | project_task_add_very_high/__openerp__.py | project_task_add_very_high/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein",
"license": ... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein, Odoo Community A... | Add OCA in authors list | Add OCA in authors list
| Python | agpl-3.0 | ddico/project,OCA/project-service,dreispt/project-service,NeovaHealth/project-service,dreispt/project,acsone/project,acsone/project-service | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein",
"license": ... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein, Odoo Community A... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein",
... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein, Odoo Community A... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein",
"license": ... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Add Very High",
"summary": "Adds an extra option 'Very High' on tasks",
"version": "8.0.1.0.0",
"author": "Onestein",
... |
729a814f976ceffba0092ba56efca8ccea06e6e6 | apps/profiles/views.py | apps/profiles/views.py | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class ProfileDetailView(DetailView):
'''
Displays the user profile information
'''
model... | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class Profil... | Add message on profile form save | Add message on profile form save | Python | mit | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class ProfileDetailView(DetailView):
'''
Displays the user profile information
'''
model... | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class Profil... | <commit_before>from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class ProfileDetailView(DetailView):
'''
Displays the user profile information
... | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class Profil... | from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class ProfileDetailView(DetailView):
'''
Displays the user profile information
'''
model... | <commit_before>from django.views.generic import DetailView, UpdateView
from django.core.urlresolvers import reverse_lazy
from braces.views import LoginRequiredMixin
from .models import User
from .forms import ProfileUpdateForm
class ProfileDetailView(DetailView):
'''
Displays the user profile information
... |
a662475e148b8ccd3186303cebdc0615ae2dab1b | asyncmongo/__init__.py | asyncmongo/__init__.py | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | Support Sort Order For TEXT Index | Support Sort Order For TEXT Index
| Python | apache-2.0 | RealGeeks/asyncmongo | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | <commit_before>#!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | <commit_before>#!/bin/env python
#
# Copyright 2010 bit.ly
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
8c69e0e75454a5665ed2d428aba3c052b97b68b5 | cmd2/constants.py | cmd2/constants.py | #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
| #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
| Remove ‘<‘ from REDIRECTION_CHARS, it’s no longer used. | Remove ‘<‘ from REDIRECTION_CHARS, it’s no longer used.
| Python | mit | python-cmd2/cmd2,python-cmd2/cmd2 | #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
Remove ‘<‘ from REDIRECTION_CHARS, i... | #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
| <commit_before>#
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
<commit_msg>Remove ‘<... | #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
| #
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
Remove ‘<‘ from REDIRECTION_CHARS, i... | <commit_before>#
# coding=utf-8
"""Constants and definitions"""
import re
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
<commit_msg>Remove ‘<... |
1892fc910e2a23971248121b44ff120ddc118270 | src/sentry/api/authentication.py | src/sentry/api/authentication.py | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.models import ApiKey, ProjectKey
clas... | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.app import raven
from sentry.models imp... | Add API key to context | Add API key to context
| Python | bsd-3-clause | fotinakis/sentry,daevaorn/sentry,hongliang5623/sentry,ngonzalvez/sentry,looker/sentry,fuziontech/sentry,mitsuhiko/sentry,felixbuenemann/sentry,kevinlondon/sentry,BuildingLink/sentry,kevinlondon/sentry,Natim/sentry,wujuguang/sentry,ewdurbin/sentry,kevinastone/sentry,alexm92/sentry,ifduyue/sentry,zenefits/sentry,drcapule... | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.models import ApiKey, ProjectKey
clas... | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.app import raven
from sentry.models imp... | <commit_before>from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.models import ApiKey, Pr... | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.app import raven
from sentry.models imp... | from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.models import ApiKey, ProjectKey
clas... | <commit_before>from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import constant_time_compare
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
from sentry.models import ApiKey, Pr... |
b8850bd7d457ebb14220213d18a6aa779d64b547 | nirum/validate.py | nirum/validate.py | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | Return its argument in validators | Return its argument in validators
| Python | mit | spoqa/nirum-python,spoqa/nirum-python | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | <commit_before>""":mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | """:mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... | <commit_before>""":mod:`nirum.validate`
~~~~~~~~~~~~~~~~~~~~~~~~
"""
__all__ = 'validate_boxed_type', 'validate_record_type'
def validate_boxed_type(boxed, type_hint):
if not isinstance(boxed, type_hint):
raise TypeError('{0} expected, found: {1}'.format(type_hint,
... |
cad5087328bd462d6db8758929d212c4b34fae6c | server_ui/glue.py | server_ui/glue.py | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | Add blank space in email message | Add blank space in email message
| Python | apache-2.0 | shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | <commit_before>"""
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_... | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | """
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)... | <commit_before>"""
Glue some events together
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_... |
4bcfb45ef0934dcbcfc711bac1a01c7204e83231 | pw_docgen/py/setup.py | pw_docgen/py/setup.py | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Set Pillow version to 8.2.0 | pw_docgen: Set Pillow version to 8.2.0
Version 8.3.0 has yet to be resolved DLL problems on windows.
No-Docs-Update-Reason: Pip dep fix.
Change-Id: I50deecd7c5d3a7f5eb01898e13e5ccb5bedfabf2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/52041
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9... | Python | apache-2.0 | google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
1f884083b612637b64f26532c221b7341c3dda8c | services/voicedetection/voicedetection.py | services/voicedetection/voicedetection.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
| import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
| Clean script header in voice detection. | Clean script header in voice detection.
| Python | apache-2.0 | angus-ai/angus-doc,angus-ai/angus-doc,angus-ai/angus-doc | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
Clean script header in voice detection. | import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
<commit_msg>Clean script header in voice detection... | import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
Clean script header in voice detection.import angus.cloud
conn =... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import angus.cloud
conn = angus.connect()
service = conn.services.get_service('voice_detection', version=1)
job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7})
print job.result
<commit_msg>Clean script header in voice detection... |
93956645792f92cffc11f4e2c72a8df1b0b82a02 | tests/runalldoctests.py | tests/runalldoctests.py | import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
| import doctest
import getopt
import glob
import sys
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
def run(pattern):
if pattern is None:
testfiles = glob.glob('*.txt')
else:
testfiles = glob.glob(pattern)
fo... | Add option to pick single test file from the runner | Add option to pick single test file from the runner
| Python | bsd-3-clause | menegon/OWSLib,QuLogic/OWSLib,jachym/OWSLib,kwilcox/OWSLib,robmcmullen/OWSLib,KeyproOy/OWSLib,geopython/OWSLib,jaygoldfinch/OWSLib,JuergenWeichand/OWSLib,geographika/OWSLib,daf/OWSLib,ocefpaf/OWSLib,daf/OWSLib,bird-house/OWSLib,tomkralidis/OWSLib,datagovuk/OWSLib,dblodgett-usgs/OWSLib,b-cube/OWSLib,gfusca/OWSLib,mbertr... | import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
Add option to pick single test file from the runner | import doctest
import getopt
import glob
import sys
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
def run(pattern):
if pattern is None:
testfiles = glob.glob('*.txt')
else:
testfiles = glob.glob(pattern)
fo... | <commit_before>import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
<commit_msg>Add option to pick single test file from the runner... | import doctest
import getopt
import glob
import sys
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
def run(pattern):
if pattern is None:
testfiles = glob.glob('*.txt')
else:
testfiles = glob.glob(pattern)
fo... | import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
Add option to pick single test file from the runnerimport doctest
import getop... | <commit_before>import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
<commit_msg>Add option to pick single test file from the runner... |
5d190f8d3b228820d1a537f0ed2b584b8c09fbae | tests/test_container.py | tests/test_container.py | # coding: utf8
from common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
| # coding: utf8
from .common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
| Fix relative import in tests. | Fix relative import in tests.
| Python | bsd-3-clause | mikeboers/PyAV,PyAV-Org/PyAV,PyAV-Org/PyAV,mikeboers/PyAV | # coding: utf8
from common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
Fix relative import in tests. | # coding: utf8
from .common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
| <commit_before># coding: utf8
from common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
<commit_msg>Fix relative import in tests.<commit_after> | # coding: utf8
from .common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
| # coding: utf8
from common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
Fix relative import in tests.# coding: utf8
from .common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
... | <commit_before># coding: utf8
from common import *
class TestContainers(TestCase):
def test_unicode_filename(self):
container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
<commit_msg>Fix relative import in tests.<commit_after># coding: utf8
from .common import *
class TestContainers(TestCase):
... |
5b8a39dc0fc5e383c30451a819c8e1542fd6f7ed | OpenSearchInNewTab.py | OpenSearchInNewTab.py | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | Remove unnecessary scratch file flag | Remove unnecessary scratch file flag
| Python | mit | everyonesdesign/OpenSearchInNewTab | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | <commit_before>import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activate... | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | <commit_before>import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activate... |
403a949a4b248076420d79ceb9d87983b1d26812 | django_errordite/handlers.py | django_errordite/handlers.py | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | Return payload even if request arg is not passed in. | Return payload even if request arg is not passed in.
| Python | bsd-2-clause | yunojuno/django-errordite | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | <commit_before>"""
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with req... | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | """
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with request info.
... | <commit_before>"""
Django-aware exception handler for integration with Errordite.
Adds django user and request information to the exception as appropriate.
"""
from errordite import ErrorditeHandler
class DjangoErrorditeHandler(ErrorditeHandler):
"""
Django-aware Errordite handler than enriches logs with req... |
0a96055a08b27d195920ad88141676b02937e029 | django_pytest/test_runner.py | django_pytest/test_runner.py | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels, extra_tests=None):
import pytest
import sys
... | Make run_tests a function to make it fully backwards compatible | Make run_tests a function to make it fully backwards compatible
| Python | bsd-3-clause | 0101/django-pytest,buchuki/django-pytest | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels, extra_tests=None):
import pytest
import sys
... | <commit_before>class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if ... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels, extra_tests=None):
import pytest
import sys
... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... | <commit_before>class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if ... |
61677883825eefcbdc2b1c943b1ce33b26def264 | PrinterApplication.py | PrinterApplication.py | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
window = MainWindow("Cura Printer")
window.Show()
super(Print... | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
... | Load all storage plugins in the printer application | Load all storage plugins in the printer application
| Python | agpl-3.0 | totalretribution/Cura,Curahelper/Cura,senttech/Cura,lo0ol/Ultimaker-Cura,markwal/Cura,fieldOfView/Cura,ynotstartups/Wanhao,ynotstartups/Wanhao,quillford/Cura,bq/Ultimaker-Cura,ad1217/Cura,derekhe/Cura,senttech/Cura,hmflash/Cura,Curahelper/Cura,lo0ol/Ultimaker-Cura,DeskboxBrazil/Cura,derekhe/Cura,DeskboxBrazil/Cura,tota... | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
window = MainWindow("Cura Printer")
window.Show()
super(Print... | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
... | <commit_before>from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
window = MainWindow("Cura Printer")
window.Show()
... | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
... | from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
window = MainWindow("Cura Printer")
window.Show()
super(Print... | <commit_before>from Cura.Wx.WxApplication import WxApplication
from Cura.Wx.MainWindow import MainWindow
class PrinterApplication(WxApplication):
def __init__(self):
super(PrinterApplication, self).__init__()
def run(self):
window = MainWindow("Cura Printer")
window.Show()
... |
e6ef3a1c609de227bff34a811910f08b3e5e69c9 | Lib/sandbox/pyem/__init__.py | Lib/sandbox/pyem/__init__.py | #! /usr/bin/env python
# Last Change: Sat Jun 09 10:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
#from online_em import OnGMM as _OnGMM
#import examples as _examples
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing i... | #! /usr/bin/env python
# Last Change: Sun Jul 22 11:00 AM 2007 J
raise ImportError(
"""pyem has been moved to scikits and renamed to em. Please install
scikits.learn instead, and change your import to the following:
from scickits.learn.machine import em.""")
from info import __doc__
from gauss_mix import GmParamErr... | Raise an import error when importing pyem as it has been moved to scikits. | Raise an import error when importing pyem as it has been moved to scikits.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@3179 d6536bca-fef9-0310-8506-e4c0a848fbcf
| Python | bsd-3-clause | scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt | #! /usr/bin/env python
# Last Change: Sat Jun 09 10:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
#from online_em import OnGMM as _OnGMM
#import examples as _examples
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing i... | #! /usr/bin/env python
# Last Change: Sun Jul 22 11:00 AM 2007 J
raise ImportError(
"""pyem has been moved to scikits and renamed to em. Please install
scikits.learn instead, and change your import to the following:
from scickits.learn.machine import em.""")
from info import __doc__
from gauss_mix import GmParamErr... | <commit_before>#! /usr/bin/env python
# Last Change: Sat Jun 09 10:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
#from online_em import OnGMM as _OnGMM
#import examples as _examples
__all__ = filter(lambda s:not s.startswith('_'), dir())
from ... | #! /usr/bin/env python
# Last Change: Sun Jul 22 11:00 AM 2007 J
raise ImportError(
"""pyem has been moved to scikits and renamed to em. Please install
scikits.learn instead, and change your import to the following:
from scickits.learn.machine import em.""")
from info import __doc__
from gauss_mix import GmParamErr... | #! /usr/bin/env python
# Last Change: Sat Jun 09 10:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
#from online_em import OnGMM as _OnGMM
#import examples as _examples
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing i... | <commit_before>#! /usr/bin/env python
# Last Change: Sat Jun 09 10:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
#from online_em import OnGMM as _OnGMM
#import examples as _examples
__all__ = filter(lambda s:not s.startswith('_'), dir())
from ... |
e7ee29f03dd83a795828de92aba654e9a7db3dd4 | deflect/views.py | deflect/views.py | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | Improve comment and logging text | Improve comment and logging text
| Python | bsd-3-clause | jbittel/django-deflect | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | <commit_before>from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import R... | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import RedirectURL
from... | <commit_before>from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import R... |
dd1c220606a1d7a40b9d3def1acbbfd03a865004 | docs/conf.py | docs/conf.py | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | Include links to source code with viewcode extension | Include links to source code with viewcode extension
| Python | mit | aimalz/qp | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | <commit_before>import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automo... | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502
a... | <commit_before>import sys
import os
import sphinx_rtd_theme
# Provide path to the python modules we want to run autodoc on
sys.path.insert(0, os.path.abspath('../qp'))
# Avoid imports that may be unsatisfied when running sphinx, see:
# http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automo... |
43ab1f2015b71ba5b63152dee524d0ccc1864302 | test/helpers/xnat_test_helper.py | test/helpers/xnat_test_helper.py | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | Move delete_subjects to a test helper. | Move delete_subjects to a test helper.
| Python | bsd-2-clause | ohsu-qin/qipipe | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | <commit_before>import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a s... | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a subject name tha... | <commit_before>import os, re
from base64 import b64encode as encode
from qipipe.staging import airc_collection as airc
from qipipe.staging.staging_helper import SUBJECT_FMT
from qipipe.helpers import xnat_helper
import logging
logger = logging.getLogger(__name__)
def generate_subject_name(name):
"""
Makes a s... |
78a40488ee1adabb77400708e7d091e94807c1b5 | PynamoDB/membership_stage.py | PynamoDB/membership_stage.py | from consistent_hash_ring import ConsistentHashRing
from error_code import ErrorCode
import util
def get_hash(value):
return hashlib.sha256(value).hexdigest()
class MembershipStage(object):
""" Stage for managing membership."""
@classmethod
def from_node_list(cls, file_name, **kwargs):
node_... | from consistent_hash_ring import ConsistentHashRing
import logging
import util
import collections
class MembershipStage(object):
""" Stage for managing ring membeship and failure detection."""
def __init__(self, server = None, node_addresses=[]):
self.logger = logging.getLogger('{}'.format(self.__cla... | Add skeleton methods for failures. | Add skeleton methods for failures.
Decided that MembershipStage should handle the announced/unannounced
failures since it’s in charge of detecting failures as well as the
consistent hash ring.
| Python | mit | samuelwu90/PynamoDB | from consistent_hash_ring import ConsistentHashRing
from error_code import ErrorCode
import util
def get_hash(value):
return hashlib.sha256(value).hexdigest()
class MembershipStage(object):
""" Stage for managing membership."""
@classmethod
def from_node_list(cls, file_name, **kwargs):
node_... | from consistent_hash_ring import ConsistentHashRing
import logging
import util
import collections
class MembershipStage(object):
""" Stage for managing ring membeship and failure detection."""
def __init__(self, server = None, node_addresses=[]):
self.logger = logging.getLogger('{}'.format(self.__cla... | <commit_before>from consistent_hash_ring import ConsistentHashRing
from error_code import ErrorCode
import util
def get_hash(value):
return hashlib.sha256(value).hexdigest()
class MembershipStage(object):
""" Stage for managing membership."""
@classmethod
def from_node_list(cls, file_name, **kwargs)... | from consistent_hash_ring import ConsistentHashRing
import logging
import util
import collections
class MembershipStage(object):
""" Stage for managing ring membeship and failure detection."""
def __init__(self, server = None, node_addresses=[]):
self.logger = logging.getLogger('{}'.format(self.__cla... | from consistent_hash_ring import ConsistentHashRing
from error_code import ErrorCode
import util
def get_hash(value):
return hashlib.sha256(value).hexdigest()
class MembershipStage(object):
""" Stage for managing membership."""
@classmethod
def from_node_list(cls, file_name, **kwargs):
node_... | <commit_before>from consistent_hash_ring import ConsistentHashRing
from error_code import ErrorCode
import util
def get_hash(value):
return hashlib.sha256(value).hexdigest()
class MembershipStage(object):
""" Stage for managing membership."""
@classmethod
def from_node_list(cls, file_name, **kwargs)... |
bfce7465713edbc4e596138c9ce24c67454d533c | pomito/plugins/__init__.py | pomito/plugins/__init__.py | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | Fix qtapp UI plugin key for CI machines where POMITO_TEST is set. | Fix qtapp UI plugin key for CI machines where POMITO_TEST is set.
| Python | mit | codito/pomito | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | <commit_before># -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
... | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | # -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
PLUGINS = {}
... | <commit_before># -*- coding: utf-8 -*-
# Pomito - Pomodoro timer on steroids
# Base package for plugins
__all__ = ['initialize', 'get_plugin']
# TODO Enable plugin discovery, support for drop-in plugins
# TODO Validate plugins
# TODO Some plugins may fail to import due to dependencies, gracefully handle them
... |
5b0dde337bbad6361e32fc99f12d51af534e6278 | ceilometer/api/config.py | ceilometer/api/config.py | # Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | # Server Specific Configurations
server = {
'port': '8777',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | Make debugging the wsme app a bit easier. | Make debugging the wsme app a bit easier.
- add a logger so we get exceptions
- setup the port to 8777 so 'pecan serve config.py' works normally
Change-Id: I7374a34ae5534d7d4127e4b405daa11cab5f5547
| Python | apache-2.0 | ityaptin/ceilometer,citrix-openstack-build/ceilometer,luogangyi/Ceilometer-oVirt,dreamhost/ceilometer,JioCloud/ceilometer,openstack/ceilometer,tanglei528/ceilometer,pkilambi/ceilometer,JioCloud/ceilometer,dreamhost/ceilometer,isyippee/ceilometer,openstack/aodh,maestro-hybrid-cloud/ceilometer,citrix-openstack-build/ceil... | # Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | # Server Specific Configurations
server = {
'port': '8777',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | <commit_before># Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/c... | # Server Specific Configurations
server = {
'port': '8777',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | # Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/ceilometer/api/t... | <commit_before># Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/c... |
7ad5619318fdac555a4350219f298adc702f6d6f | erpnext/domains/education.py | erpnext/domains/education.py | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'Guardian',
'restricted_roles': [
'Student',
'In... | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'LMS User',
'restricted_roles': [
'Student',
'In... | Set default role to LMS User for signup in Education | feat: Set default role to LMS User for signup in Education
| Python | agpl-3.0 | gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'Guardian',
'restricted_roles': [
'Student',
'In... | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'LMS User',
'restricted_roles': [
'Student',
'In... | <commit_before>from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'Guardian',
'restricted_roles': [
'... | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'LMS User',
'restricted_roles': [
'Student',
'In... | from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'Guardian',
'restricted_roles': [
'Student',
'In... | <commit_before>from __future__ import unicode_literals
data = {
'desktop_icons': [
'Student',
'Program',
'Course',
'Student Group',
'Instructor',
'Fees',
'Task',
'ToDo',
'Education',
'Student Attendance Tool',
'Student Applicant'
],
'default_portal_role': 'Guardian',
'restricted_roles': [
'... |
3ba8af66d0c6ebbdd4a3799b819a72292da2c6c5 | netmiko/citrix/netscaler_ssh.py | netmiko/citrix/netscaler_ssh.py | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | Make return character an attribute | Make return character an attribute
| Python | mit | ktbyers/netmiko,ktbyers/netmiko | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | <commit_before>import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
... | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor ... | <commit_before>import time
from netmiko.base_connection import BaseConnection
class NetscalerSSH(BaseConnection):
""" Netscaler SSH class. """
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
... |
efe3c6acb6b5336461adc18d993ad74a31205c06 | pre_push.py | pre_push.py | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | Exclude .tox/ from flake8 target | Exclude .tox/ from flake8 target
| Python | bsd-2-clause | 13steinj/praw,leviroth/praw,gschizas/praw,praw-dev/praw,gschizas/praw,13steinj/praw,praw-dev/praw,leviroth/praw | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | <commit_before>#!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on ... | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | #!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on non-zero exit a... | <commit_before>#!/usr/bin/env python
"""Run static analysis on the project."""
from shutil import rmtree
from subprocess import CalledProcessError, check_call
from tempfile import mkdtemp
import sys
def do_process(*args):
"""Run program provided by args.
Return True on success.
Output failed message on ... |
477a6334482b7cfad0a4b1edb1cf1528824e82e4 | tests/test_setuptools_command.py | tests/test_setuptools_command.py | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | Fix exception test to handle system exceptions | Fix exception test to handle system exceptions
| Python | mit | PyCQA/isort,PyCQA/isort | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | <commit_before>import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distrib... | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distribution())
co... | <commit_before>import os
from unittest.mock import MagicMock
import pytest
from isort import setuptools_commands
def test_isort_command_smoke(src_dir):
"""A basic smoke test for the setuptools_commands command"""
from distutils.dist import Distribution
command = setuptools_commands.ISortCommand(Distrib... |
62017dc7dc210d09e8f6753ad86365ac679f4a0a | oscar/apps/catalogue/categories.py | oscar/apps/catalogue/categories.py | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
try:
root = Category.objects.get(depth=1, name=bits[0])
exce... | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
name = bits[0]
try:
# Category names should be unique at the... | Rework category creation from breadcrumbs | Rework category creation from breadcrumbs
We now handle MultipleObjectsReturned exceptions, which are possible as
we are looking up based on non-unique filters.
| Python | bsd-3-clause | vovanbo/django-oscar,adamend/django-oscar,MatthewWilkes/django-oscar,manevant/django-oscar,django-oscar/django-oscar,WadeYuChen/django-oscar,elliotthill/django-oscar,sasha0/django-oscar,WillisXChen/django-oscar,jinnykoo/wuyisj,Jannes123/django-oscar,makielab/django-oscar,WadeYuChen/django-oscar,lijoantony/django-oscar,... | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
try:
root = Category.objects.get(depth=1, name=bits[0])
exce... | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
name = bits[0]
try:
# Category names should be unique at the... | <commit_before>from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
try:
root = Category.objects.get(depth=1, name=bits[0... | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
name = bits[0]
try:
# Category names should be unique at the... | from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
try:
root = Category.objects.get(depth=1, name=bits[0])
exce... | <commit_before>from django.db.models import get_model
Category = get_model('catalogue', 'category')
def create_from_sequence(bits):
"""
Create categories from an iterable
"""
if len(bits) == 1:
# Get or create root node
try:
root = Category.objects.get(depth=1, name=bits[0... |
00a7f018b80d7ddf9cad775ee39d90813879253b | migrations/194-questions-product-migration.py | migrations/194-questions-product-migration.py | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from kitsune.taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == ... | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == b, '%s !... | Fix wrong module name in migrations | Fix wrong module name in migrations
| Python | bsd-3-clause | MikkCZ/kitsune,dbbhattacharya/kitsune,MziRintu/kitsune,dbbhattacharya/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,turtleloveshoes/kitsune,feer56/Kitsune1,Osmose/kitsune,mythmon/kitsune,Osmose/kitsune,safwanrahman/kitsune,Osmose/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,Osmose/kitsune,NewPresident1/kitsune,feer56/Kitsune2... | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from kitsune.taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == ... | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == b, '%s !... | <commit_before>from django.utils.encoding import smart_str
from kitsune.products.models import Product
from kitsune.taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
... | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == b, '%s !... | from django.utils.encoding import smart_str
from kitsune.products.models import Product
from kitsune.taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
assert a == ... | <commit_before>from django.utils.encoding import smart_str
from kitsune.products.models import Product
from kitsune.taggit.models import Tag
from kitsune.questions.models import Question
tags_to_migrate = {
# source tag -> product
'desktop': ['firefox'],
'mobile': ['mobile']
}
def assert_equals(a, b):
... |
09102cb87c41330d1ae670f0e1cea00037c74b5b | src/librement/profile/models.py | src/librement/profile/models.py | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | Add model for storing multiple email addresses. | Add model for storing multiple email addresses.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
| Python | agpl-3.0 | rhertzog/librement,rhertzog/librement,rhertzog/librement | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | <commit_before>from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank... | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank=True)
add... | <commit_before>from django.db import models
from django_enumfield import EnumField
from librement.utils.user_data import PerUserData
from .enums import AccountEnum, CountryEnum
class Profile(PerUserData('profile')):
account_type = EnumField(AccountEnum)
organisation = models.CharField(max_length=100, blank... |
402d30d840e7e1d8885412cce7bee2897150a1cf | widelanguagedemo/public/views.py | widelanguagedemo/public/views.py | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | Fix an error when no samples were found. | Fix an error when no samples were found.
| Python | bsd-3-clause | larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | <commit_before># -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../st... | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | # -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../static")
@bluep... | <commit_before># -*- coding: utf-8 -*-
#
# views.py
# wide-language-index-demo
#
"""
Public facing frontpage.
"""
import json
import random
from flask import (Blueprint, request, render_template, redirect)
from . import forms
from ..index import util
blueprint = Blueprint('public', __name__, static_folder="../st... |
cbd6097cc070967963587441e6fdcf40f7c5293b | st2common/st2common/jinja/filters/data.py | st2common/st2common/jinja/filters/data.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Set default_flow_style for yaml jinja filter | Set default_flow_style for yaml jinja filter | Python | apache-2.0 | Plexxi/st2,nzlosh/st2,lakshmi-kannan/st2,StackStorm/st2,lakshmi-kannan/st2,tonybaloney/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,tonybaloney/st2,peak6/st2,tonybaloney/st2,StackStorm/st2,peak6/st2,nzlosh/st2,StackStorm/st2,peak6/st2,nzlosh/st2,lakshmi-kannan/st2,Plexxi/st2,Plexxi/st2 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you... |
042720760a71b5e372489af2335c2fccc5b4905b | ynr/apps/uk_results/views/api.py | ynr/apps/uk_results/views/api.py | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | Update filter args and fix name | Update filter args and fix name
The newer version of django-filter uses `field_name` rather than `name`
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | <commit_before>from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet)... | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet):
queryset ... | <commit_before>from rest_framework import viewsets
from django_filters import filters, filterset
from api.v09.views import ResultsSetPagination
from ..models import CandidateResult, ResultSet
from ..serializers import CandidateResultSerializer, ResultSetSerializer
class CandidateResultViewSet(viewsets.ModelViewSet)... |
853108e1c5cd9fca27d0f1dc8324b4b2a4d4b871 | pyqode/python/plugins/pyqode_python_plugin.py | pyqode/python/plugins/pyqode_python_plugin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | Fix bug with python plugin and pyside | Fix bug with python plugin and pyside
| Python | mit | pyQode/pyqode.python,mmolero/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this progra... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyQode - Python/Qt Code Editor widget
# Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this progra... |
e9605bd92e67c7f5daf7011f871c3a9d915abe76 | core/urls/base.py | core/urls/base.py | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | Make logout redirect to home | Make logout redirect to home
| Python | mit | joshsamara/game-website,joshsamara/game-website,joshsamara/game-website | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | <commit_before>from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
... | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
url(r'^$', Home... | <commit_before>from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from core.views import Home, register
# Use this file to import all other url
from game_website import settings
urlpatterns = patterns(
# Examples:
# url(r'^blog/', include('blog.urls')),
'',
... |
198181baa0b095d120b456e7191c0c49c98b3c03 | conans/client/generators/xcode.py | conans/client/generators/xcode.py | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | Fix copy and paste error | Fix copy and paste error
| Python | mit | conan-io/conan,conan-io/conan,luckielordie/conan,dragly/conan,lasote/conan,dragly/conan,tivek/conan,luckielordie/conan,memsharded/conan,conan-io/conan,memsharded/conan,birsoyo/conan,lasote/conan,memsharded/conan,mropert/conan,Xaltotun/conan,memsharded/conan,Xaltotun/conan,mropert/conan,birsoyo/conan,tivek/conan | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | <commit_before>from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINIT... | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINITIONS = $(inheri... | <commit_before>from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherited) {linker_flags} {libs}
GCC_PREPROCESSOR_DEFINIT... |
80bb5557f78268545139cd37f593278e35979fd5 | corehq/mobile_flags.py | corehq/mobile_flags.py | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
| from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
ADVANCED_SETTINGS_ACCESS = MobileFlag(
'advanced_settings_access',
'Enable access to advanced settings'
)
| Add Flag enum for settings access | Add Flag enum for settings access | Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
Add Flag enum for settings access | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
ADVANCED_SETTINGS_ACCESS = MobileFlag(
'advanced_settings_access',
'Enable access to advanced settings'
)
| <commit_before>from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
<commit_msg>Add Flag enum for settings access<commit_after> | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
ADVANCED_SETTINGS_ACCESS = MobileFlag(
'advanced_settings_access',
'Enable access to advanced settings'
)
| from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
Add Flag enum for settings accessfrom collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')... | <commit_before>from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
MULTIPLE_APPS_UNLIMITED = MobileFlag(
'multiple_apps_unlimited',
'Enable unlimited multiple apps'
)
<commit_msg>Add Flag enum for settings access<commit_after>from collections import namedtuple
MobileFlag... |
26e2feb6f2dfe74ade46cf871167101599c0acba | app/timetables/models.py | app/timetables/models.py | from __future__ import unicode_literals
from django.db import models
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
capitalized_field_names = ('name',)
... | from __future__ import unicode_literals
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the w... | Update clean method to ensure that meal end_time is not same as or less than meal start_time | Update clean method to ensure that meal end_time is not same as or less than meal start_time
| Python | mit | teamtaverna/core | from __future__ import unicode_literals
from django.db import models
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
capitalized_field_names = ('name',)
... | from __future__ import unicode_literals
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the w... | <commit_before>from __future__ import unicode_literals
from django.db import models
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
capitalized_field_name... | from __future__ import unicode_literals
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the w... | from __future__ import unicode_literals
from django.db import models
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
capitalized_field_names = ('name',)
... | <commit_before>from __future__ import unicode_literals
from django.db import models
from common.mixins import ForceCapitalizeMixin
class Weekday(ForceCapitalizeMixin, models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
capitalized_field_name... |
922c6350fda965068927611348bdd9127ee405d9 | scaffolder/commands/vcs.py | scaffolder/commands/vcs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | Remove __init__ method, not needed. | VcsCommand: Remove __init__ method, not needed.
| Python | mit | goliatone/minions | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-u",
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.vcs import VCS
class VcsCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
... |
7d6ecfe52f60ac07c57bbd6e966cded11ce40e4c | scripts/hydrafw-version.py | scripts/hydrafw-version.py | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | Fix python script dirty flag for firmware version | Fix python script dirty flag for firmware version
| Python | apache-2.0 | Baldanos/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,Baldanos/hydrafw,Baldanos/hydrafw | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | <commit_before>import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define... | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define HYDRAFW_GIT_TA... | <commit_before>import sys
from optparse import OptionParser
from datetime import *
from git import *
if __name__=="__main__":
usage = """
%prog outfile.txt"""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
if len(args)==1:
sys.stdout = open(args[0], 'w')
git=Repo().git
print '#define... |
7420d9208067f5144b301ff00d962b0b84e2a0f3 | tinymce/settings.py | tinymce/settings.py | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | Use STATIC_URL/STATIC_ROOT when using django.contrib.staticfiles (django 1.3) | Use STATIC_URL/STATIC_ROOT when using django.contrib.staticfiles (django 1.3)
| Python | mit | pterk/django-tinymce,pterk/django-tinymce | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | <commit_before>import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROW... | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROWSER = getattr(s... | <commit_before>import os
from django.conf import settings
DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',
{'theme': "simple", 'relative_urls': False})
USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)
USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False)
USE_FILEBROW... |
287609cc21ae7024507a662b2afe13520fdf8eb7 | tests/test_mysql.py | tests/test_mysql.py | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
class TestMySql(unittest.TestCase):
def setUp(self):
# This should run on pre-2.7 python so no skiptest
try:
import MySQLdb
self.mysql = MySql(logger)
except ImportError:
... | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
from tests.common import load_check
import time
class TestMySql(unittest.TestCase):
def testChecks(self):
agentConfig = { 'mysql_server': 'localhost',
'mysql_user': "datadog",
'mysql_pas... | Fix mysql check to use checks.d version | Fix mysql check to use checks.d version | Python | bsd-3-clause | eeroniemi/dd-agent,indeedops/dd-agent,relateiq/dd-agent,Shopify/dd-agent,remh/dd-agent,huhongbo/dd-agent,darron/dd-agent,jamesandariese/dd-agent,jraede/dd-agent,eeroniemi/dd-agent,urosgruber/dd-agent,jvassev/dd-agent,eeroniemi/dd-agent,polynomial/dd-agent,lookout/dd-agent,jvassev/dd-agent,Mashape/dd-agent,Shopify/dd-ag... | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
class TestMySql(unittest.TestCase):
def setUp(self):
# This should run on pre-2.7 python so no skiptest
try:
import MySQLdb
self.mysql = MySql(logger)
except ImportError:
... | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
from tests.common import load_check
import time
class TestMySql(unittest.TestCase):
def testChecks(self):
agentConfig = { 'mysql_server': 'localhost',
'mysql_user': "datadog",
'mysql_pas... | <commit_before>import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
class TestMySql(unittest.TestCase):
def setUp(self):
# This should run on pre-2.7 python so no skiptest
try:
import MySQLdb
self.mysql = MySql(logger)
excep... | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
from tests.common import load_check
import time
class TestMySql(unittest.TestCase):
def testChecks(self):
agentConfig = { 'mysql_server': 'localhost',
'mysql_user': "datadog",
'mysql_pas... | import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
class TestMySql(unittest.TestCase):
def setUp(self):
# This should run on pre-2.7 python so no skiptest
try:
import MySQLdb
self.mysql = MySql(logger)
except ImportError:
... | <commit_before>import unittest
import logging; logger = logging.getLogger()
from checks.db.mysql import MySql
class TestMySql(unittest.TestCase):
def setUp(self):
# This should run on pre-2.7 python so no skiptest
try:
import MySQLdb
self.mysql = MySql(logger)
excep... |
5b99fa7adf8ce65309f47d6456ecba32b02995a4 | tests/utils.py | tests/utils.py |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... | Use fresh build environment by default in tests | Use fresh build environment by default in tests
| Python | apache-2.0 | t4ngo/sphinxcontrib-traceables |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... | <commit_before>
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.p... |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... |
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_r... | <commit_before>
import os
import sphinx_tests_util
from xml.etree import ElementTree
from xml.dom import minidom
# =============================================================================
# Utility functions
def srcdir(name):
test_root = os.path.abspath(os.path.dirname(__file__))
return os.p... |
f54fd0bf65d731b4f25cfc2ddffb8d6f472e0d7c | examples/eiger_use_case.py | examples/eiger_use_case.py | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | Fix layout for Eiger example | Fix layout for Eiger example
| Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | <commit_before>'''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5p... | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | <commit_before>'''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5p... |
dd2c92bea635d7cfc93b437ce32266126bceb1e9 | qipipe/helpers/bolus_arrival.py | qipipe/helpers/bolus_arrival.py | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival series index. The bolus arrival is
the first series with a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D NiFT... | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival time point index. The bolus arrival
is the first occurence of a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D... | Change series to time point. | Change series to time point.
| Python | bsd-2-clause | ohsu-qin/qipipe | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival series index. The bolus arrival is
the first series with a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D NiFT... | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival time point index. The bolus arrival
is the first occurence of a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D... | <commit_before>class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival series index. The bolus arrival is
the first series with a difference in average signal larger than
double the difference from first two points.
:param time_seri... | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival time point index. The bolus arrival
is the first occurence of a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D... | class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival series index. The bolus arrival is
the first series with a difference in average signal larger than
double the difference from first two points.
:param time_series: the 4D NiFT... | <commit_before>class BolusArrivalError(Exception):
pass
def bolus_arrival_index(time_series):
"""
Determines the DCE bolus arrival series index. The bolus arrival is
the first series with a difference in average signal larger than
double the difference from first two points.
:param time_seri... |
ffd1ba9eee804fdd55e86908b158a4ad94f2f366 | Tools/idle/ZoomHeight.py | Tools/idle/ZoomHeight.py | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | Use only the height to decide whether to zoom in or out. | Use only the height to decide whether to zoom in or out.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | <commit_before># Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<z... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | <commit_before># Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<z... |
1d0570ca75419f441aa1324de78051534efba74b | search_engine.py | search_engine.py | import requests
from bs4 import BeautifulSoup
def download_url(url):
r = requests.get(url)
if r.status_code != 200:
raise Exception('Non-OK status code: {}'.format(r.status_code))
return r.text
def parse_text(html):
bs = BeautifulSoup(html, 'html.parser')
return bs.select('div.usertext-b... | import requests
from bs4 import BeautifulSoup
import os.path
from base64 import b16encode
import time
def download_reddit_url(url):
assert url.startswith('https://www.reddit.com/r/learnprogramming')
headers = {'User-Agent':'JustSearch bot version 0.1'}
r = requests.get(url, headers=headers)
if r.statu... | Create files with posts and can go to the next page. | Create files with posts and can go to the next page.
| Python | mit | tori-smile/JustSearch | import requests
from bs4 import BeautifulSoup
def download_url(url):
r = requests.get(url)
if r.status_code != 200:
raise Exception('Non-OK status code: {}'.format(r.status_code))
return r.text
def parse_text(html):
bs = BeautifulSoup(html, 'html.parser')
return bs.select('div.usertext-b... | import requests
from bs4 import BeautifulSoup
import os.path
from base64 import b16encode
import time
def download_reddit_url(url):
assert url.startswith('https://www.reddit.com/r/learnprogramming')
headers = {'User-Agent':'JustSearch bot version 0.1'}
r = requests.get(url, headers=headers)
if r.statu... | <commit_before>import requests
from bs4 import BeautifulSoup
def download_url(url):
r = requests.get(url)
if r.status_code != 200:
raise Exception('Non-OK status code: {}'.format(r.status_code))
return r.text
def parse_text(html):
bs = BeautifulSoup(html, 'html.parser')
return bs.select(... | import requests
from bs4 import BeautifulSoup
import os.path
from base64 import b16encode
import time
def download_reddit_url(url):
assert url.startswith('https://www.reddit.com/r/learnprogramming')
headers = {'User-Agent':'JustSearch bot version 0.1'}
r = requests.get(url, headers=headers)
if r.statu... | import requests
from bs4 import BeautifulSoup
def download_url(url):
r = requests.get(url)
if r.status_code != 200:
raise Exception('Non-OK status code: {}'.format(r.status_code))
return r.text
def parse_text(html):
bs = BeautifulSoup(html, 'html.parser')
return bs.select('div.usertext-b... | <commit_before>import requests
from bs4 import BeautifulSoup
def download_url(url):
r = requests.get(url)
if r.status_code != 200:
raise Exception('Non-OK status code: {}'.format(r.status_code))
return r.text
def parse_text(html):
bs = BeautifulSoup(html, 'html.parser')
return bs.select(... |
f4c1837eaadc9dfd2510e64d8dc7838ccc884379 | python/servo/packages.py | python/servo/packages.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.0",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.1",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | Update windows llvm to 8.0.1. | Update windows llvm to 8.0.1. | Python | mpl-2.0 | KiChjang/servo,KiChjang/servo,splav/servo,KiChjang/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,splav/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,splav/servo,splav/servo | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.0",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.1",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.0",
"moztools": "3.2",
"ninja": "1.7.1"... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.1",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.0",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.0",
"moztools": "3.2",
"ninja": "1.7.1"... |
73a96c3ddcf19df6534ae9dd57bcdca8d28ec615 | 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 | lubosz/django-registration,lubosz/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
... |
f2294b289b6eaa9c103f667dd3252429aac360e1 | tools/miranda/miranda_parser.py | tools/miranda/miranda_parser.py | import sys
# get hits from miranda scans
cap = ""
with open (sys.argv[1]) as infile1:
for line1 in infile1:
line1 = line1.strip()
if "%" in line1 and "Forward:" not in line1:
#print(line1)
cap = cap + line1 + "\n"
allregnettf = open(sys.argv[2], "w")
allregnettf.write(cap)
a... | import sys
# get hits from miranda scans
with open(sys.argv[1]) as infile1:
with open(sys.argv[2], "w") as outfile:
for line1 in infile1:
if "%" in line1 and "Forward:" not in line1:
outfile.write(line1)
| Write output on the file. | Write output on the file.
| Python | mit | anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/tgac-galaxytools,PerlaTroncosoRey/tgac-galaxytools,wjurkowski/earlham-galaxytools,TGAC/tgac-galaxytools,anilthanki/tgac-galaxytools,anilthanki/tgac-galaxytools... | import sys
# get hits from miranda scans
cap = ""
with open (sys.argv[1]) as infile1:
for line1 in infile1:
line1 = line1.strip()
if "%" in line1 and "Forward:" not in line1:
#print(line1)
cap = cap + line1 + "\n"
allregnettf = open(sys.argv[2], "w")
allregnettf.write(cap)
a... | import sys
# get hits from miranda scans
with open(sys.argv[1]) as infile1:
with open(sys.argv[2], "w") as outfile:
for line1 in infile1:
if "%" in line1 and "Forward:" not in line1:
outfile.write(line1)
| <commit_before>import sys
# get hits from miranda scans
cap = ""
with open (sys.argv[1]) as infile1:
for line1 in infile1:
line1 = line1.strip()
if "%" in line1 and "Forward:" not in line1:
#print(line1)
cap = cap + line1 + "\n"
allregnettf = open(sys.argv[2], "w")
allregnet... | import sys
# get hits from miranda scans
with open(sys.argv[1]) as infile1:
with open(sys.argv[2], "w") as outfile:
for line1 in infile1:
if "%" in line1 and "Forward:" not in line1:
outfile.write(line1)
| import sys
# get hits from miranda scans
cap = ""
with open (sys.argv[1]) as infile1:
for line1 in infile1:
line1 = line1.strip()
if "%" in line1 and "Forward:" not in line1:
#print(line1)
cap = cap + line1 + "\n"
allregnettf = open(sys.argv[2], "w")
allregnettf.write(cap)
a... | <commit_before>import sys
# get hits from miranda scans
cap = ""
with open (sys.argv[1]) as infile1:
for line1 in infile1:
line1 = line1.strip()
if "%" in line1 and "Forward:" not in line1:
#print(line1)
cap = cap + line1 + "\n"
allregnettf = open(sys.argv[2], "w")
allregnet... |
d70e563c3119e59de2ae23a77724e0fd803b768b | Python/tests.py | Python/tests.py | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | Remove trailing newlines from test cases | Remove trailing newlines from test cases
| Python | mit | moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCr... | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | <commit_before>import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('p... | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('password'), 'pas... | <commit_before>import unittest
from BKKCrypt import BKKCrypt
import urllib.request
class TestEncodeStrings(unittest.TestCase):
def test_simple_strings(self):
self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')
self.assertEqual(BKKCrypt('hunter2'), 'hunter2')
self.assertEqual(BKKCrypt('p... |
819b968a3bb73c1e8fed1a9c5440c8122a6dec9e | plugin/core/logging.py | plugin/core/logging.py | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | Replace binary argument with hardcoded text "server" | Replace binary argument with hardcoded text "server"
| Python | mit | tomv564/LSP | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | <commit_before>import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(... | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(traceback.forma... | <commit_before>import traceback
from .settings import settings, PLUGIN_NAME
def debug(*args):
"""Print args to the console if the "debug" setting is True."""
if settings.log_debug:
printf(*args)
def exception_log(message, ex):
print(message)
ex_traceback = ex.__traceback__
print(''.join(... |
45542f012b3dc6d089bc991529523a4ea6401b35 | br_rss/boilerroomtv/management/commands/scrape_all.py | br_rss/boilerroomtv/management/commands/scrape_all.py | from django.core.management.base import BaseCommand
from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
| from django.core.management.base import BaseCommand
from ...tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
| Use relative import in command. | Use relative import in command.
| Python | mpl-2.0 | jeffbr13/br-rss,jeffbr13/br-rss | from django.core.management.base import BaseCommand
from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
Use relative import in command... | from django.core.management.base import BaseCommand
from ...tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
| <commit_before>from django.core.management.base import BaseCommand
from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
<commit_msg>Use... | from django.core.management.base import BaseCommand
from ...tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
| from django.core.management.base import BaseCommand
from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
Use relative import in command... | <commit_before>from django.core.management.base import BaseCommand
from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels
class Command(BaseCommand):
def handle(self, *args, **options):
scrape_genres()
scrape_all_recordings()
scrape_channels()
<commit_msg>Use... |
d3f0d83b0c783d2f15a6f5eaf6fd4ace426307a6 | tests/__init__.py | tests/__init__.py | import os
import sys
import unittest
def suite():
MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')
MODULE_DIR = os.path.abspath(MODULE_DIR)
sys.path.insert(0, MODULE_DIR)
sys.path.insert(0, os.path.dirname(__file__))
SUB_UNITS = os.path.dirname(__file__)
SUB_UNITS = os.listdir(SUB_U... | from os import walk, chdir
from os.path import join, dirname, splitext, abspath, relpath
import sys
import unittest
MODULE_DIR = join(dirname(__file__), '..')
MODULE_DIR = abspath(MODULE_DIR)
def walker(opath='.'):
for path, folders, files in walk(opath):
for filename in files:
if filename.st... | Rework for tests in subdirectories | Rework for tests in subdirectories
| Python | mit | Mause/pytransperth,Mause/pytransperth | import os
import sys
import unittest
def suite():
MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')
MODULE_DIR = os.path.abspath(MODULE_DIR)
sys.path.insert(0, MODULE_DIR)
sys.path.insert(0, os.path.dirname(__file__))
SUB_UNITS = os.path.dirname(__file__)
SUB_UNITS = os.listdir(SUB_U... | from os import walk, chdir
from os.path import join, dirname, splitext, abspath, relpath
import sys
import unittest
MODULE_DIR = join(dirname(__file__), '..')
MODULE_DIR = abspath(MODULE_DIR)
def walker(opath='.'):
for path, folders, files in walk(opath):
for filename in files:
if filename.st... | <commit_before>import os
import sys
import unittest
def suite():
MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')
MODULE_DIR = os.path.abspath(MODULE_DIR)
sys.path.insert(0, MODULE_DIR)
sys.path.insert(0, os.path.dirname(__file__))
SUB_UNITS = os.path.dirname(__file__)
SUB_UNITS = o... | from os import walk, chdir
from os.path import join, dirname, splitext, abspath, relpath
import sys
import unittest
MODULE_DIR = join(dirname(__file__), '..')
MODULE_DIR = abspath(MODULE_DIR)
def walker(opath='.'):
for path, folders, files in walk(opath):
for filename in files:
if filename.st... | import os
import sys
import unittest
def suite():
MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')
MODULE_DIR = os.path.abspath(MODULE_DIR)
sys.path.insert(0, MODULE_DIR)
sys.path.insert(0, os.path.dirname(__file__))
SUB_UNITS = os.path.dirname(__file__)
SUB_UNITS = os.listdir(SUB_U... | <commit_before>import os
import sys
import unittest
def suite():
MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')
MODULE_DIR = os.path.abspath(MODULE_DIR)
sys.path.insert(0, MODULE_DIR)
sys.path.insert(0, os.path.dirname(__file__))
SUB_UNITS = os.path.dirname(__file__)
SUB_UNITS = o... |
db0ef5f31d82729f654d1d07fa39c1168aa5e5f7 | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | Disable printing of API parameters which could leak private info and were generally not useful | Disable printing of API parameters which could leak private info and were generally not useful
Change-Id: I8a8a8d10799df4f61e4465fe60b6c7efbefbd962
| Python | mit | npdoty/pywikibot,PersianWikipedia/pywikibot-core,trishnaguha/pywikibot-core,jayvdb/pywikibot-core,emijrp/pywikibot-core,wikimedia/pywikibot-core,xZise/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,magul/pywikibot-core,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,hasteur/g... | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | <commit_before># -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRe... | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRequest):
def... | <commit_before># -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import pywikibot.data.api
from pywikibot.data.api import Request as _original_Request
from pywikibot.data.api import CachedRequest
class TestRequest(CachedRe... |
96776b33fcf2ebbd2de4748c38d8be9c63fdec71 | tests/conftest.py | tests/conftest.py | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | Replace --noinput with interactive=False in syncdb command call | Replace --noinput with interactive=False in syncdb command call
| Python | bsd-2-clause | yprez/django-rest-assured,pombredanne/django-rest-assured,ydaniv/django-rest-assured | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | <commit_before>from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3'... | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | <commit_before>from django.conf import settings
from django.core.management import call_command
def pytest_configure():
settings.configure(
ROOT_URLCONF='tests.urls',
ALLOWED_HOSTS=['testserver'],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3'... |
40711cb50189c4c39ed5a60c16910646a00f9acc | docker/types/daemon.py | docker/types/daemon.py | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | Fix cancellable streams on Windows clients + HTTPS transport | Fix cancellable streams on Windows clients + HTTPS transport
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>
| Python | apache-2.0 | youhong316/docker-py,docker/docker-py,funkyfuture/docker-py,funkyfuture/docker-py,docker/docker-py,vdemeester/docker-py,youhong316/docker-py,vdemeester/docker-py | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | <commit_before>import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... pri... | <commit_before>import socket
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
class CancellableStream(object):
"""
Stream wrapper for real-time events, logs, etc. from the server.
Example:
>>> events = client.events()
>>> for event in events:
... |
07b7efdc848deeb7634f23cdb878774a99c9c535 | ambassador/tests/t_grpc_bridge.py | ambassador/tests/t_grpc_bridge.py | import json
from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
... | from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
kind: Module... | Clean up existing gRPC bridge test (make it like t_tcpmapping.py) | Clean up existing gRPC bridge test (make it like t_tcpmapping.py)
- Remove redundant HTTP status assertions
- Adjust formatting
- Remove unused import
| Python | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | import json
from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
... | from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
kind: Module... | <commit_before>import json
from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion:... | from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
kind: Module... | import json
from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion: ambassador/v0
... | <commit_before>import json
from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, EGRPC
class AcceptanceGrpcBridgeTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = EGRPC()
def config(self):
yield self, self.format("""
---
apiVersion:... |
032d1061454482db730e35a17fa058ba1ed5f66a | app/codeselfstudy/models/posts.py | app/codeselfstudy/models/posts.py | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | Add comment class to models | Add comment class to models
| Python | mit | CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | <commit_before>import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(requ... | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(required=True)
... | <commit_before>import datetime
import mongoengine as me
# Based on: https://flask-mongoengine.readthedocs.org/en/latest/
class Post(me.Document):
title = me.StringField(max_length=120, required=True)
created_at = me.DateTimeField(default=datetime.datetime.now, required=True)
content = me.StringField(requ... |
957422118d31def826d336f26152de1d0399fe4e | py/src/ai/h2o/sparkling/H2OConf.py | py/src/ai/h2o/sparkling/H2OConf.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument | [SW-1971][FollowUp] Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
| Python | apache-2.0 | h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | <commit_before>#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | <commit_before>#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... |
054f9ce0a8d08b0ec740d7b6d26a8b5553962490 | src/factories.py | src/factories.py | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | Fix faker calls since API changed. | Fix faker calls since API changed.
| Python | mit | makmanalp/flask-chassis | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | <commit_before>from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.cr... | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.create()
class ... | <commit_before>from chassis.models import db
from chassis import models
from faker import Factory as Fake
from factory.alchemy import SQLAlchemyModelFactory
import factory
import logging
#Suppress factory-boy debug data
factory_log = logging.getLogger("factory")
factory_log.setLevel(logging.WARNING)
faker = Fake.cr... |
daf68a1475530f4f0cb2e78e2ccf6ecbca821a8e | rfb_utils/prefs_utils.py | rfb_utils/prefs_utils.py | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
Args:
p... | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
# try looking for all variants of RFB_PREFS_NAME
for k, v in bpy.context.preferences.addons.items():
... | Add some fallback code when looking for our prefs object. | Add some fallback code when
looking for our prefs object.
| Python | mit | prman-pixar/RenderManForBlender,adminradio/RenderManForBlender,prman-pixar/RenderManForBlender | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
Args:
p... | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
# try looking for all variants of RFB_PREFS_NAME
for k, v in bpy.context.preferences.addons.items():
... | <commit_before>from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
... | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
# try looking for all variants of RFB_PREFS_NAME
for k, v in bpy.context.preferences.addons.items():
... | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
Args:
p... | <commit_before>from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
... |
753b2b6d04d0808e92dec0337d75a821d171e8e6 | sahara/tests/__init__.py | sahara/tests/__init__.py | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Apply monkeypatching from eventlet before the tests starts | Apply monkeypatching from eventlet before the tests starts
This should prevent issues with classes which may not have been
otherwise instrumented (and sahara_engine and sahara_all do the
instrumentation at the beginning anyway).
Issues have been notices with eventlet 0.20.1 which now instruments
subprocess.
Change-I... | Python | apache-2.0 | openstack/sahara,openstack/sahara | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | <commit_before># Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | <commit_before># Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
901bd73c61fbc6d9d8971ec1ce12e64100e633cb | base/settings/testing.py | base/settings/testing.py | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | Fix the Celery configuration under test settings. | Fix the Celery configuration under test settings.
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | <commit_before># -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | # -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME... | <commit_before># -*- coding: utf-8 -*-
import os
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# ------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
0b152333c30d061df64376bb036c5fcd20896c36 | go/billing/urls.py | go/billing/urls.py | from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
| from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^statement/(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
| Move statement PDF URL off the root of the billing URL namespace. | Move statement PDF URL off the root of the billing URL namespace.
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
Move statement PDF URL off the root of the billing URL namespace. | from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^statement/(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
| <commit_before>from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
<commit_msg>Move statement PDF URL off the root of the billing URL namespace.<commit_after> | from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^statement/(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
| from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
Move statement PDF URL off the root of the billing URL namespace.from django.conf.urls import patterns, url
from go... | <commit_before>from django.conf.urls import patterns, url
from go.billing import views
urlpatterns = patterns(
'',
url(
r'^(?P<statement_id>[\d]+)', views.statement_view,
name='pdf_statement')
)
<commit_msg>Move statement PDF URL off the root of the billing URL namespace.<commit_after>from djan... |
86ec56b0de1e822af2e03fedd2a67a3c555a7d18 | versebot/regex.py | versebot/regex.py | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | Fix return value from find_verses() | Fix return value from find_verses()
| Python | mit | Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | <commit_before>"""
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<... | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | """
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)... | <commit_before>"""
VerseBot for reddit
By Matthieu Grieger
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise. """
regex = (r"(?<=\[)(?P<... |
9bebf1c0cc9c0a03cde23fb1b92ae983f1fc3fa8 | examples/check_args.py | examples/check_args.py | from __future__ import print_function
@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
return int1 + int2
def main():
print(add_positive_integers(1, 5))
print(add_positive_integers(0, 5))
print(add_positive_integers(-1, 5))
if __nam... | from __future__ import print_function
from collections import defaultdict
def check_arg(arg_id, *constraints):
return ArgCheckAdder(arg_id, *constraints)
def check_int_value(min=None, max=None):
def constraint(arg_id, args, kwargs):
assert isinstance(args[arg_id], int)
assert args[arg_id] >=... | Make isolated arg check example | Make isolated arg check example
| Python | mit | explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc | from __future__ import print_function
@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
return int1 + int2
def main():
print(add_positive_integers(1, 5))
print(add_positive_integers(0, 5))
print(add_positive_integers(-1, 5))
if __nam... | from __future__ import print_function
from collections import defaultdict
def check_arg(arg_id, *constraints):
return ArgCheckAdder(arg_id, *constraints)
def check_int_value(min=None, max=None):
def constraint(arg_id, args, kwargs):
assert isinstance(args[arg_id], int)
assert args[arg_id] >=... | <commit_before>from __future__ import print_function
@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
return int1 + int2
def main():
print(add_positive_integers(1, 5))
print(add_positive_integers(0, 5))
print(add_positive_integers(-1,... | from __future__ import print_function
from collections import defaultdict
def check_arg(arg_id, *constraints):
return ArgCheckAdder(arg_id, *constraints)
def check_int_value(min=None, max=None):
def constraint(arg_id, args, kwargs):
assert isinstance(args[arg_id], int)
assert args[arg_id] >=... | from __future__ import print_function
@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
return int1 + int2
def main():
print(add_positive_integers(1, 5))
print(add_positive_integers(0, 5))
print(add_positive_integers(-1, 5))
if __nam... | <commit_before>from __future__ import print_function
@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
return int1 + int2
def main():
print(add_positive_integers(1, 5))
print(add_positive_integers(0, 5))
print(add_positive_integers(-1,... |
f58cce56103b98e783fa0df5bae0ae0985f7dc8e | rmake_plugins/multinode_client/nodetypes.py | rmake_plugins/multinode_client/nodetypes.py | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(**d)
class Cli... | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
_nodeTypes = {}
class _NodeTypeRegistrar(type):
def __init__(self, name, bases, dict):
type.__init__(self, name, bases, dict)
_nodeTypes[self.nodeType] = self
class NodeType(object):
__metaclass__ = _NodeType... | Use metaclasses to register node types. | Use metaclasses to register node types.
| Python | apache-2.0 | sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake,sassoftware/rmake,sassoftware/rmake3,sassoftware/rmake | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(**d)
class Cli... | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
_nodeTypes = {}
class _NodeTypeRegistrar(type):
def __init__(self, name, bases, dict):
type.__init__(self, name, bases, dict)
_nodeTypes[self.nodeType] = self
class NodeType(object):
__metaclass__ = _NodeType... | <commit_before>import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(... | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
_nodeTypes = {}
class _NodeTypeRegistrar(type):
def __init__(self, name, bases, dict):
type.__init__(self, name, bases, dict)
_nodeTypes[self.nodeType] = self
class NodeType(object):
__metaclass__ = _NodeType... | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(**d)
class Cli... | <commit_before>import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(... |
222a87ef324f66baf8113020b41d336c459ab847 | stdnum/fi/__init__.py | stdnum/fi/__init__.py | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | Add alias to hetu in for finnish personal id code | Add alias to hetu in for finnish personal id code
| Python | lgpl-2.1 | holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | <commit_before># __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 o... | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | # __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | <commit_before># __init__.py - collection of Finnish numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 o... |
563a905a48a5d4059463f25c5467a52a9d9c79c5 | groove/timezone.py | groove/timezone.py | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | Add function for creating a datetime aware object | Add function for creating a datetime aware object
| Python | bsd-2-clause | funkbit/django-groove | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | <commit_before>from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_cu... | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(... | <commit_before>from datetime import datetime, date
from django.utils import timezone
def datetime_midnight(year, month, day):
"""
Returns a timezone aware datetime object of a date at midnight, using the
current timezone.
"""
return timezone.make_aware(datetime(year, month, day), timezone.get_cu... |
b2de891e75dc84e809b9c35222e6bc8fe44c3d37 | test_arg.py | test_arg.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_truisms(self):
"""Test parameter class"""
param = arg.ARGparams()
self.assertTrue(isinsta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_param_class(self):
"""Test parameter class."""
param = arg.ARGparams()
self.assertIsInst... | Test functions a, b, c | Test functions a, b, c
| Python | mit | khrapovs/argamma | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_truisms(self):
"""Test parameter class"""
param = arg.ARGparams()
self.assertTrue(isinsta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_param_class(self):
"""Test parameter class."""
param = arg.ARGparams()
self.assertIsInst... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_truisms(self):
"""Test parameter class"""
param = arg.ARGparams()
self.ass... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_param_class(self):
"""Test parameter class."""
param = arg.ARGparams()
self.assertIsInst... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_truisms(self):
"""Test parameter class"""
param = arg.ARGparams()
self.assertTrue(isinsta... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import unittest as ut
import numpy as np
import ARG.arg as arg
class ARGTestCase(ut.TestCase):
def test_truisms(self):
"""Test parameter class"""
param = arg.ARGparams()
self.ass... |
369b0499d02531e7058f4f0d6c5051b9058701aa | metadata_to_json_and_fnamesmap.py | metadata_to_json_and_fnamesmap.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def main():
"""Illustra... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def strip(text):
try:
... | Read sheetname 'Cypern' and strip column names | Read sheetname 'Cypern' and strip column names
| Python | mit | mattiasostmar/SMVK-Cypern_2017-01 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def main():
"""Illustra... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def strip(text):
try:
... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def main():
... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def strip(text):
try:
... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def main():
"""Illustra... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Turn Excel metadata from SMVK into JSON-file for further processing.
Input: Excel-file
Processing: strip whitespace etc
Output: JSON-file `cypern_metadata.json" containg dict in the current directory
"""
import pandas as pd
import argparse
def main():
... |
592bbd24b0711be5c3e87133fc27429c83eabc01 | nipype/interfaces/spm/__init__.py | nipype/interfaces/spm/__init__.py | """Top-level namespace for spm."""
from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine,
scans_for_fname, scans_for_fnames)
from nipype.interfaces.spm.preprocess import (SliceTiming, Realign, Coregister,
Normalize, S... | Add spm imports at package level. Most tests pass now. | Add spm imports at package level. Most tests pass now.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00
| Python | bsd-3-clause | JohnGriffiths/nipype,carolFrohlich/nipype,blakedewey/nipype,christianbrodbeck/nipype,fprados/nipype,FCP-INDI/nipype,carlohamalainen/nipype,grlee77/nipype,dgellis90/nipype,sgiavasis/nipype,rameshvs/nipype,fprados/nipype,blakedewey/nipype,FredLoney/nipype,dgellis90/nipype,carlohamalainen/nipype,dmordom/nipype,sgiavasis/n... | Add spm imports at package level. Most tests pass now.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00 | """Top-level namespace for spm."""
from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine,
scans_for_fname, scans_for_fnames)
from nipype.interfaces.spm.preprocess import (SliceTiming, Realign, Coregister,
Normalize, S... | <commit_before><commit_msg>Add spm imports at package level. Most tests pass now.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00<commit_after> | """Top-level namespace for spm."""
from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine,
scans_for_fname, scans_for_fnames)
from nipype.interfaces.spm.preprocess import (SliceTiming, Realign, Coregister,
Normalize, S... | Add spm imports at package level. Most tests pass now.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00"""Top-level namespace for spm."""
from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine,
scans_for_fname, scans... | <commit_before><commit_msg>Add spm imports at package level. Most tests pass now.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00<commit_after>"""Top-level namespace for spm."""
from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine,
... | |
0c4bdc2d27fb289979004c7e0a0b9d0bf0a764cf | main.py | main.py | # -*- coding: utf-8 -*-
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world0')
uni.show()
reward = []
for i in range(n_trials):
np.random.seed(1234 + i)
uni.res... | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 14
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world1')
uni.show()
reward = []
for i in range(n_trials):
rewa... | Add trial cumulative reward plot | Add trial cumulative reward plot
| Python | mit | jakobj/python-tdl | # -*- coding: utf-8 -*-
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world0')
uni.show()
reward = []
for i in range(n_trials):
np.random.seed(1234 + i)
uni.res... | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 14
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world1')
uni.show()
reward = []
for i in range(n_trials):
rewa... | <commit_before># -*- coding: utf-8 -*-
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world0')
uni.show()
reward = []
for i in range(n_trials):
np.random.seed(1234 + ... | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 14
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world1')
uni.show()
reward = []
for i in range(n_trials):
rewa... | # -*- coding: utf-8 -*-
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world0')
uni.show()
reward = []
for i in range(n_trials):
np.random.seed(1234 + i)
uni.res... | <commit_before># -*- coding: utf-8 -*-
import numpy as np
import universe
seed = 91231
n_trials = 20
n_steps = 1000
steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.
uni = universe.Universe('grid_world', world='2d_world0')
uni.show()
reward = []
for i in range(n_trials):
np.random.seed(1234 + ... |
52c8b8d2676024ff07722115c815ecdd04dd000c | etrago/cluster/analyses/config.py | etrago/cluster/analyses/config.py | # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = '/home/openego/pf_results/' \
'snapshot-clustering-results-k10-cyclic-withpypsaweighting/'
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
| # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = path.join(path.expanduser('~'),'pf_results/' \
'snapshot-clustering-results-k10-cyclic/')
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
| Set path automatically to home of user | Set path automatically to home of user
| Python | agpl-3.0 | openego/eTraGo | # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = '/home/openego/pf_results/' \
'snapshot-clustering-results-k10-cyclic-withpypsaweighting/'
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
Set path automatically to home ... | # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = path.join(path.expanduser('~'),'pf_results/' \
'snapshot-clustering-results-k10-cyclic/')
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
| <commit_before># -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = '/home/openego/pf_results/' \
'snapshot-clustering-results-k10-cyclic-withpypsaweighting/'
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
<commit_msg>Set ... | # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = path.join(path.expanduser('~'),'pf_results/' \
'snapshot-clustering-results-k10-cyclic/')
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
| # -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = '/home/openego/pf_results/' \
'snapshot-clustering-results-k10-cyclic-withpypsaweighting/'
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
Set path automatically to home ... | <commit_before># -*- coding: utf-8 -*-
"""
"""
from os import path
root_path = '/home/openego/pf_results/' \
'snapshot-clustering-results-k10-cyclic-withpypsaweighting/'
clustered_path = path.join(root_path, 'daily')
original_path = path.join(root_path, 'original')
plot_path = root_path
<commit_msg>Set ... |
cf9ba0d497127d5261c8bee5eebe0e8f12aabf3a | armstrong/core/arm_wells/views.py | armstrong/core/arm_wells/views.py | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyConfigured(
"Expects `params` to b... | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
from django.utils.translation import ugettext as _
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyCon... | Make these exception messages translatable | Make these exception messages translatable
| Python | apache-2.0 | armstrong/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyConfigured(
"Expects `params` to b... | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
from django.utils.translation import ugettext as _
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyCon... | <commit_before>from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyConfigured(
"Expect... | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
from django.utils.translation import ugettext as _
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyCon... | from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyConfigured(
"Expects `params` to b... | <commit_before>from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView
class SimpleWellView(TemplateView):
def render_to_response(self, context, **response_kwargs):
if not 'params' in context:
raise ImproperlyConfigured(
"Expect... |
b7f07248834857e89f2f8312785a3a1f343c27c3 | quickstart/python/understand/example-2/create_joke_intent.6.x.py | quickstart/python/understand/example-2/create_joke_intent.6.x.py | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
assistant_sid = 'UAXXXXXXXXX... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new intent named ... | Update to use assistant SID inline | Update to use assistant SID inline
Maintaining consistency with the auto-generated code samples for Understand, which
don't allow for our variable-named placeholder values | Python | mit | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
assistant_sid = 'UAXXXXXXXXX... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new intent named ... | <commit_before># Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
assistant_sid... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new intent named ... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
assistant_sid = 'UAXXXXXXXXX... | <commit_before># Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
assistant_sid... |
2573178fe8051e29dab5bc4463f9ef39aa8c7657 | wordcloud/urls.py | wordcloud/urls.py | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | Remove an extraneous character from a URL's regular expression | Remove an extraneous character from a URL's regular expression
| Python | agpl-3.0 | geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary ... | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary redirects of ol... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from .views import wordcloud
urlpatterns = patterns(
'',
url(r'^wordcloud/$', wordcloud, name='wordcloud'),
url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'),
# Temporary ... |
7cf4578297667bc8b6405e99828818de87e3ba9a | extensions/ExtGameController.py | extensions/ExtGameController.py | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | Update extensions and GameController subclass | Update extensions and GameController subclass
| Python | apache-2.0 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digit... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digit... |
641a12d42bea5a78f8b1188ea758075fec6ef445 | irclogview/urls.py | irclogview/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'),
url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'),
url(r'^$', 'index', name='irclogview_index... | from django.conf.urls.defaults import patterns, url
from django.conf import settings
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)
urlpatterns += patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<mon... | Set /media/ as static folder | Set /media/ as static folder
| Python | agpl-3.0 | BlankOn/irclogview,fajran/irclogview,BlankOn/irclogview,fajran/irclogview | from django.conf.urls.defaults import *
urlpatterns = patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'),
url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'),
url(r'^$', 'index', name='irclogview_index... | from django.conf.urls.defaults import patterns, url
from django.conf import settings
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)
urlpatterns += patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<mon... | <commit_before>from django.conf.urls.defaults import *
urlpatterns = patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'),
url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'),
url(r'^$', 'index', name='i... | from django.conf.urls.defaults import patterns, url
from django.conf import settings
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)
urlpatterns += patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<mon... | from django.conf.urls.defaults import *
urlpatterns = patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'),
url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'),
url(r'^$', 'index', name='irclogview_index... | <commit_before>from django.conf.urls.defaults import *
urlpatterns = patterns('irclogview.views',
url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'),
url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'),
url(r'^$', 'index', name='i... |
b32614df983402081cad272f486fcffcd3a18fc1 | scripts/tests/data_util_test.py | scripts/tests/data_util_test.py | from data_util import DataManager
import sys
import data_util
import numpy as np
sys.path.append("../")
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/tr... | import sys
import numpy as np
sys.path.append("../")
import data_util
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/train", "../../data/test")
| Fix a bug on loding module | Fix a bug on loding module
| Python | apache-2.0 | Lucklyric/NLP-NER-CNN | from data_util import DataManager
import sys
import data_util
import numpy as np
sys.path.append("../")
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/tr... | import sys
import numpy as np
sys.path.append("../")
import data_util
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/train", "../../data/test")
| <commit_before>from data_util import DataManager
import sys
import data_util
import numpy as np
sys.path.append("../")
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk... | import sys
import numpy as np
sys.path.append("../")
import data_util
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/train", "../../data/test")
| from data_util import DataManager
import sys
import data_util
import numpy as np
sys.path.append("../")
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk("../../data/tr... | <commit_before>from data_util import DataManager
import sys
import data_util
import numpy as np
sys.path.append("../")
# DataInstance = DataManager("../../data/train", "../../data/test", 128)
# batch_input, batch_output, is_epoch_increase = DataInstance.get_batch()
# print (np.shape(batch_input))
data_util.save_to_disk... |
84254935bc78e86dadcde7ad3a09e8f1036c4051 | anytask/index/views.py | anytask/index/views.py | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | Delete blank line at end of file | Delete blank line at end of file
| Python | mit | znick/anytask,znick/anytask,znick/anytask,znick/anytask | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | <commit_before>from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Co... | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Course.objects.ex... | <commit_before>from django.shortcuts import render
from schools.models import School
def index(request):
schools = School.objects.all().filter(is_active=True).order_by('name')
# current_year = get_current_year()
# courses = Course.objects.filter(is_active=True).order_by('name')
# archive_courses = Co... |
1941cba46978fb7f8182ddb3eddf2d77002b28f7 | api/base/middleware.py | api/base/middleware.py | from framework.transactions import handlers
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_response(self, request, response):
return handlers.transaction_after_request(res... | from framework.transactions import handlers, commands
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_exception(self, request, exception):
commands.rollback()
def proc... | Make sure transaction is rolled back if an exception is raised | Make sure transaction is rolled back if an exception is raised
| Python | apache-2.0 | TomHeatwole/osf.io,asanfilippo7/osf.io,fabianvf/osf.io,chrisseto/osf.io,dplorimer/osf,monikagrabowska/osf.io,chrisseto/osf.io,TomBaxter/osf.io,doublebits/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,icereval/osf.io,jnayak1/osf.io,haoyuchen1992/osf.io,laurenrevere/osf.io,ckc6cz/osf.io,doublebits/osf.io,njantrania/osf.io... | from framework.transactions import handlers
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_response(self, request, response):
return handlers.transaction_after_request(res... | from framework.transactions import handlers, commands
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_exception(self, request, exception):
commands.rollback()
def proc... | <commit_before>from framework.transactions import handlers
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_response(self, request, response):
return handlers.transaction_af... | from framework.transactions import handlers, commands
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_exception(self, request, exception):
commands.rollback()
def proc... | from framework.transactions import handlers
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_response(self, request, response):
return handlers.transaction_after_request(res... | <commit_before>from framework.transactions import handlers
class TokuTransactionsMiddleware(object):
"""TokuMX transaction middleware."""
def process_request(self, request):
handlers.transaction_before_request()
def process_response(self, request, response):
return handlers.transaction_af... |
b1c9aaa6551902b285c96c94c269a787701bb020 | start_tornado.py | start_tornado.py | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 80
else:
default_port = 443
tornado.options.define("port", default=default_port, help="run on the... | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 443
else:
default_port = 80
tornado.options.define("port", default=default_port, help="run on the... | Correct the check of use HTTPS in Tornado file. | Correct the check of use HTTPS in Tornado file.
| Python | apache-2.0 | edmundo096/MoodMusic,edmundo096/MoodMusic,edmundo096/MoodMusic | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 80
else:
default_port = 443
tornado.options.define("port", default=default_port, help="run on the... | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 443
else:
default_port = 80
tornado.options.define("port", default=default_port, help="run on the... | <commit_before>from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 80
else:
default_port = 443
tornado.options.define("port", default=default_port, h... | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 443
else:
default_port = 80
tornado.options.define("port", default=default_port, help="run on the... | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 80
else:
default_port = 443
tornado.options.define("port", default=default_port, help="run on the... | <commit_before>from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import tornado.options
import server
import os
use_https = False
if use_https:
default_port = 80
else:
default_port = 443
tornado.options.define("port", default=default_port, h... |
4e7bcc26cb17af3879be62206231ab60d2b45fe5 | Code/clientPlayer.py | Code/clientPlayer.py | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | Fix bug when no parameter is passed | Fix bug when no parameter is passed
| Python | mit | jmigual/projecte2,jmigual/projecte2 | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | <commit_before>#!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, arg... | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | #!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, args = getopt.gnu_... | <commit_before>#!/usr/bin/env python3
import getopt
import sys
import player
from logger import *
def usage():
print("clientPlayer -t number [-v number]")
print("-t track number")
print("-v volume")
print("-d set debug mode")
def main():
logger = logging.getLogger()
try:
opts, arg... |
2394de5f46d264e2a585b6cd4b87e4a45c99cfeb | cast_convert/__init__.py | cast_convert/__init__.py | from . import *
from .convert import *
from .media_info import *
from .watch import *
| __version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| Add version and version command | Add version and version command
| Python | agpl-3.0 | thismachinechills/cast_convert | from . import *
from .convert import *
from .media_info import *
from .watch import *
Add version and version command | __version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| <commit_before>from . import *
from .convert import *
from .media_info import *
from .watch import *
<commit_msg>Add version and version command<commit_after> | __version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| from . import *
from .convert import *
from .media_info import *
from .watch import *
Add version and version command__version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
... | <commit_before>from . import *
from .convert import *
from .media_info import *
from .watch import *
<commit_msg>Add version and version command<commit_after>__version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(... |
073fc87b0641685bf228ca530927d793c919d40d | hoomd/filter/custom.py | hoomd/filter/custom.py | """Contains a class for custom particle filters in Python."""
from abc import ABCMeta, abstractmethod
class CustomFilter(metaclass=ABCMeta):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`hoomd.filter.ParticleFilter`.
"""
@ab... | """Contains a class for custom particle filters in Python."""
from abc import ABC, abstractmethod
from collections.abc import Hashable, Callable
class CustomFilter(Hashable, Callable):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`h... | Change the inherited classes of hoomd.filter.CustomFilter | Change the inherited classes of hoomd.filter.CustomFilter
CustomFilter inherits now from Hashable and Callable
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | """Contains a class for custom particle filters in Python."""
from abc import ABCMeta, abstractmethod
class CustomFilter(metaclass=ABCMeta):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`hoomd.filter.ParticleFilter`.
"""
@ab... | """Contains a class for custom particle filters in Python."""
from abc import ABC, abstractmethod
from collections.abc import Hashable, Callable
class CustomFilter(Hashable, Callable):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`h... | <commit_before>"""Contains a class for custom particle filters in Python."""
from abc import ABCMeta, abstractmethod
class CustomFilter(metaclass=ABCMeta):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`hoomd.filter.ParticleFilter`.
... | """Contains a class for custom particle filters in Python."""
from abc import ABC, abstractmethod
from collections.abc import Hashable, Callable
class CustomFilter(Hashable, Callable):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`h... | """Contains a class for custom particle filters in Python."""
from abc import ABCMeta, abstractmethod
class CustomFilter(metaclass=ABCMeta):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`hoomd.filter.ParticleFilter`.
"""
@ab... | <commit_before>"""Contains a class for custom particle filters in Python."""
from abc import ABCMeta, abstractmethod
class CustomFilter(metaclass=ABCMeta):
"""Abstract base class for custom particle filters.
The class allows the definition of particle filters in Python (see
`hoomd.filter.ParticleFilter`.
... |
27f409721a9f59b61d6fe01bad11733a7559bda0 | hotohete/production.py | hotohete/production.py | import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'localhost',
'127.0.0.1'
]
| import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'hotohetestaging.herokuapp.com',
'localhost',
'127.0.0.1'
]
| Add stating to allowed hosts | Add stating to allowed hosts
| Python | mit | wen96/hotohete,wen96/hotohete,wen96/hotohete,wen96/hotohete | import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'localhost',
'127.0.0.1'
]
Add stating to allowed hosts | import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'hotohetestaging.herokuapp.com',
'localhost',
'127.0.0.1'
]
| <commit_before>import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'localhost',
'127.0.0.1'
]
<commit_msg>Add stating to allowed hosts<commit_after> | import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'hotohetestaging.herokuapp.com',
'localhost',
'127.0.0.1'
]
| import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'localhost',
'127.0.0.1'
]
Add stating to allowed hostsimport dj_database_url
from hotohete.settings import *
... | <commit_before>import dj_database_url
from hotohete.settings import *
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
ALLOWED_HOSTS = [
'hotohete.herokuapp.com',
'localhost',
'127.0.0.1'
]
<commit_msg>Add stating to allowed hosts<commit_after>import dj_data... |
4723e5aaf60d7fcf823d5fa72b67ef3331daa049 | extruder/extrude_template.py | extruder/extrude_template.py | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
def main(args=None):
if args is None:
parser = ArgumentParser('Tool for generating skeleton package-'
'building directory.')
parser.add_argument('--appveyor-secret'... | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
import os
import shutil
from jinja2 import Environment, FileSystemLoader
def main(args=None):
"""
Copy all of the files needed from the source distribution to the current
directory.
"""
if args ... | Implement script for creating skeleton build setup | Implement script for creating skeleton build setup
| Python | bsd-3-clause | astropy/conda-build-tools,astropy/conda-build-tools | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
def main(args=None):
if args is None:
parser = ArgumentParser('Tool for generating skeleton package-'
'building directory.')
parser.add_argument('--appveyor-secret'... | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
import os
import shutil
from jinja2 import Environment, FileSystemLoader
def main(args=None):
"""
Copy all of the files needed from the source distribution to the current
directory.
"""
if args ... | <commit_before>from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
def main(args=None):
if args is None:
parser = ArgumentParser('Tool for generating skeleton package-'
'building directory.')
parser.add_argument('--a... | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
import os
import shutil
from jinja2 import Environment, FileSystemLoader
def main(args=None):
"""
Copy all of the files needed from the source distribution to the current
directory.
"""
if args ... | from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
def main(args=None):
if args is None:
parser = ArgumentParser('Tool for generating skeleton package-'
'building directory.')
parser.add_argument('--appveyor-secret'... | <commit_before>from __future__ import print_function, division, absolute_import
from argparse import ArgumentParser
def main(args=None):
if args is None:
parser = ArgumentParser('Tool for generating skeleton package-'
'building directory.')
parser.add_argument('--a... |
7a7856d9ec56de91325c7bf7c62ff25c0241badc | tests/test_connect.py | tests/test_connect.py | import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
| import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
def test_connect_with_statement():
with pypuppetdb.connect() as puppetdb:
assert puppetdb.version == 'v4'
| Add test for creating connection with 'with' statement. | Add test for creating connection with 'with' statement.
| Python | apache-2.0 | puppet-community/pypuppetdb,voxpupuli/pypuppetdb | import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
Add test for creating connection with 'with' statement. | import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
def test_connect_with_statement():
with pypuppetdb.connect() as puppetdb:
assert puppetdb.version == 'v4'
| <commit_before>import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
<commit_msg>Add test for creating connection with 'with' statement.<commit_after> | import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
def test_connect_with_statement():
with pypuppetdb.connect() as puppetdb:
assert puppetdb.version == 'v4'
| import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
Add test for creating connection with 'with' statement.import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
def test_connect_with_statement... | <commit_before>import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version == 'v4'
<commit_msg>Add test for creating connection with 'with' statement.<commit_after>import pypuppetdb
def test_connect_api():
puppetdb = pypuppetdb.connect()
assert puppetdb.version ... |
da1518d1e810ca227e84f110d4d42d1480040bc8 | tests/test_twitter.py | tests/test_twitter.py | # -*- coding: utf-8 -*-
import pytest
import tweepy
import vcr
from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
# Class level client to use a... | # -*- coding: utf-8 -*-
import pytest
import vcr
from inet.sources.twitter import api
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
@vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
def test_authd(self):
assert api.verify_credentials() is ... | Change tests to pull in twitter client from package | Change tests to pull in twitter client from package
| Python | mit | nestauk/inet | # -*- coding: utf-8 -*-
import pytest
import tweepy
import vcr
from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
# Class level client to use a... | # -*- coding: utf-8 -*-
import pytest
import vcr
from inet.sources.twitter import api
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
@vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
def test_authd(self):
assert api.verify_credentials() is ... | <commit_before># -*- coding: utf-8 -*-
import pytest
import tweepy
import vcr
from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
# Class level ... | # -*- coding: utf-8 -*-
import pytest
import vcr
from inet.sources.twitter import api
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
@vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml')
def test_authd(self):
assert api.verify_credentials() is ... | # -*- coding: utf-8 -*-
import pytest
import tweepy
import vcr
from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
# Class level client to use a... | <commit_before># -*- coding: utf-8 -*-
import pytest
import tweepy
import vcr
from secrets import TWITTER_ACCESS, TWITTER_SECRET
from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET
class TestTweepyIntegration():
"""Test class to ensure tweepy functionality works as expected"""
# Class level ... |
bfc0ce1298b9fe7a640dc31c6e5729d1c6360945 | langs/pystartup.py | langs/pystartup.py | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | Add json true/false/none in python repl | Add json true/false/none in python repl
https://mobile.twitter.com/mitsuhiko/status/1229385843585974272/photo/2
| Python | mit | keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | <commit_before># Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# ... | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | # Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# Note that PYTHO... | <commit_before># Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Set an environment variable to point to it: "export PYTHONSTARTUP=foo"
#
# ... |
2489ed6ff3d812888de4a0a2c45995389499d648 | thread_output_ctrl.py | thread_output_ctrl.py | import Queue
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
sel... | import threading
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
... | Use a lock-protected list instead of a Queue. | Use a lock-protected list instead of a Queue.
| Python | mit | shaurz/devo | import Queue
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
sel... | import threading
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
... | <commit_before>import Queue
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth... | import threading
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
... | import Queue
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth(8)
sel... | <commit_before>import Queue
import wx, wx.stc
from editor_fonts import init_stc_style
class ThreadOutputCtrl(wx.stc.StyledTextCtrl):
def __init__(self, parent, style=wx.TE_READONLY):
wx.stc.StyledTextCtrl.__init__(self, parent)
init_stc_style(self)
self.SetIndent(4)
self.SetTabWidth... |
3a11712925ca1038a1c8c8c8eef29ca4d5fd1c6f | test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py | test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | Fix expected error message in test. | Fix expected error message in test.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@168220 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | <commit_before>"""Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@... | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | """Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@python_api_test... | <commit_before>"""Check that we handle an ImportError in a special way when command script importing files."""
import os, sys, time
import unittest2
import lldb
from lldbtest import *
class Rdar12586188TestCase(TestBase):
mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188")
@... |
a877a578f0e71f9d667b5845c96b913ea51fa195 | masquerade/urls.py | masquerade/urls.py | try:
from django.conf.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
| try:
from django.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
| Fix a bad import path | Fix a bad import path
| Python | apache-2.0 | erikcw/django-masquerade,erikcw/django-masquerade,erikcw/django-masquerade | try:
from django.conf.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
Fix a bad import path | try:
from django.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
| <commit_before>try:
from django.conf.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
<commit_msg>Fix a bad im... | try:
from django.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
| try:
from django.conf.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
Fix a bad import pathtry:
from djan... | <commit_before>try:
from django.conf.urls import url
except ImportError:
from django.core.urlresolvers import reverse
from masquerade.views import mask, unmask
urlpatterns = [
url(r'^mask/$', mask, name='masquerade-mask'),
url(r'^unmask/$', unmask, name='masquerade-unmask'),
]
<commit_msg>Fix a bad im... |
336313ac982b9de278aca6e0f74f6820ef5b2526 | landlab/grid/structured_quad/tests/test_links.py | landlab/grid/structured_quad/tests/test_links.py | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CLO... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_equal
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CL... | Test of index arrays of type int. | Test of index arrays of type int.
| Python | mit | ManuSchmi88/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,laijingtao/landlab,RondaStrauch/landlab,Carralex/landlab,Carralex/landlab,ManuSchmi88/landlab,cmshobe/landlab,Carralex/landlab,landlab/landlab,csherwood-usgs/landlab,ManuSchmi88/... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CLO... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_equal
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CL... | <commit_before>import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALU... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_equal
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CL... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CLO... | <commit_before>import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALU... |
4036ef2ac8435070d8850e1dab4187890bccd7c5 | mayavi/__init__.py | mayavi/__init__.py | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'traits',
'trait... | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.3'
__requires__ = [
'apptools',
'traits',
'traitsui',... | Revert "Bump up dev version to 4.4.4.dev0" | Revert "Bump up dev version to 4.4.4.dev0"
This reverts commit c65f7d3b9305fad3037f3086256927b2e1c1f43e.
| Python | bsd-3-clause | dmsurti/mayavi,dmsurti/mayavi | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'traits',
'trait... | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.3'
__requires__ = [
'apptools',
'traits',
'traitsui',... | <commit_before># Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'trai... | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.3'
__requires__ = [
'apptools',
'traits',
'traitsui',... | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'traits',
'trait... | <commit_before># Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'trai... |
2be4b1b67ca17a400c6d22e8e29e0a4f1c69c0cc | dakota_utils/models/hydrotrend.py | dakota_utils/models/hydrotrend.py | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
import numpy as np
def load_series(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
series = np.loadtxt(outp... | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
from subprocess import call
import numpy as np
def load(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
ser... | Add call() function, rename load() function | Add call() function, rename load() function
Slowly encapsulating the run_hydrotrend.py script used in
the Dakota experiments.
| Python | mit | mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
import numpy as np
def load_series(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
series = np.loadtxt(outp... | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
from subprocess import call
import numpy as np
def load(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
ser... | <commit_before>#! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
import numpy as np
def load_series(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
series = ... | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
from subprocess import call
import numpy as np
def load(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
ser... | #! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
import numpy as np
def load_series(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
series = np.loadtxt(outp... | <commit_before>#! /usr/bin/env python
#
# A module for working with HydroTrend.
#
# Mark Piper (mark.piper@colorado.edu)
import numpy as np
def load_series(output_file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array,
or None on an error.
'''
try:
series = ... |
c231987c532885fa7bc5e8d2afc8b7a30a2ce297 | bayesian_methods_for_hackers/simulate_messages_ch02.py | bayesian_methods_for_hackers/simulate_messages_ch02.py | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'
matplotlib.rcParams.update(json.load(open(matplotlibrc_path)))
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha ... | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha = 1. / 20.
lambda_1, lambda_2 = pm.rexponential(alpha, 2)
print lambda_1, lambda_2
data = np.r_[pm.rpoisson(lambda_1, tau), pm... | Change of repo name. Update effected paths | Change of repo name. Update effected paths
| Python | mit | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'
matplotlib.rcParams.update(json.load(open(matplotlibrc_path)))
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha ... | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha = 1. / 20.
lambda_1, lambda_2 = pm.rexponential(alpha, 2)
print lambda_1, lambda_2
data = np.r_[pm.rpoisson(lambda_1, tau), pm... | <commit_before>import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'
matplotlib.rcParams.update(json.load(open(matplotlibrc_path)))
tau = pm.rdiscrete_uniform(0, 80)
print ... | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha = 1. / 20.
lambda_1, lambda_2 = pm.rexponential(alpha, 2)
print lambda_1, lambda_2
data = np.r_[pm.rpoisson(lambda_1, tau), pm... | import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'
matplotlib.rcParams.update(json.load(open(matplotlibrc_path)))
tau = pm.rdiscrete_uniform(0, 80)
print tau
alpha ... | <commit_before>import json
import matplotlib
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
def main():
matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'
matplotlib.rcParams.update(json.load(open(matplotlibrc_path)))
tau = pm.rdiscrete_uniform(0, 80)
print ... |
7310fdd86cebd1c8b28d960f0211e350fbf07a62 | handlers/login.py | handlers/login.py | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | Clear reset key on user activity | Clear reset key on user activity
| Python | mit | mrozekma/Sprint,mrozekma/Sprint,mrozekma/Sprint | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | <commit_before>from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are alr... | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are already logged in ... | <commit_before>from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
print WarningBox('Logged In', 'You are alr... |
018eab65881a2279efca88e1448dba0708a4dfe1 | django_excel_to_model/management/commands/model_create_utils/django_tables2_utils.py | django_excel_to_model/management/commands/model_create_utils/django_tables2_utils.py | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | Remove sort function by default for table generated from dict. | Remove sort function by default for table generated from dict.
| Python | bsd-3-clause | weijia/django-excel-to-model,weijia/django-excel-to-model | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | <commit_before>from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table tab... | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table table-striped tabl... | <commit_before>from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator
import django_tables2 as tables
def get_django_tables2_from_dict(data_dict):
c = ClassAttributeCreator()
table_meta_class = type("Meta", (), {
"attrs": {'class': 'table tab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.