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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7b5850d1b89d34ff9a60c3862d18691961c86656 | poisson/tests/test_irf.py | poisson/tests/test_irf.py | #!/usr/bin/env python
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_grid_initialize():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
assert_array_less(model.get_value('land_surfa... | #!/usr/bin/env python
from nose.tools import assert_equal
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_initialize_defaults():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
asser... | Test initialize with filename and file-like. | Test initialize with filename and file-like.
| Python | mit | mperignon/bmi-delta,mperignon/bmi-STM,mperignon/bmi-STM,mperignon/bmi-delta | #!/usr/bin/env python
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_grid_initialize():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
assert_array_less(model.get_value('land_surfa... | #!/usr/bin/env python
from nose.tools import assert_equal
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_initialize_defaults():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
asser... | <commit_before>#!/usr/bin/env python
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_grid_initialize():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
assert_array_less(model.get_va... | #!/usr/bin/env python
from nose.tools import assert_equal
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_initialize_defaults():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
asser... | #!/usr/bin/env python
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_grid_initialize():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
assert_array_less(model.get_value('land_surfa... | <commit_before>#!/usr/bin/env python
from numpy.testing import assert_almost_equal, assert_array_less
import numpy as np
from poisson import BmiPoisson
def test_grid_initialize():
model = BmiPoisson()
model.initialize()
assert_almost_equal(model.get_current_time(), 0.)
assert_array_less(model.get_va... |
fa824cd22d47dd85d7ea067ff9063214e5517f94 | gem/context_processors.py | gem/context_processors.py | from molo.profiles.forms import RegistrationForm
from molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm
def default_forms(request):
return {
'registration_form': RegistrationForm(),
'edit_profile_form': EditProfileForm(),
'password_change_form': ProfilePasswordChangeFor... | from molo.profiles.forms import ProfilePasswordChangeForm
def default_forms(request):
return {
'password_change_form': ProfilePasswordChangeForm()
}
# TODO: remove this context processor
def detect_freebasics(request):
return {
'is_via_freebasics':
'Internet.org' in request.... | Remove unused forms from context processor | Remove unused forms from context processor
These forms are not used by any view or template. On every request
Django is generating the entire HTML form for these 2 forms which
is a whole load of unnecessary CPU.
| Python | bsd-2-clause | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | from molo.profiles.forms import RegistrationForm
from molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm
def default_forms(request):
return {
'registration_form': RegistrationForm(),
'edit_profile_form': EditProfileForm(),
'password_change_form': ProfilePasswordChangeFor... | from molo.profiles.forms import ProfilePasswordChangeForm
def default_forms(request):
return {
'password_change_form': ProfilePasswordChangeForm()
}
# TODO: remove this context processor
def detect_freebasics(request):
return {
'is_via_freebasics':
'Internet.org' in request.... | <commit_before>from molo.profiles.forms import RegistrationForm
from molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm
def default_forms(request):
return {
'registration_form': RegistrationForm(),
'edit_profile_form': EditProfileForm(),
'password_change_form': ProfilePa... | from molo.profiles.forms import ProfilePasswordChangeForm
def default_forms(request):
return {
'password_change_form': ProfilePasswordChangeForm()
}
# TODO: remove this context processor
def detect_freebasics(request):
return {
'is_via_freebasics':
'Internet.org' in request.... | from molo.profiles.forms import RegistrationForm
from molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm
def default_forms(request):
return {
'registration_form': RegistrationForm(),
'edit_profile_form': EditProfileForm(),
'password_change_form': ProfilePasswordChangeFor... | <commit_before>from molo.profiles.forms import RegistrationForm
from molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm
def default_forms(request):
return {
'registration_form': RegistrationForm(),
'edit_profile_form': EditProfileForm(),
'password_change_form': ProfilePa... |
8ebe0966c64f344b79c450782661f4c6cab6a312 | modish/__init__.py | modish/__init__.py | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'
__version__ = '0.1... | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator, ModalityPredictor
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'... | Add modality predictor to output | Add modality predictor to output
| Python | bsd-3-clause | YeoLab/anchor,olgabot/modish,olgabot/anchor | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'
__version__ = '0.1... | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator, ModalityPredictor
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'... | <commit_before># -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'
__v... | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator, ModalityPredictor
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'... | # -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'
__version__ = '0.1... | <commit_before># -*- coding: utf-8 -*-
from .model import ModalityModel
from .estimator import ModalityEstimator
from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\
MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot
__author__ = 'Olga Botvinnik'
__email__ = 'olga.botvinnik@gmail.com'
__v... |
7c68e3b00e7c66c0223617447e16a7159118d284 | goldstone/addons/utils.py | goldstone/addons/utils.py | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | Change update_addon_node() to return the Addon node, whether created or found. | Change update_addon_node() to return the Addon node, whether created or found.
| Python | apache-2.0 | slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | <commit_before>"""Addon utilities."""
# Copyright 2015 Solinea, 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 ... | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | """Addon utilities."""
# Copyright 2015 Solinea, 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 ... | <commit_before>"""Addon utilities."""
# Copyright 2015 Solinea, 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 ... |
9c7d0895dca2909143d633a1e335a811f43481b2 | examples/fabfile.py | examples/fabfile.py | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_arg):
"""Alw... | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just below @task
@task(default=True, alias="success")
@notify
def sweet_task(some_arg, other_arg):
"""Alw... | Update fabric examples to reflect changes. | Update fabric examples to reflect changes.
| Python | bsd-3-clause | DataDog/dogapi,DataDog/dogapi | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_arg):
"""Alw... | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just below @task
@task(default=True, alias="success")
@notify
def sweet_task(some_arg, other_arg):
"""Alw... | <commit_before>"""Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_a... | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just below @task
@task(default=True, alias="success")
@notify
def sweet_task(some_arg, other_arg):
"""Alw... | """Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_arg):
"""Alw... | <commit_before>"""Example of integration between Fabric and Datadog.
"""
from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify
setup(api_key = "YOUR API KEY HERE")
# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_a... |
0fb7e8d901addc801fb9b99d744666f573f672d3 | billjobs/migrations/0003_auto_20160822_2341.py | billjobs/migrations/0003_auto_20160822_2341.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_model('billj... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations, models
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_mode... | Add billing_address and migrate data | Add billing_address and migrate data
| Python | mit | ioO/billjobs | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_model('billj... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations, models
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_mode... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.g... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations, models
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_mode... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.get_model('billj... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 23:41
from __future__ import unicode_literals
from django.db import migrations
def add_billing_address(apps, schema_editor):
''' Data migration add billing_address in Bill from user billing_address
field
'''
Bill = apps.g... |
d9f035b6915a5290b7affe1853937d45214e07bc | dbaas_zabbix/__init__.py | dbaas_zabbix/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
LOG = logging.getLogger(__name__)
def set_integration_logger():
stream = logging.Str... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
stream = logging.StreamHandler(sys.stdout)
stream.setLevel(logging.DEBUG)
log = logging.getLogger('p... | Revert "logs pyzabbix com variavel de ambiente" | Revert "logs pyzabbix com variavel de ambiente"
This reverts commit df796462b07f7470d86f4d0622a414c956a45ced.
| Python | bsd-3-clause | globocom/dbaas-zabbix,globocom/dbaas-zabbix | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
LOG = logging.getLogger(__name__)
def set_integration_logger():
stream = logging.Str... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
stream = logging.StreamHandler(sys.stdout)
stream.setLevel(logging.DEBUG)
log = logging.getLogger('p... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
LOG = logging.getLogger(__name__)
def set_integration_logger():
strea... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
stream = logging.StreamHandler(sys.stdout)
stream.setLevel(logging.DEBUG)
log = logging.getLogger('p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
LOG = logging.getLogger(__name__)
def set_integration_logger():
stream = logging.Str... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
LOG = logging.getLogger(__name__)
def set_integration_logger():
strea... |
bbb4496a99a5c65218b12c56de01c12ab83a1056 | demo/recent_questions.py | demo/recent_questions.py | #!/usr/bin/env python
from __future__ import print_function
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
try:
get_input = raw_input
except NameError:
get_input = input
user_api_key = get_input("Please enter an API key if you have one (Return for none):")
if not user_api_key: us... | #!/usr/bin/env python
from __future__ import print_function
from six.moves import input
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
user_api_key = input("Please enter an API key if you have one (Return for none):")
if not user_api_key: user_api_key = None
import stackexchange, thread
... | Use six function for input() in recent questions demo | Use six function for input() in recent questions demo
| Python | bsd-3-clause | Khilo84/Py-StackExchange,lucjon/Py-StackExchange,damanjitsingh/StackExchange-python- | #!/usr/bin/env python
from __future__ import print_function
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
try:
get_input = raw_input
except NameError:
get_input = input
user_api_key = get_input("Please enter an API key if you have one (Return for none):")
if not user_api_key: us... | #!/usr/bin/env python
from __future__ import print_function
from six.moves import input
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
user_api_key = input("Please enter an API key if you have one (Return for none):")
if not user_api_key: user_api_key = None
import stackexchange, thread
... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
try:
get_input = raw_input
except NameError:
get_input = input
user_api_key = get_input("Please enter an API key if you have one (Return for none):")
if not u... | #!/usr/bin/env python
from __future__ import print_function
from six.moves import input
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
user_api_key = input("Please enter an API key if you have one (Return for none):")
if not user_api_key: user_api_key = None
import stackexchange, thread
... | #!/usr/bin/env python
from __future__ import print_function
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
try:
get_input = raw_input
except NameError:
get_input = input
user_api_key = get_input("Please enter an API key if you have one (Return for none):")
if not user_api_key: us... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
# Same directory hack
import sys
sys.path.append('.')
sys.path.append('..')
try:
get_input = raw_input
except NameError:
get_input = input
user_api_key = get_input("Please enter an API key if you have one (Return for none):")
if not u... |
d358a759d86ce2a377e4fef84f20075bd0481d3b | ditto/flickr/views.py | ditto/flickr/views.py | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.objects.all()
r... | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
paginate_by = 48
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.ob... | Change number of photos per page | Change number of photos per page
| Python | mit | philgyford/django-ditto,philgyford/django-ditto,philgyford/django-ditto | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.objects.all()
r... | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
paginate_by = 48
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.ob... | <commit_before>from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.objects.... | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
paginate_by = 48
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.ob... | from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.objects.all()
r... | <commit_before>from ..ditto.views import PaginatedListView
from .models import Account, Photo, User
class Home(PaginatedListView):
template_name = 'flickr/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['account_list'] = Account.objects.... |
7560bce01be5560395dd2373e979dbee086f3c21 | py2app/converters/nibfile.py | py2app/converters/nibfile.py | """
Automatic compilation of XIB files
"""
import subprocess, os
from py2app.decorators import converts
@converts(suffix=".xib")
def convert_xib(source, destination, dry_run=0):
destination = destination[:-4] + ".nib"
if dry_run:
return
p = subprocess.Popen(['ibtool', '--compile', destination, so... | """
Automatic compilation of XIB files
"""
from __future__ import print_function
import subprocess, os
from py2app.decorators import converts
gTool = None
def _get_ibtool():
global gTool
if gTool is None:
if os.path.exists('/usr/bin/xcrun'):
gTool = subprocess.check_output(['/usr/bin/xcrun'... | Simplify nib compiler and support recent Xcode versions by using xcrun | Simplify nib compiler and support recent Xcode versions by using xcrun
| Python | mit | metachris/py2app,metachris/py2app,metachris/py2app,metachris/py2app | """
Automatic compilation of XIB files
"""
import subprocess, os
from py2app.decorators import converts
@converts(suffix=".xib")
def convert_xib(source, destination, dry_run=0):
destination = destination[:-4] + ".nib"
if dry_run:
return
p = subprocess.Popen(['ibtool', '--compile', destination, so... | """
Automatic compilation of XIB files
"""
from __future__ import print_function
import subprocess, os
from py2app.decorators import converts
gTool = None
def _get_ibtool():
global gTool
if gTool is None:
if os.path.exists('/usr/bin/xcrun'):
gTool = subprocess.check_output(['/usr/bin/xcrun'... | <commit_before>"""
Automatic compilation of XIB files
"""
import subprocess, os
from py2app.decorators import converts
@converts(suffix=".xib")
def convert_xib(source, destination, dry_run=0):
destination = destination[:-4] + ".nib"
if dry_run:
return
p = subprocess.Popen(['ibtool', '--compile', ... | """
Automatic compilation of XIB files
"""
from __future__ import print_function
import subprocess, os
from py2app.decorators import converts
gTool = None
def _get_ibtool():
global gTool
if gTool is None:
if os.path.exists('/usr/bin/xcrun'):
gTool = subprocess.check_output(['/usr/bin/xcrun'... | """
Automatic compilation of XIB files
"""
import subprocess, os
from py2app.decorators import converts
@converts(suffix=".xib")
def convert_xib(source, destination, dry_run=0):
destination = destination[:-4] + ".nib"
if dry_run:
return
p = subprocess.Popen(['ibtool', '--compile', destination, so... | <commit_before>"""
Automatic compilation of XIB files
"""
import subprocess, os
from py2app.decorators import converts
@converts(suffix=".xib")
def convert_xib(source, destination, dry_run=0):
destination = destination[:-4] + ".nib"
if dry_run:
return
p = subprocess.Popen(['ibtool', '--compile', ... |
b6d08abf7bc4aafaeec59944bdcdf8ae4a9352d5 | recipe_scrapers/consts.py | recipe_scrapers/consts.py | import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s{1}(hours|hrs|hr|h))?((?P<minutes>\s*\d+)\s{1}(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
| import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s*(hours|hrs|hr|h))?(\s*(?P<minutes>\d+)\s*(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
| Update time_regex captcher so to work with more sites | Update time_regex captcher so to work with more sites
| Python | mit | hhursev/recipe-scraper | import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s{1}(hours|hrs|hr|h))?((?P<minutes>\s*\d+)\s{1}(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
Update time_regex captcher so to work with more sites | import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s*(hours|hrs|hr|h))?(\s*(?P<minutes>\d+)\s*(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
| <commit_before>import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s{1}(hours|hrs|hr|h))?((?P<minutes>\s*\d+)\s{1}(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
<commit_msg>Update time_regex captcher so to work with more sites<commit_after> | import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s*(hours|hrs|hr|h))?(\s*(?P<minutes>\d+)\s*(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
| import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s{1}(hours|hrs|hr|h))?((?P<minutes>\s*\d+)\s{1}(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
Update time_regex captcher so to work with more sitesimport re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s*(hours|hrs|hr|h))?(\s*(?P<mi... | <commit_before>import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<hours>\d+)\s{1}(hours|hrs|hr|h))?((?P<minutes>\s*\d+)\s{1}(minutes|mins|min|m))?\Z'
)
HTML_SYMBOLS = '\xa0' #
<commit_msg>Update time_regex captcher so to work with more sites<commit_after>import re
TIME_REGEX = re.compile(
r'\A(\s*(?P<... |
c0de2a081cfe9af7f6b9d39daae557d45f5d69ee | middleware/module_yaml.py | middleware/module_yaml.py | from __future__ import unicode_literals
import os
import yaml
def main(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
| from __future__ import unicode_literals
import os
import yaml
import requests
def local(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
def remote(app, data):
r = requests.get(data.get('url'))
... | Allow remote and local files. | Allow remote and local files.
| Python | mit | myles/me-api,myles/me-api | from __future__ import unicode_literals
import os
import yaml
def main(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
Allow remote and local files. | from __future__ import unicode_literals
import os
import yaml
import requests
def local(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
def remote(app, data):
r = requests.get(data.get('url'))
... | <commit_before>from __future__ import unicode_literals
import os
import yaml
def main(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
<commit_msg>Allow remote and local files.<commit_after> | from __future__ import unicode_literals
import os
import yaml
import requests
def local(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
def remote(app, data):
r = requests.get(data.get('url'))
... | from __future__ import unicode_literals
import os
import yaml
def main(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
Allow remote and local files.from __future__ import unicode_literals
import os
... | <commit_before>from __future__ import unicode_literals
import os
import yaml
def main(app, data):
filepath = os.path.join(app.data_dir, data.get('filename'))
with open(filepath, 'r') as f:
contents = yaml.load(f)
return contents
<commit_msg>Allow remote and local files.<commit_after>from __fut... |
cb0baa6abcb358c4f44135b3f17d02af2d1d4d06 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create documentation of DataSource Settings | 8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
3a924ebac8ecd1c8ff1dcbf60b9e5ea45fa58554 | src/database/__init__.py | src/database/__init__.py | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
# The global database session.
session = None
def init_session(connection_string=None, drop=False):
"""Initialize the database session and create the schema if it
does not exis... | Add documentation on the database session stuff. | Add documentation on the database session stuff.
| Python | bsd-3-clause | eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
# The global database session.
session = None
def init_session(connection_string=None, drop=False):
"""Initialize the database session and create the schema if it
does not exis... | <commit_before>from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
# The global database session.
session = None
def init_session(connection_string=None, drop=False):
"""Initialize the database session and create the schema if it
does not exis... | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
echo... | <commit_before>from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import StaticPool
session = None
def init_session(connection_string=None, drop=False):
if connection_string is None:
engine = create_engine('sqlite://',
... |
4f0fbe048967cab5eb13850cd5ae1e97560a7b27 | version.py | version.py | major = 0
minor=0
patch=8
branch="master"
timestamp=1376412892.53 | major = 0
minor=0
patch=9
branch="master"
timestamp=1376413554.96 | Tag commit for v0.0.9-master generated by gitmake.py | Tag commit for v0.0.9-master generated by gitmake.py
| Python | mit | ryansturmer/gitmake | major = 0
minor=0
patch=8
branch="master"
timestamp=1376412892.53Tag commit for v0.0.9-master generated by gitmake.py | major = 0
minor=0
patch=9
branch="master"
timestamp=1376413554.96 | <commit_before>major = 0
minor=0
patch=8
branch="master"
timestamp=1376412892.53<commit_msg>Tag commit for v0.0.9-master generated by gitmake.py<commit_after> | major = 0
minor=0
patch=9
branch="master"
timestamp=1376413554.96 | major = 0
minor=0
patch=8
branch="master"
timestamp=1376412892.53Tag commit for v0.0.9-master generated by gitmake.pymajor = 0
minor=0
patch=9
branch="master"
timestamp=1376413554.96 | <commit_before>major = 0
minor=0
patch=8
branch="master"
timestamp=1376412892.53<commit_msg>Tag commit for v0.0.9-master generated by gitmake.py<commit_after>major = 0
minor=0
patch=9
branch="master"
timestamp=1376413554.96 |
2c8351ff8691eb9ad3009d316d932528d6f5c57d | runtests.py | runtests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | Add more verbosity on test running | :lipstick: Add more verbosity on test running
| Python | mit | kmike/django-widget-tweaks,daniboy/django-widget-tweaks | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
opts['DATAB... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {'INSTALLED_APPS': ['widget_tweaks']}
if django.VERSION[:2] < (1, 5):
... |
4359a9947c1d86d9e4003c1e8fc358e9a66c6b1d | DisplayAdapter/display_adapter/scripts/init_db.py | DisplayAdapter/display_adapter/scripts/init_db.py | __author__ = 'richard'
| """
Script that is run from the command line in order to
"""
import sys
import sqlite3
from display_adapter import db_name
help_message = """
This initialises an sqlite3 db for the purposes of the DisplayAdapter programs.
Arguments: init_db.py database_name
"""
runs_table = """
CREATE TABLE runs (
id INTEGER NOT... | Create internal db initialisation script | Create internal db initialisation script
Paired by Michael and Richard
| Python | mit | CO600GOL/Game_of_life,CO600GOL/Game_of_life,CO600GOL/Game_of_life | __author__ = 'richard'
Create internal db initialisation script
Paired by Michael and Richard | """
Script that is run from the command line in order to
"""
import sys
import sqlite3
from display_adapter import db_name
help_message = """
This initialises an sqlite3 db for the purposes of the DisplayAdapter programs.
Arguments: init_db.py database_name
"""
runs_table = """
CREATE TABLE runs (
id INTEGER NOT... | <commit_before>__author__ = 'richard'
<commit_msg>Create internal db initialisation script
Paired by Michael and Richard<commit_after> | """
Script that is run from the command line in order to
"""
import sys
import sqlite3
from display_adapter import db_name
help_message = """
This initialises an sqlite3 db for the purposes of the DisplayAdapter programs.
Arguments: init_db.py database_name
"""
runs_table = """
CREATE TABLE runs (
id INTEGER NOT... | __author__ = 'richard'
Create internal db initialisation script
Paired by Michael and Richard"""
Script that is run from the command line in order to
"""
import sys
import sqlite3
from display_adapter import db_name
help_message = """
This initialises an sqlite3 db for the purposes of the DisplayAdapter programs.
Ar... | <commit_before>__author__ = 'richard'
<commit_msg>Create internal db initialisation script
Paired by Michael and Richard<commit_after>"""
Script that is run from the command line in order to
"""
import sys
import sqlite3
from display_adapter import db_name
help_message = """
This initialises an sqlite3 db for the pur... |
4e9dfbaff5a91af75e3b18e6b4e06379747c6083 | research_pyutils/__init__.py | research_pyutils/__init__.py | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | Add in the init the newly introduced function | Add in the init the newly introduced function
| Python | apache-2.0 | grigorisg9gr/pyutils,grigorisg9gr/pyutils | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | <commit_before># expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modificat... | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | # expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modification)
try:
... | <commit_before># expose the most frequently used functions in the top level.
from .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,
copy_contents_of_folder, count_files,
copy_the_previous_if_missing,
folders_last_modificat... |
ba4f692e00d87afdd65d3a1b88046089b709eaab | organizer/views.py | organizer/views.py | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | Tag Detail: get Tag from database. | Ch05: Tag Detail: get Tag from database.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | <commit_before>from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = te... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | <commit_before>from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = te... |
147a3d1c690b7e1c80fafd6eb4c834585e733564 | ibmcnx/test/loadFunction.py | ibmcnx/test/loadFunction.py |
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
|
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
exec open("filesAdmin.py").read()
| Customize scripts to work with menu | Customize scripts to work with menu
| Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 |
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
Customize scripts to work with menu |
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
exec open("filesAdmin.py").read()
| <commit_before>
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
<commit_msg>Customize scripts to work with menu<commit_after> |
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
exec open("filesAdmin.py").read()
|
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
Customize scripts to work with menu
import sys
from java.lang import String
from java.util import Hash... | <commit_before>
import sys
from java.lang import String
from java.util import HashSet
from java.util import HashMap
import java
globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
<commit_msg>Customize scripts to work with menu<commit_after>
import sys
from java.lang... |
76c87d06efaac19350d870cd1c95229ed0a66c29 | editdistance/__init__.py | editdistance/__init__.py | from .bycython import eval
__all__ = ('eval',)
| from .bycython import eval
def distance(*args, **kwargs):
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
| Add alias method named "distance" | Add alias method named "distance"
| Python | mit | aflc/editdistance,aflc/editdistance,aflc/editdistance | from .bycython import eval
__all__ = ('eval',)
Add alias method named "distance" | from .bycython import eval
def distance(*args, **kwargs):
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
| <commit_before>from .bycython import eval
__all__ = ('eval',)
<commit_msg>Add alias method named "distance"<commit_after> | from .bycython import eval
def distance(*args, **kwargs):
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
| from .bycython import eval
__all__ = ('eval',)
Add alias method named "distance"from .bycython import eval
def distance(*args, **kwargs):
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
| <commit_before>from .bycython import eval
__all__ = ('eval',)
<commit_msg>Add alias method named "distance"<commit_after>from .bycython import eval
def distance(*args, **kwargs):
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
|
bea98b8228131d4228ba364c18ec89f4188c8a18 | rdtools/__init__.py | rdtools/__init__.py | from energy_normalization import normalize_with_sapm
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| from energy_normalization import normalize_with_sapm
from degradation import rd_with_ols
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| Add degradation module to init. | Add degradation module to init.
| Python | mit | kwhanalytics/rdtools,kwhanalytics/rdtools | from energy_normalization import normalize_with_sapm
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
Add degradation module to init. | from energy_normalization import normalize_with_sapm
from degradation import rd_with_ols
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| <commit_before>from energy_normalization import normalize_with_sapm
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
<commit_msg>Add degradation module to init.<commit_after> | from energy_normalization import normalize_with_sapm
from degradation import rd_with_ols
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| from energy_normalization import normalize_with_sapm
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
Add degradation module to init.from energy_normalization import normalize_with_sapm
from degradation import rd_with_ols
from ._version import get_versions
__version__ = get_... | <commit_before>from energy_normalization import normalize_with_sapm
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
<commit_msg>Add degradation module to init.<commit_after>from energy_normalization import normalize_with_sapm
from degradation import rd_with_ols
from ._versi... |
60c718564b8941d0d6fa684ee175f6bfe7c937cc | templates/test_scraper.py | templates/test_scraper.py | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | Change test template assertion order to be consistent | Change test template assertion order to be consistent
| Python | mit | hhursev/recipe-scraper | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | <commit_before>from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self... | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self.harvester_clas... | <commit_before>from tests import ScraperTest
from recipe_scrapers.template import Template
class TestTemplateScraper(ScraperTest):
scraper_class = Template
def test_host(self):
self.assertEqual("example.com", self.harvester_class.host())
def test_author(self):
self.assertEqual("", self... |
aff77b144c1a1895c9e8c0ca2d4e79451525901c | terminus/models/trunk.py | terminus/models/trunk.py | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | Make Trunks have opposite directions in the included lanes | Make Trunks have opposite directions in the included lanes
| Python | apache-2.0 | ekumenlabs/terminus,ekumenlabs/terminus | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | <commit_before>"""
Copyright (C) 2017 Open Source Robotics Foundation
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 l... | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | """
Copyright (C) 2017 Open Source Robotics Foundation
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... | <commit_before>"""
Copyright (C) 2017 Open Source Robotics Foundation
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 l... |
72a248416971a5765f908bfb26b28ea546d8d9bb | myuw_mobile/dao/canvas.py | myuw_mobile/dao/canvas.py | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | Switch to courses instead of enrollments - MUWM-457 | Switch to courses instead of enrollments - MUWM-457
| Python | apache-2.0 | fanglinfang/myuw,uw-it-aca/myuw,fanglinfang/myuw,uw-it-aca/myuw,uw-it-aca/myuw,fanglinfang/myuw,uw-it-aca/myuw | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | <commit_before>from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calen... | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calendar information... | <commit_before>from restclients.canvas import Canvas
from myuw_mobile.dao.pws import Person
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logback import log_resp_time, log_exception
import logging
import traceback
class Enrollments:
def get_enrollments(self):
"""
Returns calen... |
e8940b632737f75897c0ea7c108563a63f1a5dde | transducer/test/test_functional.py | transducer/test/test_functional.py | import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so...
self... | import unittest
from transducer.functional import compose, true, identity, false
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions complet... | Improve test coverage of functional.py. | Improve test coverage of functional.py.
| Python | mit | sixty-north/python-transducers | import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so...
self... | import unittest
from transducer.functional import compose, true, identity, false
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions complet... | <commit_before>import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so.... | import unittest
from transducer.functional import compose, true, identity, false
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions complet... | import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so...
self... | <commit_before>import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so.... |
3cf11b24cb09c1929d574f0488fac01d1032c205 | lib/python2.6/aquilon/client/depends.py | lib/python2.6/aquilon/client/depends.py | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | Make the aq client work on Solaris/x86 | Make the aq client work on Solaris/x86
The ctypes module cannot be built with the Sun C compiler, therefore it
is missing from the default Python build on Solaris.
Change-Id: I4b81adc051ea38bf9bde126f71a09d4e78c1b9b3
Addresses-Issue: Jira/AQUILON-994
Reviewed-By: Nathan Dimmock <790b96b72b5ebbbfb73a2caa0f14d8894a9e0f... | Python | apache-2.0 | guillaume-philippon/aquilon,quattor/aquilon,quattor/aquilon,quattor/aquilon,guillaume-philippon/aquilon,guillaume-philippon/aquilon,stdweird/aquilon,stdweird/aquilon,stdweird/aquilon | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | <commit_before># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | <commit_before># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... |
2408c5260106e050557b4898d5826932eb758142 | normandy/selfrepair/views.py | normandy/selfrepair/views.py | from django.shortcuts import render
from normandy.base.decorators import api_cache_control
@api_cache_control()
def repair(request, locale):
return render(request, "selfrepair/repair.html")
| from django.shortcuts import render
from django.views.decorators.cache import cache_control
ONE_WEEK_IN_SECONDS = 60 * 60 * 24 * 7
@cache_control(public=True, max_age=ONE_WEEK_IN_SECONDS)
def repair(request, locale):
return render(request, "selfrepair/repair.html")
| Increase cache on deprecated self-repair to one week | Increase cache on deprecated self-repair to one week
This view serves a message that the system is no longer active. We keep
it around because it is still gets about 40 million hits per day,
primarily from Firefox ESR 52, which never got the Normandy client.
Notably, when we dropped support for Windows XP from Firefox... | Python | mpl-2.0 | mozilla/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy | from django.shortcuts import render
from normandy.base.decorators import api_cache_control
@api_cache_control()
def repair(request, locale):
return render(request, "selfrepair/repair.html")
Increase cache on deprecated self-repair to one week
This view serves a message that the system is no longer active. We ke... | from django.shortcuts import render
from django.views.decorators.cache import cache_control
ONE_WEEK_IN_SECONDS = 60 * 60 * 24 * 7
@cache_control(public=True, max_age=ONE_WEEK_IN_SECONDS)
def repair(request, locale):
return render(request, "selfrepair/repair.html")
| <commit_before>from django.shortcuts import render
from normandy.base.decorators import api_cache_control
@api_cache_control()
def repair(request, locale):
return render(request, "selfrepair/repair.html")
<commit_msg>Increase cache on deprecated self-repair to one week
This view serves a message that the system... | from django.shortcuts import render
from django.views.decorators.cache import cache_control
ONE_WEEK_IN_SECONDS = 60 * 60 * 24 * 7
@cache_control(public=True, max_age=ONE_WEEK_IN_SECONDS)
def repair(request, locale):
return render(request, "selfrepair/repair.html")
| from django.shortcuts import render
from normandy.base.decorators import api_cache_control
@api_cache_control()
def repair(request, locale):
return render(request, "selfrepair/repair.html")
Increase cache on deprecated self-repair to one week
This view serves a message that the system is no longer active. We ke... | <commit_before>from django.shortcuts import render
from normandy.base.decorators import api_cache_control
@api_cache_control()
def repair(request, locale):
return render(request, "selfrepair/repair.html")
<commit_msg>Increase cache on deprecated self-repair to one week
This view serves a message that the system... |
dd260182bd8157fd6ac2a266b3ae5cf168400266 | tests/custom_keywords.py | tests/custom_keywords.py | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
for fname in os.listdir(maildir):
os.remove(os.path.join(maildir, fname))
def inbox_should_contain_num_m... | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
if not os.path.isdir(maildir):
return
for fname in os.listdir(maildir):
os.remove(os.path.join... | Make Clear Inbox keyword more robust. | Make Clear Inbox keyword more robust.
| Python | bsd-3-clause | andialbrecht/sentry-comments,andialbrecht/sentry-comments | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
for fname in os.listdir(maildir):
os.remove(os.path.join(maildir, fname))
def inbox_should_contain_num_m... | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
if not os.path.isdir(maildir):
return
for fname in os.listdir(maildir):
os.remove(os.path.join... | <commit_before>import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
for fname in os.listdir(maildir):
os.remove(os.path.join(maildir, fname))
def inbox_shoul... | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
if not os.path.isdir(maildir):
return
for fname in os.listdir(maildir):
os.remove(os.path.join... | import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
for fname in os.listdir(maildir):
os.remove(os.path.join(maildir, fname))
def inbox_should_contain_num_m... | <commit_before>import os
from raven import Client
def generate_event(msg, dsn):
client = Client(dsn)
client.captureMessage(msg)
def clear_inbox(maildir):
print('Clearing inbox at {}'.format(maildir))
for fname in os.listdir(maildir):
os.remove(os.path.join(maildir, fname))
def inbox_shoul... |
114f40dd282d1837db42ffb6625760d1483d3192 | jfu/templatetags/jfutags.py | jfu/templatetags/jfutags.py | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | Allow args and kwargs to upload_handler_name | Allow args and kwargs to upload_handler_name
Now can use args and kwargs for reverse url. Example in template:
{% jfu 'core/core_fileuploader.html' 'core_upload' object_id=1 content_type_str='app.model' %} | Python | bsd-3-clause | Alem/django-jfu,dzhuang/django-jfu,Alem/django-jfu,dzhuang/django-jfu,Alem/django-jfu,dzhuang/django-jfu,dzhuang/django-jfu,Alem/django-jfu | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | <commit_before>from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload... | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name =... | <commit_before>from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload... |
9f3289f45c727835c8f52b0c2489b06da2f03c25 | pyglab/__init__.py | pyglab/__init__.py | __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .apirequest import ApiRequest, RequestType
| __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .exceptions import RequestError
from .apirequest import ApiRequest, RequestType
| Make RequestError available in package root. | Make RequestError available in package root.
| Python | mit | sloede/pyglab,sloede/pyglab | __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .apirequest import ApiRequest, RequestType
Make RequestError available in package root. | __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .exceptions import RequestError
from .apirequest import ApiRequest, RequestType
| <commit_before>__title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .apirequest import ApiRequest, RequestType
<commit_msg>Make RequestError available in package root.<commit_after> | __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .exceptions import RequestError
from .apirequest import ApiRequest, RequestType
| __title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .apirequest import ApiRequest, RequestType
Make RequestError available in package root.__title__ = 'pyglab'
__version__ = '0.0dev'
__auth... | <commit_before>__title__ = 'pyglab'
__version__ = '0.0dev'
__author__ = 'Michael Schlottke'
__license__ = 'MIT License'
__copyright__ = '(c) 2014 Michael Schlottke'
from .pyglab import Pyglab
from .apirequest import ApiRequest, RequestType
<commit_msg>Make RequestError available in package root.<commit_after>__title__... |
cd2bc29837d31d8999d9f72f7ddaecddb56e26a5 | tests/unit/test_views.py | tests/unit/test_views.py | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | Use startswith instead of exact string match | Use startswith instead of exact string match
| Python | mit | agarone-mm/scholastic-demo,totem/totem-demo,risingspiral/appnexus-demo | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | <commit_before>from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'applica... | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'application/json')
... | <commit_before>from flask import json
from nose.tools import eq_
from server import app
client = app.test_client()
def test_hello_world():
# When: I access root path
resp = client.get('/')
# Then: Expected response is returned
eq_(resp.status_code, 200)
eq_(resp.headers['Content-Type'], 'applica... |
0876264d9f344dae2006841913f6b2308129f8c1 | fabfile.py | fabfile.py |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
log = logging.getLogger('deploy')
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCES... |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
logging.basicConfig(level=logging.INFO)
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET... | Change to use logging and set log level to INFO | Change to use logging and set log level to INFO
| Python | mit | vintasoftware/cdrf.co,vintasoftware/cdrf.co,aericson/cdrf.co,aericson/cdrf.co,vintasoftware/cdrf.co,aericson/cdrf.co |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
log = logging.getLogger('deploy')
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCES... |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
logging.basicConfig(level=logging.INFO)
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET... | <commit_before>
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
log = logging.getLogger('deploy')
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('A... |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
logging.basicConfig(level=logging.INFO)
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET... |
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
log = logging.getLogger('deploy')
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCES... | <commit_before>
import os
import logging
from decouple import config
FOLDER = 'public'
FOLDER = FOLDER.strip('/')
log = logging.getLogger('deploy')
def deploy():
import boto
from boto.s3.connection import S3Connection
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('A... |
a59a856a52a175ae3cbe79fcd6ea49d481aaacf3 | fabfile.py | fabfile.py | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | Break celeryd restart into distict 'stop' and 'start' commands on deploy | Break celeryd restart into distict 'stop' and 'start' commands on deploy
| Python | bsd-3-clause | FreeMusicNinja/api.freemusic.ninja | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | <commit_before>from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
... | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | <commit_before>from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
... |
b30d4301d58766471f435536cf804f7a63448ac5 | qotr/tests/test_server.py | qotr/tests/test_server.py | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
def te... | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
# def t... | Disable testing for index.html, needs ember build | Disable testing for index.html, needs ember build
Signed-off-by: Rohan Jain <f3a935f2cb7c3d75d1446a19169b923809d6e623@gmail.com>
| Python | agpl-3.0 | rmoorman/qotr,rmoorman/qotr,sbuss/qotr,rmoorman/qotr,crodjer/qotr,sbuss/qotr,crodjer/qotr,sbuss/qotr,curtiszimmerman/qotr,curtiszimmerman/qotr,rmoorman/qotr,crodjer/qotr,curtiszimmerman/qotr,curtiszimmerman/qotr,sbuss/qotr,crodjer/qotr | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
def te... | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
# def t... | <commit_before>from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application... | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
# def t... | from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application()
def te... | <commit_before>from tornado import testing
from qotr.server import make_application
from qotr.config import config
class TestChannelHandler(testing.AsyncHTTPTestCase):
'''
Test the channel creation handler.
'''
port = None
application = None
def get_app(self):
return make_application... |
cda81a4585d2b2be868e784566f3c804feb1e9bf | analyze.py | analyze.py | import sys
import re
def main(argv):
# Message to perform sentiment analysis on
message = argv[0] if len(argv) > 0 else ""
if message == "":
print("Usage: python analyze.py [message]")
sys.exit(1)
# Load the positive and negative words
words = {}
with open("words/positive.txt"... | import sys
import re
def main(argv):
# Load the positive and negative words
words = {}
with open("words/positive.txt") as file:
for line in file:
words[line.rstrip()] = 1
with open("words/negative.txt") as file:
for line in file:
words[line.rstrip()] = -1
#... | Read from standard input and perform on each line | Read from standard input and perform on each line
The analyze script can now be run with, for example
- echo "Message" | python analyze.py
- cat | python analyze.py (enter messages and end with Ctrl-D)
- python analyze.py < filename
- MapReduce (at some point)
| Python | mit | timvandermeij/sentiment-analysis,timvandermeij/sentiment-analysis | import sys
import re
def main(argv):
# Message to perform sentiment analysis on
message = argv[0] if len(argv) > 0 else ""
if message == "":
print("Usage: python analyze.py [message]")
sys.exit(1)
# Load the positive and negative words
words = {}
with open("words/positive.txt"... | import sys
import re
def main(argv):
# Load the positive and negative words
words = {}
with open("words/positive.txt") as file:
for line in file:
words[line.rstrip()] = 1
with open("words/negative.txt") as file:
for line in file:
words[line.rstrip()] = -1
#... | <commit_before>import sys
import re
def main(argv):
# Message to perform sentiment analysis on
message = argv[0] if len(argv) > 0 else ""
if message == "":
print("Usage: python analyze.py [message]")
sys.exit(1)
# Load the positive and negative words
words = {}
with open("word... | import sys
import re
def main(argv):
# Load the positive and negative words
words = {}
with open("words/positive.txt") as file:
for line in file:
words[line.rstrip()] = 1
with open("words/negative.txt") as file:
for line in file:
words[line.rstrip()] = -1
#... | import sys
import re
def main(argv):
# Message to perform sentiment analysis on
message = argv[0] if len(argv) > 0 else ""
if message == "":
print("Usage: python analyze.py [message]")
sys.exit(1)
# Load the positive and negative words
words = {}
with open("words/positive.txt"... | <commit_before>import sys
import re
def main(argv):
# Message to perform sentiment analysis on
message = argv[0] if len(argv) > 0 else ""
if message == "":
print("Usage: python analyze.py [message]")
sys.exit(1)
# Load the positive and negative words
words = {}
with open("word... |
da72373b572d3ce76ccc82b9f4ada7a122e76eb2 | __init__.py | __init__.py | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | Fix the version string generation when not a final or RC release. | Fix the version string generation when not a final or RC release.
| Python | mit | chipx86/reviewboard,sgallagher/reviewboard,chazy/reviewboard,davidt/reviewboard,custode/reviewboard,beol/reviewboard,atagar/ReviewBoard,Khan/reviewboard,1tush/reviewboard,reviewboard/reviewboard,custode/reviewboard,davidt/reviewboard,reviewboard/reviewboard,Khan/reviewboard,chazy/reviewboard,Khan/reviewboard,chazy/revi... | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | <commit_before># The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERS... | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | # The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
if ... | <commit_before># The version of Review Board.
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (1, 0, 1, 'alpha', 1, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERS... |
ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | server/canonicalization/relationship_mapper.py | server/canonicalization/relationship_mapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
def canonicalize_relationship(text):
words... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
import repoze.lru
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
@repoze.lru.lru_cache(4096)
... | Add LRU for relationship mapper. | [master] Add LRU for relationship mapper.
| Python | mit | hotpxl/canonicalization-server,hotpxl/canonicalization-server | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
def canonicalize_relationship(text):
words... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
import repoze.lru
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
@repoze.lru.lru_cache(4096)
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
def canonicalize_relationship(t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
import repoze.lru
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
@repoze.lru.lru_cache(4096)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
def canonicalize_relationship(text):
words... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains functions to canonicalize relationships."""
from __future__ import absolute_import
from __future__ import print_function
from nltk.corpus import wordnet
from .utils import wordnet_helper
from .utils import common
def canonicalize_relationship(t... |
452924faafcfb4dcb1eb960ea30ab000f1f93962 | migrations/versions/0245_archived_flag_jobs.py | migrations/versions/0245_archived_flag_jobs.py | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | Update jobs archived flag before setting the default value | Update jobs archived flag before setting the default value
Running an update before setting the column default value reduces
the time the table is locked (since most rows don't have a NULL
value anymore), but the migration takes slightly longer to run
overall.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | <commit_before>"""
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Ale... | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | """
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Alembic - please a... | <commit_before>"""
Revision ID: 0245_archived_flag_jobs
Revises: 0244_another_letter_org
Create Date: 2018-11-22 16:32:01.105803
"""
from alembic import op
import sqlalchemy as sa
revision = '0245_archived_flag_jobs'
down_revision = '0244_another_letter_org'
def upgrade():
# ### commands auto generated by Ale... |
4da19da48cb9c78e1ec327a2cc886a03ca60d67c | rtropo/outgoing.py | rtropo/outgoing.py | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
super(TropoBackend, self).configure(**kwargs)
... | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
def start(self):
"""Override Bac... | Fix indentation; override old-style start() from BackendBase | Fix indentation; override old-style start() from BackendBase
| Python | bsd-3-clause | caktus/rapidsms-tropo,dimagi/rapidsms-tropo | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
super(TropoBackend, self).configure(**kwargs)
... | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
def start(self):
"""Override Bac... | <commit_before>from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
super(TropoBackend, self).confi... | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
def start(self):
"""Override Bac... | from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
super(TropoBackend, self).configure(**kwargs)
... | <commit_before>from urllib import urlencode
from urllib2 import urlopen
from rapidsms.backends.base import BackendBase
class TropoBackend(BackendBase):
"""A RapidSMS threadless backend for Tropo"""
def configure(self, config=None, **kwargs):
self.config = config
super(TropoBackend, self).confi... |
e3a530d741529a7bbfeb274c232e2c6b8a5faddc | kokki/cookbooks/postgresql9/recipes/default.py | kokki/cookbooks/postgresql9/recipes/default.py | import os
from kokki import Execute, Package
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = None
if env.system.platform == "ubuntu":
Package("python-software-properties")
Execute("add-apt-re... | import os
from kokki import Execute, Package
if not (env.system.platform == "ubuntu" and env.system.lsb['release'] in ["11.10"]):
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = N... | Use standard repo for postgresql9 in ubuntu 11.10 | Use standard repo for postgresql9 in ubuntu 11.10
| Python | bsd-3-clause | samuel/kokki | import os
from kokki import Execute, Package
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = None
if env.system.platform == "ubuntu":
Package("python-software-properties")
Execute("add-apt-re... | import os
from kokki import Execute, Package
if not (env.system.platform == "ubuntu" and env.system.lsb['release'] in ["11.10"]):
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = N... | <commit_before>import os
from kokki import Execute, Package
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = None
if env.system.platform == "ubuntu":
Package("python-software-properties")
Exec... | import os
from kokki import Execute, Package
if not (env.system.platform == "ubuntu" and env.system.lsb['release'] in ["11.10"]):
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = N... | import os
from kokki import Execute, Package
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = None
if env.system.platform == "ubuntu":
Package("python-software-properties")
Execute("add-apt-re... | <commit_before>import os
from kokki import Execute, Package
apt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'
Execute("apt-update-postgresql9",
command = "apt-get update",
action = "nothing")
apt = None
if env.system.platform == "ubuntu":
Package("python-software-properties")
Exec... |
8e47696a805cce70989a79cc6e8324aaec870f6d | electionleaflets/apps/people/devs_dc_helpers.py | electionleaflets/apps/people/devs_dc_helpers.py | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
def make_request(self, endpoint, **params):
default_params = {
"auth_... | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
self.ballot_cache = {}
def make_request(self, endpoint, **params):
defaul... | Add a cached ballot fetcher to the DevsDC helper | Add a cached ballot fetcher to the DevsDC helper
If we happen to run out of RAM in Lambda (we won't), Lambda will just
kill the function and invoke a new one next time.
| Python | mit | DemocracyClub/electionleaflets,DemocracyClub/electionleaflets,DemocracyClub/electionleaflets | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
def make_request(self, endpoint, **params):
default_params = {
"auth_... | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
self.ballot_cache = {}
def make_request(self, endpoint, **params):
defaul... | <commit_before>import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
def make_request(self, endpoint, **params):
default_params = {
... | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
self.ballot_cache = {}
def make_request(self, endpoint, **params):
defaul... | import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
def make_request(self, endpoint, **params):
default_params = {
"auth_... | <commit_before>import requests
from django.conf import settings
class DevsDCAPIHelper:
def __init__(self):
self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN
self.base_url = "https://developers.democracyclub.org.uk/api/v1"
def make_request(self, endpoint, **params):
default_params = {
... |
00c808efd2ab38bcf9d808dcb784c9360a19937f | api/radar_api/views/organisation_consultants.py | api/radar_api/views/organisation_consultants.py | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
class OrganisationConsultantListView(ListCreateModelView):
serializer_class = OrganisationCon... | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
from radar.permissions import AdminPermission
class OrganisationConsultantListView(ListCreateMode... | Add permissions to organisation consultants endpoint | Add permissions to organisation consultants endpoint
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
class OrganisationConsultantListView(ListCreateModelView):
serializer_class = OrganisationCon... | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
from radar.permissions import AdminPermission
class OrganisationConsultantListView(ListCreateMode... | <commit_before>from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
class OrganisationConsultantListView(ListCreateModelView):
serializer_class = ... | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
from radar.permissions import AdminPermission
class OrganisationConsultantListView(ListCreateMode... | from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
class OrganisationConsultantListView(ListCreateModelView):
serializer_class = OrganisationCon... | <commit_before>from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer
from radar.models import OrganisationConsultant
from radar.views.core import RetrieveUpdateDestroyModelView, ListCreateModelView
class OrganisationConsultantListView(ListCreateModelView):
serializer_class = ... |
c977e1c235ccb040f28bc03c63d2667924d5edd3 | pythonforandroid/recipes/xeddsa/__init__.py | pythonforandroid/recipes/xeddsa/__init__.py | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | Fix xeddsa crypto_sign shared lib copy | Fix xeddsa crypto_sign shared lib copy
Could be `_crypto_sign.cpython-37m-x86_64-linux-gnu.so` or simply `_crypto_sign.so` depending on the platform/distribution | Python | mit | germn/python-for-android,rnixx/python-for-android,rnixx/python-for-android,germn/python-for-android,rnixx/python-for-android,kivy/python-for-android,PKRoma/python-for-android,germn/python-for-android,germn/python-for-android,kronenpj/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kivy/python-for... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | <commit_before>from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz'
dep... | <commit_before>from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.... |
6deab74e41cabcb9a3fb4075f270a9cdd591a435 | pgallery/tests/test_utils.py | pgallery/tests/test_utils.py | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | Test type coercion in sanitize_exif_value | Test type coercion in sanitize_exif_value
| Python | mit | zsiciarz/django-pgallery,zsiciarz/django-pgallery | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | <commit_before>from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
... | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
value = "... | <commit_before>from __future__ import unicode_literals
import unittest
from ..models import sanitize_exif_value
class SanitizeExifValueTestCase(unittest.TestCase):
def test_strip_null_bytes(self):
"""
Check that null bytes are stripped from the string.
"""
key = "not relevant"
... |
42709afec9f2e2ed419365f61324ce0c8ff96423 | budget/forms.py | budget/forms.py | from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
class Meta:
model = Budget
fields = ('name', 'start_date')
def save(self):
if not self.instance.slug:
self.in... | import datetime
from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
start_date = forms.DateTimeField(initial=datetime.datetime.now, required=False, widget=forms.SplitDateTimeWidget)
class Meta:
... | Split the start_date for better data entry (and Javascript date pickers). | Split the start_date for better data entry (and Javascript date pickers).
| Python | bsd-3-clause | jokimies/django-pj-budget,jokimies/django-pj-budget,toastdriven/django-budget,toastdriven/django-budget,jokimies/django-pj-budget | from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
class Meta:
model = Budget
fields = ('name', 'start_date')
def save(self):
if not self.instance.slug:
self.in... | import datetime
from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
start_date = forms.DateTimeField(initial=datetime.datetime.now, required=False, widget=forms.SplitDateTimeWidget)
class Meta:
... | <commit_before>from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
class Meta:
model = Budget
fields = ('name', 'start_date')
def save(self):
if not self.instance.slug:
... | import datetime
from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
start_date = forms.DateTimeField(initial=datetime.datetime.now, required=False, widget=forms.SplitDateTimeWidget)
class Meta:
... | from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
class Meta:
model = Budget
fields = ('name', 'start_date')
def save(self):
if not self.instance.slug:
self.in... | <commit_before>from django import forms
from django.template.defaultfilters import slugify
from budget.models import Budget, BudgetEstimate
class BudgetForm(forms.ModelForm):
class Meta:
model = Budget
fields = ('name', 'start_date')
def save(self):
if not self.instance.slug:
... |
db6b9761d51d45b2708ba6bca997196fc73fbe94 | sheldon/__init__.py | sheldon/__init__.py | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Utils folder contains scripts for mor... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Adapter module contains classes and t... | Add adapter module to init file | Add adapter module to init file
| Python | mit | lises/sheldon | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Utils folder contains scripts for mor... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Adapter module contains classes and t... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Utils folder contains ... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Adapter module contains classes and t... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Utils folder contains scripts for mor... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
# Bot module contains bot's main class - Sheldon
from sheldon.bot import *
# Hooks module contains hooks for plugins
from sheldon.hooks import *
# Utils folder contains ... |
82d312826ee67b098d9e9a52277912d8e1829960 | geocode.py | geocode.py | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | Remove second ? from URL | Remove second ? from URL
| Python | bsd-3-clause | caseyjlaw/flaskigm,caseyjlaw/flaskigm | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | <commit_before>import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url ... | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url = 'https://maps... | <commit_before>import os
import sys
import json
import urllib
import urllib2
api_key = os.getenv("MAPS_API_KEY")
if api_key == "":
sys.exit("Please obtain an API key from https://developers.google.com/maps/documentation/geocoding/start#get-a-key and set the environment variable MAPS_API_KEY")
#print api_key
url ... |
987fd7555eadfa15d10db7991f4a7e8a4a7dbbbf | custom/topo-2sw-2host.py | custom/topo-2sw-2host.py | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | Fix custom topology example; outdated import | Fix custom topology example; outdated import
Reported-by: Julius Bachnick
| Python | bsd-3-clause | mininet/mininet,mininet/mininet,mininet/mininet | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | <commit_before>"""Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' fro... | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | """Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command l... | <commit_before>"""Custom topology example
author: Brandon Heller (brandonh@stanford.edu)
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' fro... |
15e3bd894190ee745fab4534f7bbe14772d17ac1 | newswall/urls.py | newswall/urls.py | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Ye... | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Yea... | Test to see if commit works. | Test to see if commit works.
| Python | bsd-3-clause | registerguard/django-newswall,registerguard/django-newswall | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Ye... | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Yea... | <commit_before>from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
... | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Yea... | from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
views.Ye... | <commit_before>from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^(?P<year>\d{4})/$',
... |
66805c134125d957d7c7a0234e6b46e6aa1fa17f | walltime.py | walltime.py | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import time
t0 = time.time()
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
t1 = time.time()
print 'Importing took {} s'.format(t1-t0)
if len(sys.argv) < 2:
print 'USAGE: walltime filename... | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
if len(sys.argv) < 2:
print 'USAGE: walltime filename'
else:
fname = sys.argv[-1]
log_file = np.genfromtxt(fname, comments='#... | Revert "Print statements added for profiling" | Revert "Print statements added for profiling"
This reverts commit a6ae05c13666b83a1f1a8707fe21972bd1f758d9.
| Python | mit | ibackus/custom_python_packages,trquinn/custom_python_packages | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import time
t0 = time.time()
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
t1 = time.time()
print 'Importing took {} s'.format(t1-t0)
if len(sys.argv) < 2:
print 'USAGE: walltime filename... | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
if len(sys.argv) < 2:
print 'USAGE: walltime filename'
else:
fname = sys.argv[-1]
log_file = np.genfromtxt(fname, comments='#... | <commit_before>#!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import time
t0 = time.time()
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
t1 = time.time()
print 'Importing took {} s'.format(t1-t0)
if len(sys.argv) < 2:
print 'USAGE: wa... | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
if len(sys.argv) < 2:
print 'USAGE: walltime filename'
else:
fname = sys.argv[-1]
log_file = np.genfromtxt(fname, comments='#... | #!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import time
t0 = time.time()
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
t1 = time.time()
print 'Importing took {} s'.format(t1-t0)
if len(sys.argv) < 2:
print 'USAGE: walltime filename... | <commit_before>#!/usr/bin/env python
"""
Created on Fri Mar 14 15:25:36 2014
@author: ibackus
"""
import time
t0 = time.time()
import matplotlib.pyplot as plt
import numpy as np
import datetime
import sys
t1 = time.time()
print 'Importing took {} s'.format(t1-t0)
if len(sys.argv) < 2:
print 'USAGE: wa... |
4b819129557d5f0546d9edf206710fd2ec962881 | utsokt/restapi/models.py | utsokt/restapi/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | Order stories by descending creation time | Order stories by descending creation time
| Python | bsd-3-clause | madr/utsokt,madr/utsokt | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | <commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at =... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at = models.TimeFie... | <commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _
class Story(models.Model):
url = models.URLField(_('URL'))
title = models.CharField(_('Title'), max_length=64)
excerpt = models.CharField(_('Excerpt'), max_length=64, null=True, blank=True)
created_at =... |
dd50858ee22c27076919614d1994e3ce9c8e2399 | soundem/handlers.py | soundem/handlers.py | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': 'Bad Request',
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401... | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': e.name,
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401)
def u... | Fix json error handler name | Fix json error handler name | Python | mit | building4theweb/soundem-api | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': 'Bad Request',
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401... | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': e.name,
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401)
def u... | <commit_before>from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': 'Bad Request',
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.e... | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': e.name,
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401)
def u... | from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': 'Bad Request',
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.errorhandler(401... | <commit_before>from flask import jsonify
from soundem import app
def json_error_handler(e):
return jsonify({
'status_code': e.code,
'error': 'Bad Request',
'detail': e.description
}), e.code
@app.errorhandler(400)
def bad_request_handler(e):
return json_error_handler(e)
@app.e... |
dfc7e8a46558d3cf0e7f63da347e2b34253e302c | soundmeter/utils.py | soundmeter/utils.py | from ctypes import *
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.write(co... | from ctypes import * # NOQA
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.w... | Enforce flake8 and NOQA cases | Enforce flake8 and NOQA cases
| Python | bsd-2-clause | shichao-an/soundmeter | from ctypes import *
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.write(co... | from ctypes import * # NOQA
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.w... | <commit_before>from ctypes import *
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
... | from ctypes import * # NOQA
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.w... | from ctypes import *
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
f.write(co... | <commit_before>from ctypes import *
from contextlib import contextmanager
import os
import stat
def get_file_path(f):
if f:
name = getattr(f, 'name')
if name:
path = os.path.abspath(name)
return path
def create_executable(path, content):
with open(path, 'w') as f:
... |
00eb518f9caeab4df20f08a08826aac57f23300e | notescli/core.py | notescli/core.py | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | Remove reindex calls after changes | Remove reindex calls after changes
Already reindex notes on initialization
| Python | mit | phss/notes-cli | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | <commit_before>import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_opti... | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_options()
index =... | <commit_before>import argparse
import yaml
import shutil
import os
from subprocess import call
from os.path import expanduser, isdir
from config import load_config
import cliparser
import indexer
import io
import commands
def main():
config = load_config("~/.notes-cli/config.yaml")
options = cliparser.parse_opti... |
b8e1e5a926bc11d2d8ea975ad24496fca444f09e | betainvite/management/commands/send_waitlist_invites.py | betainvite/management/commands/send_waitlist_invites.py | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
option_list = BaseCommand.option_list + (
make_option('-c', '--count',
type="int",
default = 1... | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
def handle(self, *args, **options):
try:
count = args[0]
except IndexError:
print u'usage :', __name__... | Add console log send invitations command | Add console log send invitations command
| Python | bsd-3-clause | euanlau/django-betainvite | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
option_list = BaseCommand.option_list + (
make_option('-c', '--count',
type="int",
default = 1... | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
def handle(self, *args, **options):
try:
count = args[0]
except IndexError:
print u'usage :', __name__... | <commit_before>from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
option_list = BaseCommand.option_list + (
make_option('-c', '--count',
type="int",
... | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
def handle(self, *args, **options):
try:
count = args[0]
except IndexError:
print u'usage :', __name__... | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
option_list = BaseCommand.option_list + (
make_option('-c', '--count',
type="int",
default = 1... | <commit_before>from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Send invitations to people on the waiting list"
option_list = BaseCommand.option_list + (
make_option('-c', '--count',
type="int",
... |
569dbdc820d9ead02a8941d69b1c8143fe4d4cfa | pytest_pipeline/plugin.py | pytest_pipeline/plugin.py | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | Remove unused 'skip_run' option flag | Remove unused 'skip_run' option flag
| Python | bsd-3-clause | bow/pytest-pipeline | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | <commit_before># -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/125796... | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | # -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/12579625/243058
def p... | <commit_before># -*- coding: utf-8 -*-
"""
pytest_pipeline.plugin
~~~~~~~~~~~~~~~~~~~~~~
pytest plugin entry point.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
## credits to Holger Krekel himself for these xfail marking functions
## http://stackoverflow.com/a/125796... |
4f2a3f26b8b0ec1f62e036f0bd9d15d71a628e0c | mamba/formatters.py | mamba/formatters.py | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts(colored.white(item.... | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts()
puts(colo... | Put a blank line among main suites | Put a blank line among main suites
| Python | mit | alejandrodob/mamba,eferro/mamba,jaimegildesagredo/mamba,dex4er/mamba,angelsanz/mamba,nestorsalceda/mamba,markng/mamba | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts(colored.white(item.... | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts()
puts(colo... | <commit_before># -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts(colo... | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts()
puts(colo... | # -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts(colored.white(item.... | <commit_before># -*- coding: utf-8 -*-
from clint.textui import indent, puts, colored
from mamba import spec
class DocumentationFormatter(object):
def __init__(self):
self.has_failed_tests = False
self.total_specs = 0
self.total_seconds = .0
def format(self, item):
puts(colo... |
f9f9111ddafb7dfd0554d541befd3cc660169689 | apps/redirects/urls.py | apps/redirects/urls.py | from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos'),
redirect(r'^b2g/faq', 'firefoxos'),
redirect(r'^b2g/about', 'firefoxos'),
)
| from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos.firefoxos'),
redirect(r'^b2g/faq', 'firefoxos.firefoxos'),
redirect(r'^b2g/about', 'firefoxos.firefoxos'),
)
| Fix view name for b2g redirects | Fix view name for b2g redirects
bug 792482
| Python | mpl-2.0 | dudepare/bedrock,rishiloyola/bedrock,mahinthjoe/bedrock,ckprice/bedrock,davehunt/bedrock,davidwboswell/documentation_autoresponse,jpetto/bedrock,dudepare/bedrock,glogiotatidis/bedrock,kyoshino/bedrock,mahinthjoe/bedrock,MichaelKohler/bedrock,ckprice/bedrock,analytics-pros/mozilla-bedrock,analytics-pros/mozilla-bedrock,... | from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos'),
redirect(r'^b2g/faq', 'firefoxos'),
redirect(r'^b2g/about', 'firefoxos'),
)
Fix view name for b2g redirects
bug 792482 | from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos.firefoxos'),
redirect(r'^b2g/faq', 'firefoxos.firefoxos'),
redirect(r'^b2g/about', 'firefoxos.firefoxos'),
)
| <commit_before>from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos'),
redirect(r'^b2g/faq', 'firefoxos'),
redirect(r'^b2g/about', 'firefoxos'),
)
<commit_msg>Fix view name for b2g redirects
bug 792482<commit_after> | from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos.firefoxos'),
redirect(r'^b2g/faq', 'firefoxos.firefoxos'),
redirect(r'^b2g/about', 'firefoxos.firefoxos'),
)
| from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos'),
redirect(r'^b2g/faq', 'firefoxos'),
redirect(r'^b2g/about', 'firefoxos'),
)
Fix view name for b2g redirects
bug 792482from django.conf.urls.defaults import *
from util imp... | <commit_before>from django.conf.urls.defaults import *
from util import redirect
urlpatterns = patterns('',
redirect(r'^b2g', 'firefoxos'),
redirect(r'^b2g/faq', 'firefoxos'),
redirect(r'^b2g/about', 'firefoxos'),
)
<commit_msg>Fix view name for b2g redirects
bug 792482<commit_after>from django.... |
960eb0ce813988d8f90e76fbfd0485656cef541f | mff_rams_plugin/__init__.py | mff_rams_plugin/__init__.py | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | Rename new admin dropdown menu | Rename new admin dropdown menu
| Python | agpl-3.0 | MidwestFurryFandom/mff-rams-plugin,MidwestFurryFandom/mff-rams-plugin | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | <commit_before>from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(con... | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(config['module_roo... | <commit_before>from uber.common import *
from ._version import __version__
from .config import *
from .models import *
from .model_checks import *
from .automated_emails import *
static_overrides(join(config['module_root'], 'static'))
template_overrides(join(config['module_root'], 'templates'))
mount_site_sections(con... |
0cd55ad979912112edb5e26381a2697f235c890a | teknologr/registration/mailutils.py | teknologr/registration/mailutils.py | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | Fix typo in automatic email | Fix typo in automatic email
| Python | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | <commit_before>from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message ... | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message = '''Hej {name}... | <commit_before>from django.core.mail import send_mail
# TODO: check whether this should be sent from Phuxivator
def mailApplicantSubmission(context, sender='phuxivator@tf.fi'):
name = context['name']
receiver = context['email']
subject = 'Tack för din medlemsansökan till Teknologföreningen!'
message ... |
d30c9f5d83c88890771a0046a59325450151eebd | lagesonum/__main__.py | lagesonum/__main__.py | # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='172.31.1.100', port=80, reloader=True)
| # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='127.0.0.1', port=8080, reloader=True)
| Enable development start at localhost | Enable development start at localhost
| Python | mit | christophmeissner/lagesonum,coders4help/lagesonum,fzesch/lagesonum,fzesch/lagesonum,coders4help/lagesonum,fzesch/lagesonum,coders4help/lagesonum,christophmeissner/lagesonum | # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='172.31.1.100', port=80, reloader=True)
Enable development start at localhost | # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='127.0.0.1', port=8080, reloader=True)
| <commit_before># coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='172.31.1.100', port=80, reloader=True)
<commit_msg>Enable development start at localhost<commit_after> | # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='127.0.0.1', port=8080, reloader=True)
| # coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='172.31.1.100', port=80, reloader=True)
Enable development start at localhost# coding: utf-8
# Datei zum lokalen testen, Pyth... | <commit_before># coding: utf-8
# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt
from bottle import run, debug
from bottle_app import application
#debug(True)
run(application, host='172.31.1.100', port=80, reloader=True)
<commit_msg>Enable development start at localhost<commit_after># coding... |
6196c1fe13df88c1d9f1fe706120c175ab890a1d | gen_tone.py | gen_tone.py | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | Use 16 bit samples instead of float | Use 16 bit samples instead of float
| Python | mit | nickodell/morse-code | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | <commit_before>import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per... | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per_element * len(... | <commit_before>import math
import numpy
from demodulate.cfg import *
def gen_tone(pattern, WPM):
cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ
radians_per_sample = cycles_per_sample * 2 * math.pi
elements_per_second = WPM * 50.0 / 60.0
samples_per_element = int(SAMPLE_FREQ/elements_per_second)
length = samples_per... |
da28458dffc3529f16cb222fce1676ddb0d87e05 | oembed/resources.py | oembed/resources.py | from django.utils.simplejson import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
... | from django.utils import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
return... | Use the simplejson bundled with django | Use the simplejson bundled with django
| Python | mit | 0101/djangoembed,worldcompany/djangoembed,akvo/djangoembed,akvo/djangoembed,worldcompany/djangoembed,d4nielcosta/djangoembed,0101/djangoembed,d4nielcosta/djangoembed | from django.utils.simplejson import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
... | from django.utils import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
return... | <commit_before>from django.utils.simplejson import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(s... | from django.utils import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
return... | from django.utils.simplejson import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(self, name):
... | <commit_before>from django.utils.simplejson import simplejson
from oembed.exceptions import OEmbedException
class OEmbedResource(object):
"""
OEmbed resource, as well as a factory for creating resource instances
from response json
"""
_data = {}
content_object = None
def __getattr__(s... |
1cb201c57c592ebd014910fe225fa594cd87c745 | opendebates/middleware.py | opendebates/middleware.py | from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
request.site_mode = get_site_mode(request)
| from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_request(self, request):
request.site_mode = get_site_mode(request)
| Make sure that the site mode is populated on the request | Make sure that the site mode is populated on the request
even if the request winds up getting dispatched to a flatpage.
| Python | apache-2.0 | caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates | from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
request.site_mode = get_site_mode(request)
Make sure that the site mode ... | from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_request(self, request):
request.site_mode = get_site_mode(request)
| <commit_before>from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
request.site_mode = get_site_mode(request)
<commit_msg>Ma... | from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_request(self, request):
request.site_mode = get_site_mode(request)
| from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
request.site_mode = get_site_mode(request)
Make sure that the site mode ... | <commit_before>from opendebates.utils import get_site_mode
class SiteModeMiddleware(object):
"""
Gets or creates a SiteMode for the request, based on the hostname.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
request.site_mode = get_site_mode(request)
<commit_msg>Ma... |
9651c0278d93bf5c4620e198baac975f0c84e9a0 | src/unittest/stattestmain.py | src/unittest/stattestmain.py | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.initText("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Reset to p... | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.addStatVisitor("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Rese... | Fix the stats unit test. | tests: Fix the stats unit test.
This has been broken since February. The interface for opening
initializing where the stats output should go was changed, but the
test wasn't updated.
Change-Id: I54bd8be15bf870352d5fcfad95ded28d87c7cc5a
Reviewed-on: https://gem5-review.googlesource.com/6001
Reviewed-by: Andreas Sandbe... | Python | bsd-3-clause | TUD-OS/gem5-dtu,gem5/gem5,TUD-OS/gem5-dtu,gem5/gem5,gem5/gem5,TUD-OS/gem5-dtu,TUD-OS/gem5-dtu,gem5/gem5,TUD-OS/gem5-dtu,gem5/gem5,TUD-OS/gem5-dtu,gem5/gem5,gem5/gem5,TUD-OS/gem5-dtu | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.initText("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Reset to p... | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.addStatVisitor("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Rese... | <commit_before>def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.initText("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
... | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.addStatVisitor("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Rese... | def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.initText("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
# Reset to p... | <commit_before>def main():
from _m5.stattest import stattest_init, stattest_run
import m5.stats
stattest_init()
# Initialize the global statistics
m5.stats.initSimStats()
m5.stats.initText("cout")
# We're done registering statistics. Enable the stats package now.
m5.stats.enable()
... |
c9f1335bff52e54f90eed151a273879b0f5144ea | test/test_commonsdowloader.py | test/test_commonsdowloader.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | Add unit test for make_thumbnail_name() | Add unit test for make_thumbnail_name()
| Python | mit | Commonists/CommonsDownloader | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | <commit_before>#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | <commit_before>#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [... |
93f61fa8eb526763ddaf3de476cee6643f044908 | stringer/utils/file_utils.py | stringer/utils/file_utils.py | '''
Utilities to search files and retain meta data about files.
'''
import logging
import os
import mmap
def map_file(path=None):
logging.debug("map_file: " + path)
file_map = ""
if path is None or path is os.path.isfile(path):
logging.error('generate string is None')
logging.error('path... | Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through. | Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.
| Python | apache-2.0 | kalaboster/stringer,kalaboster/stringer | Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through. | '''
Utilities to search files and retain meta data about files.
'''
import logging
import os
import mmap
def map_file(path=None):
logging.debug("map_file: " + path)
file_map = ""
if path is None or path is os.path.isfile(path):
logging.error('generate string is None')
logging.error('path... | <commit_before><commit_msg>Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.<commit_after> | '''
Utilities to search files and retain meta data about files.
'''
import logging
import os
import mmap
def map_file(path=None):
logging.debug("map_file: " + path)
file_map = ""
if path is None or path is os.path.isfile(path):
logging.error('generate string is None')
logging.error('path... | Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.'''
Utilities to search files and retain meta data about files.
'''
import logging
import os
import mmap
def map_file(path=None):
logging.... | <commit_before><commit_msg>Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.<commit_after>'''
Utilities to search files and retain meta data about files.
'''
import logging
import os
import mma... | |
61accbe3fa6ebdeed3bbf48573d5ac5412d0f1db | app/status/views.py | app/status/views.py | import os
from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
status="o... | from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from ..models import Framework
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
... | Add framework status to API /_status | Add framework status to API /_status
To figure out current framework statuses for the given environment
you either need access to the API token or you'd have to look through
a number of frontend pages to infer the status from.
Framework status is a part of almost every request to the API, so
it should always be avail... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | import os
from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
status="o... | from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from ..models import Framework
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
... | <commit_before>import os
from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
... | from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from ..models import Framework
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
... | import os
from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
status="o... | <commit_before>import os
from flask import jsonify, current_app, request
from sqlalchemy.exc import SQLAlchemyError
from . import status
from . import utils
from dmutils.status import get_flags
@status.route('/_status')
def status_no_db():
if 'ignore-dependencies' in request.args:
return jsonify(
... |
43175d338f9a8e7eb779421bb4e1aa3bec4a94f1 | mediacrush/network.py | mediacrush/network.py | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | Update IP address Tor traffic comes from | Update IP address Tor traffic comes from
| Python | mit | nerdzeu/NERDZCrush,roderickm/MediaCrush,MediaCrush/MediaCrush,nerdzeu/NERDZCrush,roderickm/MediaCrush,MediaCrush/MediaCrush,roderickm/MediaCrush,nerdzeu/NERDZCrush | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | <commit_before>import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def ma... | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | <commit_before>import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def ma... |
bb6a4659527077413845e912e53bea5ee9327293 | content/test/gpu/gpu_tests/memory_expectations.py | content/test/gpu/gpu_tests/memory_expectations.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | Add a failure expectation to Linux memory.css3d test. | Add a failure expectation to Linux memory.css3d test.
BUG=373098
NOTRY=true
R=kbr@chromium.org
Review URL: https://codereview.chromium.org/303503009
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@273109 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,dednal/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,Pluto... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leop... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowleopar... | <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leop... |
8d1a4869286735a55773ce0c074349bb0cafd3aa | ca_on_ottawa/people.py | ca_on_ottawa/people.py | # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
| # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
corrections = {
'district name': {
... | Use corrections, as none of utf-8, iso-8859-1 or windows-1252 work | ca_on_ottawa: Use corrections, as none of utf-8, iso-8859-1 or windows-1252 work
| Python | mit | opencivicdata/scrapers-ca,opencivicdata/scrapers-ca | # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
ca_on_ottawa: Use corrections, as none of utf-8, iso-... | # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
corrections = {
'district name': {
... | <commit_before># coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
<commit_msg>ca_on_ottawa: Use correcti... | # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
corrections = {
'district name': {
... | # coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
ca_on_ottawa: Use corrections, as none of utf-8, iso-... | <commit_before># coding: utf-8
from utils import CSVScraper
class OttawaPersonScraper(CSVScraper):
csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe1a-40d8-8951-72df40021c82/resource/33a437d3-a06d-4c56-a7fe-4fd622364ce6/download/elected-officials-282014-201829-v.2.csv'
<commit_msg>ca_on_ottawa: Use correcti... |
9be4329b0586047f9184f04ca2e331dbd871ab56 | casepro/rules/views.py | casepro/rules/views.py | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | Fix coverage by removing unused lines | Fix coverage by removing unused lines
| Python | bsd-3-clause | rapidpro/casepro,rapidpro/casepro,rapidpro/casepro | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | <commit_before>from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
cl... | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
class List(OrgPer... | <commit_before>from dash.orgs.views import OrgPermsMixin
from smartmin.views import SmartCRUDL, SmartListView
from .models import Rule
class RuleCRUDL(SmartCRUDL):
"""
Simple CRUDL for debugging by superusers, i.e. not exposed to regular users for now
"""
model = Rule
actions = ("list",)
cl... |
081e5c36cfa8505f1c639bb1e34a5b929b2d4076 | app/main/forms.py | app/main/forms.py | from flask_wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(message... | from flask.ext.wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(mes... | Update import to use new style as per SO answer | Update import to use new style as per SO answer
https://stackoverflow.com/questions/20032922/no-module-named-flask-ext-wtf
| Python | mit | alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend | from flask_wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(message... | from flask.ext.wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(mes... | <commit_before>from flask_wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validator... | from flask.ext.wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(mes... | from flask_wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validators.Email(message... | <commit_before>from flask_wtf import Form
from wtforms import validators
from dmutils.forms import StripWhitespaceStringField
class EmailAddressForm(Form):
email_address = StripWhitespaceStringField('Email address', validators=[
validators.DataRequired(message="Email can not be empty"),
validator... |
e326cef4ae66d4d2dd500e933ff4f7c6fc619b28 | fix-perm.py | fix-perm.py | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | Change permissions to either 644 or 755. | Change permissions to either 644 or 755.
| Python | isc | eliteraspberries/minipkg,eliteraspberries/minipkg | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | <commit_before>#!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(pa... | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | #!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(path):
... | <commit_before>#!/usr/bin/env python
"""fix-perm.py - Fix file permissions
"""
from __future__ import print_function
import os
import stat
import sys
if __name__ == '__main__':
for line in sys.stdin:
path = line.rstrip('\n')
if path == '':
continue
if not os.path.isfile(pa... |
b7b6fdbc270359e82a2f13f5257a0c2a3875c28f | src/foremast/slacknotify/slack_notification.py | src/foremast/slacknotify/slack_notification.py | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | Move properties fetching before dict | fix: Move properties fetching before dict
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | <commit_before>"""Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
... | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | """Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
timestam... | <commit_before>"""Notify Slack channel."""
import time
from ..utils import get_properties, get_template, post_slack_message
class SlackNotification:
"""Post slack notification.
Inform users about infrastructure changes to prod* accounts.
"""
def __init__(self, app=None, env=None, prop_path=None):
... |
0078bb14b85df519744371df89e243822a86ed4c | generate.py | generate.py | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] = y
buff... | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
print('WIRING')
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer... | Add a little more detail to the generator | Add a little more detail to the generator
| Python | mit | spgill/bitnigma | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] = y
buff... | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
print('WIRING')
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer... | <commit_before>import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] =... | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
print('WIRING')
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer... | import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] = y
buff... | <commit_before>import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] =... |
211f1fdfe1d969df7c9762ba8e914d3ea829e9b4 | manual/conf.py | manual/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | Allow real <= and >= in LateX | Allow real <= and >= in LateX
| Python | apache-2.0 | jberkenbilt/qpdf,jberkenbilt/qpdf,jberkenbilt/qpdf,qpdf/qpdf,jberkenbilt/qpdf,qpdf/qpdf,jberkenbilt/qpdf,qpdf/qpdf,qpdf/qpdf,qpdf/qpdf | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | <commit_before># Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | <commit_before># Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
... |
aa720a34c918e3d6454a4cfcb4fa0548f9fbd078 | hggithub.py | hggithub.py |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... | Update bookmark interface to work with mercurial 3.0.2 | Update bookmark interface to work with mercurial 3.0.2
--HG--
extra : transplant_source : Qn%AB4%08%F4%3D%60%0DDb%10%E1%9C%A2%82%00z%1D5
| Python | bsd-2-clause | stephenmcd/hg-github |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... | <commit_before>
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbuc... |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... |
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbucket->GitHub mir... | <commit_before>
# Mimic the hggit extension.
try:
from hggit import *
hggit_reposetup = reposetup
except ImportError:
# Allow this module to be imported without
# hg-git installed, eg for setup.py
pass
__version__ = "0.1.4"
def reposetup(ui, repo, **kwargs):
"""
Automatically adds Bitbuc... |
ad55d04d6688f75f0e441603668e0337a0333d76 | tests/test_validate.py | tests/test_validate.py | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | Add length validator unit tests | Add length validator unit tests | Python | mit | maximkulkin/marshmallow,0xDCA/marshmallow,Tim-Erwin/marshmallow,xLegoz/marshmallow,marshmallow-code/marshmallow,VladimirPal/marshmallow,0xDCA/marshmallow,daniloakamine/marshmallow,dwieeb/marshmallow,mwstobo/marshmallow,quxiaolong1504/marshmallow,etataurov/marshmallow,Bachmann1234/marshmallow,bartaelterman/marshmallow | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | <commit_before># -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validat... | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | # -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... | <commit_before># -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validat... |
98eaf33328814342cdf6a2e8379c87cd00c911ce | campaign/views.py | campaign/views.py | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if request.method == ... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP, Campaign
def create_edit_prospectus(request):
if request.... | Update default queryset for formsets | Update default queryset for formsets | Python | mit | tdphillips/campaigns,tdphillips/campaigns | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if request.method == ... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP, Campaign
def create_edit_prospectus(request):
if request.... | <commit_before>from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if req... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP, Campaign
def create_edit_prospectus(request):
if request.... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if request.method == ... | <commit_before>from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if req... |
547130e5f3717fd5bfd083be89afd361fdcdefc1 | van/contactology/tests/test_contactology.py | van/contactology/tests/test_contactology.py | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('van.contact... | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology, APIError
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('v... | Test for exception raising on API error. | Test for exception raising on API error.
| Python | bsd-3-clause | jinty/van.contactology | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('van.contact... | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology, APIError
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('v... | <commit_before>import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = pat... | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology, APIError
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('v... | import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = patch('van.contact... | <commit_before>import unittest
from simplejson import dumps
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from mock import patch, Mock
from van.contactology import Contactology
class TestProxy(TestCase):
@defer.inlineCallbacks
def test_list_return(self):
patcher = pat... |
e4c7a9186ef90ab6af637dbfb2bf5331823e64d9 | kimochiconsumer/views.py | kimochiconsumer/views.py | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimoc... | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimo... | Remove pprint and add PEP-8 lf | Remove pprint and add PEP-8 lf
| Python | mit | matslindh/kimochi-consumer | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimoc... | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimo... | <commit_before>from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data ... | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimo... | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimoc... | <commit_before>from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data ... |
ee4f312e89fe262a682011da3a7881bfbf47fcdf | spacy/lang/ar/__init__.py | spacy/lang/ar/__init__.py | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | Add writing_system to ArabicDefaults (experimental) | Add writing_system to ArabicDefaults (experimental)
| Python | mit | honnibal/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import ... | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import ... |
87de1fce846d7f50017fba885725a0907d43275e | swf/querysets/__init__.py | swf/querysets/__init__.py | #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
| #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.history import HistoryQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
| Add history qs to swf querysets modules | Add history qs to swf querysets modules
| Python | mit | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
Add history qs to swf querysets modules | #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.history import HistoryQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
| <commit_before>#! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
<commit_msg>Add history qs to swf querysets modules<com... | #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.history import HistoryQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
| #! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
Add history qs to swf querysets modules#! -*- coding:utf-8 -*-
from s... | <commit_before>#! -*- coding:utf-8 -*-
from swf.querysets.activity import ActivityTypeQuerySet
from swf.querysets.domain import DomainQuerySet
from swf.querysets.workflow import (WorkflowTypeQuerySet,
WorkflowExecutionQuerySet)
<commit_msg>Add history qs to swf querysets modules<com... |
ebe6281773bd10ed2e6be9b20e257f0403e3cc74 | tests/test_decorators.py | tests/test_decorators.py | from name.decorators import jsonp
from mock import MagicMock
def test_jsonp_returns_without_status_code_200():
# Setup the mock view.
f = MagicMock()
f.__name__ = 'Wrapped View'
# Setup the mock response.
response = MagicMock()
response.status_code = 301
# Set the response as the return ... | Add intial tests for decorators. | Add intial tests for decorators.
| Python | bsd-3-clause | damonkelley/django-name,unt-libraries/django-name,unt-libraries/django-name,damonkelley/django-name,unt-libraries/django-name,damonkelley/django-name | Add intial tests for decorators. | from name.decorators import jsonp
from mock import MagicMock
def test_jsonp_returns_without_status_code_200():
# Setup the mock view.
f = MagicMock()
f.__name__ = 'Wrapped View'
# Setup the mock response.
response = MagicMock()
response.status_code = 301
# Set the response as the return ... | <commit_before><commit_msg>Add intial tests for decorators.<commit_after> | from name.decorators import jsonp
from mock import MagicMock
def test_jsonp_returns_without_status_code_200():
# Setup the mock view.
f = MagicMock()
f.__name__ = 'Wrapped View'
# Setup the mock response.
response = MagicMock()
response.status_code = 301
# Set the response as the return ... | Add intial tests for decorators.from name.decorators import jsonp
from mock import MagicMock
def test_jsonp_returns_without_status_code_200():
# Setup the mock view.
f = MagicMock()
f.__name__ = 'Wrapped View'
# Setup the mock response.
response = MagicMock()
response.status_code = 301
#... | <commit_before><commit_msg>Add intial tests for decorators.<commit_after>from name.decorators import jsonp
from mock import MagicMock
def test_jsonp_returns_without_status_code_200():
# Setup the mock view.
f = MagicMock()
f.__name__ = 'Wrapped View'
# Setup the mock response.
response = MagicMoc... | |
3a0b844f33274f7d9c389dd89b21a953cb9c1510 | promgen/sender/webhook.py | promgen/sender/webhook.py | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | Fix case where annotations may not exist | Fix case where annotations may not exist
| Python | mit | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | <commit_before>'''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, a... | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | '''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, alert, data):
... | <commit_before>'''
Simple webhook bridge
Accepts alert json from Alert Manager and then POSTs individual alerts to
configured webhook destinations
'''
import logging
import requests
from promgen.sender import SenderBase
logger = logging.getLogger(__name__)
class SenderWebhook(SenderBase):
def _send(self, url, a... |
cfc50cb9e70b7a5358b36a54d4b3bc27a2cfb2cb | us_ignite/common/sanitizer.py | us_ignite/common/sanitizer.py | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym':... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
'table',
'tr',
'th',
'td',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'tit... | Allow ``table`` attributes during HTML sanitation. | Allow ``table`` attributes during HTML sanitation.
Tables are part of the content expected to be added
in some of the resources in the site.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym':... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
'table',
'tr',
'th',
'td',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'tit... | <commit_before>import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
'table',
'tr',
'th',
'td',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'tit... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym':... | <commit_before>import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],... |
aa1f421161e9afe20e0f28532d2b0327a8654a13 | Lib/distutils/__init__.py | Lib/distutils/__init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
| """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "2.4.0"
| Make the distutils version number the same as the python version. It must be literally contained here, because it is still possible to install this distutils in older Python versions. | Make the distutils version number the same as the python version. It
must be literally contained here, because it is still possible to
install this distutils in older Python versions.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
Make the distutils version number the same... | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "2.4.0"
| <commit_before>"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
<commit_msg>Make the distut... | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "2.4.0"
| """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
Make the distutils version number the same... | <commit_before>"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
<commit_msg>Make the distut... |
f7bb5a58774cdb6ecdfae12f7919ae2e3dfd8f8d | upsrv/conary_schema.py | upsrv/conary_schema.py | #!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
class SimpleFileLog(tracelog.FileLog):
def pr... | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary import dbstore
from .config import UpsrvConfig
class SimpleFileLog(tracelog.FileLog):
def printLog(self, level, msg):
self.fd.wri... | Update conary migration script to deal with extended config | Update conary migration script to deal with extended config
| Python | apache-2.0 | sassoftware/rbm,sassoftware/rbm,sassoftware/rbm | #!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
class SimpleFileLog(tracelog.FileLog):
def pr... | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary import dbstore
from .config import UpsrvConfig
class SimpleFileLog(tracelog.FileLog):
def printLog(self, level, msg):
self.fd.wri... | <commit_before>#!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
class SimpleFileLog(tracelog.FileL... | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary import dbstore
from .config import UpsrvConfig
class SimpleFileLog(tracelog.FileLog):
def printLog(self, level, msg):
self.fd.wri... | #!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
class SimpleFileLog(tracelog.FileLog):
def pr... | <commit_before>#!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
class SimpleFileLog(tracelog.FileL... |
eb40e27b0699a717708dd9367ac91ac0326456fe | regress/tests.py | regress/tests.py | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | Rename class to sync with new file name. | Rename class to sync with new file name.
| Python | isc | rutube/djonet,gijzelaerr/djonet | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | <commit_before>import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE... | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE_PASSWORD=passw... | <commit_before>import subprocess
import sys
import unittest
from django.conf import settings
#
# Must configure settings before importing base.
#
db = 'testdjangodb1'
schema = 'django1'
user = 'django1'
passwd = 'django1'
settings.configure(
DEBUG=True,
DATABASE_NAME=db,
DATABASE_USER=user,
DATABASE... |
130d73d64e6f4abe4946240a8e876891cb02182c | corehq/ex-submodules/pillow_retry/admin.py | corehq/ex-submodules/pillow_retry/admin.py | from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'dat... | from datetime import datetime
from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'da... | Add reset attempts to PillowError actions | Add reset attempts to PillowError actions
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'dat... | from datetime import datetime
from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'da... | <commit_before>from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt... | from datetime import datetime
from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'da... | from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'dat... | <commit_before>from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt... |
e9e632008db1eb2bbdbd989584b82255a10f8944 | CodeFights/arrayReplace.py | CodeFights/arrayReplace.py | #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
pass
def main():
pass
if __name__ == '__main__':
main()
| #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
return [x if x != elemToReplace else substitutionElem for x in inputArray]
def main():
tests = [
[[1, 2, 1], 1, 3, [3, 2, 3]],
[[1, 2, 3, 4, 5], 3, 0, [1, 2, 0, 4, 5]],
... | Solve Code Fights array replace problem | Solve Code Fights array replace problem
| Python | mit | HKuz/Test_Code | #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
pass
def main():
pass
if __name__ == '__main__':
main()
Solve Code Fights array replace problem | #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
return [x if x != elemToReplace else substitutionElem for x in inputArray]
def main():
tests = [
[[1, 2, 1], 1, 3, [3, 2, 3]],
[[1, 2, 3, 4, 5], 3, 0, [1, 2, 0, 4, 5]],
... | <commit_before>#!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
pass
def main():
pass
if __name__ == '__main__':
main()
<commit_msg>Solve Code Fights array replace problem<commit_after> | #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
return [x if x != elemToReplace else substitutionElem for x in inputArray]
def main():
tests = [
[[1, 2, 1], 1, 3, [3, 2, 3]],
[[1, 2, 3, 4, 5], 3, 0, [1, 2, 0, 4, 5]],
... | #!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
pass
def main():
pass
if __name__ == '__main__':
main()
Solve Code Fights array replace problem#!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray,... | <commit_before>#!/usr/local/bin/python
# Code Fights Add Border Problem
def arrayReplace(inputArray, elemToReplace, substitutionElem):
pass
def main():
pass
if __name__ == '__main__':
main()
<commit_msg>Solve Code Fights array replace problem<commit_after>#!/usr/local/bin/python
# Code Fights Add Bord... |
9d93a7a5d474a8725125077ae888f2d586955489 | tests/cli/fsm/fsm_test.py | tests/cli/fsm/fsm_test.py | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | Remove comments in fsm tests | Remove comments in fsm tests
| Python | apache-2.0 | Yelp/paasta,gstarnberger/paasta,somic/paasta,somic/paasta,Yelp/paasta,gstarnberger/paasta | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | <commit_before># Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | <commit_before># Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
016d955319b6971fec42ac6ada1052f88d867cee | freepacktbook/__init__.py | freepacktbook/__init__.py | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | Add ability to get book details | Add ability to get book details
| Python | mit | bogdal/freepacktbook | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | <commit_before>import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
... | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
self.pas... | <commit_before>import os
from bs4 import BeautifulSoup
import requests
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
url = base_url + '/packt/offers/free-learning/'
def __init__(self, email=None, password=None):
self.session = requests.Session()
self.email = email
... |
76b39021fb0171da6036ceaf7894e3ff18d259ae | src/syft/grid/client/request_api/worker_api.py | src/syft/grid/client/request_api/worker_api.py | # stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messag... | # stdlib
from typing import Callable
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messages import GetWorkersMessage
from ...messages.infra_messages imp... | Update Worker API - ADD type hints - Remove unused imports | Update Worker API
- ADD type hints
- Remove unused imports
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | # stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messag... | # stdlib
from typing import Callable
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messages import GetWorkersMessage
from ...messages.infra_messages imp... | <commit_before># stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messag... | # stdlib
from typing import Callable
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messages import GetWorkersMessage
from ...messages.infra_messages imp... | # stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messag... | <commit_before># stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messag... |
6153952ca9794ccb1dd5d76696aa2d4881a665c1 | tests/core/migrations/0004_bookwithchapters.py | tests/core/migrations/0004_bookwithchapters.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-09 10:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class PostgresOnlyCreateModel(migrations.CreateModel):
def database_forwards(self, app_label, schema_editor, from_state, t... | from __future__ import unicode_literals
from django import VERSION
from django.db import migrations, models
if VERSION >= (1, 8):
from django.contrib.postgres.fields import ArrayField
chapters_field = ArrayField(base_field=models.CharField(max_length=100), default=list, size=None)
else:
chapters_field = mo... | Add version check for importing django.contrib.postgres.fields.ArrayField | Add version check for importing django.contrib.postgres.fields.ArrayField
| Python | bsd-2-clause | daniell/django-import-export,jnns/django-import-export,django-import-export/django-import-export,bmihelac/django-import-export,copperleaftech/django-import-export,brillgen/django-import-export,PetrDlouhy/django-import-export,daniell/django-import-export,daniell/django-import-export,PetrDlouhy/django-import-export,PetrD... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-09 10:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class PostgresOnlyCreateModel(migrations.CreateModel):
def database_forwards(self, app_label, schema_editor, from_state, t... | from __future__ import unicode_literals
from django import VERSION
from django.db import migrations, models
if VERSION >= (1, 8):
from django.contrib.postgres.fields import ArrayField
chapters_field = ArrayField(base_field=models.CharField(max_length=100), default=list, size=None)
else:
chapters_field = mo... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-09 10:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class PostgresOnlyCreateModel(migrations.CreateModel):
def database_forwards(self, app_label, schema_editor... | from __future__ import unicode_literals
from django import VERSION
from django.db import migrations, models
if VERSION >= (1, 8):
from django.contrib.postgres.fields import ArrayField
chapters_field = ArrayField(base_field=models.CharField(max_length=100), default=list, size=None)
else:
chapters_field = mo... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-09 10:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class PostgresOnlyCreateModel(migrations.CreateModel):
def database_forwards(self, app_label, schema_editor, from_state, t... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-09 10:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class PostgresOnlyCreateModel(migrations.CreateModel):
def database_forwards(self, app_label, schema_editor... |
d317b27a5dac13900beb8f2674b0725313970a80 | nodeconductor/core/handlers.py | nodeconductor/core/handlers.py | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | Rename event types for consistency | Rename event types for consistency
- NC-332
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | <commit_before>from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
... | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
'SSH k... | <commit_before>from __future__ import unicode_literals
import logging
from nodeconductor.core.log import EventLoggerAdapter
logger = logging.getLogger(__name__)
event_logger = EventLoggerAdapter(logger)
def log_ssh_key_save(sender, instance, created=False, **kwargs):
if created:
event_logger.info(
... |
fbcf9fbfe162b0f7491c5c89a2098a3f56bd6c6a | scripts/data_download/school_census/create_all_files.py | scripts/data_download/school_census/create_all_files.py | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | Rename database in log file. | Rename database in log file.
| Python | mit | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | <commit_before>import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(s... | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | <commit_before>import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(s... |
fba983fa54691fcde0de93d6519b3906dff3cb32 | sara_flexbe_states/src/sara_flexbe_states/get_distance2D.py | sara_flexbe_states/src/sara_flexbe_states/get_distance2D.py | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | Correct call to super constructor | Correct call to super constructor
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | <commit_before>#!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | <commit_before>#!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.