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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1160a10a3d78eee3be61d760849e70e645272355 | analytical/__init__.py | analytical/__init__.py | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | Add 'and others' to copyright | Add 'and others' to copyright
| Python | mit | jcassee/django-analytical,ericdwang/django-analytical,machtfit/django-analytical,apocquet/django-analytical,bittner/django-analytical,ChristosChristofidis/django-analytical,pjdelport/django-analytical | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | <commit_before>"""
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__em... | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | <commit_before>"""
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__em... |
576dc66d2826759e05d55d5ffbef446825a62481 | designatedashboard/__init__.py | designatedashboard/__init__.py | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | Fix package name in init.py | Fix package name in init.py
Change-Id: Ib20efd224de709d493d98cfd9ab5dad6005779de
| Python | apache-2.0 | openstack/designate-dashboard,openstack/designate-dashboard,openstack/designate-dashboard | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# 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... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# 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... |
b2a977a7285cbe832350492b967213b5261ad6b4 | flask_app/tasks.py | flask_app/tasks.py | from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localhost')
queue.con... | from __future__ import absolute_import
import functools
import os
import sys
import logging
import logging.handlers
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from celery.log import redirect_stdouts_to_logger
from .app import create_app
_logger =... | Fix celery logging in deployment | Fix celery logging in deployment
| Python | mit | getslash/mailboxer,getslash/mailboxer,getslash/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,Infinidat/lanister,Infinidat/lanister | from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localhost')
queue.con... | from __future__ import absolute_import
import functools
import os
import sys
import logging
import logging.handlers
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from celery.log import redirect_stdouts_to_logger
from .app import create_app
_logger =... | <commit_before>from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localh... | from __future__ import absolute_import
import functools
import os
import sys
import logging
import logging.handlers
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from celery.log import redirect_stdouts_to_logger
from .app import create_app
_logger =... | from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localhost')
queue.con... | <commit_before>from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localh... |
16256c57de5b12b2a1ef148d2ba15db2dfce7407 | foundry/settings_dev.py | foundry/settings_dev.py | from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
| from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
#FOUNDRY['layers'] = ('smart', 'basic',)
FOUNDRY['layers'] = ('web', 'basic',)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
| Disable caching in development mode | Disable caching in development mode
| Python | bsd-3-clause | praekelt/jmbo-foundry,praekelt/jmbo-foundry,praekelt/jmbo-foundry | from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
Disable caching in development mode | from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
#FOUNDRY['layers'] = ('smart', 'basic',)
FOUNDRY['layers'] = ('web', 'basic',)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
| <commit_before>from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
<commit_msg>Disable caching in development mode<commit_after> | from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
#FOUNDRY['layers'] = ('smart', 'basic',)
FOUNDRY['layers'] = ('web', 'basic',)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
| from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
Disable caching in development modefrom foundry.settings import *
#FOUNDRY['layers']... | <commit_before>from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
<commit_msg>Disable caching in development mode<commit_after>from foun... |
796f9ff27f579557237c48196eb50d40269c6840 | glitch/__main__.py | glitch/__main__.py | from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log", help="Logging... | from . import config
from . import apikeys
import argparse
# Hack: Allow "python -m glitch database" to be the same as "glitch.database"
import sys
if len(sys.argv) > 1 and sys.argv[1] == "database":
from . import database
import clize
sys.exit(clize.run(*database.commands, args=sys.argv[1:]))
import logging
parse... | Allow 'python -m glitch database' as well as with a dot | Allow 'python -m glitch database' as well as with a dot
| Python | artistic-2.0 | MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log", help="Logging... | from . import config
from . import apikeys
import argparse
# Hack: Allow "python -m glitch database" to be the same as "glitch.database"
import sys
if len(sys.argv) > 1 and sys.argv[1] == "database":
from . import database
import clize
sys.exit(clize.run(*database.commands, args=sys.argv[1:]))
import logging
parse... | <commit_before>from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log"... | from . import config
from . import apikeys
import argparse
# Hack: Allow "python -m glitch database" to be the same as "glitch.database"
import sys
if len(sys.argv) > 1 and sys.argv[1] == "database":
from . import database
import clize
sys.exit(clize.run(*database.commands, args=sys.argv[1:]))
import logging
parse... | from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log", help="Logging... | <commit_before>from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log"... |
452b48b9313af8126052a32230e789dff2c69df7 | frontui/data.py | frontui/data.py | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | Fix non ascii symbols in json | Fix non ascii symbols in json
| Python | mit | nixxa/SecretShopper,nixxa/SecretShopper,nixxa/SecretShopper | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | <commit_before>""" Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/... | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | <commit_before>""" Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/... |
0d572d60522ae0e80105330981a66bc541434b99 | rip/filter_operators.py | rip/filter_operators.py |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else None
if filte... |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
IN = 'in'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1, IN: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else N... | Support __in as operator for backwards comp | Support __in as operator for backwards comp
| Python | mit | Aplopio/rip,Aplopio/django_rip |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else None
if filte... |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
IN = 'in'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1, IN: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else N... | <commit_before>
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else Non... |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
IN = 'in'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1, IN: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else N... |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else None
if filte... | <commit_before>
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else Non... |
dc6819f67a5f348d260c36c496bc9d116a875ef7 | backend/backend/serializers.py | backend/backend/serializers.py | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | Change sanitizer to normal model sanitizer, so it sends ids of parents. | Change sanitizer to normal model sanitizer, so it sends ids of parents.
| Python | apache-2.0 | mmlado/animal_pairing,mmlado/animal_pairing | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')Change sanitizer to normal model sanitizer, so it sends ids of pa... | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | <commit_before>from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')<commit_msg>Change sanitizer to normal model sanit... | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')Change sanitizer to normal model sanitizer, so it sends ids of pa... | <commit_before>from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother')<commit_msg>Change sanitizer to normal model sanit... |
988cac30eeb3ca9ee25378581371e5ea61faec3e | paypal/exceptions.py | paypal/exceptions.py | from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
| try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
pass
class PayPalError(PaymentError):
pass | Make gateway importable without django-oscar installed. | Make gateway importable without django-oscar installed.
| Python | bsd-3-clause | vintasoftware/django-oscar-paypal,ZachGoldberg/django-oscar-paypal,bharling/django-oscar-worldpay,britco/django-oscar-paypal,st8st8/django-oscar-paypal,evonove/django-oscar-paypal,embedded1/django-oscar-paypal,bharling/django-oscar-worldpay,FedeDR/django-oscar-paypal,django-oscar/django-oscar-paypal,django-oscar/django... | from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
Make gateway importable without django-oscar installed. | try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
pass
class PayPalError(PaymentError):
pass | <commit_before>from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
<commit_msg>Make gateway importable without django-oscar installed.<commit_after> | try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
pass
class PayPalError(PaymentError):
pass | from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
Make gateway importable without django-oscar installed.try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
pass
class PayPalError(PaymentError):
... | <commit_before>from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
<commit_msg>Make gateway importable without django-oscar installed.<commit_after>try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
... |
8fa0c30cce8d47344ea66a26d4d627fe12c46ee9 | pombola/settings/south_africa.py | pombola/settings/south_africa.py | import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSES += ( 'pombola... | import re
from .base import *
from .south_africa_base import *
HAYSTACK_CONNECTIONS['default']['EXCLUDED_INDEXES'] = ['pombola.search.search_indexes.PlaceIndex']
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_... | Add PlaceIndex to the Haystack EXCLUDED_INDEXES | ZA: Add PlaceIndex to the Haystack EXCLUDED_INDEXES
This was a mistake in the earlier rearrangement of the settings
modules; PlaceIndex needed to be added to Haystack EXCLUDED_INDEXES
in the south_africa module as well as tests_south_africa.
| Python | agpl-3.0 | hzj123/56th,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,mysociety/pombola,ken-muturi/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,hzj123/56th,hzj123/56th,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,mysociety/pombola,ken-muturi/pombola,hzj123/56th,geo... | import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSES += ( 'pombola... | import re
from .base import *
from .south_africa_base import *
HAYSTACK_CONNECTIONS['default']['EXCLUDED_INDEXES'] = ['pombola.search.search_indexes.PlaceIndex']
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_... | <commit_before>import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSE... | import re
from .base import *
from .south_africa_base import *
HAYSTACK_CONNECTIONS['default']['EXCLUDED_INDEXES'] = ['pombola.search.search_indexes.PlaceIndex']
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_... | import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSES += ( 'pombola... | <commit_before>import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSE... |
cbacb4148eba442a5d2b178721bf5805d31fdf8d | disposable_email_checker/__init__.py | disposable_email_checker/__init__.py | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(l,n):
retu... | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(self,l,n):
... | Fix bug in chunk arguments | Fix bug in chunk arguments
| Python | bsd-3-clause | aaronbassett/DisposableEmailChecker | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(l,n):
retu... | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(self,l,n):
... | <commit_before>from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(l,n... | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(self,l,n):
... | from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(l,n):
retu... | <commit_before>from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(l,n... |
8a28dee1bc3ca8ec83705cc431768ef18be7798c | segments/virtual_env.py | segments/virtual_env.py | import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV') or os.getenv('CONDA_ENV_PATH')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| Allow venv segment to be from Anaconda | Allow venv segment to be from Anaconda
| Python | mit | banga/powerline-shell,tswsl1989/powerline-shell,paulhybryant/powerline-shell,b-ryan/powerline-shell,rbanffy/powerline-shell,b-ryan/powerline-shell,Menci/powerline-shell,iKrishneel/powerline-shell,milkbikis/powerline-shell,paulhybryant/powerline-shell,torbjornvatn/powerline-shell,banga/powerline-shell,bitIO/powerline-sh... | import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
Allow venv segment to be from Anaco... | import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV') or os.getenv('CONDA_ENV_PATH')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| <commit_before>import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
<commit_msg>Allow ve... | import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV') or os.getenv('CONDA_ENV_PATH')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
Allow venv segment to be from Anaco... | <commit_before>import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
<commit_msg>Allow ve... |
4262e9fa6b67d56c33202ce05d6a1128338ebf7f | zipline/gens/brokers/__init__.py | zipline/gens/brokers/__init__.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | Fix ib_broker import from brokers | Fix ib_broker import from brokers
| Python | apache-2.0 | Scapogo/zipline,florentchandelier/zipline,florentchandelier/zipline,Scapogo/zipline | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | <commit_before>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | <commit_before>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... |
6b762607914e1c79bc05f7e8d5cdbe6c6d7a49e4 | hiro/patches.py | hiro/patches.py | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | Fix issue with daylight saving time + utcnow | Fix issue with daylight saving time + utcnow
Fixes issue #2
| Python | mit | alisaifee/hiro,alisaifee/hiro | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | <commit_before>"""
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
... | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | <commit_before>"""
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
... |
3d91950735d8b42e030f6f479a32369804e90ac0 | gaphas/picklers.py | gaphas/picklers.py | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
return cairo.Matrix(*args)
def reduce_cairo_matrix(m):... | Remove ununsed pickle code for instance methods | Remove ununsed pickle code for instance methods
| Python | lgpl-2.1 | amolenaar/gaphas | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
return cairo.Matrix(*args)
def reduce_cairo_matrix(m):... | <commit_before>"""
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
return cairo.Matrix(*args)
def reduce_cairo_matrix(m):... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... | <commit_before>"""
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz... |
aa6d6e59be8c0b8577517bd16de3e75de7f0e570 | project_name/urls.py | project_name/urls.py | """{{project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.views.generic import TemplateView
from django.conf.urls.static import static
from django.views import defaults as default_views
urlpatterns = [
url(settings.ADMIN_URL, in... | Improve url patterns structure, enable debugging common error pages while debugging | Improve url patterns structure, enable debugging common error pages while debugging
| Python | mit | Nikola-K/django-template,Nikola-K/django-template | """{{project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.views.generic import TemplateView
from django.conf.urls.static import static
from django.views import defaults as default_views
urlpatterns = [
url(settings.ADMIN_URL, in... | <commit_before>"""{{project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.views.generic import TemplateView
from django.conf.urls.static import static
from django.views import defaults as default_views
urlpatterns = [
url(settings.ADMIN_URL, in... | """{{project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | <commit_before>"""{{project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... |
a4a139e4476fefe431e6561bd0ef950cb74c0db4 | htpt/buffers.py | htpt/buffers.py | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's n... | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's not enough space
if l... | Change indentation to 2 spaces | Change indentation to 2 spaces
| Python | mit | gsathya/htpt,gsathya/htpt | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's n... | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's not enough space
if l... | <commit_before>from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the ... | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's not enough space
if l... | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's n... | <commit_before>from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the ... |
ee7a49fa7094160f27993adb25fb2d98db518cb9 | pinax/wiki/urls.py | pinax/wiki/urls.py | import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pin... | import os
from django.conf.urls import url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = [
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pinax_wiki_file_upload")
]
f... | Fix for patterns() being deprecated and now removed in Django 1.10 | Fix for patterns() being deprecated and now removed in Django 1.10 | Python | mit | pinax/pinax-wiki | import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pin... | import os
from django.conf.urls import url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = [
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pinax_wiki_file_upload")
]
f... | <commit_before>import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_up... | import os
from django.conf.urls import url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = [
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pinax_wiki_file_upload")
]
f... | import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pin... | <commit_before>import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_up... |
c9534dfb1b2aaa8cb4aaee3a3471ac39d956e5b7 | plugins/spotify.py | plugins/spotify.py | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | Remove URL from Spotify response | Remove URL from Spotify response
| Python | mit | molly/GorillaBot,molly/GorillaBot,quanticle/GorillaBot,quanticle/GorillaBot | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | <commit_before>from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIF... | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | <commit_before>from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIF... |
794868448bc9740bc76f9c3381ff75385f72c769 | kinetic_widget/admin.py | kinetic_widget/admin.py | from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
| from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls import url, patterns
from django.shortcuts import render_to_response, render, get_object_or_404, redirect
from kinetic_widget.models import *
class TestWidgetSimpleAdmin(admin.ModelAdmin):
def get_urls(self):
urls ... | Test Widget: added support for displaying raw json | Test Widget: added support for displaying raw json
| Python | bsd-2-clause | knaperek/gits,knaperek/gits,knaperek/gits | from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
Test Widget: added support for displaying raw json | from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls import url, patterns
from django.shortcuts import render_to_response, render, get_object_or_404, redirect
from kinetic_widget.models import *
class TestWidgetSimpleAdmin(admin.ModelAdmin):
def get_urls(self):
urls ... | <commit_before>from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
<commit_msg>Test Widget: added support for displaying raw json<commit_after> | from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls import url, patterns
from django.shortcuts import render_to_response, render, get_object_or_404, redirect
from kinetic_widget.models import *
class TestWidgetSimpleAdmin(admin.ModelAdmin):
def get_urls(self):
urls ... | from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
Test Widget: added support for displaying raw jsonfrom django.contrib import admin
from django.http import HttpResponse
from django.conf.urls import url, patterns
from django... | <commit_before>from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
<commit_msg>Test Widget: added support for displaying raw json<commit_after>from django.contrib import admin
from django.http import HttpResponse
from django.c... |
b6eaabd47e98d51e4392c5419a59a75a0db45bf1 | geotrek/core/tests/test_forms.py | geotrek/core/tests/test_forms.py | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic segmentation onl... | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory, PathFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm, PathForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with d... | Add tests for path overlapping check | Add tests for path overlapping check
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic segmentation onl... | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory, PathFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm, PathForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with d... | <commit_before>from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic s... | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory, PathFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm, PathForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with d... | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic segmentation onl... | <commit_before>from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic s... |
cef2fbc059c5c9f55e4379e1963b4b974d09b7fb | statbot/__init__.py | statbot/__init__.py | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | Bump statbot version to 0.4.0 | Bump statbot version to 0.4.0
| Python | mit | strinking/statbot,strinking/statbot | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | <commit_before>#
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, b... | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | #
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT AN... | <commit_before>#
# __init__.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, b... |
6392e2d9487d5718d13f73f87797ad142ff14e50 | src/zeit/find/cli.py | src/zeit/find/cli.py | from argparse import ArgumentParser
from gocept.runner import once
from zeit.find import search, elastic
def parse():
parser = ArgumentParser(description='Elasticsearch debug client')
parser.add_argument('-f', '--fulltext', help='Fulltext search term')
parser.add_argument('-a', '--authors', help='Search a... | from argparse import ArgumentParser
from gocept.runner import once
from logging import getLogger
from operator import itemgetter
from zeit.cms.interfaces import ICMSContent
from zeit.find import search, elastic
log = getLogger(__name__)
def parse():
parser = ArgumentParser(description='Elasticsearch debug clien... | Allow search script to report the query & results. | TMS-240: Allow search script to report the query & results.
In addition search conditions are now specified using a <field>:<term>
notation:
$ work/zope/bin/search-solr --verbose "authors:Klaus Mustermann"
$ work/zope/bin/search-elastic --verbose "fulltext:Klaus Lage"
| Python | bsd-3-clause | ZeitOnline/zeit.find,ZeitOnline/zeit.find | from argparse import ArgumentParser
from gocept.runner import once
from zeit.find import search, elastic
def parse():
parser = ArgumentParser(description='Elasticsearch debug client')
parser.add_argument('-f', '--fulltext', help='Fulltext search term')
parser.add_argument('-a', '--authors', help='Search a... | from argparse import ArgumentParser
from gocept.runner import once
from logging import getLogger
from operator import itemgetter
from zeit.cms.interfaces import ICMSContent
from zeit.find import search, elastic
log = getLogger(__name__)
def parse():
parser = ArgumentParser(description='Elasticsearch debug clien... | <commit_before>from argparse import ArgumentParser
from gocept.runner import once
from zeit.find import search, elastic
def parse():
parser = ArgumentParser(description='Elasticsearch debug client')
parser.add_argument('-f', '--fulltext', help='Fulltext search term')
parser.add_argument('-a', '--authors',... | from argparse import ArgumentParser
from gocept.runner import once
from logging import getLogger
from operator import itemgetter
from zeit.cms.interfaces import ICMSContent
from zeit.find import search, elastic
log = getLogger(__name__)
def parse():
parser = ArgumentParser(description='Elasticsearch debug clien... | from argparse import ArgumentParser
from gocept.runner import once
from zeit.find import search, elastic
def parse():
parser = ArgumentParser(description='Elasticsearch debug client')
parser.add_argument('-f', '--fulltext', help='Fulltext search term')
parser.add_argument('-a', '--authors', help='Search a... | <commit_before>from argparse import ArgumentParser
from gocept.runner import once
from zeit.find import search, elastic
def parse():
parser = ArgumentParser(description='Elasticsearch debug client')
parser.add_argument('-f', '--fulltext', help='Fulltext search term')
parser.add_argument('-a', '--authors',... |
8ef82138d513630f5d83adef6233c6a9386019a1 | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | Fix problem with repeating rows. Good data on 3x3. | Fix problem with repeating rows. Good data on 3x3.
| Python | apache-2.0 | zimolzak/ffuu,zimolzak/ffuu | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... |
a83949ef067a5302bd1bb1f428c40c1c244b9f0d | main.py | main.py | from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner','books')
... | from createCollection import createCollection
from ObjectFactories.ItemFactory import ItemFactory
from DataObjects.Collection import Collection
import datetime
import json
def main():
#createCollection('agarner','books')
now = datetime.datetime.now()
items = []
for i in range(0,10):
... | Implement export data to json test | Implement export data to json test
| Python | apache-2.0 | AmosGarner/PyInventory | from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner','books')
... | from createCollection import createCollection
from ObjectFactories.ItemFactory import ItemFactory
from DataObjects.Collection import Collection
import datetime
import json
def main():
#createCollection('agarner','books')
now = datetime.datetime.now()
items = []
for i in range(0,10):
... | <commit_before>from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner'... | from createCollection import createCollection
from ObjectFactories.ItemFactory import ItemFactory
from DataObjects.Collection import Collection
import datetime
import json
def main():
#createCollection('agarner','books')
now = datetime.datetime.now()
items = []
for i in range(0,10):
... | from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner','books')
... | <commit_before>from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner'... |
cd5802850fab20648748b4be4a47ad4cc050c32d | tests/test_fields/common_tests.py | tests/test_fields/common_tests.py | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | Fix detail in one of the common tests | Fix detail in one of the common tests
The value returned by the submit will not necessarily be truish.
| Python | mit | hugollm/lie2me,hugollm/lie2me | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | <commit_before>from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error =... | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | <commit_before>from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error =... |
2306478f67a93e27dd9d7d397f97e3641df3516a | ipython_startup.py | ipython_startup.py | import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
| from __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import operator as op
import sys
import sympy
# Plotting
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pyplot import subplots
from matplotl... | Add lots of useful default imports to ipython | Add lots of useful default imports to ipython
| Python | cc0-1.0 | davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles | import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
Add lots of useful default imports to ipython | from __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import operator as op
import sys
import sympy
# Plotting
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pyplot import subplots
from matplotl... | <commit_before>import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
<commit_msg>Add lots of useful default imports to ipython<commit_after> | from __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import operator as op
import sys
import sympy
# Plotting
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pyplot import subplots
from matplotl... | import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
Add lots of useful default imports to ipythonfrom __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import operator as op
import sys
import sympy
... | <commit_before>import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
<commit_msg>Add lots of useful default imports to ipython<commit_after>from __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import... |
109085a9f5f6eded6ea2afe1f6aabaf183980d7c | scripts/jenkins/cloud/ansible/roles/heat-generator/files/dns-update.py | scripts/jenkins/cloud/ansible/roles/heat-generator/files/dns-update.py | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | Add option for name and path of cloudConfig.yml file | Add option for name and path of cloudConfig.yml file
This change adds a command line option to the dns script to specify
the name and location of the `cloudConfig.yml` file.
Signed-off-by: Nicolas Bock <4ad6fd604400c7892c7a2cb53bf674987bcaa405@suse.com>
| Python | apache-2.0 | aspiers/automation,SUSE-Cloud/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,SUSE-Cloud/automation,aspiers/automation,aspiers/automation,aspiers/automation,SUSE-Cloud/automation,SUSE-Cloud/automation | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | <commit_before>#!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | <commit_before>#!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--... |
58ae075463518e477185816094eb83f42ce5b77c | gcloud/bigquery/__init__.py | gcloud/bigquery/__init__.py | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Add public API entties from 'bigquery.table'. | Add public API entties from 'bigquery.table'.
| Python | apache-2.0 | CyrusBiotechnology/gcloud-python,tseaver/google-cloud-python,Fkawala/gcloud-python,waprin/gcloud-python,jonparrott/gcloud-python,EugenePig/gcloud-python,dhermes/google-cloud-python,tswast/google-cloud-python,thesandlord/gcloud-python,tswast/google-cloud-python,EugenePig/gcloud-python,jbuberel/gcloud-python,dhermes/goog... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
661baf5e280f64824bf983b710c54efccb93a41a | oscar/apps/wishlists/forms.py | oscar/apps/wishlists/forms.py | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory, fields_for_model
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args,... | Set size on wishlist line quantity form field | Set size on wishlist line quantity form field
This doesn't actually work since there is an overriding CSS style. When
issue #851 is resolved, this should start working.
| Python | bsd-3-clause | sasha0/django-oscar,nickpack/django-oscar,elliotthill/django-oscar,DrOctogon/unwash_ecom,josesanch/django-oscar,bnprk/django-oscar,kapari/django-oscar,marcoantoniooliveira/labweb,solarissmoke/django-oscar,kapt/django-oscar,nickpack/django-oscar,machtfit/django-oscar,jlmadurga/django-oscar,marcoantoniooliveira/labweb,Bo... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory, fields_for_model
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args,... | <commit_before># -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory, fields_for_model
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args,... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
... | <commit_before># -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **... |
e5322958f14b2428b74de726476fd98adae8c454 | app.py | app.py | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', methods=['GET', 'POS... | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
# @app.route('/')
# def main():
# return redirect('/index')
@app.route('/', methods=['GET', 'PO... | Remove redirect to avoid Chrome privacy error | Remove redirect to avoid Chrome privacy error
| Python | mit | gsganden/pitcher-reports,gsganden/pitcher-reports | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', methods=['GET', 'POS... | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
# @app.route('/')
# def main():
# return redirect('/index')
@app.route('/', methods=['GET', 'PO... | <commit_before>from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', metho... | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
# @app.route('/')
# def main():
# return redirect('/index')
@app.route('/', methods=['GET', 'PO... | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', methods=['GET', 'POS... | <commit_before>from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', metho... |
5c64fe29690e2471aef20473592f0dcebac4eff8 | tests/_support/contextualized.py | tests/_support/contextualized.py | from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('x')
| from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('false')
| Tweak a test so it fails more usefully when mocking doesn't work, heh | Tweak a test so it fails more usefully when mocking doesn't work, heh
| Python | bsd-2-clause | kejbaly2/invoke,frol/invoke,pyinvoke/invoke,singingwolfboy/invoke,pfmoore/invoke,mattrobenolt/invoke,tyewang/invoke,mkusz/invoke,mattrobenolt/invoke,mkusz/invoke,kejbaly2/invoke,frol/invoke,pfmoore/invoke,pyinvoke/invoke | from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('x')
Tweak a test so it fails more usefully when mocking doesn't work, heh | from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('false')
| <commit_before>from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('x')
<commit_msg>Tweak a test so it fails more usefully when mocking doesn't work, heh<commit_after> | from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('false')
| from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('x')
Tweak a test so it fails more usefully when mocking doesn't work, hehfrom invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('false')
| <commit_before>from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('x')
<commit_msg>Tweak a test so it fails more usefully when mocking doesn't work, heh<commit_after>from invoke import ctask
@ctask
def go(ctx):
return ctx
@ctask
def run(ctx):
ctx.run('false')
|
67a102e5da283e318928028e54f6a85b4d266043 | nipap/nipap/nipapconfig.py | nipap/nipap/nipapconfig.py | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | Remove requirement on presence of config file | Remove requirement on presence of config file
The NipapConfig object required the presence of a configuration file. As
it is benficial to be able to load the NipapConfig without a
configuration file (for example when building docs using Sphinx), this
requirement has been removed.
| Python | mit | fredsod/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,ettrig/NIPAP,fredsod/NIPAP,ettrig/NIPAP,ettrig/NIPAP,garberg/NIPAP,bbaja42/NIPAP,bbaja42/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,plajjan/NIPAP,fredsod/NIPAP,bbaja42/NIPAP,garberg/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,SoundGoof/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | <commit_before>import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | <commit_before>import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
... |
441ecd25c9fdbc3acbe0e345bbaeafd8de9e3b73 | tests/test_srvy.py | tests/test_srvy.py | import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqual(get_c... | import unittest
import context
from collection.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqua... | Update unittest to check get_current_questions | Update unittest to check get_current_questions
| Python | mit | andrewlrogers/srvy | import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqual(get_c... | import unittest
import context
from collection.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqua... | <commit_before>import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.as... | import unittest
import context
from collection.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqua... | import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqual(get_c... | <commit_before>import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.as... |
aceee9b19920d6a78fd8edda07009480ed48f565 | jsondb/__init__.py | jsondb/__init__.py | """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
| """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
| Update release version to 0.1.6 | Update release version to 0.1.6
| Python | bsd-3-clause | gunthercox/jsondb | """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
Update release version to 0.1.6 | """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
| <commit_before>"""
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
<commit_msg>Update release version to 0.1.6<commit_after> | """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
| """
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
Update release version to 0.1.6"""
A flat file database for json objects.
"""
from .db import Database
__version... | <commit_before>"""
A flat file database for json objects.
"""
from .db import Database
__version__ = '0.1.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/jsondb'
<commit_msg>Update release version to 0.1.6<commit_after>"""
A flat file database for json objects.... |
c4741e3246ca85d621f10530e9d70a85cdff7414 | learn/my_pbkdf2.py | learn/my_pbkdf2.py | import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2_HMAC_SHA1(
... | import ctypes
import platform
__all__ = ["pbkdf2"]
name = "libssl.%s" % ("dylib" if platform.system() == "Darwin" else "so")
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iter... | Load .so if not on Crap OS X | Load .so if not on Crap OS X
| Python | bsd-2-clause | tzwenn/luksfs | import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2_HMAC_SHA1(
... | import ctypes
import platform
__all__ = ["pbkdf2"]
name = "libssl.%s" % ("dylib" if platform.system() == "Darwin" else "so")
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iter... | <commit_before>import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2... | import ctypes
import platform
__all__ = ["pbkdf2"]
name = "libssl.%s" % ("dylib" if platform.system() == "Darwin" else "so")
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iter... | import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2_HMAC_SHA1(
... | <commit_before>import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2... |
4c372b62ac97bc06f18dc953fd9e0ccfe4de80fe | ibmcnx/doc/Documentation.py | ibmcnx/doc/Documentation.py | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | <commit_before>######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: ... | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | ######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-08
... | <commit_before>######
# Create a file (html or markdown) with the output of
# - JVMHeap
# - LogFiles
# - Ports
# - Variables
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: ... |
058a0eb16a5a807c137553042f973c907d231cf1 | ndb/operate/__init__.py | ndb/operate/__init__.py | # coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
return node_update.N... | # coding=utf-8
import node_locate
import node_select
import node_update
import node_delete
import node_insert
import node_script
import node_clean
import node_travel
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
re... | Add clean and travel to operate | Add clean and travel to operate | Python | apache-2.0 | PinaeOS/ndb-py,node-db/ndb-py | # coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
return node_update.N... | # coding=utf-8
import node_locate
import node_select
import node_update
import node_delete
import node_insert
import node_script
import node_clean
import node_travel
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
re... | <commit_before># coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
retur... | # coding=utf-8
import node_locate
import node_select
import node_update
import node_delete
import node_insert
import node_script
import node_clean
import node_travel
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
re... | # coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
return node_update.N... | <commit_before># coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
retur... |
c9eb050771c487aae67e0a1f8c69ad011b6aaa90 | repomgmt/management/commands/process-build-queue.py | repomgmt/management/commands/process-build-queue.py | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add tailing / to APT_REPO_BASE_URL | Add tailing / to APT_REPO_BASE_URL
| Python | apache-2.0 | sorenh/python-django-repomgmt,sorenh/python-django-repomgmt | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | <commit_before>#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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/l... | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | <commit_before>#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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/l... |
7f611e99d36089bc6836042ba8aec2df02a56f3a | pymemcache/test/test_serde.py | pymemcache/test/test_serde.py | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serializer(b'key', value... | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer, FLAG_PICKLE,
FLAG_INTEGER, FLAG_LONG, FLAG_TEXT)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(sel... | Test for expected flags with serde tests | Test for expected flags with serde tests
| Python | apache-2.0 | bwalks/pymemcache,sontek/pymemcache,pinterest/pymemcache,ewdurbin/pymemcache,pinterest/pymemcache,sontek/pymemcache | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serializer(b'key', value... | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer, FLAG_PICKLE,
FLAG_INTEGER, FLAG_LONG, FLAG_TEXT)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(sel... | <commit_before>from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serialize... | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer, FLAG_PICKLE,
FLAG_INTEGER, FLAG_LONG, FLAG_TEXT)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(sel... | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serializer(b'key', value... | <commit_before>from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serialize... |
f050c0429beffa13d94ad303c1730fef5b44f544 | pymysql/tests/test_nextset.py | pymysql/tests/test_nextset.py | from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
self.as... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | Add multi cursor test currently failed. | Add multi cursor test currently failed.
| Python | mit | Geoion/Tornado-MySQL,PyMySQL/PyMySQL,PyMySQL/Tornado-MySQL,boneyao/PyMySQL,aio-libs/aiomysql,jwjohns/PyMySQL,yeyinzhu3211/PyMySQL,jheld/PyMySQL,eibanez/PyMySQL,pymysql/pymysql,lzedl/PyMySQL,modulexcite/PyMySQL,xjzhou/PyMySQL,xjzhou/PyMySQL,MartinThoma/PyMySQL,wraziens/PyMySQL,mosquito/Tornado-MySQL,pulsar314/Tornado-My... | from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
self.as... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | <commit_before>from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
self.as... | <commit_before>from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
... |
21ac167e827cde53ccbb60f713c8190ec2ff6bda | api/management/commands/cron_notifications.py | api/management/commands/cron_notifications.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | Handle errors in cron notifications | Handle errors in cron notifications
| Python | apache-2.0 | SchoolIdolTomodachi/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | <commit_before># -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filte... | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filter(email_sent=Fa... | <commit_before># -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from api import models
from web.utils import send_email
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
notifications = models.Notification.objects.filte... |
c955628b134586491265bc2e6b4045398072cead | allauth/socialaccount/providers/kakao/provider.py | allauth/socialaccount/providers/kakao/provider.py | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | Handle case where email is not present | fix(kakao): Handle case where email is not present
| Python | mit | pennersr/django-allauth,rsalmaso/django-allauth,rsalmaso/django-allauth,lukeburden/django-allauth,bittner/django-allauth,AltSchool/django-allauth,pennersr/django-allauth,AltSchool/django-allauth,rsalmaso/django-allauth,AltSchool/django-allauth,lukeburden/django-allauth,bittner/django-allauth,lukeburden/django-allauth,b... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | <commit_before>from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | <commit_before>from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data... |
6064f95021119e781b13224febfeca2d7de4aec5 | wagtailmenus/management/commands/autopopulate_main_menus.py | wagtailmenus/management/commands/autopopulate_main_menus.py | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | Make the '--add-home-links' option work for any value that evaluates to a bool | Make the '--add-home-links' option work for any value that evaluates to a bool
| Python | mit | rkhleics/wagtailmenus,ababic/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | <commit_before># -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that... | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | <commit_before># -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that... |
f0a1cd06f954094bc5ef3dfa337901a87d22485c | prod.py | prod.py | #! /usr/bin/env python2.7
import cherrypy
import medlem
wsgiapp = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
| #! /usr/bin/env python2.7
import cherrypy
import medlem
app = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
| Change name of the wsgi-object to match what uwsgi | Change name of the wsgi-object to match what uwsgi
| Python | bsd-3-clause | UngaForskareStockholm/medlem2 | #! /usr/bin/env python2.7
import cherrypy
import medlem
wsgiapp = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
Change name of the wsgi-object to match what uwsgi | #! /usr/bin/env python2.7
import cherrypy
import medlem
app = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
| <commit_before>#! /usr/bin/env python2.7
import cherrypy
import medlem
wsgiapp = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
<commit_msg>Change name of the wsgi-object to match what uwsgi<commit_after> | #! /usr/bin/env python2.7
import cherrypy
import medlem
app = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
| #! /usr/bin/env python2.7
import cherrypy
import medlem
wsgiapp = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
Change name of the wsgi-object to match what uwsgi#! /usr/bin/env python2.7
import cherrypy
import medlem
app = cherrypy.Application(medlem.Medlem(), '/', config="config/prod... | <commit_before>#! /usr/bin/env python2.7
import cherrypy
import medlem
wsgiapp = cherrypy.Application(medlem.Medlem(), '/', config="config/production.conf")
<commit_msg>Change name of the wsgi-object to match what uwsgi<commit_after>#! /usr/bin/env python2.7
import cherrypy
import medlem
app = cherrypy.Application(... |
5aa13f1aafd2afa71d7a95f6b59ff28a1c97fbd2 | compare_mt/__init__.py | compare_mt/__init__.py | import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2"
| import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2.1"
| Increase version number to update pipy | Increase version number to update pipy
| Python | bsd-3-clause | neulab/compare-mt,neulab/compare-mt | import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2"
Increase version number to update pipy | import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2.1"
| <commit_before>import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2"
<commit_msg>Increase ver... | import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2.1"
| import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2"
Increase version number to update pipyi... | <commit_before>import compare_mt.ngram_utils
import compare_mt.stat_utils
import compare_mt.corpus_utils
import compare_mt.sign_utils
import compare_mt.scorers
import compare_mt.bucketers
import compare_mt.reporters
import compare_mt.arg_utils
import compare_mt.print_utils
__version__ = "0.2"
<commit_msg>Increase ver... |
94edf518993860dbff8d845292bfe4ce94d9fe5e | netdumplings/console/__init__.py | netdumplings/console/__init__.py | from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
| from .printer import printer
from .shifty import shifty
from .shiftydetails import shiftydetails
from .shiftysummary import shiftysummary
from .snifty import snifty
(
printer,
shifty,
shiftydetails,
shiftysummary,
snifty,
)
| Update console module with new cli names | Update console module with new cli names
| Python | mit | mjoblin/netdumplings,mjoblin/netdumplings,mjoblin/netdumplings | from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
Update console module with new cli names | from .printer import printer
from .shifty import shifty
from .shiftydetails import shiftydetails
from .shiftysummary import shiftysummary
from .snifty import snifty
(
printer,
shifty,
shiftydetails,
shiftysummary,
snifty,
)
| <commit_before>from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
<commit_msg>Update console module with new cli names<commit_after> | from .printer import printer
from .shifty import shifty
from .shiftydetails import shiftydetails
from .shiftysummary import shiftysummary
from .snifty import snifty
(
printer,
shifty,
shiftydetails,
shiftysummary,
snifty,
)
| from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
Update console module with new cli namesfrom .printer import printer
from .shifty ... | <commit_before>from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
<commit_msg>Update console module with new cli names<commit_after>f... |
68e8dfb52aea3a3f6ee99b3ce2a2b479a39c19db | doc/examples/special/plot_errorfill.py | doc/examples/special/plot_errorfill.py | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | Fix labeling on plots so it matches elements. | DOC: Fix labeling on plots so it matches elements.
| Python | bsd-3-clause | tonysyu/mpltools,matteoicardi/mpltools | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | <commit_before>"""
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import nu... | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | <commit_before>"""
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import nu... |
2a2c9e01b51b10594da97c5ce273073931e44c43 | social_auth/backends/pipeline/misc.py | social_auth/backends/pipeline/misc.py | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(request, auth, *arg... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def save_status_to_session(request, auth, *args, **kwargs):
"""Saves current social-auth status to session."""
next_entry = setting('SOCIAL_AUTH_PIPELI... | Revert "Add own tuple_index function to stay compatible with python 2.5" | Revert "Add own tuple_index function to stay compatible with python 2.5"
This reverts commit 7e6af723e15a785b403010de4b44b49fce924e91.
| Python | bsd-3-clause | michael-borisov/django-social-auth,qas612820704/django-social-auth,VishvajitP/django-social-auth,beswarm/django-social-auth,lovehhf/django-social-auth,antoviaque/django-social-auth-norel,qas612820704/django-social-auth,MjAbuz/django-social-auth,omab/django-social-auth,caktus/django-social-auth,VishvajitP/django-social-... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(request, auth, *arg... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def save_status_to_session(request, auth, *args, **kwargs):
"""Saves current social-auth status to session."""
next_entry = setting('SOCIAL_AUTH_PIPELI... | <commit_before>from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(requ... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def save_status_to_session(request, auth, *args, **kwargs):
"""Saves current social-auth status to session."""
next_entry = setting('SOCIAL_AUTH_PIPELI... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(request, auth, *arg... | <commit_before>from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(requ... |
93effb501a50d8265afd37826fbcab4dd4a87611 | qa_app/views.py | qa_app/views.py | # Copyright 2016 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 ... | # Copyright 2016 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 ... | Fix user and attempts sqlalchemia request. | Fix user and attempts sqlalchemia request.
| Python | apache-2.0 | molecul/qa_app_flask,molecul/qa_app_flask,molecul/qa_app_flask | # Copyright 2016 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 ... | # Copyright 2016 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 ... | <commit_before># Copyright 2016 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 app... | # Copyright 2016 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 ... | # Copyright 2016 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 ... | <commit_before># Copyright 2016 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 app... |
1914bd9a9fc2f1ce7a557dd2134d98796866283d | rootpy/userdata.py | rootpy/userdata.py | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
DATA_ROOT =... | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
from os.path import expanduser, expandvars, exists, isdir
if "XDG_CONFIG_HOME" not in os.environ:
os.environ["XDG_CONFIG_HOME"] = expanduser('~/.config')
if "XDG_CACHE_HOME" not in os.environ:
os.environ["XDG_C... | Use XDG base directory specificiation | Use XDG base directory specificiation
| Python | bsd-3-clause | rootpy/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,rootpy/rootpy | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
DATA_ROOT =... | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
from os.path import expanduser, expandvars, exists, isdir
if "XDG_CONFIG_HOME" not in os.environ:
os.environ["XDG_CONFIG_HOME"] = expanduser('~/.config')
if "XDG_CACHE_HOME" not in os.environ:
os.environ["XDG_C... | <commit_before>"""
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
... | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
from os.path import expanduser, expandvars, exists, isdir
if "XDG_CONFIG_HOME" not in os.environ:
os.environ["XDG_CONFIG_HOME"] = expanduser('~/.config')
if "XDG_CACHE_HOME" not in os.environ:
os.environ["XDG_C... | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
DATA_ROOT =... | <commit_before>"""
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
... |
1ae98c0f2186dcdbd658f774a14172b4618bb0a8 | logging_util.py | logging_util.py | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | Fix bug some log output showing on screen not present in log file by changing logging file handler mode from 'w' write to 'a' append. | Fix bug some log output showing on screen not present in log file by changing logging file handler mode from 'w' write to 'a' append.
| Python | mit | beepscore/fibonacci | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | <commit_before># https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.py... | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | # https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.python.org/3.6/ho... | <commit_before># https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial
import logging
import sys
def get_logger(name):
"""
https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python
https://docs.python.org/3/library/logging.html#formatter-objects
https://docs.py... |
98fd04596367f94b7f47056c429ea23b2dd6165b | miller-rabin.py | miller-rabin.py | import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint(2, modulo - 1)... | import sys, math, random
# Receive candidate number from arguments, or default to 221 for test purposes.
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
# Write the modulo (candidate -1) number in the form
# 2^s * d.
s = 0
quotient = modulo
remainder = 0
while rema... | Add comments to Python version | Add comments to Python version
| Python | mit | boppreh/miller-rabin,boppreh/miller-rabin | import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint(2, modulo - 1)... | import sys, math, random
# Receive candidate number from arguments, or default to 221 for test purposes.
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
# Write the modulo (candidate -1) number in the form
# 2^s * d.
s = 0
quotient = modulo
remainder = 0
while rema... | <commit_before>import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint... | import sys, math, random
# Receive candidate number from arguments, or default to 221 for test purposes.
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
# Write the modulo (candidate -1) number in the form
# 2^s * d.
s = 0
quotient = modulo
remainder = 0
while rema... | import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint(2, modulo - 1)... | <commit_before>import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint... |
0fed2ca675967f1d43d0abacb9110875b30b0d64 | tests/test_input.py | tests/test_input.py | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | Add custom rangers to slider | Add custom rangers to slider
| Python | mit | pviafore/rcfc,pviafore/rcfc,pviafore/rcfc | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | <commit_before>from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_meth... | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | <commit_before>from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_meth... |
91bdd47afe409e86bceca71ebb07ae1975e9073a | tests/test_sweep.py | tests/test_sweep.py | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | Fix bug in unit test (ignore header row in output csv file) | Fix bug in unit test (ignore header row in output csv file)
| Python | mit | marl/crepe | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | <commit_before>import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0... | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | <commit_before>import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0... |
fcfe2513fc8532dc2212a254da42d75048e76de7 | form_designer/tests/test_cms_plugin.py | form_designer/tests/test_cms_plugin.py | from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models import FormDefini... | import django
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models imp... | Disable Django-CMS test on Django 1.10+ | Disable Django-CMS test on Django 1.10+
Someone with the time and inclination should set up the test to work with a Django-CMS version compatible with Django 1.10+, then try again
| Python | bsd-3-clause | andersinno/django-form-designer-ai,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer-ai | from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models import FormDefini... | import django
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models imp... | <commit_before>from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models im... | import django
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models imp... | from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models import FormDefini... | <commit_before>from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models im... |
1d82b988fdd913e291ed73552964c8724934ad32 | tools/build_interface_docs.py | tools/build_interface_docs.py | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | Remove pymvpa from documentation build. | Remove pymvpa from documentation build.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@931 ead46cd0-7350-4e37-8683-fc4c6f79bf00
| Python | bsd-3-clause | arokem/nipype,grlee77/nipype,JohnGriffiths/nipype,wanderine/nipype,fprados/nipype,fprados/nipype,christianbrodbeck/nipype,dgellis90/nipype,wanderine/nipype,sgiavasis/nipype,arokem/nipype,rameshvs/nipype,mick-d/nipype,FredLoney/nipype,mick-d/nipype_source,mick-d/nipype,blakedewey/nipype,sgiavasis/nipype,rameshvs/nipype,... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | <commit_before>#!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abs... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | <commit_before>#!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abs... |
0c69c3e25f52ab126886a2a2f1c33d099d0bb5a4 | annfab/distances/matrix_cosine.py | annfab/distances/matrix_cosine.py | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distance(x, y)
... | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distan... | Add simple tests for matrix operands for distance measure. | Add simple tests for matrix operands for distance measure.
| Python | mit | elezar/ann-fab,elezar/ann-fab,elezar/ann-fab | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distance(x, y)
... | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distan... | <commit_before>import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).... | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distan... | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distance(x, y)
... | <commit_before>import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).... |
6723dd3e2980d040cef4f7d0f7675933666eb088 | tests/benchmarks/constructs/LocalVariableAssign.py | tests/benchmarks/constructs/LocalVariableAssign.py | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | Enhance construct test to avoid local variable optimization. | Tests: Enhance construct test to avoid local variable optimization.
| Python | apache-2.0 | wfxiang08/Nuitka,kayhayen/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,wfxiang08/Nuitka | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | <commit_before># Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indica... | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | <commit_before># Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indica... |
6f939e9c2bd4cf42cb4ad58112375f36abf489bf | terraform/templates/sch_log_parser.py | terraform/templates/sch_log_parser.py | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | Add group/job info to job dashboard | Add group/job info to job dashboard
Signed-off-by: Salim Alam <18ae4dd1e3db1d49a738226169e3b099325c79a0@chef.io>
| Python | apache-2.0 | habitat-sh/habitat,nathenharvey/habitat,nathenharvey/habitat,georgemarshall/habitat,georgemarshall/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,nathenharvey/habitat,rsertelon/habitat,nathenharvey/habitat,habitat-sh/habitat,georg... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | <commit_before>import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | <commit_before>import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:... |
51dc6f26ef8c063c51e1218a0cc09105ae16022c | twext/who/test/test_aggregate.py | twext/who/test/test_aggregate.py | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Make sure the aggregate service only using the IDirectoryService interface when interactive with its sub-services. | Make sure the aggregate service only using the IDirectoryService interface when interactive with its sub-services.
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@10781 e27351fd-9f3e-4f54-a53b-843176b1656c
| Python | apache-2.0 | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | <commit_before>##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | ##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | <commit_before>##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
29ecb6f6bac85aeecba6b2602744f178735c0adc | pyautoupdate/_move_glob.py | pyautoupdate/_move_glob.py | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | Fix bug in copy_glob when destination directory already has files | Fix bug in copy_glob when destination directory already has files
| Python | lgpl-2.1 | rlee287/pyautoupdate,rlee287/pyautoupdate | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | <commit_before>import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob... | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | <commit_before>import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob... |
7698ad7a907da5e7b4ad7cfd40255bb9c44b5b87 | scripts/sort-cluster-issue.py | scripts/sort-cluster-issue.py | #!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19-20160919-a50-o... | #!/usr/bin/python
from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import desc
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: sort-cluster-issue.py <input> <output>", file=sys.stderr)
exit(-1)
sc... | Use command-line arguments for paths. | Use command-line arguments for paths.
| Python | apache-2.0 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | #!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19-20160919-a50-o... | #!/usr/bin/python
from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import desc
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: sort-cluster-issue.py <input> <output>", file=sys.stderr)
exit(-1)
sc... | <commit_before>#!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19... | #!/usr/bin/python
from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import desc
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: sort-cluster-issue.py <input> <output>", file=sys.stderr)
exit(-1)
sc... | #!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19-20160919-a50-o... | <commit_before>#!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19... |
742e5e7a998e8e397a438d4edf9fa3d6234009fc | popit/migrations/0001_initial.py | popit/migrations/0001_initial.py | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ app_name }}']
| # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['popit']
| Replace placeholders with actual app name | Replace placeholders with actual app name
| Python | agpl-3.0 | ciudadanointeligente/popit-django,mysociety/popit-django,ciudadanointeligente/popit-django,mysociety/popit-django,mysociety/popit-django,ciudadanointeligente/popit-django | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ app_name }}']
R... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['popit']
| <commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ ... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['popit']
| # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ app_name }}']
R... | <commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ ... |
c05e1d39af6089f31e72fa8dc1c27e22795e8e2f | sites/docs/conf.py | sites/docs/conf.py | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | Fix Invoke doc intersphinx path (and tweak formatting) | Fix Invoke doc intersphinx path (and tweak formatting)
| Python | bsd-2-clause | fabric/fabric | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | <commit_before># Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', '... | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | # Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.inte... | <commit_before># Obtain shared config values
import os, sys
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), '..')))
sys.path.append(abspath(join(dirname(__file__), '..', '..')))
from shared_conf import *
# Enable autodoc, intersphinx
extensions.extend(['sphinx.ext.autodoc', '... |
e12138061b0babca3f14b1479cd3269fec36e9ea | remo/featuredrep/models.py | remo/featuredrep/models.py | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | Change ordering to FeaturedRep model. | Change ordering to FeaturedRep model.
| Python | bsd-3-clause | flamingspaz/remo,akatsoulas/remo,Mte90/remo,flamingspaz/remo,johngian/remo,abdullah2891/remo,flamingspaz/remo,akatsoulas/remo,chirilo/remo,abdullah2891/remo,mozilla/remo,Mte90/remo,johngian/remo,johngian/remo,tsmrachel/remo,Mte90/remo,mozilla/remo,chirilo/remo,mozilla/remo,chirilo/remo,johngian/remo,chirilo/remo,akatso... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | <commit_before>from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | <commit_before>from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month... |
27e86c661021b1276123b264f00536fc89d203c4 | common/templatetags/lutris.py | common/templatetags/lutris.py | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | Fix download link , again | Fix download link , again
| Python | agpl-3.0 | Turupawn/website,Turupawn/website,lutris/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | <commit_before>import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | <commit_before>import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
... |
a367b1d4bdbb639b4eab862c7ce691eb4a861d26 | wandb/compat/windows.py | wandb/compat/windows.py | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, escape with doub... | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
if s.startswith('"') and s.endswith('"'):
re... | Add check for args which are already quotes | Add check for args which are already quotes
| Python | mit | wandb/client,wandb/client,wandb/client | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, escape with doub... | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
if s.startswith('"') and s.endswith('"'):
re... | <commit_before>"""
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, e... | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
if s.startswith('"') and s.endswith('"'):
re... | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, escape with doub... | <commit_before>"""
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, e... |
508ca596d46c08fdc9295769059f5de974b2d1df | base/components/accounts/admin.py | base/components/accounts/admin.py | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
obj.... | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
if not change:
obj.submitted_by = request.user
obj.edited_by.add(request.user)
o... | Move this to the bottom... | Move this to the bottom...
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
obj.... | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
if not change:
obj.submitted_by = request.user
obj.edited_by.add(request.user)
o... | <commit_before>from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
... | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
if not change:
obj.submitted_by = request.user
obj.edited_by.add(request.user)
o... | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
obj.... | <commit_before>from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
... |
9502755baf7efba7851c07edbf2579f7cff95e44 | py/rackattack/tcp/debug.py | py/rackattack/tcp/debug.py | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
def __init__(self, message):
self._message = message
s... | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
TRANSACTION_PERIOD_MAX = 0.3
def __init__(self, message):
... | Increase max transaction period due to more networking tasks | Increase max transaction period due to more networking tasks
| Python | apache-2.0 | eliran-stratoscale/rackattack-api,Stratoscale/rackattack-api | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
def __init__(self, message):
self._message = message
s... | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
TRANSACTION_PERIOD_MAX = 0.3
def __init__(self, message):
... | <commit_before>import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
def __init__(self, message):
self._message = me... | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
TRANSACTION_PERIOD_MAX = 0.3
def __init__(self, message):
... | import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
def __init__(self, message):
self._message = message
s... | <commit_before>import contextlib
import logging
import time
import os
logger = logging.getLogger('network')
@contextlib.contextmanager
def logNetwork(message):
transaction = Transaction(message)
yield
transaction.finished()
class Transaction:
def __init__(self, message):
self._message = me... |
1a04c983eb921f47452ea6c013313f90875c400f | pkgconf/__init__.py | pkgconf/__init__.py | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | Fix "import star" feature support | Fix "import star" feature support
`dict.keys()` returns `dict_keys` object in py3,
which does not support indexing.
| Python | bsd-3-clause | byashimov/django-pkgconf | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | <commit_before>import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
... | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | <commit_before>import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
... |
4fe1350e5bb5d093e4d41fb1deace70fd8dfec50 | main.py | main.py | #!/usr/bin/python
from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
def login():
pass
def logo... | #!/usr/bin/python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
@app.route("/login", methods=["POST"])
def login():
pass
@app.ro... | Add missing routes to API. | Add missing routes to API.
| Python | agpl-3.0 | tatsuhirosatou/p2p-app-backend,tatsuhirosatou/p2p-app-backend | #!/usr/bin/python
from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
def login():
pass
def logo... | #!/usr/bin/python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
@app.route("/login", methods=["POST"])
def login():
pass
@app.ro... | <commit_before>#!/usr/bin/python
from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
def login():
... | #!/usr/bin/python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
@app.route("/login", methods=["POST"])
def login():
pass
@app.ro... | #!/usr/bin/python
from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
def login():
pass
def logo... | <commit_before>#!/usr/bin/python
from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/recent")
def get_recent_questions():
pass
@app.route('/register', methods=["POST"])
def register():
pass
def login():
... |
d61bc5d2d5dad607332bfe131e537d139011ab57 | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start() | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import os
import signal
def signal_handler(signal, frame):
print "Caught SIGINT, terminating."
os._exit(0)
if __name__ == "__main__":
bot = Bot()
bot.start()
signal.signal(signal.SIGINT, signal_handler)
while Ture:
signa... | Allow program termination using SIGINT | Allow program termination using SIGINT
It's a rather crude method, but it works.
| Python | mit | gehaxelt/python-rss2irc | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start()Allow program termination using SIGINT
It's a rather crude method, but it works. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import os
import signal
def signal_handler(signal, frame):
print "Caught SIGINT, terminating."
os._exit(0)
if __name__ == "__main__":
bot = Bot()
bot.start()
signal.signal(signal.SIGINT, signal_handler)
while Ture:
signa... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start()<commit_msg>Allow program termination using SIGINT
It's a rather crude method, but it works.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import os
import signal
def signal_handler(signal, frame):
print "Caught SIGINT, terminating."
os._exit(0)
if __name__ == "__main__":
bot = Bot()
bot.start()
signal.signal(signal.SIGINT, signal_handler)
while Ture:
signa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start()Allow program termination using SIGINT
It's a rather crude method, but it works.#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import os
import signal
def signal_handler(sign... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start()<commit_msg>Allow program termination using SIGINT
It's a rather crude method, but it works.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import ... |
c49024439978fddee1cd688524741e8ee482132b | pi_gpio/sockets.py | pi_gpio/sockets.py | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | Fix the usage of dict object | Fix the usage of dict object
Fix this error:
```sh
pi@raspberrypi:~/Pi-GPIO-Server $ !sudo
sudo python pi_gpio_server.py
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/... | Python | mit | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | <commit_before>from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PI... | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | <commit_before>from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PI... |
324c61e220fcb66973007cab4b95ca249aef3274 | bvggrabber/api/actualdeparture.py | bvggrabber/api/actualdeparture.py | # -*- coding: utf-8 -*-
| # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class ActualDepartureQueryApi(QueryApi):
def __init__(self, station):
super(ActualDepartureQueryApi, se... | Add first attempt of ActualDepartureQueryApi | Add first attempt of ActualDepartureQueryApi
| Python | bsd-3-clause | MarkusH/bvg-grabber | # -*- coding: utf-8 -*-
Add first attempt of ActualDepartureQueryApi | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class ActualDepartureQueryApi(QueryApi):
def __init__(self, station):
super(ActualDepartureQueryApi, se... | <commit_before># -*- coding: utf-8 -*-
<commit_msg>Add first attempt of ActualDepartureQueryApi<commit_after> | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class ActualDepartureQueryApi(QueryApi):
def __init__(self, station):
super(ActualDepartureQueryApi, se... | # -*- coding: utf-8 -*-
Add first attempt of ActualDepartureQueryApi# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class ActualDepartureQueryApi(QueryApi):
de... | <commit_before># -*- coding: utf-8 -*-
<commit_msg>Add first attempt of ActualDepartureQueryApi<commit_after># -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class A... |
98bb4305ccdd8a83763bedb1f09c261e9904487c | cla_backend/apps/legalaid/tests/test_views.py | cla_backend/apps/legalaid/tests/test_views.py | import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullCaseViewSet
from... | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from legalaid.views import FullCaseViewSet
from cla_backend.apps.call_centre.permissions impor... | Refactor the test for the method test_filter inside class FullCaseViewSet and create a new test that allows you to test for just ASCII characters | Refactor the test for the method test_filter inside class FullCaseViewSet and create a new test that allows you to test for just ASCII characters
| Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullCaseViewSet
from... | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from legalaid.views import FullCaseViewSet
from cla_backend.apps.call_centre.permissions impor... | <commit_before>import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullC... | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from legalaid.views import FullCaseViewSet
from cla_backend.apps.call_centre.permissions impor... | import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullCaseViewSet
from... | <commit_before>import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullC... |
e9a5bbd1eba1cdad15626a712bfc7994008c7381 | byceps/blueprints/snippet/init.py | byceps/blueprints/snippet/init.py | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | Fix snippet URL rules to use mountpoints' endpoint suffix | Fix snippet URL rules to use mountpoints' endpoint suffix
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | <commit_before>"""
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_cu... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | <commit_before>"""
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_cu... |
5611d502c30ee0274fcd523deffcb68c77f31fd8 | basic.py | basic.py |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cmd
def make(even... |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
"""Responds 'okay.' to your 'sudo ... | Add docstrings to 'sudo' and 'make'. | Add docstrings to 'sudo' and 'make'. | Python | apache-2.0 | Adman/brutal-plugins,mrshu/brutal-plugins |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cmd
def make(even... |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
"""Responds 'okay.' to your 'sudo ... | <commit_before>
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cm... |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
"""Responds 'okay.' to your 'sudo ... |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cmd
def make(even... | <commit_before>
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cm... |
d37cac61f1457609806fba507cf9568188d1664d | button.py | button.py | import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_down=GPIO.PUD_DOWN... | import RPi.GPIO as GPIO
import time
import os
import sys
from optparse import OptionParser
# Parse input arguments
parser = OptionParser()
parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.")
# The option --pin sets the Input Pin for your Button
# It d... | Allow parsing of option arguments and basic GPIO testing. | Allow parsing of option arguments and basic GPIO testing.
| Python | mit | henne-/guest-password-printer,henne-/guest-password-printer | import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_down=GPIO.PUD_DOWN... | import RPi.GPIO as GPIO
import time
import os
import sys
from optparse import OptionParser
# Parse input arguments
parser = OptionParser()
parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.")
# The option --pin sets the Input Pin for your Button
# It d... | <commit_before>import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_dow... | import RPi.GPIO as GPIO
import time
import os
import sys
from optparse import OptionParser
# Parse input arguments
parser = OptionParser()
parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.")
# The option --pin sets the Input Pin for your Button
# It d... | import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_down=GPIO.PUD_DOWN... | <commit_before>import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_dow... |
eb39ec42078994eac9a5d085f35bcb35dea77a64 | salt/states/apt.py | salt/states/apt.py | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __salt__['pkg.get_... | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name, 'changes': {}, 'result': False... | Make dict updates more dense | Make dict updates more dense
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __salt__['pkg.get_... | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name, 'changes': {}, 'result': False... | <commit_before># Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __s... | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name, 'changes': {}, 'result': False... | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __salt__['pkg.get_... | <commit_before># Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __s... |
d0818c7dcabebe7697444b73b6b8f30ade73958d | openedx/core/djangoapps/appsembler/eventtracking/utils.py | openedx/core/djangoapps/appsembler/eventtracking/utils.py | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | Return exeption if cannot get the site config in event | Return exeption if cannot get the site config in event
| Python | agpl-3.0 | appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | <commit_before>"""
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an e... | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | <commit_before>"""
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an e... |
872875ecb3b5a09c14da8836cdd4b7a6f6610675 | vumi/transports/mxit/responses.py | vumi/transports/mxit/responses.py | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __init__(self, content):
header_match = re.match(self.HEADER_PATTERN, con... | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
from vumi.utils import PkgResources
MXIT_RESOURCES = PkgResources(__name__)
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __... | Use PkgResources helper to load response templates. | Use PkgResources helper to load response templates.
| Python | bsd-3-clause | TouK/vumi,TouK/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __init__(self, content):
header_match = re.match(self.HEADER_PATTERN, con... | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
from vumi.utils import PkgResources
MXIT_RESOURCES = PkgResources(__name__)
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __... | <commit_before>import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __init__(self, content):
header_match = re.match(self.HEAD... | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
from vumi.utils import PkgResources
MXIT_RESOURCES = PkgResources(__name__)
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __... | import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __init__(self, content):
header_match = re.match(self.HEADER_PATTERN, con... | <commit_before>import re
from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ResponseParser(object):
HEADER_PATTERN = r'^(.*)[\r\n]{1,2}\d?'
ITEM_PATTERN = r'^(\d+)\. (.+)$'
def __init__(self, content):
header_match = re.match(self.HEAD... |
4719401819a877ceebfcc49f1084fb01395a3f4d | nyuki/bus/persistence/mongo_backend.py | nyuki/bus/persistence/mongo_backend.py | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | Add failsafe mongo calls | Add failsafe mongo calls [ci skip]
| Python | apache-2.0 | optiflows/nyuki,gdraynz/nyuki,gdraynz/nyuki,optiflows/nyuki | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | <commit_before>from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collect... | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collection = None
... | <commit_before>from datetime import datetime
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo.errors import AutoReconnect
log = logging.getLogger(__name__)
class MongoBackend(object):
def __init__(self, name):
self.name = name
self.host = None
self._collect... |
eb7201789bc5ce03ca415fc4c208ce5a41bfc249 | sha1.py | sha1.py | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://gist.github.com/techtonik/df09baeacbebc52d234b'
# /-- these ... | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://github.com/techtonik/sha1'
# /-- these fields are required f... | Move from Gist to GitHub | Move from Gist to GitHub | Python | unlicense | techtonik/sha1 | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://gist.github.com/techtonik/df09baeacbebc52d234b'
# /-- these ... | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://github.com/techtonik/sha1'
# /-- these fields are required f... | <commit_before>#!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://gist.github.com/techtonik/df09baeacbebc52d234... | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://github.com/techtonik/sha1'
# /-- these fields are required f... | #!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://gist.github.com/techtonik/df09baeacbebc52d234b'
# /-- these ... | <commit_before>#!/usr/bin/env python
"""
usage: python -m sha1 <filename>
"""
import sys
import hashlib
# --- these fields are required for packaging
__version__ = '1.0'
__author__ = 'anatoly techtonik <techtonik@gmail.com>'
__license__ = 'Public Domain'
__url__ = 'https://gist.github.com/techtonik/df09baeacbebc52d234... |
fbbb01a3ef5811c102be6822a16a881212e421a9 | typo.py | typo.py | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | Use passed url argument in get_best_match | Use passed url argument in get_best_match
| Python | mit | sabf/typo | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | <commit_before>from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['c... | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['config.ini', 'co... | <commit_before>from __future__ import absolute_import
__all__ = ['app']
from ConfigParser import SafeConfigParser as ConfigParser
from urlparse import urlparse, urlunparse
from flask import Flask, request, redirect
from fuzzywuzzy import process
from tldextract import extract
config = ConfigParser()
config.read(['c... |
75e0c323871d6eae6959523b105a06cfe8460a28 | etk2/etk.py | etk2/etk.py | import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path):
res = dict()
with open(file_path) as fp:
line = fp.readline().rstrip('\n')
while line:
res[line] = line
line = fp.readline().rstrip('\n')
... | from typing import List
import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path) -> List[str]:
"""
A glossary is a text file, one entry per line.
Args:
file_path (str): path to a text file containing a glossary.
Returns: L... | Add comments and typing annotations | Add comments and typing annotations
| Python | mit | usc-isi-i2/etk,usc-isi-i2/etk,usc-isi-i2/etk | import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path):
res = dict()
with open(file_path) as fp:
line = fp.readline().rstrip('\n')
while line:
res[line] = line
line = fp.readline().rstrip('\n')
... | from typing import List
import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path) -> List[str]:
"""
A glossary is a text file, one entry per line.
Args:
file_path (str): path to a text file containing a glossary.
Returns: L... | <commit_before>import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path):
res = dict()
with open(file_path) as fp:
line = fp.readline().rstrip('\n')
while line:
res[line] = line
line = fp.readline(... | from typing import List
import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path) -> List[str]:
"""
A glossary is a text file, one entry per line.
Args:
file_path (str): path to a text file containing a glossary.
Returns: L... | import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path):
res = dict()
with open(file_path) as fp:
line = fp.readline().rstrip('\n')
while line:
res[line] = line
line = fp.readline().rstrip('\n')
... | <commit_before>import json
class ETK(object):
def __init__(self):
pass
def get_glossary(self, file_path):
res = dict()
with open(file_path) as fp:
line = fp.readline().rstrip('\n')
while line:
res[line] = line
line = fp.readline(... |
3f1c988830b7b5128c8da141326ecbf7234a791a | kolibri/core/content/utils/content_types_tools.py | kolibri/core/content/utils/content_types_tools.py | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = ContentNod... | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
# Start with an empty Q object, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = Q()
# loop through all the registered content renderer hooks... | Use Q object instead of empty queryset | Use Q object instead of empty queryset
| Python | mit | mrpau/kolibri,lyw07/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri,lyw07/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = ContentNod... | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
# Start with an empty Q object, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = Q()
# loop through all the registered content renderer hooks... | <commit_before>from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filt... | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
# Start with an empty Q object, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = Q()
# loop through all the registered content renderer hooks... | from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = ContentNod... | <commit_before>from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filt... |
756456992247bf8dbb0731556e37ecd0cf32e3ab | scripts/splitfa.py | scripts/splitfa.py | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | Remove gaps from individual genomes | Remove gaps from individual genomes
| Python | mit | kdmurray91/kwip-experiments,kdmurray91/kwip-experiments,kdmurray91/kwip-experiments | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | <commit_before>#!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.... | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | #!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.fasta".format(p... | <commit_before>#!/usr/bin/env python
from __future__ import print_function, absolute_import, division
import screed
import docopt
CLI = """
USAGE:
fasplit <fasta> <prefix>
"""
opts = docopt.docopt(CLI)
prefix = opts['<prefix>']
with screed.open(opts['<fasta>']) as fh:
for record in fh:
fname = "{}{}.... |
e8880d6a4fb96722551bdc50274cdfddc2bd41d2 | corehq/ex-submodules/casexml/apps/case/tests/test_signals.py | corehq/ex-submodules/casexml/apps/case/tests/test_signals.py | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | Refactor test to not use global variable | Refactor test to not use global variable
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | <commit_before>from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfac... | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfaces.processor im... | <commit_before>from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
from corehq.form_processor.interfac... |
081b1cd60e363adf941ba511c7683c0ed2843a97 | gubernator/appengine_config.py | gubernator/appengine_config.py | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Increase Gubernator's url fetch deadline -- 5 seconds is too fast! | Increase Gubernator's url fetch deadline -- 5 seconds is too fast!
This should avoid a lot of refreshes because some directory listing or
download takes slightly too long.
| Python | apache-2.0 | mikedanese/test-infra,gmarek/test-infra,mindprince/test-infra,shashidharatd/test-infra,cblecker/test-infra,rmmh/kubernetes-test-infra,mikedanese/test-infra,jlowdermilk/test-infra,shyamjvs/test-infra,mikedanese/test-infra,girishkalele/test-infra,grodrigues3/test-infra,monopole/test-infra,foxish/test-infra,mikedanese/tes... | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | <commit_before># Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | <commit_before># Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
e8e326fe39623ea04082553d1293b1e79c3611f6 | proto/ho.py | proto/ho.py | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': view.cursor_up,... | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
err = None
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': ... | Add error handling to main game loop | Add error handling to main game loop
| Python | mit | davesque/go.py | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': view.cursor_up,... | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
err = None
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': ... | <commit_before>#!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': ... | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
err = None
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': ... | #!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': view.cursor_up,... | <commit_before>#!/usr/bin/env python
import sys
from board import Board, BoardView
from utils import clear, getch
def main():
board = Board(19, 19)
view = BoardView(board)
def move():
board.move(*view.cursor)
view.redraw()
def exit():
sys.exit(0)
KEYS = {
'w': ... |
bc399ed6902f6ba3d24e1ce1a8ff88a259793c3a | Artifactorial/urls.py | Artifactorial/urls.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | Use the new url pattern | Use the new url pattern
| Python | mit | ivoire/Artifactorial,ivoire/Artifactorial,ivoire/Artifactorial | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | <commit_before># -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ver... | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the L... | <commit_before># -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of Artifactorial.
#
# Artifactorial is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ver... |
ff2d9b276928d2bf06ae81b1fa243ee2816cd694 | seawater/__init__.py | seawater/__init__.py | # -*- coding: utf-8 -*-
__all__ = ["csiro", "extras"]
__authors__ = 'Filipe Fernandes'
__created_ = "14-Jan-2010"
__email__ = "ocefpaf@gmail.com"
__license__ = "MIT"
__maintainer__ = "Filipe Fernandes"
__modified__ = "16-Mar-2013"
__status__ = "Production"
__version__ = "2.0.0"
import csiro
import extras
| # -*- coding: utf-8 -*-
from csiro import *
| Update to reflect some small re-factoring. | Update to reflect some small re-factoring.
| Python | mit | ocefpaf/python-seawater,pyoceans/python-seawater,pyoceans/python-seawater,ocefpaf/python-seawater | # -*- coding: utf-8 -*-
__all__ = ["csiro", "extras"]
__authors__ = 'Filipe Fernandes'
__created_ = "14-Jan-2010"
__email__ = "ocefpaf@gmail.com"
__license__ = "MIT"
__maintainer__ = "Filipe Fernandes"
__modified__ = "16-Mar-2013"
__status__ = "Production"
__version__ = "2.0.0"
import csiro
import extras
Update to re... | # -*- coding: utf-8 -*-
from csiro import *
| <commit_before># -*- coding: utf-8 -*-
__all__ = ["csiro", "extras"]
__authors__ = 'Filipe Fernandes'
__created_ = "14-Jan-2010"
__email__ = "ocefpaf@gmail.com"
__license__ = "MIT"
__maintainer__ = "Filipe Fernandes"
__modified__ = "16-Mar-2013"
__status__ = "Production"
__version__ = "2.0.0"
import csiro
import extr... | # -*- coding: utf-8 -*-
from csiro import *
| # -*- coding: utf-8 -*-
__all__ = ["csiro", "extras"]
__authors__ = 'Filipe Fernandes'
__created_ = "14-Jan-2010"
__email__ = "ocefpaf@gmail.com"
__license__ = "MIT"
__maintainer__ = "Filipe Fernandes"
__modified__ = "16-Mar-2013"
__status__ = "Production"
__version__ = "2.0.0"
import csiro
import extras
Update to re... | <commit_before># -*- coding: utf-8 -*-
__all__ = ["csiro", "extras"]
__authors__ = 'Filipe Fernandes'
__created_ = "14-Jan-2010"
__email__ = "ocefpaf@gmail.com"
__license__ = "MIT"
__maintainer__ = "Filipe Fernandes"
__modified__ = "16-Mar-2013"
__status__ = "Production"
__version__ = "2.0.0"
import csiro
import extr... |
9e8093fe66da557ca9e976e600b8977c002f5241 | blog/testsettings.py | blog/testsettings.py | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | Revert "Fixed up some things." | Revert "Fixed up some things."
This reverts commit 2d3d6c1b569e1f35faf9cd79a369862651c008ff.
| Python | bsd-3-clause | myles-archive/asgard-blog,asgardproject/asgard-blog,asgardproject/asgard-blog,asgardproject/asgard-blog,myles-archive/asgard-blog,myles-archive/asgard-blog | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | <commit_before>DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'dja... | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sit... | <commit_before>DEBUG = True
DEBUG_TEMPLATE = True
SITE_ID = 1
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/asgard-blog-devel.db'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'dja... |
0d135a746dd79ad1b703570e2bb3b27a694c67b0 | simuvex/procedures/stubs/NoReturnUnconstrained.py | simuvex/procedures/stubs/NoReturnUnconstrained.py | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
use_cases = {'exit_group', 'exit', 'abort', 'longjmp', 'pthread_exit', 'siglongjmp'}
... | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
class NoReturnUnconstrained(simuvex.SimProcedure): #pylint:disable=redefined-builtin
... | Move use_cases into the class | Move use_cases into the class
| Python | bsd-2-clause | iamahuman/angr,iamahuman/angr,f-prettyland/angr,chubbymaggie/simuvex,chubbymaggie/angr,schieb/angr,angr/angr,tyb0807/angr,f-prettyland/angr,tyb0807/angr,axt/angr,tyb0807/angr,chubbymaggie/angr,angr/angr,angr/angr,iamahuman/angr,axt/angr,f-prettyland/angr,chubbymaggie/angr,angr/simuvex,chubbymaggie/simuvex,zhuyue1314/si... | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
use_cases = {'exit_group', 'exit', 'abort', 'longjmp', 'pthread_exit', 'siglongjmp'}
... | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
class NoReturnUnconstrained(simuvex.SimProcedure): #pylint:disable=redefined-builtin
... | <commit_before>import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
use_cases = {'exit_group', 'exit', 'abort', 'longjmp', 'pthread_exit', ... | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
class NoReturnUnconstrained(simuvex.SimProcedure): #pylint:disable=redefined-builtin
... | import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
use_cases = {'exit_group', 'exit', 'abort', 'longjmp', 'pthread_exit', 'siglongjmp'}
... | <commit_before>import simuvex
######################################
# NoReturnUnconstrained
# Use in places you would put ReturnUnconstrained as a default action
# But the function shouldn't actually return
######################################
use_cases = {'exit_group', 'exit', 'abort', 'longjmp', 'pthread_exit', ... |
4e5825b732597d7adcfcf8eaea3468c893b86347 | src/akllt/tests.py | src/akllt/tests.py | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(self):
self.client.get('/')
class FoobarTestCase(BrowserTestCase):
... | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
from akllt.models import StandardPage
def import_pages(directory):
pass
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(s... | Create functional test for data import | Create functional test for data import
| Python | agpl-3.0 | python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(self):
self.client.get('/')
class FoobarTestCase(BrowserTestCase):
... | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
from akllt.models import StandardPage
def import_pages(directory):
pass
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(s... | <commit_before># coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(self):
self.client.get('/')
class FoobarTestCase(Brows... | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
from akllt.models import StandardPage
def import_pages(directory):
pass
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(s... | # coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(self):
self.client.get('/')
class FoobarTestCase(BrowserTestCase):
... | <commit_before># coding: utf-8
import pkg_resources
from django.test.testcases import TransactionTestCase
from homophony import BrowserTestCase, Browser
def import_pages(directory):
pass
class SmokeTest(TransactionTestCase):
def test_nothing(self):
self.client.get('/')
class FoobarTestCase(Brows... |
983e4fc9c5fafcfb60996c73571fc9ae9dd6b307 | app/__init__.py | app/__init__.py | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | Fix table names in flask-admin | Fix table names in flask-admin
| Python | mpl-2.0 | teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | <commit_before>from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_conne... | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_connect():
db.co... | <commit_before>from flask import Flask
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
from playhouse.flask_utils import FlaskDB
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def _db_conne... |
d617ce484c1c85032f6c792b7f03d7710df97acf | GoldenDictMedia/2.1/golden_dict_media/__init__.py | GoldenDictMedia/2.1/golden_dict_media/__init__.py | import aqt
from golden_dict_media.AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
| import aqt
from .AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
| Use relative paths in golden_dict_media | Use relative paths in golden_dict_media
| Python | mit | searene/Anki-Addons,searene/Anki-Addons | import aqt
from golden_dict_media.AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
Use relative paths in golden_dict_media | import aqt
from .AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
| <commit_before>import aqt
from golden_dict_media.AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
<commit_msg>Use relative paths in golden_dict_media<commit_after> | import aqt
from .AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
| import aqt
from golden_dict_media.AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
Use relative paths in golden_dict_mediaimport aqt
from .AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
| <commit_before>import aqt
from golden_dict_media.AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
<commit_msg>Use relative paths in golden_dict_media<commit_after>import aqt
from .AddonInitializer import init_addon
if aqt.mw is not None:
init_addon()
|
130dbb5003273e0681b35aa171c8c7e235fbbe59 | src/bibim/lexer.py | src/bibim/lexer.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | Fix issue on multi-line comment | Fix issue on multi-line comment
| Python | mit | bibim-lang/pybibim,rishubil/pybibim,bibim-lang/pybibim | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'N... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'NOT': r'!',
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from rply import LexerGenerator
op_map = {
'NUMBER': r'\d[\d\s]*',
'PLUS': r'\+',
'MINUS': r'-',
'MUL': r'\*',
'NUMBER_SEP': r'/',
'EXPR_OPEN': r'\(',
'EXPR_CLOSE': r'\)',
'AND': r'&',
'OR': r'\|',
'N... |
5e736819e35efaad8568bb0782af3d256d55963d | game/quests/__init__.py | game/quests/__init__.py | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
ret = self.values
self.values = []
return ret
class Q... | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
self.appendEmptyLine()
self.append("objective", self.obj... | Implement getObjective and tooltip objective | game/quests: Implement getObjective and tooltip objective
| Python | cc0-1.0 | jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
ret = self.values
self.values = []
return ret
class Q... | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
self.appendEmptyLine()
self.append("objective", self.obj... | <commit_before># -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
ret = self.values
self.values = []
retu... | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
self.appendEmptyLine()
self.append("objective", self.obj... | # -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
ret = self.values
self.values = []
return ret
class Q... | <commit_before># -*- coding: utf-8 -*-
"""
Quests
- questcache.wdb
"""
from .. import *
class Quest(Model):
def getTooltip(self):
return QuestTooltip(self)
class QuestTooltip(Tooltip):
def tooltip(self):
self.append("name", self.obj.getName(), color=YELLOW)
ret = self.values
self.values = []
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.