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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82e964dab398caee75c3174f86593ab6cfa7dbaf | src/constants.py | src/constants.py | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 40.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 80.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | Increase simulation time for linear trajectory | Increase simulation time for linear trajectory
| Python | mit | bit0001/trajectory_tracking,bit0001/trajectory_tracking | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 40.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 80.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | <commit_before>#!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 40.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(S... | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 80.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | #!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 40.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(SIMULATION_TIME_... | <commit_before>#!/usr/bin/env python
TRAJECTORY = 'linear'
if TRAJECTORY == 'linear':
SIMULATION_TIME_IN_SECONDS = 40.0
elif TRAJECTORY == 'circular':
SIMULATION_TIME_IN_SECONDS = 120.0
elif TRAJECTORY == 'squared':
SIMULATION_TIME_IN_SECONDS = 160.0
DELTA_T = 0.1 # this is the sampling time
STEPS = int(S... |
63e61d9123a4abeb85d83545da351ed0abf792aa | src/core/urls.py | src/core/urls.py | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | Handle installs not using new settings engine | Handle installs not using new settings engine
| Python | agpl-3.0 | BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | <commit_before>__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic impor... | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
... | <commit_before>__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic impor... |
1a5c1ea0815d30048d7dbce56adf2503b9c82c28 | moksha/widgets/container/tests/test_container.py | moksha/widgets/container/tests/test_container.py | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | Update our container test case | Update our container test case
| Python | apache-2.0 | ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,ralphbean/moksha,ralphbean/moksha,lmacken/moksha,pombredanne/moksha | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | <commit_before># This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later... | <commit_before># This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... |
35ffe6bb97a30970d4bc3c265b6337712669ee09 | githubsetupircnotifications.py | githubsetupircnotifications.py | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
parser.add_argument('--password')
parser.add_argumen... | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def error(message):
print(message)
sys.exit(1)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
... | Add error function to remove duplicate code | Add error function to remove duplicate code
| Python | mit | kragniz/github-setup-irc-notifications | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
parser.add_argument('--password')
parser.add_argumen... | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def error(message):
print(message)
sys.exit(1)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
... | <commit_before>"""
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
parser.add_argument('--password')
par... | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def error(message):
print(message)
sys.exit(1)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
... | """
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
parser.add_argument('--password')
parser.add_argumen... | <commit_before>"""
github-setup-irc-notifications - Configure all repositories in an organization
with irc notifications
"""
import argparse
import getpass
import sys
import github3
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--username')
parser.add_argument('--password')
par... |
859a23790968c84cdbc4fa7467957a3a1ed1e069 | greatbigcrane/project/forms.py | greatbigcrane/project/forms.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | Add a name for the recipe section | Add a name for the recipe section
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | <commit_before>"""
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | <commit_before>"""
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
61cf5a4ab4d7b9e0cb95925acc633aa7cb156d59 | taggit/models.py | taggit/models.py | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()
def _... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(unique=True, max... | Make slug unique and fix the max_length. | Make slug unique and fix the max_length.
| Python | bsd-3-clause | izquierdo/django-taggit,theatlantic/django-taggit2,doselect/django-taggit,gem/django-taggit,theatlantic/django-taggit,Maplecroft/django-taggit,benjaminrigaud/django-taggit,kminkov/django-taggit,twig/django-taggit,cimani/django-taggit,decibyte/django-taggit,IRI-Research/django-taggit,eugena/django-taggit,theatlantic/dja... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()
def _... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(unique=True, max... | <commit_before>from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(unique=True, max... | from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()
def _... | <commit_before>from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import slugify
class Tag(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()... |
9afc0f35b718e11418c22e2f60e07f7a9ee9aaa3 | core/commands/log_graph.py | core/commands/log_graph.py | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | Add `--all` to graph command to show other branches (esp. origin) | Add `--all` to graph command to show other branches (esp. origin)
| Python | mit | asfaltboy/GitSavvy,asfaltboy/GitSavvy,jmanuel1/GitSavvy,divmain/GitSavvy,ddevlin/GitSavvy,theiviaxx/GitSavvy,divmain/GitSavvy,stoivo/GitSavvy,dvcrn/GitSavvy,theiviaxx/GitSavvy,ralic/GitSavvy,ddevlin/GitSavvy,ralic/GitSavvy,divmain/GitSavvy,stoivo/GitSavvy,dreki/GitSavvy,stoivo/GitSavvy,asfaltboy/GitSavvy,ddevlin/GitSav... | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | <commit_before>from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def r... | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def run(self):
... | <commit_before>from sublime_plugin import WindowCommand, TextCommand
from ..git_command import GitCommand
LOG_GRAPH_TITLE = "GRAPH"
class GsLogGraphCommand(WindowCommand, GitCommand):
"""
Open a new window displaying an ASCII-graphic representation
of the repo's branch relationships.
"""
def r... |
7db62eefb0601098db6eff9becf566f51fee9be4 | pythonforandroid/recipes/setuptools/__init__.py | pythonforandroid/recipes/setuptools/__init__.py | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpyt... | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpython... | Use zip instead of tar.gz to obtain setuptools | Use zip instead of tar.gz to obtain setuptools
Newer releases of setuptools on pypi are only available as zip archives.
In order to support higher versions of setuptools, zip should be
preferred over tar.gz. Otherwise, installing e.g. setuptools==40.0.0
will fail.
| Python | mit | kivy/python-for-android,rnixx/python-for-android,germn/python-for-android,rnixx/python-for-android,PKRoma/python-for-android,rnixx/python-for-android,rnixx/python-for-android,kronenpj/python-for-android,PKRoma/python-for-android,germn/python-for-android,kronenpj/python-for-android,PKRoma/python-for-android,kronenpj/pyt... | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpyt... | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpython... | <commit_before>from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
ins... | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpython... | from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
install_in_hostpyt... | <commit_before>from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '18.3.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
depends = [('python2', 'python3crystax')]
call_hostpython_via_targetpython = False
ins... |
b3757884bdaa6e488d54ee51f943dbb3578ea469 | stores/forms.py | stores/forms.py | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | Remove limit for search field | Remove limit for search field
| Python | bsd-3-clause | django-oscar/django-oscar-stores,django-oscar/django-oscar-stores,django-oscar/django-oscar-stores | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | <commit_before>from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
... | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
(_('SA')... | <commit_before>from django import forms
from django.db.models import get_model
from django.utils.translation import ugettext as _
StoreAddress = get_model('stores', 'StoreAddress')
class StoreSearchForm(forms.Form):
STATE_CHOICES = (
(_('VIC'), _('Victoria')),
(_('NSW'), _('New South Wales')),
... |
fe50886a42bf7fa5e3217134e1f7a732960ab2d9 | nbgrader/tests/apps/test_nbgrader_generate_config.py | nbgrader/tests/apps/test_nbgrader_generate_config.py | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | Add assertion for issue gh-1089 | Add assertion for issue gh-1089
| Python | bsd-3-clause | jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | <commit_before>import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the... | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the config file pr... | <commit_before>import os
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateConfig(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["generate_config", "--help-all"])
def test_generate_config(self):
"""Is the... |
5d673ed6cf8f810ee22bc701f6927f9580b4ec34 | rest-api/config.py | rest-api/config.py | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
ALLOWED_CLIENT_IDS = [PYTHON_TEST_CLIENT_ID]
# TOD... | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
STAGING_CLIENT_ID = '101582376895035372811'
ALLOWED... | Add the staging client id too. | Add the staging client id too.
| Python | bsd-3-clause | all-of-us/raw-data-repository,all-of-us/raw-data-repository,all-of-us/raw-data-repository | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
ALLOWED_CLIENT_IDS = [PYTHON_TEST_CLIENT_ID]
# TOD... | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
STAGING_CLIENT_ID = '101582376895035372811'
ALLOWED... | <commit_before>"""Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
ALLOWED_CLIENT_IDS = [PYTHON_TEST_CL... | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
STAGING_CLIENT_ID = '101582376895035372811'
ALLOWED... | """Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
ALLOWED_CLIENT_IDS = [PYTHON_TEST_CLIENT_ID]
# TOD... | <commit_before>"""Configuration parameters.
Contains things such as the database to connect to.
"""
CLOUDSQL_INSTANCE = 'pmi-drc-api-test:us-central1:pmi-rdr'
CLOUDSQL_SOCKET = '/cloudsql/' + CLOUDSQL_INSTANCE
CLOUDSQL_USER = 'api'
PYTHON_TEST_CLIENT_ID = '116540421226121250670'
ALLOWED_CLIENT_IDS = [PYTHON_TEST_CL... |
d8a861c47df6b41c27f2ec43474766284ba728af | bot/logger/message_sender/reusable/limiter/group.py | bot/logger/message_sender/reusable/limiter/group.py | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | Make ReusableMessageGroup broadcast the notify_about_to_send_message to all limiters | Make ReusableMessageGroup broadcast the notify_about_to_send_message to all limiters
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | <commit_before>from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
... | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
def should_issu... | <commit_before>from bot.logger.message_sender.message_builder import MessageBuilder
from bot.logger.message_sender.reusable.limiter import ReusableMessageLimiter
class ReusableMessageLimiterGroup(ReusableMessageLimiter):
def __init__(self, *limiters: ReusableMessageLimiter):
self.limiters = limiters
... |
769fa2c0c777ac88702e6b3802de4909c8f8df22 | sh_app/forms.py | sh_app/forms.py | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | Remove isPrivate field on league form | Remove isPrivate field on league form
| Python | mit | skill-huddle/skill-huddle,skill-huddle/skill-huddle | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | <commit_before>from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
c... | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class SH_UserFor... | <commit_before>from django import forms
from django.forms import Textarea
from sh_app.models import User, SH_User, League, Suggestion
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
c... |
6dd52ba31141f28e1f37e32f8c3de6932ed49b4f | make_mozilla/base/tests/assertions.py | make_mozilla/base/tests/assertions.py | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_(resolved_route.func is view_function)
if kwargs:
eq_(resolved_route.kwargs, kwargs)
if name:
eq_(revers... | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function_or_class, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_((resolved_route.func is view_function_or_class) or (type(resolved_route.func) is view_function_or_class))
if kwarg... | Allow assert_routing to cope with Feed instances used as route endpoints | Allow assert_routing to cope with Feed instances used as route endpoints | Python | bsd-3-clause | mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_(resolved_route.func is view_function)
if kwargs:
eq_(resolved_route.kwargs, kwargs)
if name:
eq_(revers... | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function_or_class, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_((resolved_route.func is view_function_or_class) or (type(resolved_route.func) is view_function_or_class))
if kwarg... | <commit_before>from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_(resolved_route.func is view_function)
if kwargs:
eq_(resolved_route.kwargs, kwargs)
if name:
... | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function_or_class, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_((resolved_route.func is view_function_or_class) or (type(resolved_route.func) is view_function_or_class))
if kwarg... | from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_(resolved_route.func is view_function)
if kwargs:
eq_(resolved_route.kwargs, kwargs)
if name:
eq_(revers... | <commit_before>from nose.tools import eq_, ok_
from django.core.urlresolvers import resolve, reverse
def assert_routing(url, view_function, name = '', kwargs = {}):
resolved_route = resolve(url)
ok_(resolved_route.func is view_function)
if kwargs:
eq_(resolved_route.kwargs, kwargs)
if name:
... |
8f530fac6e16dcae18aae8696b5a30117137f9f3 | rest/messages/sms-conversation-tracking/example-1.py | rest/messages/sms-conversation-tracking/example-1.py | from flask import Flask, request, redirect, session
import twilio.twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"... | from flask import Flask, request, session
from twilio import twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"+1415... | Clean up Python example for sms-conversation-tracking | Clean up Python example for sms-conversation-tracking
| Python | mit | teoreteetik/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snip... | from flask import Flask, request, redirect, session
import twilio.twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"... | from flask import Flask, request, session
from twilio import twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"+1415... | <commit_before>from flask import Flask, request, redirect, session
import twilio.twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310"... | from flask import Flask, request, session
from twilio import twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"+1415... | from flask import Flask, request, redirect, session
import twilio.twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310": "Finn",
"... | <commit_before>from flask import Flask, request, redirect, session
import twilio.twiml
# The session object makes use of a secret key.
SECRET_KEY = 'a secret key'
app = Flask(__name__)
app.config.from_object(__name__)
# Try adding your own number to this list!
callers = {
"+14158675309": "Rey",
"+14158675310"... |
e6873d3d40d868e743a239c6a74a345c2999541e | dusty_coffin/elasticsearch_custom/edit_spreadsheet.py | dusty_coffin/elasticsearch_custom/edit_spreadsheet.py | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=0Ahf71UaPpMOSdGl0NnQtSFgyVFpvSmV3R2JobzVmZHc&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame.from_csv(bio)... | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=1h1udf_H073YaVlZs0fkYUf9dC6KbEZAhF1veeLExyXo&gid=937170620&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame... | Edit spreadsheet is now fixed. | Edit spreadsheet is now fixed.
| Python | mit | bhillmann/dusty_coffin,bhillmann/dusty_coffin,bhillmann/dusty_coffin,bhillmann/dusty_coffin | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=0Ahf71UaPpMOSdGl0NnQtSFgyVFpvSmV3R2JobzVmZHc&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame.from_csv(bio)... | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=1h1udf_H073YaVlZs0fkYUf9dC6KbEZAhF1veeLExyXo&gid=937170620&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame... | <commit_before>import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=0Ahf71UaPpMOSdGl0NnQtSFgyVFpvSmV3R2JobzVmZHc&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFram... | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=1h1udf_H073YaVlZs0fkYUf9dC6KbEZAhF1veeLExyXo&gid=937170620&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame... | import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=0Ahf71UaPpMOSdGl0NnQtSFgyVFpvSmV3R2JobzVmZHc&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFrame.from_csv(bio)... | <commit_before>import urllib.request
from io import BytesIO
import pandas as pd
import ujson
from elasticsearch import Elasticsearch
csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=0Ahf71UaPpMOSdGl0NnQtSFgyVFpvSmV3R2JobzVmZHc&output=csv").read()
bio = BytesIO(csv)
csv_pd = pd.DataFram... |
8eb0b7fcd6ffb81d6b0fc69cb31c7625550583d7 | targetrupypy.py | targetrupypy.py | from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "rupypy-c"
return entry_point, None
def jitpolicy(driver):
return JitPolicy() | from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "./bin/topaz"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()
| Move towards a normal bin directory. | Move towards a normal bin directory.
| Python | bsd-3-clause | babelsberg/babelsberg-r,topazproject/topaz,babelsberg/babelsberg-r,kachick/topaz,kachick/topaz,babelsberg/babelsberg-r,babelsberg/babelsberg-r,babelsberg/babelsberg-r,kachick/topaz,topazproject/topaz,topazproject/topaz,topazproject/topaz | from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "rupypy-c"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()Move towards a normal bin directory. | from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "./bin/topaz"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()
| <commit_before>from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "rupypy-c"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()<commit_msg>Move towards a normal bin directory.<commit_after> | from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "./bin/topaz"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()
| from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "rupypy-c"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()Move towards a normal bin directory.from pypy.jit.codewriter.policy import JitPolicy
from rupypy.... | <commit_before>from pypy.jit.codewriter.policy import JitPolicy
from rupypy.main import entry_point
def target(driver, args):
driver.exe_name = "rupypy-c"
return entry_point, None
def jitpolicy(driver):
return JitPolicy()<commit_msg>Move towards a normal bin directory.<commit_after>from pypy.jit.codewri... |
39561a89ea497776d980d3eda97fc2f75493528f | internal_social_auth/views.py | internal_social_auth/views.py | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):
def get(se... | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.encoding import force_text
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name_... | Clean up the AuthComplete API a little | Clean up the AuthComplete API a little
| Python | bsd-2-clause | incuna/incuna-internal-social-auth | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):
def get(se... | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.encoding import force_text
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name_... | <commit_before>import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):... | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.encoding import force_text
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name_... | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):
def get(se... | <commit_before>import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):... |
97b000547898d6aa3006f07cf2ef9d8656a67865 | conllu/__init__.py | conllu/__init__.py | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def par... | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def _i... | Add incremental parsing versions of parse and parse_tree | Add incremental parsing versions of parse and parse_tree
| Python | mit | EmilStenstrom/conllu | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def par... | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def _i... | <commit_before>from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence... | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def _i... | from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence
]
def par... | <commit_before>from __future__ import unicode_literals
from conllu.models import TokenList
from conllu.parser import parse_token_and_metadata
def parse(data, fields=None):
return [
TokenList(*parse_token_and_metadata(sentence, fields=fields))
for sentence in data.split("\n\n")
if sentence... |
9e3a6190b2dcfd7de03ef5c974b400a51219839e | pyof/v0x04/symmetric/hello.py | pyof/v0x04/symmetric/hello.py | """Defines Hello message."""
# System imports
# Third-party imports
from pyof.v0x01.symmetric.hello import Hello
__all__ = ('Hello',)
| """Defines Hello message."""
# System imports
from enum import Enum
from pyof.foundation.base import GenericMessage, GenericStruct
from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16
from pyof.v0x04.common.header import Header, Type
# Third-party imports
__all__ = ('Hello', 'HelloElemHeader... | Add Hello class and related classes for v0x04 | Add Hello class and related classes for v0x04
Fix #302
Fix #303
| Python | mit | cemsbr/python-openflow,kytos/python-openflow | """Defines Hello message."""
# System imports
# Third-party imports
from pyof.v0x01.symmetric.hello import Hello
__all__ = ('Hello',)
Add Hello class and related classes for v0x04
Fix #302
Fix #303 | """Defines Hello message."""
# System imports
from enum import Enum
from pyof.foundation.base import GenericMessage, GenericStruct
from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16
from pyof.v0x04.common.header import Header, Type
# Third-party imports
__all__ = ('Hello', 'HelloElemHeader... | <commit_before>"""Defines Hello message."""
# System imports
# Third-party imports
from pyof.v0x01.symmetric.hello import Hello
__all__ = ('Hello',)
<commit_msg>Add Hello class and related classes for v0x04
Fix #302
Fix #303<commit_after> | """Defines Hello message."""
# System imports
from enum import Enum
from pyof.foundation.base import GenericMessage, GenericStruct
from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16
from pyof.v0x04.common.header import Header, Type
# Third-party imports
__all__ = ('Hello', 'HelloElemHeader... | """Defines Hello message."""
# System imports
# Third-party imports
from pyof.v0x01.symmetric.hello import Hello
__all__ = ('Hello',)
Add Hello class and related classes for v0x04
Fix #302
Fix #303"""Defines Hello message."""
# System imports
from enum import Enum
from pyof.foundation.base import GenericMessage,... | <commit_before>"""Defines Hello message."""
# System imports
# Third-party imports
from pyof.v0x01.symmetric.hello import Hello
__all__ = ('Hello',)
<commit_msg>Add Hello class and related classes for v0x04
Fix #302
Fix #303<commit_after>"""Defines Hello message."""
# System imports
from enum import Enum
from py... |
66ae5304c81d74e8f30e9274c90d0f83766744d7 | datamodel/nodes/printer.py | datamodel/nodes/printer.py | import sys
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
sys.stdout.write(self._context)
return self._conte... | import sys
import os
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
try:
sys.stdout.write(str(self._cont... | Make sure we only write chars to stdout | Make sure we only write chars to stdout
| Python | apache-2.0 | csparpa/robograph,csparpa/robograph | import sys
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
sys.stdout.write(self._context)
return self._conte... | import sys
import os
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
try:
sys.stdout.write(str(self._cont... | <commit_before>import sys
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
sys.stdout.write(self._context)
ret... | import sys
import os
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
try:
sys.stdout.write(str(self._cont... | import sys
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
sys.stdout.write(self._context)
return self._conte... | <commit_before>import sys
from datamodel.base import node
class ConsolePrinter(node.Node):
"""
This node prints on stdout its context and then returns it as output.
"""
def input(self, context):
self._context = context
def output(self):
sys.stdout.write(self._context)
ret... |
f7153fd88f07f99181f790a93559efd585272f18 | nuxeo-drive-client/tests/test_copy.py | nuxeo-drive-client/tests/test_copy.py | from tests.common_unit_test import UnitTestCase
class TestCopy(UnitTestCase):
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the remote root workspace
remote.make_file('/', 'test.odt', 'So... | from tests.common_unit_test import RandomBug, UnitTestCase
class TestCopy(UnitTestCase):
@RandomBug('NXDRIVE-808', target='linux', repeat=5)
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the ... | Add RandomBug for Linux on test_synchronize_remote_copy | NXDRIVE-808: Add RandomBug for Linux on test_synchronize_remote_copy
| Python | lgpl-2.1 | ssdi-drive/nuxeo-drive,ssdi-drive/nuxeo-drive,ssdi-drive/nuxeo-drive | from tests.common_unit_test import UnitTestCase
class TestCopy(UnitTestCase):
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the remote root workspace
remote.make_file('/', 'test.odt', 'So... | from tests.common_unit_test import RandomBug, UnitTestCase
class TestCopy(UnitTestCase):
@RandomBug('NXDRIVE-808', target='linux', repeat=5)
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the ... | <commit_before>from tests.common_unit_test import UnitTestCase
class TestCopy(UnitTestCase):
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the remote root workspace
remote.make_file('/', ... | from tests.common_unit_test import RandomBug, UnitTestCase
class TestCopy(UnitTestCase):
@RandomBug('NXDRIVE-808', target='linux', repeat=5)
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the ... | from tests.common_unit_test import UnitTestCase
class TestCopy(UnitTestCase):
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the remote root workspace
remote.make_file('/', 'test.odt', 'So... | <commit_before>from tests.common_unit_test import UnitTestCase
class TestCopy(UnitTestCase):
def test_synchronize_remote_copy(self):
local = self.local_client_1
remote = self.remote_document_client_1
# Create a file and a folder in the remote root workspace
remote.make_file('/', ... |
0dc72761a3b4b17098633df27fdbb70058afe311 | geotrek/signage/migrations/0013_auto_20200423_1255.py | geotrek/signage/migrations/0013_auto_20200423_1255.py | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
def delete_force(apps, schema_editor):
# We can't import Infrastructure models directly as it may be a newer
# version than this migration expects. We use the historical version.
Bla... | Change order migration, user runpython instead | Change order migration, user runpython instead
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
def delete_force(apps, schema_editor):
# We can't import Infrastructure models directly as it may be a newer
# version than this migration expects. We use the historical version.
Bla... | <commit_before># Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
def delete_force(apps, schema_editor):
# We can't import Infrastructure models directly as it may be a newer
# version than this migration expects. We use the historical version.
Bla... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | <commit_before># Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM... |
b6d4baa9d30362a291567f078c1f93df7a63aeaa | waterbutler/providers/osfstorage/metadata.py | waterbutler/providers/osfstorage/metadata.py | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | Return full path if it exists for OSF | Return full path if it exists for OSF
| Python | apache-2.0 | cosenal/waterbutler,Ghalko/waterbutler,CenterForOpenScience/waterbutler,icereval/waterbutler,Johnetordoff/waterbutler,TomBaxter/waterbutler,rdhyee/waterbutler,felliott/waterbutler,RCOSDP/waterbutler,rafaeldelucena/waterbutler,chrisseto/waterbutler,hmoco/waterbutler,kwierman/waterbutler | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | <commit_before>from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
d... | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
def path(self):
... | <commit_before>from waterbutler.core import metadata
class BaseOsfStorageMetadata:
@property
def provider(self):
return 'osfstorage'
class OsfStorageFileMetadata(BaseOsfStorageMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return self.raw['name']
@property
d... |
f2fd526e08cc5576c651a7677c781c0c0bb7c94c | tests/test_jg.py | tests/test_jg.py | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | Fix test generating graph file | Fix test generating graph file
| Python | bsd-2-clause | abele/jinja-graph | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | <commit_before>from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"a... | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"analytics.html"\... | <commit_before>from jg.__main__ import main, generate_template_graph
from mock import patch
FIXTURE_GRAPH = (
'digraph {\n'
'\t"snippets/sub/analytics.html"\n'
'\t"snippets/ga.html"\n'
'\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n'
'\t"header.html"\n'
'\t"a... |
fe9a47f480b8db8de3b2b572f333e56497462ea2 | Python/item15.py | Python/item15.py | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority3(num,pro):
found=False
def helper(x):
nonlocal found
if x in pro:
found=True
return (0,x)
return (1,x... | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority2(num,pro):
found=[False]
def helper(x):
nonlocal found
if x in pro:
found[0]=True
return (0,x)
return... | Add the sort_priority2 for python2. | Add the sort_priority2 for python2.
| Python | mit | Vayne-Lover/Effective | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority3(num,pro):
found=False
def helper(x):
nonlocal found
if x in pro:
found=True
return (0,x)
return (1,x... | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority2(num,pro):
found=[False]
def helper(x):
nonlocal found
if x in pro:
found[0]=True
return (0,x)
return... | <commit_before># -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority3(num,pro):
found=False
def helper(x):
nonlocal found
if x in pro:
found=True
return (0,x)
... | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority2(num,pro):
found=[False]
def helper(x):
nonlocal found
if x in pro:
found[0]=True
return (0,x)
return... | # -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority3(num,pro):
found=False
def helper(x):
nonlocal found
if x in pro:
found=True
return (0,x)
return (1,x... | <commit_before># -*- coding: utf-8 -*-
def sort_priority(num,pro):
res=num[:]
def helper(x):
if x in pro:
return (0,x)
return (1,x)
res.sort(key=helper)
return res
def sort_priority3(num,pro):
found=False
def helper(x):
nonlocal found
if x in pro:
found=True
return (0,x)
... |
8c7c2a65c9d9793e8ba4167ca629eda155f42c4e | mopidy/settings.py | mopidy/settings.py | CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
| CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
| Add logger name to log output | Add logger name to log output
| Python | apache-2.0 | quartz55/mopidy,bacontext/mopidy,mopidy/mopidy,mokieyue/mopidy,vrs01/mopidy,bencevans/mopidy,abarisain/mopidy,adamcik/mopidy,jmarsik/mopidy,tkem/mopidy,SuperStarPL/mopidy,jmarsik/mopidy,mokieyue/mopidy,ali/mopidy,dbrgn/mopidy,ZenithDK/mopidy,tkem/mopidy,priestd09/mopidy,adamcik/mopidy,woutervanwijk/mopidy,quartz55/mopi... | CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
Add logger name to log output | CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
| <commit_before>CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
<commit_msg>Add logger name to log output<commit_after> | CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
| CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
Add logger name to log outputCONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_... | <commit_before>CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s\n %(message)s'
MPD_LINE_ENCODING = u'utf-8'
MPD_LINE_TERMINATOR = u'\n'
MPD_SERVER_HOSTNAME = u'localhost'
MPD_SERVER_PORT = 6600
<commit_msg>Add logger name to log output<commit_after>CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\n %(mes... |
d4ea0bb24d79fa7900ffad4676a09cd4b830a4dc | parser_queuelog.py | parser_queuelog.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | Change split file lines by line | Change split file lines by line
| Python | mit | roramirez/qpanel,roramirez/qpanel,roramirez/qpanel,skazancev/qpanel,skazancev/qpanel,skazancev/qpanel,skazancev/qpanel,roramirez/qpanel | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',... |
0599e76db6c1eef495a608d7386601bbee3cfbc5 | test/authinfo.py | test/authinfo.py | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
def testInquire... | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Empty Result with HTTP GET
'''
def testEmpt... | Add test for empty responses | Add test for empty responses
| Python | mit | fbraem/mqweb,fbraem/mqweb,fbraem/mqweb | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
def testInquire... | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Empty Result with HTTP GET
'''
def testEmpt... | <commit_before>import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
... | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Empty Result with HTTP GET
'''
def testEmpt... | import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
def testInquire... | <commit_before>import unittest
from testbase import MQWebTest
'''
Test for AuthenticationInformationController
'''
class TestAuthInfoActions(MQWebTest):
'''
Test Inquire with HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/authinfo/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
... |
d4a0a85673b5d61b82c65e77efcd6518da719952 | pmxbot/__init__.py | pmxbot/__init__.py | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | Remove places default config. It doesn't appear to be used anywhere. | Remove places default config. It doesn't appear to be used anywhere.
| Python | mit | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | <commit_before># vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
... | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | # vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
log_channels=[]... | <commit_before># vim:ts=4:sw=4:noexpandtab
import socket
import logging as _logging
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname='pmxbot',
database='sqlite:pmxbot.sqlite',
server_host='localhost',
server_port=6667,
use_ssl=False,
password=None,
nickserv_password=None,
silent_bot=False,
... |
525cbab46570342098613ae591749b4cf5026453 | tests/terrain.py | tests/terrain.py | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | Create the tests output directory automatically. | Create the tests output directory automatically.
| Python | mit | gnott/elife-poa-xml-generation,gnott/elife-poa-xml-generation | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | <commit_before>from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.bas... | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.basedir)
world.bas... | <commit_before>from lettuce import world
import os
"""
Set world.basedir relative to this terrain.py file,
when running lettuce from this directory,
and add the directory it to the import path
"""
world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.sys.path.insert(0,world.bas... |
8d09a8557433d95015010465b62f31ffe7b6fe2c | usb/shortener.py | usb/shortener.py | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = None
def get_short_id(self, number):
if self._hashe... | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = Hashids(self.secret, self.min_length)
def get_short_id(self... | Move hasher creation to constructor | Move hasher creation to constructor
| Python | mit | dizpers/usb | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = None
def get_short_id(self, number):
if self._hashe... | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = Hashids(self.secret, self.min_length)
def get_short_id(self... | <commit_before>from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = None
def get_short_id(self, number):
... | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = Hashids(self.secret, self.min_length)
def get_short_id(self... | from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = None
def get_short_id(self, number):
if self._hashe... | <commit_before>from hashids import Hashids
class Shortener(object):
def __init__(self, secret, min_length, short_url_domain):
self.secret = secret
self.min_length = min_length
self.short_url_domain = short_url_domain
self._hasher = None
def get_short_id(self, number):
... |
b5ae6290382ef69f9d76c0494aee90f85bdf2c16 | plugins/Views/SimpleView/__init__.py | plugins/Views/SimpleView/__init__.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple View"),
... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"type": "view",
"plugin": {
"name": i18n_catalog.i18nc("@label"... | Fix plug-in type and description key | Fix plug-in type and description key
't Was a typo.
Contributes to issue CURA-1190.
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple View"),
... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"type": "view",
"plugin": {
"name": i18n_catalog.i18nc("@label"... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"type": "view",
"plugin": {
"name": i18n_catalog.i18nc("@label"... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple View"),
... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple... |
35c7d7816c3c441286519658a3426a5f03aca284 | plugins/check_pinned/check_pinned.py | plugins/check_pinned/check_pinned.py | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | Add note about potential work around | Add note about potential work around
The bot itself cannot send a message only on presence_change actions
We may be able to contact the slack bot to send a message in our stead instead.
| Python | mit | pyamanak/oithdbot | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | <commit_before>from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
... | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
# While we ca... | <commit_before>from __future__ import unicode_literals
# don't convert to ascii in py2.7 when creating string to return
crontable = []
outputs = []
# Catch all the events
def catch_all(data):
print(data)
# Only handles when a user becomes active
def process_presence_change(data):
print("PRESENCE CHANGE")
... |
e4ee7034291fbeda48efa0d1c617be8a20eb49bd | algorithms/python/496_next_greater_element.py | algorithms/python/496_next_greater_element.py | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | Add another solution for 496 next greater element | Add another solution for 496 next greater element
| Python | mit | ruichao-factual/leetcode | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | <commit_before>class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = in... | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = index + 1
... | <commit_before>class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
results = []
for findNum in findNums:
index = nums.index(findNum)
result = in... |
c480c2058d7f5d2e9bfe2e1a6f0a318eb0d49a4b | tangled/website/resources.py | tangled/website/resources.py | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template_name='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, ... | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, dir_a... | Rename template_name @config arg to template | Rename template_name @config arg to template
| Python | mit | TangledWeb/tangled.website | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template_name='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, ... | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, dir_a... | <commit_before>from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template_name='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
... | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, dir_a... | from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template_name='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
for prefix, ... | <commit_before>from tangled.web import Resource, config
from tangled.site.resources.entry import Entry
class Docs(Entry):
@config('text/html', template_name='tangled.website:templates/docs.mako')
def GET(self):
static_dirs = self.app.get_all('static_directory', as_dict=True)
links = []
... |
428371a67a7c742e239d96914a96558171f9f59e | test/requests/test-website.py | test/requests/test-website.py | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
import requests as req
import sys
print "Mechanical Rob firing up..."
if len(sys... | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
from __future__ import print_function
from link_checker import check_links
import a... | Use argparse to handle arguments | Use argparse to handle arguments
* Use argparse to handle commandline arguments.
* Create initial layout of how the code might end up - lots of the code
is currently commented out.
| Python | agpl-3.0 | zsloan/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,... | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
import requests as req
import sys
print "Mechanical Rob firing up..."
if len(sys... | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
from __future__ import print_function
from link_checker import check_links
import a... | <commit_before># Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
import requests as req
import sys
print "Mechanical Rob firing up.... | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
from __future__ import print_function
from link_checker import check_links
import a... | # Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
import requests as req
import sys
print "Mechanical Rob firing up..."
if len(sys... | <commit_before># Run with something like
#
# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules
import requests as req
import sys
print "Mechanical Rob firing up.... |
e5daa53aab94360c2e06a6cb608c4992b25becc6 | test/helpers.py | test/helpers.py | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | Allow stream ids != 1 in frame factory. | Allow stream ids != 1 in frame factory.
| Python | mit | Kriechi/hyper-h2,mhils/hyper-h2,bhavishyagopesh/hyper-h2,Kriechi/hyper-h2,vladmunteanu/hyper-h2,python-hyper/hyper-h2,python-hyper/hyper-h2,vladmunteanu/hyper-h2 | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | <commit_before># -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allo... | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | # -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allows test cases t... | <commit_before># -*- coding: utf-8 -*-
"""
helpers
~~~~~~~
This module contains helpers for the h2 tests.
"""
from hyperframe.frame import HeadersFrame, DataFrame
from hpack.hpack import Encoder
class FrameFactory(object):
"""
A class containing lots of helper methods and state to build frames. This
allo... |
1509336a27d80eae68e56cfa776bd8342221297f | tests/scoring_engine/engine/test_basic_check.py | tests/scoring_engine/engine/test_basic_check.py | from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
def setup(sel... | import pytest
from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
... | Add test for incorrect check properties | Add test for incorrect check properties
| Python | mit | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
def setup(sel... | import pytest
from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
... | <commit_before>from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
... | import pytest
from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
... | from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
def setup(sel... | <commit_before>from scoring_engine.engine.basic_check import BasicCheck
from scoring_engine.models.service import Service
from scoring_engine.models.environment import Environment
from scoring_engine.models.account import Account
from tests.scoring_engine.unit_test import UnitTest
class TestBasicCheck(UnitTest):
... |
8b5ccf93fbac8929ecfc185d7407a79b1e890bde | project_template/project_settings.py | project_template/project_settings.py | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.icekit import * # icekit, glamkit
# Override the defau... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the defa... | Use GLAMkit settings in default project template. | Use GLAMkit settings in default project template.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.icekit import * # icekit, glamkit
# Override the defau... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the defa... | <commit_before># Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.icekit import * # icekit, glamkit
# Ove... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the defa... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.icekit import * # icekit, glamkit
# Override the defau... | <commit_before># Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `icekit_settings_local.py`
from icekit.project.settings.icekit import * # icekit, glamkit
# Ove... |
ea20424f2645f1157c0a7ea76b32a4f834c1e27b | pythonect/internal/__init__.py | pythonect/internal/__init__.py | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | Delete blank line at end of file | Delete blank line at end of file
| Python | bsd-3-clause | ikotler/pythonect,fr34k8/pythonect,fr34k8/pythonect,TOSPIO/pythonect,ikotler/pythonect | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | <commit_before># Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | # Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | <commit_before># Copyright (c) 2012-2013, Itzik Kotler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... |
6cfc784ce3136cbec8c88948f4d6b45f9070b91b | pyqode/__init__.py | pyqode/__init__.py | # -*- coding: utf-8 -*-
"""
pyQode is a code editor framework for python qt applications.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__)
| # -*- coding: utf-8 -*-
"""
pyQode is a source code editor widget for Python Qt (PyQt5/PyQt4/PySide)
pyQode is a **namespace package**.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__) | Fix pyqode main docstring (uniformised with other pyqode namespace packages) | Fix pyqode main docstring (uniformised with other pyqode namespace packages)
| Python | mit | mmolero/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python,pyQode/pyqode.python | # -*- coding: utf-8 -*-
"""
pyQode is a code editor framework for python qt applications.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__)
Fix pyqode main docstring (uniformised with other pyqode namespace packages) | # -*- coding: utf-8 -*-
"""
pyQode is a source code editor widget for Python Qt (PyQt5/PyQt4/PySide)
pyQode is a **namespace package**.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__) | <commit_before># -*- coding: utf-8 -*-
"""
pyQode is a code editor framework for python qt applications.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__)
<commit_msg>Fix pyqode main docstring (uniformised with other pyqode namespace packages)<commit_after> | # -*- coding: utf-8 -*-
"""
pyQode is a source code editor widget for Python Qt (PyQt5/PyQt4/PySide)
pyQode is a **namespace package**.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__) | # -*- coding: utf-8 -*-
"""
pyQode is a code editor framework for python qt applications.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__)
Fix pyqode main docstring (uniformised with other pyqode namespace packages)# -*- coding: utf-8 -*-
"""
pyQode is a source code editor widget for Python Qt (PyQt5/... | <commit_before># -*- coding: utf-8 -*-
"""
pyQode is a code editor framework for python qt applications.
"""
import pkg_resources
pkg_resources.declare_namespace(__name__)
<commit_msg>Fix pyqode main docstring (uniformised with other pyqode namespace packages)<commit_after># -*- coding: utf-8 -*-
"""
pyQode is a source... |
226e8c322670a310fcfb9eb95d9d59838bbac3d3 | refcollections/admin_custom.py | refcollections/admin_custom.py | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | Add User back into admin | Add User back into admin
| Python | bsd-3-clause | uq-eresearch/archaeology-reference-collections,uq-eresearch/archaeology-reference-collections,uq-eresearch/archaeology-reference-collections,uq-eresearch/archaeology-reference-collections | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | <commit_before>from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls ... | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls = patterns('',
... | <commit_before>from django.contrib.admin.sites import AdminSite
from django.conf.urls.defaults import patterns, url
from shells.admin_views import ShellsImagesUploader, upload_species_spreadsheet
class ShellsAdmin(AdminSite):
def get_urls(self):
urls = super(ShellsAdmin, self).get_urls()
my_urls ... |
52d38e360b14fcfad01f87ff1e9ca5db27004877 | src/comms/admin.py | src/comms/admin.py | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | Remove unsupport M2M field in channelAdmin handler. Removes traceback when DEBUG=True. | Remove unsupport M2M field in channelAdmin handler. Removes traceback when DEBUG=True.
| Python | bsd-3-clause | ypwalter/evennia,TheTypoMaster/evennia,TheTypoMaster/evennia,mrkulk/text-world,mrkulk/text-world,titeuf87/evennia,ergodicbreak/evennia,mrkulk/text-world,feend78/evennia,shollen/evennia,jamesbeebop/evennia,shollen/evennia,feend78/evennia,ergodicbreak/evennia,feend78/evennia,titeuf87/evennia,mrkulk/text-world,jamesbeebop... | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | <commit_before>#
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'd... | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | #
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'db_lock_storage'... | <commit_before>#
# This sets up how models are displayed
# in the web admin interface.
#
from django.contrib import admin
from src.comms.models import ChannelDB
class MsgAdmin(admin.ModelAdmin):
list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers',
'db_channels', 'db_message', 'd... |
21b6a5573190848b93de930b9d41e1ac766c18bc | src/epiweb/urls.py | src/epiweb/urls.py | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | Add user registration URLs. Use what django-registration provides for the moment. | Add user registration URLs. Use what django-registration provides for the moment.
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | <commit_before>from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc lin... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc line below and add... | <commit_before>from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import epiweb.apps.survey.urls
urlpatterns = patterns('',
# Example:
# (r'^epiweb/', include('epiweb.foo.urls')),
# Uncomment the admin/doc lin... |
017de01e8a1ec8f49069cf546e89652b4ddb8e39 | tests/test_create_template.py | tests/test_create_template.py | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
@pytest.fixture
def output_dir(tmpdir):
return str(tmpdir.mkdir('output'))
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([... | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([
'tox',
plugin,
'-c', os.path.join(plugin, 't... | Remove output_dir fixture from test | Remove output_dir fixture from test
| Python | mit | pytest-dev/cookiecutter-pytest-plugin | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
@pytest.fixture
def output_dir(tmpdir):
return str(tmpdir.mkdir('output'))
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([... | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([
'tox',
plugin,
'-c', os.path.join(plugin, 't... | <commit_before># -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
@pytest.fixture
def output_dir(tmpdir):
return str(tmpdir.mkdir('output'))
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subproce... | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([
'tox',
plugin,
'-c', os.path.join(plugin, 't... | # -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
@pytest.fixture
def output_dir(tmpdir):
return str(tmpdir.mkdir('output'))
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subprocess.check_call([... | <commit_before># -*- coding: utf-8 -*-
"""
test_create_template
--------------------
"""
import os
import pytest
import subprocess
@pytest.fixture
def output_dir(tmpdir):
return str(tmpdir.mkdir('output'))
def run_tox(plugin):
"""Run the tox suite of the newly created plugin."""
try:
subproce... |
a6e9438cd7aa205fb1ae1f20d192b9139bcd7f95 | thecure/game.py | thecure/game.py | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | Increase the resolution to 1024x768. | Increase the resolution to 1024x768.
This will make it easier to see things like the house. 800x600 is just
too small.
| Python | mit | chipx86/the-cure | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | <commit_before>import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pyg... | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pygame.display.set... | <commit_before>import pygame
from pygame.locals import *
from thecure.engine import TheCureEngine
def main():
pygame.init()
version = pygame.__version__.split('.')
if int(version[0]) <= 1 and int(version[1]) < 9:
print 'This game requires pygame 1.9 or higher.'
return
screen = pyg... |
18b0ddbbca429778a70f1e9b7f7d5140eb88d68f | tests/test_fs.py | tests/test_fs.py | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | Add test to Path compare. | Add test to Path compare. | Python | mit | andrewguy9/farmfs,andrewguy9/farmfs | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | <commit_before>from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
ass... | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
assert _normalize(... | <commit_before>from farmfs.fs import normpath as _normalize
from farmfs.fs import userPath2Path as up2p
from farmfs.fs import Path
def test_normalize_abs():
assert _normalize("/") == "/"
assert _normalize("/a") == "/a"
assert _normalize("/a/") == "/a"
assert _normalize("/a/b") == "/a/b"
ass... |
c41d0a9f03e66fdc20fb093aaad87cdd6f60461e | studies/helpers.py | studies/helpers.py | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
# TODO: celery taskify
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
Helper for sendi... | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.celery import app
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
@app.task
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
... | Add decorator to send_mail function to celery taskify. | Add decorator to send_mail function to celery taskify.
| Python | apache-2.0 | pattisdr/lookit-api,pattisdr/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,CenterForOpenScience/lookit-api | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
# TODO: celery taskify
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
Helper for sendi... | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.celery import app
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
@app.task
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
... | <commit_before>from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
# TODO: celery taskify
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
H... | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.celery import app
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
@app.task
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
... | from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
# TODO: celery taskify
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
Helper for sendi... | <commit_before>from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import get_template
from project.settings import EMAIL_FROM_ADDRESS, BASE_URL
# TODO: celery taskify
def send_mail(template_name, subject, to_addresses, cc=None, bcc=None, from_email=None, **context):
"""
H... |
49a1548399fa822515920d910ec6ea6a6c813bca | threadpool.py | threadpool.py | from __future__ import with_statement
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
@threado.stream
def run(inner, self, func, *args, **keys):
... | from __future__ import with_statement
import sys
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
def run(self, func, *args, **keys):
with self... | Fix a weird situation when a function run in a thread raises StopIteration, which was erroneusly interpreted that the thread returned None. | Fix a weird situation when a function run in a thread raises StopIteration, which was erroneusly interpreted that the thread returned None.
| Python | mit | abusesa/idiokit | from __future__ import with_statement
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
@threado.stream
def run(inner, self, func, *args, **keys):
... | from __future__ import with_statement
import sys
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
def run(self, func, *args, **keys):
with self... | <commit_before>from __future__ import with_statement
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
@threado.stream
def run(inner, self, func, *a... | from __future__ import with_statement
import sys
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
def run(self, func, *args, **keys):
with self... | from __future__ import with_statement
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
@threado.stream
def run(inner, self, func, *args, **keys):
... | <commit_before>from __future__ import with_statement
import threado
import threading
import Queue
class ThreadPool(object):
def __init__(self, idle_time=5.0):
self.lock = threading.Lock()
self.threads = list()
self.idle_time = idle_time
@threado.stream
def run(inner, self, func, *a... |
b252592eb40263994317d88ced43ddc4669a4975 | tests/run_tests.py | tests/run_tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | Fix return code when running unittests. | Fix return code when running unittests.
| Python | bsd-3-clause | AndiDog/sqlparse,actsasgeek/sqlparse,zhongdai/sqlparse,tailhook/sqlparse,AndiDog/sqlparse,Yelp/sqlparse,Yelp/sqlparse,benekastah/sqlparse,actsasgeek/sqlparse,tailhook/sqlparse,Yelp/sqlparse,MariaPet/sqlparse,payne/sqlparse,adamgreenhall/sqlparse,andialbrecht/sqlparse,tailhook/sqlparse,adamgreenhall/sqlparse,payne/sqlpa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()
parser.add_opt... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test runner for sqlparse."""
import optparse
import os
import sys
import unittest
test_mod = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if test_mod not in sys.path:
sys.path.insert(1, test_mod)
parser = optparse.OptionParser()... |
12ec1cf9084789b9e2022eb0d1d55b553db06cb5 | tests/test_util.py | tests/test_util.py | import util
from nose.tools import assert_equal
class TestPick():
def check(self, filenames, expected, k, randomized):
result = util.pick(filenames, k, randomized)
assert_equal(result, expected)
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', '... | import util
from nose.tools import assert_equal, assert_true, raises
class TestPick():
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', 'e-0.txt']
expected = ['e-0.txt', 'd-1.txt', 'b-2.txt', 'c-3.txt', 'a-4.txt']
result = util.pick(filenames, random... | Fix unit test for util.py | Fix unit test for util.py
| Python | mit | kemskems/otdet | import util
from nose.tools import assert_equal
class TestPick():
def check(self, filenames, expected, k, randomized):
result = util.pick(filenames, k, randomized)
assert_equal(result, expected)
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', '... | import util
from nose.tools import assert_equal, assert_true, raises
class TestPick():
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', 'e-0.txt']
expected = ['e-0.txt', 'd-1.txt', 'b-2.txt', 'c-3.txt', 'a-4.txt']
result = util.pick(filenames, random... | <commit_before>import util
from nose.tools import assert_equal
class TestPick():
def check(self, filenames, expected, k, randomized):
result = util.pick(filenames, k, randomized)
assert_equal(result, expected)
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt... | import util
from nose.tools import assert_equal, assert_true, raises
class TestPick():
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', 'e-0.txt']
expected = ['e-0.txt', 'd-1.txt', 'b-2.txt', 'c-3.txt', 'a-4.txt']
result = util.pick(filenames, random... | import util
from nose.tools import assert_equal
class TestPick():
def check(self, filenames, expected, k, randomized):
result = util.pick(filenames, k, randomized)
assert_equal(result, expected)
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt', 'd-1.txt', '... | <commit_before>import util
from nose.tools import assert_equal
class TestPick():
def check(self, filenames, expected, k, randomized):
result = util.pick(filenames, k, randomized)
assert_equal(result, expected)
def test_all_sequential(self):
filenames = ['a-4.txt', 'b-2.txt', 'c-3.txt... |
048107baf565c26a21421ef8f703be5cf7591cee | src/ggrc/fulltext/__init__.py | src/ggrc/fulltext/__init__.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | Change tags to kwarg in full text record | Change tags to kwarg in full text record
This change will allow us to set the tags value with kwargs that are set
in custom attribute values.
| Python | apache-2.0 | edofic/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,j0gurt/ggr... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def u... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def update_record(se... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.extensions import get_extension_instance
class Indexer(object):
def __init__(self, settings):
pass
def create_record(self, record):
raise NotImplementedError()
def u... |
f6bcc5af968c5c8b81fd6db10bad50b1fadcb5d1 | discover_road_runner/meep_meep/tests/test_meep_meep.py | discover_road_runner/meep_meep/tests/test_meep_meep.py | import unittest
from django.test import SimpleTestCase
class BasicTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')
... | import unittest
from django.test import SimpleTestCase
class CombinedTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')... | Rename test as it really is a full integration test. | Rename test as it really is a full integration test.
| Python | mit | pzrq/discover-road-runner | import unittest
from django.test import SimpleTestCase
class BasicTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')
... | import unittest
from django.test import SimpleTestCase
class CombinedTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')... | <commit_before>import unittest
from django.test import SimpleTestCase
class BasicTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix ... | import unittest
from django.test import SimpleTestCase
class CombinedTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')... | import unittest
from django.test import SimpleTestCase
class BasicTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix me later?')
... | <commit_before>import unittest
from django.test import SimpleTestCase
class BasicTest(SimpleTestCase):
def test_success(self):
self.assertEqual(1 + 1, 2)
def test_error(self):
raise ValueError
def test_fail(self):
self.fail()
def test_skip(self):
self.skipTest('Fix ... |
ff9a4f89d81c2059f51f7346700ce16972f04e36 | django_basic_tinymce_flatpages/admin.py | django_basic_tinymce_flatpages/admin.py | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | Fix getattr() takes no keyword arguments | Fix getattr() takes no keyword arguments
| Python | bsd-3-clause | ad-m/django-basic-tinymce-flatpages | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | <commit_before>from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tiny... | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | <commit_before>from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tiny... |
0bf00b40e84a5c5fbcdbeb7b81911998e3f1081a | src/idea/tests/smoke_tests.py | src/idea/tests/smoke_tests.py | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state']
@fixture
def user(self):
try:
... | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state', 'core... | Use fixtures for smoke tests | Use fixtures for smoke tests
| Python | cc0-1.0 | cmc333333/idea-box,m3brown/idea-box,18F/idea-box,cmc333333/idea-box,CapeSepias/idea-box,geomapdev/idea-box,CapeSepias/idea-box,cmc333333/idea-box,18F/idea-box,geomapdev/idea-box,geomapdev/idea-box,18F/idea-box,CapeSepias/idea-box,m3brown/idea-box | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state']
@fixture
def user(self):
try:
... | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state', 'core... | <commit_before>import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state']
@fixture
def user(self):
... | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state', 'core... | import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state']
@fixture
def user(self):
try:
... | <commit_before>import os
from django.utils import timezone
from django_webtest import WebTest
from exam.decorators import fixture
from exam.cases import Exam
from django.core.urlresolvers import reverse
class SmokeTest(Exam, WebTest):
csrf_checks = False
fixtures = ['state']
@fixture
def user(self):
... |
b77a3f47876d824d2e0f1c009a6d580fc5d41ec6 | accelerator/migrations/0019_add_deferred_user_role.py | accelerator/migrations/0019_add_deferred_user_role.py | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | Make changes to the migration file | [AC-7594] Make changes to the migration file
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | <commit_before># Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = a... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | <commit_before># Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = a... |
4574d25ade5c18d6c15ac6d427f4fbd4cb2f0f04 | braid/info.py | braid/info.py | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | Add debian-squeeze support for os detection. | Add debian-squeeze support for os detection.
| Python | mit | alex/braid,alex/braid | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | <commit_before>from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | <commit_before>from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb... |
ee7ced467a7b87e71aa5a1df4c828e672d0b9870 | Utils/py/BallDetection/RegressionNetwork/evaluate.py | Utils/py/BallDetection/RegressionNetwork/evaluate.py | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | Print all evaluation metrics associated with the model | Print all evaluation metrics associated with the model
| Python | apache-2.0 | BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | <commit_before>#!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the ... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | <commit_before>#!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the ... |
d25603818e6af0b99ee1a6add0a7e182037d7a12 | tests/test_set_pref.py | tests/test_set_pref.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | Verify that recent list is cleared when language is changed | Verify that recent list is cleared when language is changed
| Python | mit | caleb531/youversion-suggest,caleb531/youversion-suggest | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.pre... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.preserve_recent_re... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose.tools as nose
import yv_suggest.set_pref as yvs
import context_managers as ctx
def test_set_language():
"""should set preferred language"""
with ctx.preserve_prefs() as prefs:
with ctx.pre... |
88098475358aaee18d32a1ad2c4a4301672bca0e | account_move_fiscal_month/models/account_move_line.py | account_move_fiscal_month/models/account_move_line.py | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
store=True, copy=False)
| # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
)
| Remove unneeded and inefficient "store=True" | [FIX] Remove unneeded and inefficient "store=True"
| Python | agpl-3.0 | OCA/account-financial-tools,OCA/account-financial-tools | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
store=True, copy=False)
[... | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
)
| <commit_before># Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
store=True... | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
)
| # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
store=True, copy=False)
[... | <commit_before># Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fm_id = fields.Many2one(
related='move_id.date_range_fm_id',
store=True... |
68a7fd8a444a8c568d716db11849f58ad7a9dee5 | django_pesapal/views.py | django_pesapal/views.py | # Create your views here.
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import RedirectView
from django.db.models.loading import get_model
from .models import Transaction
import conf
class TransactionCompletedView(Redirect... | # Create your views here.
from django.core.urlresolvers import reverse_lazy, reverse
from django.views.generic.base import RedirectView
from django.core.urlresolvers import NoReverseMatch
from .models import Transaction
import conf
class TransactionCompletedView(RedirectView):
permanent = False
url = None
... | Add support for further processing of the payment while maintaining compatibility | Add support for further processing of the payment while maintaining compatibility
| Python | bsd-3-clause | odero/django-pesapal,odero/django-pesapal | # Create your views here.
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import RedirectView
from django.db.models.loading import get_model
from .models import Transaction
import conf
class TransactionCompletedView(Redirect... | # Create your views here.
from django.core.urlresolvers import reverse_lazy, reverse
from django.views.generic.base import RedirectView
from django.core.urlresolvers import NoReverseMatch
from .models import Transaction
import conf
class TransactionCompletedView(RedirectView):
permanent = False
url = None
... | <commit_before># Create your views here.
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import RedirectView
from django.db.models.loading import get_model
from .models import Transaction
import conf
class TransactionComplet... | # Create your views here.
from django.core.urlresolvers import reverse_lazy, reverse
from django.views.generic.base import RedirectView
from django.core.urlresolvers import NoReverseMatch
from .models import Transaction
import conf
class TransactionCompletedView(RedirectView):
permanent = False
url = None
... | # Create your views here.
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import RedirectView
from django.db.models.loading import get_model
from .models import Transaction
import conf
class TransactionCompletedView(Redirect... | <commit_before># Create your views here.
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.views.generic.base import RedirectView
from django.db.models.loading import get_model
from .models import Transaction
import conf
class TransactionComplet... |
7c1345c09cffaef9710bed24f6ae4ed791c3ade0 | setup_cuda_deps.py | setup_cuda_deps.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | Add chainer to required packages | Add chainer to required packages
| Python | mit | yanweifu/chainer,ytoyama/yans_chainer_hackathon,AlpacaDB/chainer,jfsantos/chainer,jnishi/chainer,cupy/cupy,woodshop/chainer,okuta/chainer,woodshop/complex-chainer,niboshi/chainer,ysekky/chainer,cupy/cupy,hvy/chainer,ktnyt/chainer,hvy/chainer,wkentaro/chainer,benob/chainer,rezoo/chainer,kiyukuta/chainer,1986ks/chainer,K... | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_r... | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | #!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_requires=[
... | <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='chainer-cuda-deps',
version='1.0.0',
description='Install dependent packages to use Chainer on CUDA',
author='Seiya Tokui',
author_email='tokui@preferred.jp',
url='http://chainer.org/',
packages=[],
install_r... |
b7106307baf97ba32cb29fe2a4bb9ed925c194ca | custom/onse/management/commands/update_onse_facility_cases.py | custom/onse/management/commands/update_onse_facility_cases.py | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | Fix passing keyword arg to task | Fix passing keyword arg to task
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | <commit_before>from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args,... | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args, **options):
... | <commit_before>from django.core.management import BaseCommand
from custom.onse.tasks import update_facility_cases_from_dhis2_data_elements
class Command(BaseCommand):
help = ('Update facility_supervision cases with indicators collected '
'in DHIS2 over the last quarter.')
def handle(self, *args,... |
e5eff6f7f92b2946ca17e59c70b81df6f2e7a12d | opps/core/models/publisher.py | opps/core/models/publisher.py | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | Remove date field (insert and update) | Remove date field (insert and update)
| Python | mit | jeanmask/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | <commit_before>#!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_availab... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | <commit_before>#!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_availab... |
1dd58c6717fb8c3c23bce8cecf205c04cc03a134 | comrade/views/simple.py | comrade/views/simple.py | from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader
from django.conf import settings
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("Responding to status check")
return HttpResponse()
def server_error(re... | from django.http import HttpResponse, HttpResponseServerError
from django.template import RequestContext, loader
from django.conf import settings
from maintenancemode.http import HttpResponseTemporaryUnavailable
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("R... | Use requestcontext in error views. | Use requestcontext in error views.
| Python | mit | bueda/django-comrade | from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader
from django.conf import settings
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("Responding to status check")
return HttpResponse()
def server_error(re... | from django.http import HttpResponse, HttpResponseServerError
from django.template import RequestContext, loader
from django.conf import settings
from maintenancemode.http import HttpResponseTemporaryUnavailable
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("R... | <commit_before>from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader
from django.conf import settings
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("Responding to status check")
return HttpResponse()
def ... | from django.http import HttpResponse, HttpResponseServerError
from django.template import RequestContext, loader
from django.conf import settings
from maintenancemode.http import HttpResponseTemporaryUnavailable
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("R... | from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader
from django.conf import settings
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("Responding to status check")
return HttpResponse()
def server_error(re... | <commit_before>from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader
from django.conf import settings
import logging
logger = logging.getLogger('comrade.views.simple')
def status(request):
logger.info("Responding to status check")
return HttpResponse()
def ... |
0ba671698bf4e268ae3f17e11078a5eb669a174c | indico/modules/events/roles/__init__.py | indico/modules/events/roles/__init__.py | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Move roles menu item into a submenu | Move roles menu item into a submenu
- 'organization' for conferences
- 'advanced' for other event types
| Python | mit | mic4ael/indico,indico/indico,mic4ael/indico,pferreir/indico,DirkHoffmann/indico,OmeGak/indico,pferreir/indico,OmeGak/indico,DirkHoffmann/indico,indico/indico,mvidalgarcia/indico,ThiefMaster/indico,indico/indico,OmeGak/indico,ThiefMaster/indico,DirkHoffmann/indico,DirkHoffmann/indico,mvidalgarcia/indico,ThiefMaster/indi... | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | <commit_before># This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
#... | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | <commit_before># This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
#... |
8ab4dd1012bedad286e19543f75e5a86d72a0402 | biothings/web/api/es/handlers/biothing_handler.py | biothings/web/api/es/handlers/biothing_handler.py |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Inject bi... |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Set GA tr... | Set _version requirement for annotation | Set _version requirement for annotation
| Python | apache-2.0 | biothings/biothings.api,biothings/biothings.api |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Inject bi... |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Set GA tr... | <commit_before>
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
... |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Set GA tr... |
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
Inject bi... | <commit_before>
from tornado.web import Finish
from biothings.web.api.es.handlers.base_handler import ESRequestHandler
class BiothingHandler(ESRequestHandler):
'''
Handle requests to the annotation lookup endpoint.
'''
name = 'annotation'
def pre_query_builder_hook(self, options):
'''
... |
369e70cc5d5e1c880bd61f055ffbe43d5aeab509 | nodeconductor/structure/tests/unittests/test_models.py | nodeconductor/structure/tests/unittests/test_models.py | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | Break test flow into logical subsets | Break test flow into logical subsets [WAL-615]
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | <commit_before>from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certif... | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certifications(self):... | <commit_before>from django.test import TestCase
from nodeconductor.structure.tests import factories
class ServiceProjectLinkTest(TestCase):
def setUp(self):
self.link = factories.TestServiceProjectLinkFactory()
def test_link_is_in_certification_erred_state_if_service_does_not_satisfy_project_certif... |
5a785f725d68733561a7e5e82c57655e25439ec8 | indra/tests/test_grounding_resources.py | indra/tests/test_grounding_resources.py | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in def... | Remove exceptional namespaces from test | Remove exceptional namespaces from test
| Python | bsd-2-clause | johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in def... | <commit_before>import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in stateme... | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in def... | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | <commit_before>import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in stateme... |
1e42bc1ef04ff3f52ce3f5db75d781be7d450a25 | etl_framework/etl_class.py | etl_framework/etl_class.py | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | Make EtlClass attribute access more robust | Make EtlClass attribute access more robust
| Python | mit | pantheon-systems/etl-framework | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | <commit_before>"""Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key... | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | """Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key] = value
... | <commit_before>"""Base EtlClass that all EtlClasses should inherit"""
class EtlClass(object):
def __init__(self, config):
self.config = config
def __setattr__(self, key, value):
"""Set attribute on config if not in EtlClass object"""
if key == "config":
self.__dict__[key... |
1f83113e748963cda9688d88a5d36dd7f9a54c1f | tests/app/test_cloudfoundry_config.py | tests/app/test_cloudfoundry_config.py | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | Move setting VCAP_SERVICES out of fixture | Move setting VCAP_SERVICES out of fixture
This was inconsistent with the source data for the fixture being
overidden in some of the tests. We only need to set it in the env
once, so it makes sense to just put the code there.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | <commit_before>import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
... | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
}],
'u... | <commit_before>import json
import os
import pytest
from app.cloudfoundry_config import (
extract_cloudfoundry_config,
set_config_env_vars,
)
@pytest.fixture
def cloudfoundry_config():
return {
'postgres': [{
'credentials': {
'uri': 'postgres uri'
}
... |
7cbe2351c2ad93def98005597a24e21d878ea492 | flask_velox/mixins/http.py | flask_velox/mixins/http.py | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | Allow RedirectMixin to work within flask-admin | Allow RedirectMixin to work within flask-admin
| Python | mit | thisissoon/Flask-Velox,thisissoon/Flask-Velox,jstacoder/Flask-Velox,jstacoder/Flask-Velox | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | <commit_before># -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be... | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | # -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be used
howev... | <commit_before># -*- coding: utf-8 -*-
""" Module provides mixins for issuing HTTP Status codes using the
Flask ``View``.
"""
from flask import url_for
from flask.views import View
from werkzeug.utils import redirect
class RedirectMixin(View):
""" Raise a HTTP Redirect, by default a 302 HTTP Status Code will be... |
c058ea00594efcdb39bb106ebe79dde39354e159 | downloader.py | downloader.py | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "0",
"--audio-format", "mp3",
"--exec",
... | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "9",
"--audio-format", "mp3",
"--exec",
... | Use low quality audio (sounds good enough) | Use low quality audio (sounds good enough)
| Python | mit | xrisk/webdl,xrisk/webdl,xrisk/webdl | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "0",
"--audio-format", "mp3",
"--exec",
... | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "9",
"--audio-format", "mp3",
"--exec",
... | <commit_before>import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "0",
"--audio-format", "mp3",
"-... | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "9",
"--audio-format", "mp3",
"--exec",
... | import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "0",
"--audio-format", "mp3",
"--exec",
... | <commit_before>import sha
import os
def sha_hash(content):
return sha.new(content).hexdigest()
def download_audio(url):
from subprocess import call
retcode = call(["youtube-dl", "-x", "--id",
"--audio-quality", "0",
"--audio-format", "mp3",
"-... |
bdda5e565981ac26a7e5e1ab8d1486eb91b09e4c | views/base.py | views/base.py | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
if page.override_url:
return HttpResponseRedirect(page.ov... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path=None):
if path is None:
path = request.path
page = Page.objects.page_for_path_or_404(path)
if page.ov... | Use request.path if no path was passed to the default view | Use request.path if no path was passed to the default view
| Python | bsd-3-clause | mjl/feincms,nickburlett/feincms,nickburlett/feincms,pjdelport/feincms,matthiask/django-content-editor,michaelkuty/feincms,matthiask/feincms2-content,mjl/feincms,matthiask/django-content-editor,matthiask/django-content-editor,mjl/feincms,hgrimelid/feincms,hgrimelid/feincms,joshuajonah/feincms,nickburlett/feincms,matthia... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
if page.override_url:
return HttpResponseRedirect(page.ov... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path=None):
if path is None:
path = request.path
page = Page.objects.page_for_path_or_404(path)
if page.ov... | <commit_before>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
if page.override_url:
return HttpResponseR... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path=None):
if path is None:
path = request.path
page = Page.objects.page_for_path_or_404(path)
if page.ov... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
if page.override_url:
return HttpResponseRedirect(page.ov... | <commit_before>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
if page.override_url:
return HttpResponseR... |
31bfe8fb498ea2e528da6463c9045b397992e028 | python/caffe/test/test_draw.py | python/caffe/test/test_draw.py | import os
import unittest
from google import protobuf
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..'))
asse... | import os
import unittest
from google.protobuf import text_format
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..... | Add main() for draw_net unittest, fix import errors | Add main() for draw_net unittest, fix import errors
| Python | apache-2.0 | gnina/gnina,gnina/gnina,gnina/gnina,gnina/gnina,gnina/gnina,gnina/gnina | import os
import unittest
from google import protobuf
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..'))
asse... | import os
import unittest
from google.protobuf import text_format
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..... | <commit_before>import os
import unittest
from google import protobuf
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', ... | import os
import unittest
from google.protobuf import text_format
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..... | import os
import unittest
from google import protobuf
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..'))
asse... | <commit_before>import os
import unittest
from google import protobuf
import caffe.draw
from caffe.proto import caffe_pb2
def getFilenames():
"""Yields files in the source tree which are Net prototxts."""
result = []
root_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', ... |
b64bac9def90d53e76a3427f04f8664d513ae7ed | wallace/db.py | wallace/db.py | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(d... | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(db_url)
Se... | Fix assignment of database url | Fix assignment of database url
| Python | mit | berkeley-cocosci/Wallace,Dallinger/Dallinger,berkeley-cocosci/Wallace,jcpeterson/Dallinger,suchow/Wallace,berkeley-cocosci/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,suchow/Wallace,suchow/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dalli... | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(d... | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(db_url)
Se... | <commit_before>"""Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = ... | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(db_url)
Se... | """Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = create_engine(d... | <commit_before>"""Create a connection to the database."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
import os
db_url = db_url = os.environ.get("DATABASE_URL", "postgresql://postgres@localhost/wallace")
engine = ... |
e452663965f63ffb1d1e3ac04ae10dc26b3e2ecc | fabric/api.py | fabric/api.py | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | Allow access to state.output via API. | Allow access to state.output via API.
| Python | bsd-2-clause | bitmonk/fabric,fernandezcuesta/fabric,opavader/fabric,xLegoz/fabric,getsentry/fabric,bitprophet/fabric,jaraco/fabric,MjAbuz/fabric,SamuelMarks/fabric,pashinin/fabric,tolbkni/fabric,pgroudas/fabric,bspink/fabric,likesxuqiang/fabric,hrubi/fabric,TarasRudnyk/fabric,sdelements/fabric,tekapo/fabric,simon-engledew/fabric,eri... | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | <commit_before>"""
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're ... | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | """
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're using setup.py ... | <commit_before>"""
Non-init module for doing convenient * imports from.
Necessary because if we did this in __init__, one would be unable to import
anything else inside the package -- like, say, the version number used in
setup.py -- without triggering loads of most of the code. Which doesn't work so
well when you're ... |
d1e1f63062eff158b9bce8b9c3cbcaef1abed8ba | flask_gzip.py | flask_gzip.py | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | Fix a runtime error when direct_passthrough is used. | Fix a runtime error when direct_passthrough is used.
| Python | mit | wichitacode/flask-compress,wichitacode/flask-compress,libwilliam/flask-compress,saymedia/flask-compress,saymedia/flask-compress,libwilliam/flask-compress,libwilliam/flask-compress | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | <commit_before>import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
... | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | <commit_before>import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
... |
23ad531d932b6c042c3bd0161b74a6088d02524f | myfedora/lib/app_globals.py | myfedora/lib/app_globals.py | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | Add a feed_storage and feed_cache to our Globals object. | Add a feed_storage and feed_cache to our Globals object.
| Python | agpl-3.0 | fedora-infra/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | <commit_before>"""The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
... | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | """The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
initializat... | <commit_before>"""The application's Globals object"""
from app_factory import AppFactoryDict
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self):
"""One instance of Globals is created during application
... |
e9f3b6f9eb59ef7290498e8ceaf81c2bc66c8f59 | ichnaea/gunicorn_config.py | ichnaea/gunicorn_config.py | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | Update gunicorn timeout after gunicorn issue was answered. | Update gunicorn timeout after gunicorn issue was answered.
| Python | apache-2.0 | mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | <commit_before># This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default... | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | # This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default one from Amazo... | <commit_before># This file contains gunicorn configuration setttings, as described at
# http://docs.gunicorn.org/en/latest/settings.html
# The file is loaded via the -c ichnaea.gunicorn_config command line option
# Be explicit about the worker class
worker_class = "sync"
# Set timeout to the same value as the default... |
1c8f29d78d6409ba58df36d439f1ffd436c9dd10 | gaphas/picklers.py | gaphas/picklers.py | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import new
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return new.ins... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import types
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return types... | Fix no module 'new', replaced new.instancemethod with types.MethodType | Fix no module 'new', replaced new.instancemethod with types.MethodType
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
| Python | lgpl-2.1 | amolenaar/gaphas | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import new
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return new.ins... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import types
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return types... | <commit_before>"""
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import new
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import types
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return types... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import new
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return new.ins... | <commit_before>"""
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import new
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... |
62f6e4a07ef63d53e1ff4230b7a40ad38168d103 | python/testData/highlighting/assignmentTargets3K.py | python/testData/highlighting/assignmentTargets3K.py | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="assignment to keyword">True</error> = 2
<error descr="assignment to keyword">Fal... | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="Assignment to keyword">True</error> = 2
<error descr="Assignment to keyword">Fal... | Fix test broken by change in message capitalization | Fix test broken by change in message capitalization
GitOrigin-RevId: 48f81146490e925712005aa91064e56670abfbda | Python | apache-2.0 | allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/int... | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="assignment to keyword">True</error> = 2
<error descr="assignment to keyword">Fal... | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="Assignment to keyword">True</error> = 2
<error descr="Assignment to keyword">Fal... | <commit_before><error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="assignment to keyword">True</error> = 2
<error descr="assignment ... | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="Assignment to keyword">True</error> = 2
<error descr="Assignment to keyword">Fal... | <error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="assignment to keyword">True</error> = 2
<error descr="assignment to keyword">Fal... | <commit_before><error descr="starred assignment target must be in a list or tuple">*hi</error> = [1, 2]
*a, = range(5)
for a, *b in [(1, 2, 3), (4, 5, 6, 7)]:
print(b)
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
<error descr="assignment to keyword">True</error> = 2
<error descr="assignment ... |
48c9b0fc46da538633e7597bb919ac15e4accf7c | zeus/db/func.py | zeus/db/func.py | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | Correct padding on array aggregations | fix: Correct padding on array aggregations
This was incorrectly building padding based on a single row.
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | <commit_before>import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.co... | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.compile(r'"(.*?)"... | <commit_before>import re
from sqlalchemy.sql import func
from sqlalchemy.types import String, TypeDecorator
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does
class ArrayOfRecord(TypeDecorator):
_array_regexp = re.compile(r"^\{(\".+?\")*\}$")
_chunk_regexp = re.co... |
83042027fe74ffe200d0bdaa79b0529af54ae6dc | addons/website/__openerp__.py | addons/website/__openerp__.py | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | Revert "[FIX] website: add missing module dependency `base_setup`" | Revert "[FIX] website: add missing module dependency `base_setup`"
This reverts commit d269eb0eb62d88e02c4fa33b84178d0e73d82ef1.
The issue has been fixed in 61f2c90d507645492e1904c1005e8da6253788ea.
| Python | agpl-3.0 | ygol/odoo,dfang/odoo,hip-odoo/odoo,hip-odoo/odoo,ygol/odoo,ygol/odoo,dfang/odoo,dfang/odoo,ygol/odoo,hip-odoo/odoo,hip-odoo/odoo,ygol/odoo,ygol/odoo,ygol/odoo,dfang/odoo,hip-odoo/odoo,hip-odoo/odoo,dfang/odoo,dfang/odoo | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | <commit_before># -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': ... | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'des... | <commit_before># -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Builder',
'category': 'Website',
'sequence': 50,
'summary': 'Build Your Enterprise Website',
'website': 'https://www.odoo.com/page/website-builder',
'version': ... |
c138adaf69f5029209f03cafe72f1082cdb78f30 | ppp_nlp_ml_standalone/requesthandler.py | ppp_nlp_ml_standalone/requesthandler.py | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
class RequestHandler:
def __init__(self, request):
self.request = request
def answer(self):
... | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence, Missing, Resource
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
def missing_or_resource(x):
return Missing() if x == '?' else Resource(value=x)
class Reques... | Make RequestHandler's code less redundant. | Make RequestHandler's code less redundant.
| Python | mit | ProjetPP/PPP-QuestionParsing-ML-Standalone,ProjetPP/PPP-QuestionParsing-ML-Standalone | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
class RequestHandler:
def __init__(self, request):
self.request = request
def answer(self):
... | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence, Missing, Resource
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
def missing_or_resource(x):
return Missing() if x == '?' else Resource(value=x)
class Reques... | <commit_before>"""Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
class RequestHandler:
def __init__(self, request):
self.request = request
def answe... | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence, Missing, Resource
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
def missing_or_resource(x):
return Missing() if x == '?' else Resource(value=x)
class Reques... | """Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
class RequestHandler:
def __init__(self, request):
self.request = request
def answer(self):
... | <commit_before>"""Request handler of the module."""
import ppp_datamodel
from ppp_datamodel import Sentence
from ppp_datamodel.communication import TraceItem, Response
from ppp_nlp_ml_standalone import ExtractTriplet
class RequestHandler:
def __init__(self, request):
self.request = request
def answe... |
b4473d45ba5925551334762bc02708fcb373c957 | config.py | config.py | CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
| CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| Add page size for sql query | Add page size for sql query
| Python | mit | goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator | CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
Add page size for sql query | CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| <commit_before>CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
<commit_msg>Add page size for sql query<commit_after> | CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
Add page size for sql queryCONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| <commit_before>CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
<commit_msg>Add page size for sql query<commit_after>CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
|
840c764dbe8da07546381b51996f64f7680327bb | sciunit/unit_test/doc_tests.py | sciunit/unit_test/doc_tests.py | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | Drop test ch. 6 since sympy is not in travis-ci | Drop test ch. 6 since sympy is not in travis-ci
| Python | mit | scidash/sciunit,scidash/sciunit | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | <commit_before>"""Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
de... | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | """Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
def test_chapter2... | <commit_before>"""Unit tests for documentation"""
import unittest
from sciunit.utils import NotebookTools
class DocumentationTestCase(NotebookTools, unittest.TestCase):
"""Unit tests for documentation notebooks"""
path = "../../docs"
def test_chapter1(self):
self.do_notebook("chapter1")
de... |
cc19d0af1c22c9677960f406ced425aa48da54c1 | src/sentry/migrations/0063_remove_bad_groupedmessage_index.py | src/sentry/migrations/0063_remove_bad_groupedmessage_index.py | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
db.delete_... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.delete_unique('sentry_gr... | Revert "Dont error if 0063 index was already cleaned up" | Revert "Dont error if 0063 index was already cleaned up"
This reverts commit b3a51fa482fc949de75d962ddd9fe3464fa70e58.
| Python | bsd-3-clause | felixbuenemann/sentry,JackDanger/sentry,zenefits/sentry,korealerts1/sentry,fuziontech/sentry,daevaorn/sentry,argonemyth/sentry,beeftornado/sentry,vperron/sentry,mvaled/sentry,rdio/sentry,gg7/sentry,hongliang5623/sentry,felixbuenemann/sentry,jokey2k/sentry,pauloschilling/sentry,beni55/sentry,rdio/sentry,BayanGroup/sentr... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
db.delete_... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.delete_unique('sentry_gr... | <commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.delete_unique('sentry_gr... | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
db.delete_... | <commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
... |
da0d5d5058e57b3f2dd2b16822e0ab47ced7353a | AddressServer.py | AddressServer.py | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | Allow re-use of a port a la SO_REUSEADDRESS | Allow re-use of a port a la SO_REUSEADDRESS
| Python | apache-2.0 | mattrichards/TCPAddressServer | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | <commit_before>#!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each... | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | #!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each request be sen... | <commit_before>#!/usr/bin/python
"""
Simple TCP server that sends back the IP address and port from which it
sees you connect. Useful when used with `telnet` for network debugging.
Currently only IPv4.
"""
import SocketServer
VERBOSE = False
class TCPHandler(SocketServer.BaseRequestHandler):
"""
Handles each... |
1daeedde2cd8597e047b6a6d7fc737f103fa4ac8 | example/handler/my_handler.py | example/handler/my_handler.py | from base_handler import BaseHandler
from utils import truncated_stdout, with_payload
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
print("Hello there, {}!".format(who))
| from base_handler import BaseHandler
from utils import truncated_stdout, with_payload, with_member_info
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
"""A custom user event."""
print("Hello there, {}!".format(who))
@with_payload
def sup... | Add example of supervisor event and member join | Add example of supervisor event and member join
| Python | mit | waltermoreira/serfnode,waltermoreira/serfnode,waltermoreira/serfnode | from base_handler import BaseHandler
from utils import truncated_stdout, with_payload
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
print("Hello there, {}!".format(who))
Add example of supervisor event and member join | from base_handler import BaseHandler
from utils import truncated_stdout, with_payload, with_member_info
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
"""A custom user event."""
print("Hello there, {}!".format(who))
@with_payload
def sup... | <commit_before>from base_handler import BaseHandler
from utils import truncated_stdout, with_payload
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
print("Hello there, {}!".format(who))
<commit_msg>Add example of supervisor event and member join<commit_af... | from base_handler import BaseHandler
from utils import truncated_stdout, with_payload, with_member_info
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
"""A custom user event."""
print("Hello there, {}!".format(who))
@with_payload
def sup... | from base_handler import BaseHandler
from utils import truncated_stdout, with_payload
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
print("Hello there, {}!".format(who))
Add example of supervisor event and member joinfrom base_handler import BaseHandler
... | <commit_before>from base_handler import BaseHandler
from utils import truncated_stdout, with_payload
class MyHandler(BaseHandler):
@truncated_stdout
@with_payload
def hello(self, who=None):
print("Hello there, {}!".format(who))
<commit_msg>Add example of supervisor event and member join<commit_af... |
54d4551ce8efb16d4a8d02e38b9f223f8f1cd816 | ab_game.py | ab_game.py | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.current_state)
self.base_gam... | Disable min_priority filter for now | Disable min_priority filter for now
| Python | mit | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.current_state)
self.base_gam... | <commit_before>#!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.current_state)
self.base_gam... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | <commit_before>#!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(... |
06d9171b2244e4dd9d5e1883101d7ec3e05be4b2 | bitfield/apps.py | bitfield/apps.py | from django.apps import AppConfig
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
| import django
from django.apps import AppConfig
django.setup()
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
| Add django.setup to the AppConfig | Add django.setup to the AppConfig
| Python | apache-2.0 | Elec/django-bitfield,disqus/django-bitfield,joshowen/django-bitfield | from django.apps import AppConfig
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
Add django.setup to the AppConfig | import django
from django.apps import AppConfig
django.setup()
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
| <commit_before>from django.apps import AppConfig
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
<commit_msg>Add django.setup to the AppConfig<commit_after> | import django
from django.apps import AppConfig
django.setup()
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
| from django.apps import AppConfig
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
Add django.setup to the AppConfigimport django
from django.apps import AppConfig
django.setup()
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
| <commit_before>from django.apps import AppConfig
class BitFieldAppConfig(AppConfig):
name = 'bitfield'
verbose_name = "Bit Field"
<commit_msg>Add django.setup to the AppConfig<commit_after>import django
from django.apps import AppConfig
django.setup()
class BitFieldAppConfig(AppConfig):
name = 'bitfie... |
0db43d894bfb419a7f4b538f755af47fc0b653cb | tests/unit/test_sharpspring.py | tests/unit/test_sharpspring.py | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class TestSharpspring(PMGTestCase):
@patch("pmg.sharpspring.requests.post")
def test_make_sharpsrping_request(self, post_mock):
sharpspring = Sharpspring()
details = {
"emailAddre... | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class MockResponse:
def __init__(self, json_data, status_code):
self.json_data = json_data
self.status_code = status_code
def raise_for_status(self):
pass
def json(self):
... | Add mock response to sharpspring test | Add mock response to sharpspring test
| Python | apache-2.0 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class TestSharpspring(PMGTestCase):
@patch("pmg.sharpspring.requests.post")
def test_make_sharpsrping_request(self, post_mock):
sharpspring = Sharpspring()
details = {
"emailAddre... | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class MockResponse:
def __init__(self, json_data, status_code):
self.json_data = json_data
self.status_code = status_code
def raise_for_status(self):
pass
def json(self):
... | <commit_before>from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class TestSharpspring(PMGTestCase):
@patch("pmg.sharpspring.requests.post")
def test_make_sharpsrping_request(self, post_mock):
sharpspring = Sharpspring()
details = {
... | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class MockResponse:
def __init__(self, json_data, status_code):
self.json_data = json_data
self.status_code = status_code
def raise_for_status(self):
pass
def json(self):
... | from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class TestSharpspring(PMGTestCase):
@patch("pmg.sharpspring.requests.post")
def test_make_sharpsrping_request(self, post_mock):
sharpspring = Sharpspring()
details = {
"emailAddre... | <commit_before>from unittest.mock import patch
from pmg.sharpspring import Sharpspring
from tests import PMGTestCase
class TestSharpspring(PMGTestCase):
@patch("pmg.sharpspring.requests.post")
def test_make_sharpsrping_request(self, post_mock):
sharpspring = Sharpspring()
details = {
... |
0cb807470ee56207251f36ad78d35c48f6e9361b | example_project/urls.py | example_project/urls.py | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accounts/login/$', 'django.contrib.auth.views.... | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover() # For Django 1.6
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accou... | Update Python/Django: Restore admin.autodiscover() for Django 1.6 compatibility | Update Python/Django: Restore admin.autodiscover() for Django 1.6 compatibility
| Python | mit | BocuStudio/django-timepiece,caktus/django-timepiece,arbitrahj/django-timepiece,BocuStudio/django-timepiece,caktus/django-timepiece,arbitrahj/django-timepiece,caktus/django-timepiece,arbitrahj/django-timepiece,BocuStudio/django-timepiece | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accounts/login/$', 'django.contrib.auth.views.... | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover() # For Django 1.6
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accou... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accounts/login/$', 'django.cont... | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover() # For Django 1.6
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accou... | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accounts/login/$', 'django.contrib.auth.views.... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^selectable/', include('selectable.urls')),
url(r'', include('timepiece.urls')),
# authentication views
url(r'^accounts/login/$', 'django.cont... |
23343eb3316a3d304a3b021519b9a470f9c2446b | django_bcrypt/models.py | django_bcrypt/models.py | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | Allow users to be created with blank (unusable) passwords. | Allow users to be created with blank (unusable) passwords.
| Python | mit | dwaiter/django-bcrypt | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | <commit_before>import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
... | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
salt_and_has... | <commit_before>import bcrypt
from django.contrib.auth.models import User
from django.conf import settings
try:
rounds = settings.BCRYPT_ROUNDS
except AttributeError:
rounds = 12
_check_password = User.check_password
def bcrypt_check_password(self, raw_password):
if self.password.startswith('bc$'):
... |
f5e4a8000e23e279192834d03e4b5b9ecca6b2b0 | linguist/utils/__init__.py | linguist/utils/__init__.py | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
build_localized_field_name,
build_localized_verbose_name)
from .models import load_class, get_model_string
from .template import select_template... | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
get_real_field_name,
get_fallback_field_name,
build_localized_field_name,
build_localized_verbose_name)
fr... | Fix new i18n utils imports. | Fix new i18n utils imports.
| Python | mit | ulule/django-linguist | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
build_localized_field_name,
build_localized_verbose_name)
from .models import load_class, get_model_string
from .template import select_template... | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
get_real_field_name,
get_fallback_field_name,
build_localized_field_name,
build_localized_verbose_name)
fr... | <commit_before># -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
build_localized_field_name,
build_localized_verbose_name)
from .models import load_class, get_model_string
from .template import ... | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
get_real_field_name,
get_fallback_field_name,
build_localized_field_name,
build_localized_verbose_name)
fr... | # -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
build_localized_field_name,
build_localized_verbose_name)
from .models import load_class, get_model_string
from .template import select_template... | <commit_before># -*- coding: utf-8 -*-
from .i18n import (get_language_name,
get_language,
get_fallback_language,
build_localized_field_name,
build_localized_verbose_name)
from .models import load_class, get_model_string
from .template import ... |
986b9227fe66d95a7e42253395c89de5c2385b2d | scuole/campuses/management/commands/dedupecampusslugs.py | scuole/campuses/management/commands/dedupecampusslugs.py | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | Edit dedupe campus slugs code | Edit dedupe campus slugs code
| Python | mit | texastribune/scuole,texastribune/scuole,texastribune/scuole,texastribune/scuole | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | <commit_before>from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **option... | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **options):
dup... | <commit_before>from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.text import slugify
from scuole.campuses.models import Campus
class Command(BaseCommand):
help = "Dedupe Campus slugs by adding the county name to the end."
def handle(self, *args, **option... |
de0bb4886b9a6ecd2fb4e5c4272167911141c71c | apic_ml2/neutron/plugins/ml2/drivers/cisco/apic/nova_client.py | apic_ml2/neutron/plugins/ml2/drivers/cisco/apic/nova_client.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Load Nova Client only once to avoid reconnecting | Load Nova Client only once to avoid reconnecting
| Python | apache-2.0 | noironetworks/apic-ml2-driver,noironetworks/apic-ml2-driver | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
79c5a3b12fbe0ccde4bf8ec8694d42696241621d | products/bika/browser/clientfolder.py | products/bika/browser/clientfolder.py | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | Remove 'field' and 'icon' from column list | Remove 'field' and 'icon' from column list
| Python | agpl-3.0 | veroc/Bika-LIMS,veroc/Bika-LIMS,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,rockfruit/bika.lims,labsanmartin/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,anneline/Bika-LIMS,DeBortoliWines/Bika-LIMS,anneline/Bika-LIMS,rockfruit/bika.lims | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | <commit_before>from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFo... | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFolderContentsVie... | <commit_before>from Products.CMFCore.utils import getToolByName
from Products.bika import logger
from Products.bika.browser.bika_folder_contents import BikaFolderContentsView
from plone.app.content.browser.interfaces import IFolderContentsView
from zope.interface import implements
class ClientFolderContentsView(BikaFo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.