commit stringlengths 40 40 | old_file stringlengths 5 117 | new_file stringlengths 5 117 | old_contents stringlengths 0 1.93k | new_contents stringlengths 19 3.3k | subject stringlengths 17 320 | message stringlengths 18 3.28k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 7 42.4k | completion stringlengths 19 3.3k | prompt stringlengths 21 3.65k |
|---|---|---|---|---|---|---|---|---|---|---|---|
3165cbdd418a38f72f2b638797b692589452528c | setup.py | setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
#author_email='',
#url='',
install_requires=[... | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
#author_email='',
#url='',
install_requires=[... | Make library dependencies python-debian a bit more sane | Make library dependencies python-debian a bit more sane
| Python | mit | jonnylamb/debexpo,jonnylamb/debexpo,jadonk/debexpo,jonnylamb/debexpo,jadonk/debexpo,swvist/Debexpo,swvist/Debexpo,swvist/Debexpo,jadonk/debexpo | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
#author_email='',
#url='',
install_requires=[... | Make library dependencies python-debian a bit more sane
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
... |
f22eff612427dc5f530858bb47326d69b48aa68a | darchan/urls.py | darchan/urls.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import patterns, url
urlpatterns = patterns(
'darchan.views',
url(r'^view_matrix/$', 'v_view_last_matrix', name='view_last_matrix'),
url(r'^view_matrix/(?P<builder_id>\d+)/(?P<depth>\d+)/$', 'v_view_matrix',
name=... | # -*- coding: utf-8 -*-
# from __future__ import unicode_literals
from django.conf.urls import url
from darchan import views
urlpatterns = [
url(r'^view_matrix/$',
views.v_view_last_matrix, name='view_last_matrix'),
url(r'^view_matrix/(?P<builder_id>\d+)/(?P<depth>\d+)/$',
views.v_view_matrix, ... | Update support to Django 1.9 | Update support to Django 1.9
| Python | mpl-2.0 | Pawamoy/django-archan,Pawamoy/django-archan,Pawamoy/django-archan | # -*- coding: utf-8 -*-
# from __future__ import unicode_literals
from django.conf.urls import url
from darchan import views
urlpatterns = [
url(r'^view_matrix/$',
views.v_view_last_matrix, name='view_last_matrix'),
url(r'^view_matrix/(?P<builder_id>\d+)/(?P<depth>\d+)/$',
views.v_view_matrix, ... | Update support to Django 1.9
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import patterns, url
urlpatterns = patterns(
'darchan.views',
url(r'^view_matrix/$', 'v_view_last_matrix', name='view_last_matrix'),
url(r'^view_matrix/(?P<builder_id>\d+)/(?P<depth>\d+)/$', ... |
814974c6736f1a9aef6fec7abf4153f194a231c7 | simpleubjson/exceptions.py | simpleubjson/exceptions.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error."""
class MarkerError(DecodeError):... | Add missed exception module. Ooops. | Add missed exception module. Ooops.
| Python | bsd-2-clause | samipshah/simpleubjson,brainwater/simpleubjson,498888197/simpleubjson,kxepal/simpleubjson | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error."""
class MarkerError(DecodeError):... | Add missed exception module. Ooops.
| |
2ed7e3af5f6ab586dbad33e566f61a0a3c3ff61b | setup.py | setup.py | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
DESCRIPTION = "<placeholder>"
else:
DESCRIPTION = README + '\n' + CHANGELOG
s... | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
LONG_DESCRIPTION = "Coming soon..."
else:
LONG_DESCRIPTION = README + '\n' + C... | Deploy Travis CI build 715 to GitHub | Deploy Travis CI build 715 to GitHub
| Python | mit | jacebrowning/template-python-demo | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
LONG_DESCRIPTION = "Coming soon..."
else:
LONG_DESCRIPTION = README + '\n' + C... | Deploy Travis CI build 715 to GitHub
#!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
DESCRIPTION = "<placeholder>"
else:
DESC... |
225f4ba42e2184b09b49e7d6a933748d436f7d3e | eultheme/__init__.py | eultheme/__init__.py | __version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | __version_info__ = (0, 5, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | Update version number for release | Update version number for release
| Python | apache-2.0 | emory-libraries/django-eultheme,emory-libraries/django-eultheme,emory-libraries/django-eultheme | __version_info__ = (0, 5, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | Update version number for release
__version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) |
682010eafe28eed1eeb32ba9d34e213b4f2d7d4b | sourcer/__init__.py | sourcer/__init__.py | from .compiler import ParseResult
from .expressions import (
Alt,
And,
Any,
Backtrack,
Bind,
End,
Expect,
Fail,
ForwardRef,
Left,
List,
Literal,
Not,
Opt,
Or,
Require,
Return,
Right,
Some,
Start,
Struct,
Term,
Transform,
Wh... | from .compiler import ParseResult
from .expressions import (
Alt,
And,
Any,
AnyOf,
Backtrack,
Bind,
End,
Expect,
Fail,
ForwardRef,
Left,
List,
Literal,
Not,
Opt,
Or,
Require,
Return,
Right,
Some,
Start,
Struct,
Term,
Transf... | Add "AnyOf" to public API. | Add "AnyOf" to public API.
| Python | mit | jvs/sourcer | from .compiler import ParseResult
from .expressions import (
Alt,
And,
Any,
AnyOf,
Backtrack,
Bind,
End,
Expect,
Fail,
ForwardRef,
Left,
List,
Literal,
Not,
Opt,
Or,
Require,
Return,
Right,
Some,
Start,
Struct,
Term,
Transf... | Add "AnyOf" to public API.
from .compiler import ParseResult
from .expressions import (
Alt,
And,
Any,
Backtrack,
Bind,
End,
Expect,
Fail,
ForwardRef,
Left,
List,
Literal,
Not,
Opt,
Or,
Require,
Return,
Right,
Some,
Start,
Struct,
... |
42b50470458d91cd0882f927ed83ba267ab78764 | zinnia_wymeditor/__init__.py | zinnia_wymeditor/__init__.py | """WYMeditor for Django-blog-zinnia"""
__version__ = '1.0'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = 'fantomas42@gmail.com'
__url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-wymeditor'
| Create zinnia_wymeditor module with his metadatas | Create zinnia_wymeditor module with his metadatas
| Python | bsd-3-clause | layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor | """WYMeditor for Django-blog-zinnia"""
__version__ = '1.0'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = 'fantomas42@gmail.com'
__url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-wymeditor'
| Create zinnia_wymeditor module with his metadatas
| |
c7f6e0c2e9c5be112a7576c3d2a1fc8a79eb9f18 | brasilcomvc/settings/staticfiles.py | brasilcomvc/settings/staticfiles.py | import os
import sys
# Disable django-pipeline when in test mode
PIPELINE_ENABLED = 'test' not in sys.argv
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BA... | import os
import sys
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file UR... | Fix django-pipeline configuration for development/test | fix(set): Fix django-pipeline configuration for development/test
| Python | apache-2.0 | brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc | import os
import sys
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file UR... | fix(set): Fix django-pipeline configuration for development/test
import os
import sys
# Disable django-pipeline when in test mode
PIPELINE_ENABLED = 'test' not in sys.argv
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../... |
173aba72cad0c6c3602b2ae4e1b8bd4e5773bd3b | pyservice/context.py | pyservice/context.py | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
def __init_... | Add building blocks Container, Context | Add building blocks Container, Context
These will be used for request/response dicts, as well as
containers for plugins to pass functions and values to the
operation function or other plugins.
| Python | mit | numberoverzero/pyservice | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
def __init_... | Add building blocks Container, Context
These will be used for request/response dicts, as well as
containers for plugins to pass functions and values to the
operation function or other plugins.
| |
eb1fdf3419bdfd1d5920d73a877f707162b783b0 | cfgrib/__init__.py | cfgrib/__init__.py | #
# Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | #
# Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | Drop unused and dangerous entrypoint `open_fileindex` | Drop unused and dangerous entrypoint `open_fileindex`
| Python | apache-2.0 | ecmwf/cfgrib | #
# Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | Drop unused and dangerous entrypoint `open_fileindex`
#
# Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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
#
# ... |
0004bde0d40dfea167d76a83c20acfffc0abfa28 | poyo/__init__.py | poyo/__init__.py | # -*- coding: utf-8 -*-
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
__all__ = ['parse_string', 'PoyoException']
| # -*- coding: utf-8 -*-
import logging
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
logging.getLogger(__name__).addHandler(logging.NullHandler())
__all__ = ['parse_string', 'PoyoException']
| Add NullHandler to poyo root logger | Add NullHandler to poyo root logger
| Python | mit | hackebrot/poyo | # -*- coding: utf-8 -*-
import logging
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
logging.getLogger(__name__).addHandler(logging.NullHandler())
__all__ = ['parse_string', 'PoyoException']
| Add NullHandler to poyo root logger
# -*- coding: utf-8 -*-
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
__all__ = ['parse_string', 'PoyoException']
|
d70014d317f7abc9dffe674aca5eaf77d20a002f | djangosaml2/urls.py | djangosaml2/urls.py | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | Fix imports for Django 1.6 and above | Fix imports for Django 1.6 and above
| Python | apache-2.0 | bernii/djangosaml2,azavea/djangosaml2 | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | Fix imports for Django 1.6 and above
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
7ea630074262beed16c70649809fe8115bcc6105 | saleor/account/templatetags/i18n_address_tags.py | saleor/account/templatetags/i18n_address_tags.py | import i18naddress
from django import template
from django.utils.translation import pgettext
register = template.Library()
@register.inclusion_tag("formatted_address.html")
def format_address(address, include_phone=True, inline=False, latin=False):
address_data = address.as_data()
address_data["name"] = (
... | import i18naddress
from django import template
from django.utils.translation import pgettext
register = template.Library()
@register.inclusion_tag("formatted_address.html")
def format_address(address, include_phone=True, inline=False, latin=False):
address_data = address.as_data()
address_data["name"] = (
... | Fix phone number formatting in emails | Fix phone number formatting in emails
| Python | bsd-3-clause | mociepka/saleor,mociepka/saleor,mociepka/saleor | import i18naddress
from django import template
from django.utils.translation import pgettext
register = template.Library()
@register.inclusion_tag("formatted_address.html")
def format_address(address, include_phone=True, inline=False, latin=False):
address_data = address.as_data()
address_data["name"] = (
... | Fix phone number formatting in emails
import i18naddress
from django import template
from django.utils.translation import pgettext
register = template.Library()
@register.inclusion_tag("formatted_address.html")
def format_address(address, include_phone=True, inline=False, latin=False):
address_data = address.as... |
c97dc5e977e57df26962a1f3e7bf0dc4b3440508 | kaleo/views.py | kaleo/views.py | from django import http
from django.utils import simplejson as json
from django.views.decorators.http import require_http_methods
from account.models import EmailAddress
from kaleo.forms import InviteForm
from kaleo.models import JoinInvitation
@require_http_methods(["POST"])
def invite(request):
if not request... | import json
from django import http
from django.views.decorators.http import require_POST
from account.models import EmailAddress
from django.contrib.auth.decorators import login_required
from kaleo.forms import InviteForm
from kaleo.models import JoinInvitation
@login_required
@require_POST
def invite(request):
... | Update view to use different imports/decorators | Update view to use different imports/decorators
1. We can generally expect the json module to be
available now, so no need to use what ships with
django
2. require_POST is just simpler and more direct
3. Using login_required is clearer as well instead
of using custom logic. | Python | bsd-3-clause | rizumu/pinax-invitations,pinax/pinax-invitations,ntucker/kaleo,jacobwegner/pinax-invitations,eldarion/kaleo,abramia/kaleo,JPWKU/kaleo | import json
from django import http
from django.views.decorators.http import require_POST
from account.models import EmailAddress
from django.contrib.auth.decorators import login_required
from kaleo.forms import InviteForm
from kaleo.models import JoinInvitation
@login_required
@require_POST
def invite(request):
... | Update view to use different imports/decorators
1. We can generally expect the json module to be
available now, so no need to use what ships with
django
2. require_POST is just simpler and more direct
3. Using login_required is clearer as well instead
of using custom logic.
from django import http
from django... |
194449e880bf50cde799a1853474c8075e4cf5d4 | derrida/__init__.py | derrida/__init__.py | __version_info__ = (1, 2, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | Set develop version to 1.3-dev | Set develop version to 1.3-dev
| Python | apache-2.0 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | Set develop version to 1.3-dev
__version_info__ = (1, 2, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add ... |
54683555997032cccf97f5fedf88b7a2402f0449 | sponsorship_tracking/migrations/10.0.2.0.0/post-migration.py | sponsorship_tracking/migrations/10.0.2.0.0/post-migration.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | FIX only sponsorships can go through waiting_welcome state | FIX only sponsorships can go through waiting_welcome state
| Python | agpl-3.0 | eicher31/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,ecino/compassion-modules,maxime-beck/compassion-modules,eicher31/compassion-modules,maxime-beck/compassion-modules,maxime-beck/compassion-modules,CompassionCH/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,Comp... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | FIX only sponsorships can go through waiting_welcome state
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@comp... |
5e2dbeab75501254da598c6c401cbbd8446f01a5 | util/timeline_adjust.py | util/timeline_adjust.py | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | Fix timeline adjust not being able to load Windows files | Fix timeline adjust not being able to load Windows files
| Python | apache-2.0 | quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | Fix timeline adjust not being able to load Windows files
#!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match ... |
a5c0f5c46c64e56e0a4a0791b86b820e8ed0241b | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.4',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wohler',
author_email='parait... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.5',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wohler',
author_email='parait... | Update package version for Pypi | Update package version for Pypi
| Python | mit | paraita/sophiabus230,paraita/sophiabus230 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.5',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wohler',
author_email='parait... | Update package version for Pypi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.4',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wo... |
9ee6b2e61fccf7ebc6b3e90370f78ffcf948969d | webserver/home/views.py | webserver/home/views.py | from django.views.generic import TemplateView
from competition.models import Competition
class HomePageView(TemplateView):
template_name = "home/home.html"
def get_context_data(self, **kwargs):
context = super(HomePageView, self).get_context_data(**kwargs)
my_competitions = Competition.objec... | from django.views.generic import TemplateView
from competition.models import Competition
class HomePageView(TemplateView):
template_name = "home/home.html"
def get_context_data(self, **kwargs):
context = super(HomePageView, self).get_context_data(**kwargs)
if not self.request.user.is_an... | Check if user is not anonymous on homepage | Check if user is not anonymous on homepage
| Python | bsd-3-clause | siggame/webserver,siggame/webserver,siggame/webserver | from django.views.generic import TemplateView
from competition.models import Competition
class HomePageView(TemplateView):
template_name = "home/home.html"
def get_context_data(self, **kwargs):
context = super(HomePageView, self).get_context_data(**kwargs)
if not self.request.user.is_an... | Check if user is not anonymous on homepage
from django.views.generic import TemplateView
from competition.models import Competition
class HomePageView(TemplateView):
template_name = "home/home.html"
def get_context_data(self, **kwargs):
context = super(HomePageView, self).get_context_data(**kwarg... |
4d161278963252d8502f1be2bfb857bcb379f540 | test/python/topology/test_utilities.py | test/python/topology/test_utilities.py | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import sys
import streamsx.topology.context
def standalone(test, topo):
rc = streamsx.topology.context.submit("STANDALONE", topo)
test.assertEqual(0, rc)
| # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import sys
import streamsx.topology.context
def standalone(test, topo):
rc = streamsx.topology.context.submit("STANDALONE", topo)
test.assertEqual(0, rc['return_code'])
| Return value of submit is now a json dict | Return value of submit is now a json dict
| Python | apache-2.0 | ibmkendrick/streamsx.topology,ibmkendrick/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,IBMStreams/streamsx.topology,wmarshall484/streamsx.topology,ibmkendrick/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,IBMStreams/streamsx.topol... | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import sys
import streamsx.topology.context
def standalone(test, topo):
rc = streamsx.topology.context.submit("STANDALONE", topo)
test.assertEqual(0, rc['return_code'])
| Return value of submit is now a json dict
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import sys
import streamsx.topology.context
def standalone(test, topo):
rc = streamsx.topology.context.submit("STANDALONE", topo)
test.assertEqual(0, rc)
|
4f170397acac08c6fd8a4573ead1f66d631ac8dc | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.3.2.dev0 | Update dsub version to 0.3.2.dev0
PiperOrigin-RevId: 243855458
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.3.2.dev0
PiperOrigin-RevId: 243855458
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... |
c89abd6a285225313c91ba03c0fd8ab2cfed399d | setup.py | setup.py | #!/usr/bin/env python
import os
import urllib
import zipfile
script_path = os.path.dirname(os.path.realpath(__file__))
packer_archive_path = script_path + "/packer.zip"
bin_path = script_path + "/bin"
if not os.path.isfile(bin_path + "/packer"):
if not os.path.exists(bin_path):
os.makedirs(bin_path)
... | #!/usr/bin/env python
import os
import urllib
import zipfile
script_path = os.path.dirname(os.path.realpath(__file__))
packer_archive_path = script_path + "/packer.zip"
bin_path = script_path + "/bin"
if not os.path.isfile(bin_path + "/packer"):
if not os.path.exists(bin_path):
os.makedirs(bin_path)
... | Fix false positive octal syntax warning | Fix false positive octal syntax warning
| Python | unlicense | dharmab/centos-vagrant | #!/usr/bin/env python
import os
import urllib
import zipfile
script_path = os.path.dirname(os.path.realpath(__file__))
packer_archive_path = script_path + "/packer.zip"
bin_path = script_path + "/bin"
if not os.path.isfile(bin_path + "/packer"):
if not os.path.exists(bin_path):
os.makedirs(bin_path)
... | Fix false positive octal syntax warning
#!/usr/bin/env python
import os
import urllib
import zipfile
script_path = os.path.dirname(os.path.realpath(__file__))
packer_archive_path = script_path + "/packer.zip"
bin_path = script_path + "/bin"
if not os.path.isfile(bin_path + "/packer"):
if not os.path.exists(bin_... |
810e688e8e896caf5a3c6de1c76a5bc696d918c6 | apps.py | apps.py | import os
import webapp2
import handlers
debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
task_app = webapp2.WSGIApplication([
('/task/index', handlers.IndexTaskHandler),
('/task/torrent', handlers.TorrentTaskHandler),
('/task/update_feeds', handlers.FeedTaskHandler),
('/task/cleanup'... | import os
import webapp2
import logging
import handlers
debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
loglevel = logging.DEBUG if debug else logging.INFO
logging.getLogger().setLevel(loglevel)
task_app = webapp2.WSGIApplication([
('/task/index', handlers.IndexTaskHandler),
('/task/torrent'... | Set logging level depenging on environment | Set logging level depenging on environment
| Python | apache-2.0 | notapresent/rutracker_rss,notapresent/rutracker_rss,notapresent/rutracker_rss | import os
import webapp2
import logging
import handlers
debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
loglevel = logging.DEBUG if debug else logging.INFO
logging.getLogger().setLevel(loglevel)
task_app = webapp2.WSGIApplication([
('/task/index', handlers.IndexTaskHandler),
('/task/torrent'... | Set logging level depenging on environment
import os
import webapp2
import handlers
debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
task_app = webapp2.WSGIApplication([
('/task/index', handlers.IndexTaskHandler),
('/task/torrent', handlers.TorrentTaskHandler),
('/task/update_feeds', han... |
ce71f3bd66ad5b532e43791cca0ef811680000de | constants.py | constants.py | import os
from pathlib import Path
from string import Template
from dotenv import load_dotenv
load_dotenv() # helps with local dev
TEMPLATE_PATH = Path.cwd() / "email.md"
STARMINDER_COUNT = int(os.getenv("STARMINDER_COUNT"))
STARMINDER_RECIPIENT = os.getenv("STARMINDER_RECIPIENT")
STARMINDER_SUBJECT = Template("... | import os
from pathlib import Path
from string import Template
from dotenv import load_dotenv
load_dotenv() # helps with local dev
TEMPLATE_PATH = Path.cwd() / "email.md"
STARMINDER_COUNT = int(os.getenv("STARMINDER_COUNT"))
STARMINDER_RECIPIENT = os.getenv("STARMINDER_RECIPIENT")
STARMINDER_SUBJECT = Template("... | Rename GH token env var | Rename GH token env var
GitHub disallows user set GITHUB_ prefixed ones.
| Python | mit | nkantar/Starminder | import os
from pathlib import Path
from string import Template
from dotenv import load_dotenv
load_dotenv() # helps with local dev
TEMPLATE_PATH = Path.cwd() / "email.md"
STARMINDER_COUNT = int(os.getenv("STARMINDER_COUNT"))
STARMINDER_RECIPIENT = os.getenv("STARMINDER_RECIPIENT")
STARMINDER_SUBJECT = Template("... | Rename GH token env var
GitHub disallows user set GITHUB_ prefixed ones.
import os
from pathlib import Path
from string import Template
from dotenv import load_dotenv
load_dotenv() # helps with local dev
TEMPLATE_PATH = Path.cwd() / "email.md"
STARMINDER_COUNT = int(os.getenv("STARMINDER_COUNT"))
STARMINDER_RE... |
6603657df4626a9e2c82a3658c63314c7a9537f4 | src/experimental/os_walk_with_filechecker.py | src/experimental/os_walk_with_filechecker.py | #!/usr/bin/python3
# THIS FILE IS AN EXPERIMENTAL PROGRAM TO LEARN ABOUT OS_WALK
import os, sys
walk_dir = sys.argv[1]
print("walk directory: " + walk_dir)
print("Walk directory (absolute) = " + os.path.abspath(walk_dir))
print("\n\n\n\n\n\n\n\n\n")
for root, subdirs, files in os.walk(walk_dir):
print(root)
#lis... | #!/usr/bin/python3
# THIS FILE IS AN EXPERIMENTAL PROGRAM TO LEARN ABOUT OS_WALK
import os, sys, datetime
#dt = datetime.datetime(1970,1,1).total_seconds()
# print(dt)
walk_dir = sys.argv[1]
with open("fsscan.scan", "w") as f:
print("SCANFROM" + walk_dir)
for root, subdirs, files in os.walk(walk_dir):
f.write... | Add write dump to file | Add write dump to file
| Python | bsd-3-clause | paulkramme/btsoot | #!/usr/bin/python3
# THIS FILE IS AN EXPERIMENTAL PROGRAM TO LEARN ABOUT OS_WALK
import os, sys, datetime
#dt = datetime.datetime(1970,1,1).total_seconds()
# print(dt)
walk_dir = sys.argv[1]
with open("fsscan.scan", "w") as f:
print("SCANFROM" + walk_dir)
for root, subdirs, files in os.walk(walk_dir):
f.write... | Add write dump to file
#!/usr/bin/python3
# THIS FILE IS AN EXPERIMENTAL PROGRAM TO LEARN ABOUT OS_WALK
import os, sys
walk_dir = sys.argv[1]
print("walk directory: " + walk_dir)
print("Walk directory (absolute) = " + os.path.abspath(walk_dir))
print("\n\n\n\n\n\n\n\n\n")
for root, subdirs, files in os.walk(walk_... |
1975b33b5f251198b59a772a38b6302fbea89017 | tests/test_create_template.py | tests/test_create_template.py | # -*- 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
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... | Extend test to check for the exit code and for an exception | Extend test to check for the exit code and for an exception
| Python | mit | pytest-dev/cookiecutter-pytest-plugin | # -*- 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... | Extend test to check for the exit code and for an exception
# -*- 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',
... |
7faa73b5046fb87099d955705c4f00c5240f3544 | running.py | running.py | import tcxparser
from darksky import forecast
from configparser import ConfigParser
# Darksky weather API.
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky', 'key')
tcx = tcxparser.TCXParser('gps_logs/2017-06-15_Running.tcx')
pri... | import tcxparser
from configparser import ConfigParser
from datetime import datetime
import urllib.request
import dateutil.parser
t = '1984-06-02T19:05:00.000Z'
# Darksky weather API
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky... | Call Darksky API with TCX run time Use simpler GET request to Darksky API rather than a third party Python wrapper | Call Darksky API with TCX run time
Use simpler GET request to Darksky API rather than a third party Python
wrapper
| Python | mit | briansuhr/slowburn | import tcxparser
from configparser import ConfigParser
from datetime import datetime
import urllib.request
import dateutil.parser
t = '1984-06-02T19:05:00.000Z'
# Darksky weather API
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky... | Call Darksky API with TCX run time
Use simpler GET request to Darksky API rather than a third party Python
wrapper
import tcxparser
from darksky import forecast
from configparser import ConfigParser
# Darksky weather API.
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='u... |
f72c0b792f41daed065df1c8a42be8da6938e691 | setup.py | setup.py | from distutils.core import setup
setup(
name='Flask-thumbnails',
version='0.2.1',
url='https://github.com/SilentSokolov/flask-thumbnails',
license='MIT',
author='Dmitriy Sokolov',
author_email='silentsokolov@gmail.com',
description='A simple extension to create a thumbs for the Flask',
... | from distutils.core import setup
setup(
name='Flask-thumbnails',
version='0.2.1',
url='https://github.com/SilentSokolov/flask-thumbnails',
license='MIT',
author='Dmitriy Sokolov',
author_email='silentsokolov@gmail.com',
description='A simple extension to create a thumbs for the Flask',
... | Update pillow and stop requiring exact pillow version | Update pillow and stop requiring exact pillow version
| Python | mit | silentsokolov/flask-thumbnails | from distutils.core import setup
setup(
name='Flask-thumbnails',
version='0.2.1',
url='https://github.com/SilentSokolov/flask-thumbnails',
license='MIT',
author='Dmitriy Sokolov',
author_email='silentsokolov@gmail.com',
description='A simple extension to create a thumbs for the Flask',
... | Update pillow and stop requiring exact pillow version
from distutils.core import setup
setup(
name='Flask-thumbnails',
version='0.2.1',
url='https://github.com/SilentSokolov/flask-thumbnails',
license='MIT',
author='Dmitriy Sokolov',
author_email='silentsokolov@gmail.com',
description='A s... |
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):
... | Add `--all` to graph command to show other branches (esp. origin)
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... |
780d1fa408677994c739ce489bd0fde2ed6242f0 | ideascaly/__init__.py | ideascaly/__init__.py | __author__ = 'jorgesaldivar'
| # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
"""
IdeaScaly: IdeaScale API client
"""
__version__ = '0.1'
__author__ = 'Jorge Saldivar'
__license__ = 'MIT'
from ideascaly.api import API
from ideascaly.auth import AuthNonSSO, AuthNonSSOMem, AuthSSO, AuthResearch
from ideascaly.error import Id... | Add details of the project | Add details of the project
| Python | mit | joausaga/ideascaly | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
"""
IdeaScaly: IdeaScale API client
"""
__version__ = '0.1'
__author__ = 'Jorge Saldivar'
__license__ = 'MIT'
from ideascaly.api import API
from ideascaly.auth import AuthNonSSO, AuthNonSSOMem, AuthSSO, AuthResearch
from ideascaly.error import Id... | Add details of the project
__author__ = 'jorgesaldivar'
|
1aed26838d1616b3686b74697e01bb4da5e47b79 | sqlobject/tests/test_identity.py | sqlobject/tests/test_identity.py | from sqlobject import IntCol, SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
########################################
# Identity (MS SQL)
########################################
class SOTestIdentity(SQLObject):
n = IntCol()
def test_identity():
# (re)create table
SOTestIdentit... | from sqlobject import IntCol, SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
########################################
# Identity (MS SQL)
########################################
class SOTestIdentity(SQLObject):
n = IntCol()
def test_identity():
# (re)create table
SOTestIdentit... | Fix `flake8` E275 missing whitespace after keyword | Style: Fix `flake8` E275 missing whitespace after keyword
| Python | lgpl-2.1 | sqlobject/sqlobject,sqlobject/sqlobject | from sqlobject import IntCol, SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
########################################
# Identity (MS SQL)
########################################
class SOTestIdentity(SQLObject):
n = IntCol()
def test_identity():
# (re)create table
SOTestIdentit... | Style: Fix `flake8` E275 missing whitespace after keyword
from sqlobject import IntCol, SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
########################################
# Identity (MS SQL)
########################################
class SOTestIdentity(SQLObject):
n = IntCol()
de... |
40958981df401a898a39ddad45c2b48669a44ee7 | setup.py | setup.py | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='mammoth',
version='0.1.1',
description='Convert Word documents to simple and clean HTML',
long_description=read("README"),
author='... | #!/usr/bin/env python
import os
import sys
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
_install_requires = [
"parsimonious>=0.5,<0.6",
]
if sys.version_info[:2] <= (2, 6):
_install_requires.append("argparse==1.2.1")
setup(
na... | Support CLI on Python 2.6 | Support CLI on Python 2.6
| Python | bsd-2-clause | mwilliamson/python-mammoth,JoshBarr/python-mammoth | #!/usr/bin/env python
import os
import sys
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
_install_requires = [
"parsimonious>=0.5,<0.6",
]
if sys.version_info[:2] <= (2, 6):
_install_requires.append("argparse==1.2.1")
setup(
na... | Support CLI on Python 2.6
#!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='mammoth',
version='0.1.1',
description='Convert Word documents to simple and clean HTML',
long_description=r... |
e3728beb16dfb72a7be71cdf8ea53adb730827ad | examples/share-amis-boto3.py | examples/share-amis-boto3.py | import os
import boto3
import botocore
from boto3.core.session import Session
os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg"
orig_owner = ""
shared_owner = ""
region = "us-west-2"
session = botocore.session.get_session()
session.profile = 'beta'
session = Session(session=session)
ec2_conn = session.connect_to(... | Update the example via boto3 | Update the example via boto3
| Python | apache-2.0 | henrysher/kamboo,henrysher/kamboo | import os
import boto3
import botocore
from boto3.core.session import Session
os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg"
orig_owner = ""
shared_owner = ""
region = "us-west-2"
session = botocore.session.get_session()
session.profile = 'beta'
session = Session(session=session)
ec2_conn = session.connect_to(... | Update the example via boto3
| |
986675f8b415ddbe3d9bccc9d9c88ee00f9d589c | tldextract_app/handlers.py | tldextract_app/handlers.py | from cStringIO import StringIO
import tldextract
import web
try:
import json
except ImportError:
from django.utils import simplejson as json
urls = (
'/api/extract', 'Extract',
'/api/re', 'TheRegex',
'/test', 'Test',
)
class Extract:
def GET(self):
url = web.input(url='').... | from cStringIO import StringIO
import tldextract
import web
try:
import json
except ImportError:
from django.utils import simplejson as json
urls = (
'/api/extract', 'Extract',
'/api/re', 'TLDSet',
'/test', 'Test',
)
class Extract:
def GET(self):
url = web.input(url='').ur... | Fix viewing live TLD definitions on GAE | Fix viewing live TLD definitions on GAE
| Python | bsd-3-clause | john-kurkowski/tldextract,jvrsantacruz/tldextract,TeamHG-Memex/tldextract,pombredanne/tldextract,jvanasco/tldextract | from cStringIO import StringIO
import tldextract
import web
try:
import json
except ImportError:
from django.utils import simplejson as json
urls = (
'/api/extract', 'Extract',
'/api/re', 'TLDSet',
'/test', 'Test',
)
class Extract:
def GET(self):
url = web.input(url='').ur... | Fix viewing live TLD definitions on GAE
from cStringIO import StringIO
import tldextract
import web
try:
import json
except ImportError:
from django.utils import simplejson as json
urls = (
'/api/extract', 'Extract',
'/api/re', 'TheRegex',
'/test', 'Test',
)
class Extract:
def GE... |
771f429433d201463ab94439870d1bc803022722 | nap/auth.py | nap/auth.py | from __future__ import unicode_literals
# Authentication and Authorisation
from functools import wraps
from . import http
def permit(test_func, response_class=http.Forbidden):
'''Decorate a handler to control access'''
def decorator(view_func):
@wraps(view_func)
def _wrapped_view(self, *args... | from __future__ import unicode_literals
# Authentication and Authorisation
from functools import wraps
from . import http
def permit(test_func, response_class=http.Forbidden):
'''Decorate a handler to control access'''
def decorator(view_func):
@wraps(view_func)
def _wrapped_view(self, *args... | Make it DRYer for people | Make it DRYer for people
| Python | bsd-3-clause | limbera/django-nap | from __future__ import unicode_literals
# Authentication and Authorisation
from functools import wraps
from . import http
def permit(test_func, response_class=http.Forbidden):
'''Decorate a handler to control access'''
def decorator(view_func):
@wraps(view_func)
def _wrapped_view(self, *args... | Make it DRYer for people
from __future__ import unicode_literals
# Authentication and Authorisation
from functools import wraps
from . import http
def permit(test_func, response_class=http.Forbidden):
'''Decorate a handler to control access'''
def decorator(view_func):
@wraps(view_func)
def... |
ec3a70e038efc565ce88294caf0e78d5efaa9a85 | djangocms_picture/cms_plugins.py | djangocms_picture/cms_plugins.py | from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import Picture
class PicturePlugin(CMSPluginBase):
model = Picture
name = _("Picture")
render_template = "cms/plugins/pi... | from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import Picture
class PicturePlugin(CMSPluginBase):
model = Picture
name = _("Picture")
render_template = "cms/plugins/pi... | Modify the picture plugin slightly | Modify the picture plugin slightly
| Python | mit | okfn/foundation,okfn/website,okfn/website,okfn/foundation,MjAbuz/foundation,MjAbuz/foundation,okfn/website,okfn/foundation,MjAbuz/foundation,okfn/foundation,okfn/website,MjAbuz/foundation | from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import Picture
class PicturePlugin(CMSPluginBase):
model = Picture
name = _("Picture")
render_template = "cms/plugins/pi... | Modify the picture plugin slightly
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import Picture
class PicturePlugin(CMSPluginBase):
model = Picture
name = _("Picture")
... |
03d628abc4711bb0de4a7a0ef13cc4c0ecb92032 | opps/articles/tests/models.py | opps/articles/tests/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
self.assertTrue(post)
self.assertEqu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
self.assertTrue(post)
self.assertEqu... | Add test articles (post), check child_class | Add test articles (post), check child_class
| Python | mit | YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
self.assertTrue(post)
self.assertEqu... | Add test articles (post), check child_class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
... |
5e87af4770a05bc187df7efbb5292c876393aef0 | nbgrader/apps/formgradeapp.py | nbgrader/apps/formgradeapp.py | from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp impor... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
from nbgrader.templates import get_t... | Make form grade server be a flag | Make form grade server be a flag
| Python | bsd-3-clause | modulexcite/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,modulexcite/nbgrader,alope107/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,dementrock/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,MatKallada/nbgrad... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
from nbgrader.templates import get_t... | Make form grade server be a flag
from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgr... |
d137f2cf16b088e2d9722568fce6dad89d950016 | Cauldron/ext/expose/keywords.py | Cauldron/ext/expose/keywords.py | # -*- coding: utf-8 -*-
"""
An extension for keywords which expose pieces of native python objects.
"""
from __future__ import absolute_import
from Cauldron.types import Integer, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
__all__ = ['ExposeAttribute']
class ExposeAttribute(DispatcherKeywordType)... | # -*- coding: utf-8 -*-
"""
An extension for keywords which expose pieces of native python objects.
"""
from __future__ import absolute_import
from Cauldron.types import Integer, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
__all__ = ['ExposeAttribute']
class ExposeAttribute(DispatcherKeywordType)... | FIx a bug in exposed attribute keyword | FIx a bug in exposed attribute keyword
| Python | bsd-3-clause | alexrudy/Cauldron | # -*- coding: utf-8 -*-
"""
An extension for keywords which expose pieces of native python objects.
"""
from __future__ import absolute_import
from Cauldron.types import Integer, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
__all__ = ['ExposeAttribute']
class ExposeAttribute(DispatcherKeywordType)... | FIx a bug in exposed attribute keyword
# -*- coding: utf-8 -*-
"""
An extension for keywords which expose pieces of native python objects.
"""
from __future__ import absolute_import
from Cauldron.types import Integer, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
__all__ = ['ExposeAttribute']
clas... |
822f62de129e08df7ff6802b18d531b15b33fec7 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.3.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
... | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.3.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
... | Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 | Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26
Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://git... | Python | apache-2.0 | zooniverse/panoptes-python-client | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.3.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
... | Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26
Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://git... |
90aebb2fe3c4605798148adbff57deedba0ad175 | test_user_operations.py | test_user_operations.py | import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.append(thingToAdd)
class FakeDatabase:
def _... | Add some unit tests for common user operations | Add some unit tests for common user operations
| Python | bsd-2-clause | peterhajas/LivingDex,peterhajas/LivingDex,peterhajas/LivingDex,peterhajas/LivingDex | import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.append(thingToAdd)
class FakeDatabase:
def _... | Add some unit tests for common user operations
| |
b6ec3ba9efae7b6b291391b0333e80f2e9fc6fa0 | src/waldur_mastermind/invoices/migrations/0053_invoiceitem_uuid.py | src/waldur_mastermind/invoices/migrations/0053_invoiceitem_uuid.py | import uuid
from django.db import migrations
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migratio... | import uuid
from django.db import migrations, models
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(... | Fix database migration script for UUID field in invoice item model. | Fix database migration script for UUID field in invoice item model.
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | import uuid
from django.db import migrations, models
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(... | Fix database migration script for UUID field in invoice item model.
import uuid
from django.db import migrations
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().he... |
ff17f0ef71ccc2e553b19d67eac13ec74021f0a5 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.13.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.13.3 | Increment version number to 0.13.3
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | """Configuration for Django system."""
__version__ = "0.13.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.13.3
"""Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
|
65bfede8d8739699e57ddd4f66049ac0374d1a8d | ydf/instructions.py | ydf/instructions.py | """
ydf/instructions
~~~~~~~~~~~~~~~~
Convert objects parsed from YAML to those that represent Dockerfile instructions.
"""
__all__ = []
FROM = 'FROM'
RUN = 'RUN'
CMD = 'CMD'
LABEL = 'LABEL'
EXPOSE = 'EXPOSE'
ENV = 'ENV'
ADD = 'ADD'
COPY = 'COPY'
ENTRYPOINT = 'ENTRYPOINT'
VOLUME = 'VOLUME'
USER = 'USER'... | """
ydf/instructions
~~~~~~~~~~~~~~~~
Convert objects parsed from YAML to those that represent Dockerfile instructions.
"""
import collections
import functools
from ydf import meta
__all__ = []
FROM = 'FROM'
RUN = 'RUN'
CMD = 'CMD'
LABEL = 'LABEL'
EXPOSE = 'EXPOSE'
ENV = 'ENV'
ADD = 'ADD'
COPY = 'COP... | Add @instruction decorator to mark module level funcs as handlers. | Add @instruction decorator to mark module level funcs as handlers.
| Python | apache-2.0 | ahawker/ydf | """
ydf/instructions
~~~~~~~~~~~~~~~~
Convert objects parsed from YAML to those that represent Dockerfile instructions.
"""
import collections
import functools
from ydf import meta
__all__ = []
FROM = 'FROM'
RUN = 'RUN'
CMD = 'CMD'
LABEL = 'LABEL'
EXPOSE = 'EXPOSE'
ENV = 'ENV'
ADD = 'ADD'
COPY = 'COP... | Add @instruction decorator to mark module level funcs as handlers.
"""
ydf/instructions
~~~~~~~~~~~~~~~~
Convert objects parsed from YAML to those that represent Dockerfile instructions.
"""
__all__ = []
FROM = 'FROM'
RUN = 'RUN'
CMD = 'CMD'
LABEL = 'LABEL'
EXPOSE = 'EXPOSE'
ENV = 'ENV'
ADD = 'ADD'
COP... |
de69b88f47714848e4a73b6375d9665fb48faeda | climlab/__init__.py | climlab/__init__.py | __version__ = '0.5.0.dev0'
# this should ensure that we can still import constants.py as climlab.constants
from climlab.utils import constants
from climlab.utils import thermo, legendre
# some more useful shorcuts
from climlab.model.column import GreyRadiationModel, RadiativeConvectiveModel, BandRCModel
from climlab.m... | __version__ = '0.5.0'
# this should ensure that we can still import constants.py as climlab.constants
from climlab.utils import constants
from climlab.utils import thermo, legendre
# some more useful shorcuts
from climlab.model.column import GreyRadiationModel, RadiativeConvectiveModel, BandRCModel
from climlab.model.... | Increment version number to 0.5.0 | Increment version number to 0.5.0 | Python | mit | cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab,brian-rose/climlab | __version__ = '0.5.0'
# this should ensure that we can still import constants.py as climlab.constants
from climlab.utils import constants
from climlab.utils import thermo, legendre
# some more useful shorcuts
from climlab.model.column import GreyRadiationModel, RadiativeConvectiveModel, BandRCModel
from climlab.model.... | Increment version number to 0.5.0
__version__ = '0.5.0.dev0'
# this should ensure that we can still import constants.py as climlab.constants
from climlab.utils import constants
from climlab.utils import thermo, legendre
# some more useful shorcuts
from climlab.model.column import GreyRadiationModel, RadiativeConvectiv... |
fba983fa54691fcde0de93d6519b3906dff3cb32 | sara_flexbe_states/src/sara_flexbe_states/get_distance2D.py | sara_flexbe_states/src/sara_flexbe_states/get_distance2D.py | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | Correct call to super constructor | Correct call to super constructor
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
<= done
"""
def __init__... | Correct call to super constructor
#!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
import re
import ros
import math
class getDistance(EventState):
"""
Calcule la distance entre deux points donnes.
### InputKey
># point1
># point2
### OutputKey
#> distance
... |
70a2196d7748a9b01a0c23e2b2bda6a074ae4c8a | python/setup_fsurfer_backend.py | python/setup_fsurfer_backend.py | #!/usr/bin/env python
# Copyright 2015 University of Chicago
# Available under Apache 2.0 License
# setup for fsurf on OSG Connect login
from distutils.core import setup
import fsurfer
setup(name='fsurfer-backend',
version=fsurfer.__version__,
description='Scripts to handle background freesurfer processin... | #!/usr/bin/env python
# Copyright 2015 University of Chicago
# Available under Apache 2.0 License
# setup for fsurf on OSG Connect login
from distutils.core import setup
import fsurfer
setup(name='fsurfer-backend',
version=fsurfer.__version__,
description='Scripts to handle background freesurfer processin... | Add purge and warn scripts | Add purge and warn scripts
| Python | apache-2.0 | OSGConnect/freesurfer_workflow,OSGConnect/freesurfer_workflow | #!/usr/bin/env python
# Copyright 2015 University of Chicago
# Available under Apache 2.0 License
# setup for fsurf on OSG Connect login
from distutils.core import setup
import fsurfer
setup(name='fsurfer-backend',
version=fsurfer.__version__,
description='Scripts to handle background freesurfer processin... | Add purge and warn scripts
#!/usr/bin/env python
# Copyright 2015 University of Chicago
# Available under Apache 2.0 License
# setup for fsurf on OSG Connect login
from distutils.core import setup
import fsurfer
setup(name='fsurfer-backend',
version=fsurfer.__version__,
description='Scripts to handle bac... |
171144db2109e4bbe357b44ca37ad5578e1c3996 | config.py | config.py | FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv']
OUTPUT_EXT = '.mp4'
| FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv', '.mp4']
OUTPUT_EXT = '... | Add mp4 as input ext | Add mp4 as input ext
| Python | mit | danielbreves/auto_encoder | FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv', '.mp4']
OUTPUT_EXT = '... | Add mp4 as input ext
FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv']
... |
33e1c57cd6186820fb95b5d04a1f494710b2ccbe | democracy_club/apps/authorities/management/commands/import_mapit_area_type.py | democracy_club/apps/authorities/management/commands/import_mapit_area_type.py | import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authorities.helpers impor... | """
DIW
MTW
UTW
"""
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from auth... | Comment for types of area that need importing | Comment for types of area that need importing
| Python | bsd-3-clause | DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website | """
DIW
MTW
UTW
"""
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from auth... | Comment for types of area that need importing
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities ... |
86d4aa3e5895d5f7ac029df82c63e2b1e29e8c2d | spc/types.py | spc/types.py | """
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['type'])
ArrayOf = namedtuple('ArrayOf', ['type', 'count'])
Fu... | """
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['type'])
ArrayOf = namedtuple('ArrayOf', ['type', 'count'])
Fu... | Add note that Struct's field collection is an OrderedDict | Add note that Struct's field collection is an OrderedDict
| Python | mit | adamnew123456/spc,adamnew123456/spc | """
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['type'])
ArrayOf = namedtuple('ArrayOf', ['type', 'count'])
Fu... | Add note that Struct's field collection is an OrderedDict
"""
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['ty... |
db45d34db6e4c14be226f33a383a4034cc6f7048 | lib/utils.py | lib/utils.py | import re
def find_memtions(content):
regex = re.compile(r"@(?P<username>)(\s|$)", re.I)
return [m.group("username") for m in regex.finditer(content)]
| Add the method for finding names using regular expression matching. | Add the method for finding names using regular expression matching.
| Python | mit | yiyangyi/cc98-tornado | import re
def find_memtions(content):
regex = re.compile(r"@(?P<username>)(\s|$)", re.I)
return [m.group("username") for m in regex.finditer(content)]
| Add the method for finding names using regular expression matching.
| |
50c4dd5b6b911b783a29ff7e8764c113ab474d9c | tools/coverage_parser.py | tools/coverage_parser.py |
import os
os.chdir('tests/cmdline')
lines = file('coverage.out', 'r').readlines()
files = {}
for line in lines:
filename, lineno = line.split("----------")
if filename not in files:
files[filename] = set()
files[filename].add(int(lineno))
filenames = files.keys()
filenames.sort()
for filename in filen... | Add makefile build rule for building HTML files which show which lines are covered and which are not. | Add makefile build rule for building HTML files which show which lines are covered and which are not.
| Python | bsd-2-clause | Ms2ger/dom.js,andreasgal/dom.js,modulexcite/dom.js,modulexcite/dom.js,modulexcite/dom.js |
import os
os.chdir('tests/cmdline')
lines = file('coverage.out', 'r').readlines()
files = {}
for line in lines:
filename, lineno = line.split("----------")
if filename not in files:
files[filename] = set()
files[filename].add(int(lineno))
filenames = files.keys()
filenames.sort()
for filename in filen... | Add makefile build rule for building HTML files which show which lines are covered and which are not.
| |
7169f578892f9a72c2c14baa9bfd1ce2b7f9b9ec | fastats/core/decorator.py | fastats/core/decorator.py |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... | Remove a for loop in favour of a dict comprehension | Remove a for loop in favour of a dict comprehension
| Python | mit | fastats/fastats,dwillmer/fastats |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... | Remove a for loop in favour of a dict comprehension
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
... |
c4d64672c8c72ca928b354e9cfd35a7d40dbb78f | MROCPdjangoForm/ocpipeline/mrpaths.py | MROCPdjangoForm/ocpipeline/mrpaths.py | #
# Code to load project paths
#
import os, sys
MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "/Users/dmhembere44/MR-connectome" ))
MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" )
MR_MRCAP_PATH = os.path.join(MR_BASE_PATH, "mrcap" )
sys.path += [ MR_BASE_PATH, MR_CMAPPER_PATH, MR_MR... | #
# Code to load project paths
#
import os, sys
MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.." ))
MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" )
MR_MRCAP_PATH = os.path.join(MR_BASE_PATH, "mrcap" )
sys.path += [ MR_BASE_PATH, MR_CMAPPER_PATH, MR_MRCAP_PATH ]
| Change to path, made relative | Change to path, made relative
Former-commit-id: f00bf782fad3f6ddc6d2c97a23ff4f087ad3a22f
| Python | apache-2.0 | neurodata/ndmg | #
# Code to load project paths
#
import os, sys
MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.." ))
MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" )
MR_MRCAP_PATH = os.path.join(MR_BASE_PATH, "mrcap" )
sys.path += [ MR_BASE_PATH, MR_CMAPPER_PATH, MR_MRCAP_PATH ]
| Change to path, made relative
Former-commit-id: f00bf782fad3f6ddc6d2c97a23ff4f087ad3a22f
#
# Code to load project paths
#
import os, sys
MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "/Users/dmhembere44/MR-connectome" ))
MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" )
MR_MRCAP_PAT... |
a921605204a7a89839ef01f0b76d62cfacd3af25 | setup.py | setup.py | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.4',
description='Utility for installing binaries from source with a single command',
long_description=read("README... | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.4',
description='Utility for installing binaries from source with a single command',
long_description=read("README... | Update locket to 0.1.1 for bug fix | Update locket to 0.1.1 for bug fix
| Python | bsd-2-clause | mwilliamson/whack | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.4',
description='Utility for installing binaries from source with a single command',
long_description=read("README... | Update locket to 0.1.1 for bug fix
#!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='whack',
version='0.3.4',
description='Utility for installing binaries from source with a single command... |
354fcdbe045e80119b1edd4b322589e56df09c39 | examples/buffer_results.py | examples/buffer_results.py | """
Process 20 lines of output at a time.
Example runs:
python buffer_results.py
"""
import sys
import time
import drainers
# fake this
def setup_cruncher():
time.sleep(1)
def do_something_expensive(file):
time.sleep(0.005)
def destroy_cruncher():
time.sleep(0.8)
files = []
def crunch(files):
prin... | Add result buffering/batch processing example. | Add result buffering/batch processing example.
| Python | bsd-3-clause | nvie/python-drainers,nvie/python-drainers | """
Process 20 lines of output at a time.
Example runs:
python buffer_results.py
"""
import sys
import time
import drainers
# fake this
def setup_cruncher():
time.sleep(1)
def do_something_expensive(file):
time.sleep(0.005)
def destroy_cruncher():
time.sleep(0.8)
files = []
def crunch(files):
prin... | Add result buffering/batch processing example.
| |
bc36a19d3bb1c07cbe2a44de88f227ef71c50b8c | notebooks/utils.py | notebooks/utils.py | def print_generated_sequence(g, num, *, sep=", "):
"""
Helper function which prints a sequence of `num` items
produced by the random generator `g`.
"""
elems = [str(next(g)) for _ in range(num)]
sep_initial = "\n" if sep == "\n" else " "
print("Generated sequence:{}{}".format(sep_initial, s... | def print_generated_sequence(g, num, *, sep=", ", seed=None):
"""
Helper function which prints a sequence of `num` items
produced by the random generator `g`.
"""
if seed:
g.reset(seed)
elems = [str(next(g)) for _ in range(num)]
sep_initial = "\n" if sep == "\n" else " "
print("G... | Allow passing seed directly to helper function | Allow passing seed directly to helper function
| Python | mit | maxalbert/tohu | def print_generated_sequence(g, num, *, sep=", ", seed=None):
"""
Helper function which prints a sequence of `num` items
produced by the random generator `g`.
"""
if seed:
g.reset(seed)
elems = [str(next(g)) for _ in range(num)]
sep_initial = "\n" if sep == "\n" else " "
print("G... | Allow passing seed directly to helper function
def print_generated_sequence(g, num, *, sep=", "):
"""
Helper function which prints a sequence of `num` items
produced by the random generator `g`.
"""
elems = [str(next(g)) for _ in range(num)]
sep_initial = "\n" if sep == "\n" else " "
print... |
db01eb72829db32c87a167c9b3529577a028ec54 | example_project/example_project/settings.py | example_project/example_project/settings.py | # Django settings for example_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example_project.sqlite3',
}
}
SITE_ID = 1
SECRET_KEY = 'u%38dln@$1!7w#cxi4np504^sa3_skv5aekad)jy_u0v2mc+nr'
TEMPLATE_LOADERS = (
... | # Django settings for example_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example_project.sqlite3',
}
}
SITE_ID = 1
SECRET_KEY = 'u%38dln@$1!7w#cxi4np504^sa3_skv5aekad)jy_u0v2mc+nr'
TEMPLATE_LOADERS = (
... | Append slash to urls in example project | Append slash to urls in example project
| Python | mit | yetty/django-embed-video,mpachas/django-embed-video,yetty/django-embed-video,jazzband/django-embed-video,jazzband/django-embed-video,mpachas/django-embed-video | # Django settings for example_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example_project.sqlite3',
}
}
SITE_ID = 1
SECRET_KEY = 'u%38dln@$1!7w#cxi4np504^sa3_skv5aekad)jy_u0v2mc+nr'
TEMPLATE_LOADERS = (
... | Append slash to urls in example project
# Django settings for example_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example_project.sqlite3',
}
}
SITE_ID = 1
SECRET_KEY = 'u%38dln@$1!7w#cxi4np504^sa3_skv5aeka... |
233e5b2f48ae567f50843dc3b8b4301a21c12b71 | cloud_notes/templatetags/markdown_filters.py | cloud_notes/templatetags/markdown_filters.py | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'br', 'hr', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), tags = allowed_tags)
... | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['blockquote', 'pre', 'p', 'br', 'hr', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), t... | Add pre tag to cloud notes | Add pre tag to cloud notes
| Python | apache-2.0 | kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2 | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['blockquote', 'pre', 'p', 'br', 'hr', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), t... | Add pre tag to cloud notes
from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'br', 'hr', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(va... |
f6cede5524061faee8ae0f4c0f7dd3ef8c05a0a7 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'pybit',
'jsonpickle',
'requests',
]
test_requirements = []
# These requirements are specifically for the l... | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'requests',
# PyBit and dependencies
'pybit',
# 'psycopg2',
# 'amqplib',
'jsonpickle',
]
test_r... | Put in the necessary pybit dependenies | Put in the necessary pybit dependenies
| Python | agpl-3.0 | Connexions/roadrunners,Connexions/roadrunners | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'requests',
# PyBit and dependencies
'pybit',
# 'psycopg2',
# 'amqplib',
'jsonpickle',
]
test_r... | Put in the necessary pybit dependenies
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(here, 'README.rst')
install_requirements = [
'pybit',
'jsonpickle',
'requests',
]
test_requirements = []
# These... |
a0fc801130fa9068c5acc0a48d389f469cdb4bb2 | tasks.py | tasks.py | """
Automation tasks, aided by the Invoke package.
"""
import os
import webbrowser
from invoke import task, run
DOCS_DIR = 'docs'
DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build')
@task
def docs(show=True):
"""Build the docs and show them in default web browser."""
run('sphinx-build docs docs/_build')
... | """
Automation tasks, aided by the Invoke package.
"""
import os
import webbrowser
from invoke import task, run
DOCS_DIR = 'docs'
DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build')
@task
def docs(output='html', rebuild=False, show=True):
"""Build the docs and show them in default web browser."""
build_cmd ... | Add more options to the `docs` task | Add more options to the `docs` task
| Python | bsd-3-clause | Xion/callee | """
Automation tasks, aided by the Invoke package.
"""
import os
import webbrowser
from invoke import task, run
DOCS_DIR = 'docs'
DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build')
@task
def docs(output='html', rebuild=False, show=True):
"""Build the docs and show them in default web browser."""
build_cmd ... | Add more options to the `docs` task
"""
Automation tasks, aided by the Invoke package.
"""
import os
import webbrowser
from invoke import task, run
DOCS_DIR = 'docs'
DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build')
@task
def docs(show=True):
"""Build the docs and show them in default web browser."""
run... |
decb9212a5e0adae31d8e7562fa8258c222aae23 | dbmigrator/__init__.py | dbmigrator/__init__.py | # -*- coding: utf-8 -*-
import logging
import sys
logger = logging.getLogger('dbmigrator')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter('[%(levelname)s] %(name)s (%(filename)s) - %(message)s'))
logger.addHandler(handler)
| Add a logger for dbmigrator that writes to stdout | Add a logger for dbmigrator that writes to stdout
For example in a migration file
20160128111115_mimetype_removal_from_module_files.py:
```
from dbmigrator import logger
logger.info('message from migration')
```
You will see this when you run the migration:
```
[INFO] dbmigrator (20160128111115_mimetype_removal_fr... | Python | agpl-3.0 | karenc/db-migrator | # -*- coding: utf-8 -*-
import logging
import sys
logger = logging.getLogger('dbmigrator')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter('[%(levelname)s] %(name)s (%(filename)s) - %(message)s'))
logger.addHandler(handler)
| Add a logger for dbmigrator that writes to stdout
For example in a migration file
20160128111115_mimetype_removal_from_module_files.py:
```
from dbmigrator import logger
logger.info('message from migration')
```
You will see this when you run the migration:
```
[INFO] dbmigrator (20160128111115_mimetype_removal_fr... | |
348536786d6194f0f23475427f96a5f5b69c0743 | heron/tools/cli/src/python/version.py | heron/tools/cli/src/python/version.py | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | Add back a deleted newline. | Add back a deleted newline.
| Python | apache-2.0 | tomncooper/heron,tomncooper/heron,lewiskan/heron,streamlio/heron,twitter/heron,ashvina/heron,mycFelix/heron,twitter/heron,huijunwu/heron,lucperkins/heron,tomncooper/heron,tomncooper/heron,lucperkins/heron,srkukarni/heron,objmagic/heron,lewiskan/heron,lewiskan/heron,ashvina/heron,lucperkins/heron,streamlio/heron,huijunw... | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | Add back a deleted newline.
# Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
29f8849f74b10490561177668ef30dd267445ffb | test/test_speed.py | test/test_speed.py | from nose.tools import assert_greater, assert_less
import collections
import time
import cProfile
import pstats
import pandas as pd
import numpy as np
from numpy.random import normal
from phip import hit_calling
def test_speed(profile=False):
starts = collections.OrderedDict()
timings = collections.Ordere... | Add speed test for hit calling | Add speed test for hit calling
| Python | apache-2.0 | laserson/phip-stat,lasersonlab/phip-stat | from nose.tools import assert_greater, assert_less
import collections
import time
import cProfile
import pstats
import pandas as pd
import numpy as np
from numpy.random import normal
from phip import hit_calling
def test_speed(profile=False):
starts = collections.OrderedDict()
timings = collections.Ordere... | Add speed test for hit calling
| |
1f2d0b0978d55d471322ec3e8a93464f9da4c59b | xlsxcompose.py | xlsxcompose.py | import argparse
__author__ = 'perks'
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Migrate columns from one spreadsheet to columns in a new spreadsheet.'
)
parser.add_argument(
'-i',
'--input',
help='Input .xlsx file',
... | __author__ = 'perks'
from xlutils.copy import copy
from xlrd import open_workbook
import xlsxwriter
def compose(input, output, mappings):
START_ROW = 501
END_ROW = 1000
rb = open_workbook(input)
r_sheet = rb.sheet_by_name("CLEAN")
workbook = xlsxwriter.Workbook(output)
worksheet = workbook.a... | Load settings from file, fix logic | Load settings from file, fix logic
| Python | mit | perks/xlsxcompose | __author__ = 'perks'
from xlutils.copy import copy
from xlrd import open_workbook
import xlsxwriter
def compose(input, output, mappings):
START_ROW = 501
END_ROW = 1000
rb = open_workbook(input)
r_sheet = rb.sheet_by_name("CLEAN")
workbook = xlsxwriter.Workbook(output)
worksheet = workbook.a... | Load settings from file, fix logic
import argparse
__author__ = 'perks'
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Migrate columns from one spreadsheet to columns in a new spreadsheet.'
)
parser.add_argument(
'-i',
'--input',
... |
e9d62c12448822246ad0ed79a90b36dd27429615 | echidna/demo/server.py | echidna/demo/server.py | """
Echidna demo server.
"""
import os
from cyclone.web import RequestHandler
from echidna.server import EchidnaServer
class DemoServer(EchidnaServer):
"""
A server to demo Echidna.
"""
def __init__(self, **settings):
defaults = {
"template_path": (
os.path.join... | """
Echidna demo server.
"""
import os
from cyclone.web import RequestHandler
from echidna.server import EchidnaServer
class DemoServer(EchidnaServer):
"""
A server to demo Echidna.
"""
def __init__(self, **settings):
defaults = {
"template_path": (
os.path.join... | Add list of channels to demo.html template context. | Add list of channels to demo.html template context.
| Python | bsd-3-clause | praekelt/echidna,praekelt/echidna,praekelt/echidna,praekelt/echidna | """
Echidna demo server.
"""
import os
from cyclone.web import RequestHandler
from echidna.server import EchidnaServer
class DemoServer(EchidnaServer):
"""
A server to demo Echidna.
"""
def __init__(self, **settings):
defaults = {
"template_path": (
os.path.join... | Add list of channels to demo.html template context.
"""
Echidna demo server.
"""
import os
from cyclone.web import RequestHandler
from echidna.server import EchidnaServer
class DemoServer(EchidnaServer):
"""
A server to demo Echidna.
"""
def __init__(self, **settings):
defaults = {
... |
0eb860c2bfbc015970fef517e835a49dd84812db | rcamp/mailer/migrations/0002_allocation_expiration_mailer_field_choices.py | rcamp/mailer/migrations/0002_allocation_expiration_mailer_field_choices.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mailer', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='mailnotifier',
name='e... | Add db migration: expiration/expiring choices for mailer | Add db migration: expiration/expiring choices for mailer
| Python | mit | ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mailer', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='mailnotifier',
name='e... | Add db migration: expiration/expiring choices for mailer
| |
950b18ed6a4eaabd99ec6ce769247fc84676eb3b | tests.py | tests.py | #! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
(
id INT PRIMARY... | #! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
(
id INT PRIMARY... | Fix misplaced colon in test suite | Fix misplaced colon in test suite | Python | mit | hawkw/sqlviz | #! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
(
id INT PRIMARY... | Fix misplaced colon in test suite
#! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
... |
11c30f5dd765475a9f5f0f847f31c47af8c40a39 | user_agent/device.py | user_agent/device.py | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(open())
| import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(f)
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(f)
| Fix uses of file objects | Fix uses of file objects | Python | mit | lorien/user_agent | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(f)
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(f)
| Fix uses of file objects
import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS =... |
82c86350f62aefa3b732d5273216b0cb937758db | site/api/migrations/0009_load_pos_fixture_data.py | site/api/migrations/0009_load_pos_fixture_data.py | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixture(apps, schema_editor):
"Dele... | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixture(apps, schema_editor):
"Dele... | Fix bug in unload_fixture method | Fix bug in unload_fixture method | Python | mit | LitPalimpsest/parser-api-search,LitPalimpsest/parser-api-search,LitPalimpsest/parser-api-search | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixture(apps, schema_editor):
"Dele... | Fix bug in unload_fixture method
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixtur... |
c6fbba9da9d1cf2a5a0007a56d192e267d19fcff | flexget/utils/database.py | flexget/utils/database.py | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | Fix with_session decorator for python 2.5 | Fix with_session decorator for python 2.5
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@1957 3942dd89-8c5d-46d7-aeed-044bccf3e60c
| Python | mit | vfrc2/Flexget,tobinjt/Flexget,Pretagonist/Flexget,oxc/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,Flexget/Flexget,spencerjanssen/Flexget,ianstalk/Flexget,xfouloux/Flexget,malkavi/Flexget,asm0dey/Flexget,v17al/Flexget,camon/Flexget,ZefQ/Flexget,cvium/Flexget,jacobmetrick/Flexget,crawln45/Flexget,camon/Flexget,OmgOhnoe... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | Fix with_session decorator for python 2.5
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@1957 3942dd89-8c5d-46d7-aeed-044bccf3e60c
from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, *... |
46b8a4d0668c764df85f1e8a94672d81dd112beb | maps/api/views.py | maps/api/views.py | from django.http import HttpResponse
def list_question_sets(request):
return HttpResponse('Lol, udachi')
| import json
from django.http import HttpResponse
from maps.models import QuestionSet
def list_question_sets(request):
objects = QuestionSet.objects.all()
items = []
for obj in objects:
items.append({
'title': obj.title,
'max_duration': obj.max_duration.seconds,
... | Add API method for question sets list | Add API method for question sets list
| Python | mit | sevazhidkov/greenland,sevazhidkov/greenland | import json
from django.http import HttpResponse
from maps.models import QuestionSet
def list_question_sets(request):
objects = QuestionSet.objects.all()
items = []
for obj in objects:
items.append({
'title': obj.title,
'max_duration': obj.max_duration.seconds,
... | Add API method for question sets list
from django.http import HttpResponse
def list_question_sets(request):
return HttpResponse('Lol, udachi')
|
c2782795dc679897b333138482b99b21b4c60349 | salt/modules/test.py | salt/modules/test.py | '''
Module for running arbitrairy tests
'''
import time
def echo(text):
'''
Return a string - used for testing the connection
CLI Example:
salt '*' test.echo 'foo bar baz quo qux'
'''
print 'Echo got called!'
return text
def ping():
'''
Just used to make sure the minion is up and... | '''
Module for running arbitrairy tests
'''
import time
def echo(text):
'''
Return a string - used for testing the connection
CLI Example:
salt '*' test.echo 'foo bar baz quo qux'
'''
print 'Echo got called!'
return text
def ping():
'''
Just used to make sure the minion is up and... | Fix assignment issue in coallatz | Fix assignment issue in coallatz
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
Module for running arbitrairy tests
'''
import time
def echo(text):
'''
Return a string - used for testing the connection
CLI Example:
salt '*' test.echo 'foo bar baz quo qux'
'''
print 'Echo got called!'
return text
def ping():
'''
Just used to make sure the minion is up and... | Fix assignment issue in coallatz
'''
Module for running arbitrairy tests
'''
import time
def echo(text):
'''
Return a string - used for testing the connection
CLI Example:
salt '*' test.echo 'foo bar baz quo qux'
'''
print 'Echo got called!'
return text
def ping():
'''
Just used... |
3c4a91171c3588a918415801f39442a5733dcfd4 | tests/test_rst.py | tests/test_rst.py | # -*- coding: utf-8 -*-
import sys
import os
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide"))
import rst
class TestRst(object):
def test_pygments(self):
p = rst.Pygments('')
print p.__dict__
print p.run()
assert False
def html_pa... | Structure for the Rst test | Structure for the Rst test | Python | apache-2.0 | netantho/epicslide,netantho/epicslide | # -*- coding: utf-8 -*-
import sys
import os
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide"))
import rst
class TestRst(object):
def test_pygments(self):
p = rst.Pygments('')
print p.__dict__
print p.run()
assert False
def html_pa... | Structure for the Rst test
| |
29cc044b50cf0fdc8bfad97f194ea7fa993e08e6 | tests/test_worker.py | tests/test_worker.py | from twisted.trial import unittest
from ooni.plugoo import work, tests
class WorkerTestCase(unittest.TestCase):
def testWorkGenerator(self):
class DummyTest:
assets = {}
dummytest = DummyTest()
asset = []
for i in range(10):
asset.append(i)
dummytest... | Write test case for worker | Write test case for worker
| Python | bsd-2-clause | kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,hackerberry/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,hackerberry/ooni-p... | from twisted.trial import unittest
from ooni.plugoo import work, tests
class WorkerTestCase(unittest.TestCase):
def testWorkGenerator(self):
class DummyTest:
assets = {}
dummytest = DummyTest()
asset = []
for i in range(10):
asset.append(i)
dummytest... | Write test case for worker
| |
086371f56748da9fb68acc4aaa10094b6cf24fcb | tests/unit/returners/test_pgjsonb.py | tests/unit/returners/test_pgjsonb.py | # -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.mixins impo... | Revert "Remove pgjsonb returner unit tests" | Revert "Remove pgjsonb returner unit tests"
This reverts commit ab4a670ff22878d5115f408baf0304a0ba3ec994.
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.mixins impo... | Revert "Remove pgjsonb returner unit tests"
This reverts commit ab4a670ff22878d5115f408baf0304a0ba3ec994.
| |
aa974a2d12020e324db222b022594d9e489e559f | convert.py | convert.py | import argparse
import numpy as np
from PIL import Image
lookup = " .,:-?X#"
def image_to_ascii(image):
"""
PIL image object -> 2d array of values
"""
quantised = image.quantize(len(lookup))
quantised.show()
array = np.asarray(quantised.resize((128,64)))
return [[lookup[k] for k in i... | import argparse
import numpy as np
from PIL import Image
lookup = " .,:-!?X#"
def image_to_ascii(image, width=128):
"""
PIL image object -> 2d array of values
"""
def scale_height(h, w, new_width):
print "original height: {}".format(h)
print "original width: {}".format(w)
pr... | CORRECT height/width conversion this time around | CORRECT height/width conversion this time around
| Python | mit | machineperson/fantastic-doodle | import argparse
import numpy as np
from PIL import Image
lookup = " .,:-!?X#"
def image_to_ascii(image, width=128):
"""
PIL image object -> 2d array of values
"""
def scale_height(h, w, new_width):
print "original height: {}".format(h)
print "original width: {}".format(w)
pr... | CORRECT height/width conversion this time around
import argparse
import numpy as np
from PIL import Image
lookup = " .,:-?X#"
def image_to_ascii(image):
"""
PIL image object -> 2d array of values
"""
quantised = image.quantize(len(lookup))
quantised.show()
array = np.asarray(quantised.re... |
74305170ee64a0129d5c8eec8d908e4a8696d038 | jobs/migrations/0012_auto_20170809_1849.py | jobs/migrations/0012_auto_20170809_1849.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps as global_apps
from django.contrib.contenttypes.management import update_contenttypes
from django.db import models, migrations
from django.utils.timezone import now
MARKER = '.. Migrated from django_comments_xtd.Comment model... | Migrate old comments over jobs.JobReviewComment | Migrate old comments over jobs.JobReviewComment
Fixes #591
| Python | apache-2.0 | manhhomienbienthuy/pythondotorg,python/pythondotorg,manhhomienbienthuy/pythondotorg,manhhomienbienthuy/pythondotorg,proevo/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,python/pythondotorg,python/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,proevo/pythondotorg,proevo/pythondotorg,python/pythondot... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps as global_apps
from django.contrib.contenttypes.management import update_contenttypes
from django.db import models, migrations
from django.utils.timezone import now
MARKER = '.. Migrated from django_comments_xtd.Comment model... | Migrate old comments over jobs.JobReviewComment
Fixes #591
| |
05419e49c438c3f867c1ab4bd37021755ec09332 | skimage/exposure/__init__.py | skimage/exposure/__init__.py | from .exposure import histogram, equalize, equalize_hist, \
rescale_intensity, cumulative_distribution, \
adjust_gamma, adjust_sigmoid, adjust_log
from ._adapthist import equalize_adapthist
__all__ = ['histogram',
'equalize',
'equalize_hist',
... | from .exposure import histogram, equalize, equalize_hist, \
rescale_intensity, cumulative_distribution, \
adjust_gamma, adjust_sigmoid, adjust_log
from ._adapthist import equalize_adapthist
from .unwrap import unwrap
__all__ = ['histogram',
'equalize',
... | Make unwrap visible in the exposure package. | Make unwrap visible in the exposure package.
| Python | bsd-3-clause | SamHames/scikit-image,ClinicalGraphics/scikit-image,chintak/scikit-image,bennlich/scikit-image,robintw/scikit-image,rjeli/scikit-image,youprofit/scikit-image,ClinicalGraphics/scikit-image,rjeli/scikit-image,chriscrosscutler/scikit-image,SamHames/scikit-image,blink1073/scikit-image,youprofit/scikit-image,GaZ3ll3/scikit-... | from .exposure import histogram, equalize, equalize_hist, \
rescale_intensity, cumulative_distribution, \
adjust_gamma, adjust_sigmoid, adjust_log
from ._adapthist import equalize_adapthist
from .unwrap import unwrap
__all__ = ['histogram',
'equalize',
... | Make unwrap visible in the exposure package.
from .exposure import histogram, equalize, equalize_hist, \
rescale_intensity, cumulative_distribution, \
adjust_gamma, adjust_sigmoid, adjust_log
from ._adapthist import equalize_adapthist
__all__ = ['histogram',
'eq... |
09f429e76a7b2cd49ea66b70d314bb4510971a5f | gui.py | gui.py | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="")
win = MainWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
| import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Text Playing Game")
self.set_border_width(10)
self.set_size_request(500, 400)
win = MainWindow()
win.connect("delete-event", Gtk.ma... | Set GUI title and size | Set GUI title
and size
| Python | mit | Giovanni21M/Text-Playing-Game | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Text Playing Game")
self.set_border_width(10)
self.set_size_request(500, 400)
win = MainWindow()
win.connect("delete-event", Gtk.ma... | Set GUI title
and size
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="")
win = MainWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
|
0578b55f4e1e62b7c5c9c6f62721576970f43fdd | setup.py | setup.py | #!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
from django_evolution import get_package_version, VERSION
def run_tests(*args):
import os
os.system('tests/ru... | #!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
from django_evolution import get_package_version, VERSION
def run_tests(*args):
import os
os.system('tests/ru... | Revert "Allow Django Evolution to install along with Django >= 1.7." | Revert "Allow Django Evolution to install along with Django >= 1.7."
This reverts commit 28b280bb04f806f614f6f2cd25ce779b551fef9e.
This was committed to the wrong branch.
| Python | bsd-3-clause | beanbaginc/django-evolution | #!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
from django_evolution import get_package_version, VERSION
def run_tests(*args):
import os
os.system('tests/ru... | Revert "Allow Django Evolution to install along with Django >= 1.7."
This reverts commit 28b280bb04f806f614f6f2cd25ce779b551fef9e.
This was committed to the wrong branch.
#!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, f... |
3a98e416f844bf9be93d704a8f7fb9caf3bf1723 | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/dev.py | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/dev.py | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'CHANGEME!!!'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Process all tasks synchronously.... | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'CHANGEME!!!'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Process all ta... | Update TEMPLATE_DEBUG to Django 1.8 version | Update TEMPLATE_DEBUG to Django 1.8 version | Python | bsd-3-clause | torchbox/cookiecutter-wagtail,torchbox/cookiecutter-wagtail,torchbox/wagtail-cookiecutter,torchbox/cookiecutter-wagtail,torchbox/cookiecutter-wagtail,torchbox/wagtail-cookiecutter,torchbox/wagtail-cookiecutter,torchbox/wagtail-cookiecutter | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'CHANGEME!!!'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Process all ta... | Update TEMPLATE_DEBUG to Django 1.8 version
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'CHANGEME!!!'
EMAIL_BACKEND = 'django.core.mail.backends.console.Email... |
23c9aeb707f6bc0b6948dffb03bd7c960b7e97a8 | tests/test_vector2_reflect.py | tests/test_vector2_reflect.py | from ppb_vector import Vector2
import pytest
from hypothesis import given, assume, note
from math import isclose, isinf
from utils import units, vectors
reflect_data = (
(Vector2(1, 1), Vector2(0, -1), Vector2(1, -1)),
(Vector2(1, 1), Vector2(-1, 0), Vector2(-1, 1)),
(Vector2(0, 1), Vector2(0, -1), Vector... | from ppb_vector import Vector2
import pytest
from hypothesis import given, assume, note
from math import isclose, isinf
from utils import angle_isclose, units, vectors
reflect_data = (
(Vector2(1, 1), Vector2(0, -1), Vector2(1, -1)),
(Vector2(1, 1), Vector2(-1, 0), Vector2(-1, 1)),
(Vector2(0, 1), Vector2... | Add a property tying reflect() and angle() | test_reflect_prop: Add a property tying reflect() and angle()
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | from ppb_vector import Vector2
import pytest
from hypothesis import given, assume, note
from math import isclose, isinf
from utils import angle_isclose, units, vectors
reflect_data = (
(Vector2(1, 1), Vector2(0, -1), Vector2(1, -1)),
(Vector2(1, 1), Vector2(-1, 0), Vector2(-1, 1)),
(Vector2(0, 1), Vector2... | test_reflect_prop: Add a property tying reflect() and angle()
from ppb_vector import Vector2
import pytest
from hypothesis import given, assume, note
from math import isclose, isinf
from utils import units, vectors
reflect_data = (
(Vector2(1, 1), Vector2(0, -1), Vector2(1, -1)),
(Vector2(1, 1), Vector2(-1, ... |
9c42a7925d4e872a6245301ef68b2b9aa1f0aa7b | tests/__init__.py | tests/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | Declare unittest lib used within python version | Declare unittest lib used within python version
| Python | apache-2.0 | glorizen/watchdog,ymero/watchdog,javrasya/watchdog,mconstantin/watchdog,teleyinex/watchdog,gorakhargosh/watchdog,javrasya/watchdog,ymero/watchdog,javrasya/watchdog,mconstantin/watchdog,teleyinex/watchdog,teleyinex/watchdog,glorizen/watchdog,glorizen/watchdog,gorakhargosh/watchdog,mconstantin/watchdog,ymero/watchdog | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | Declare unittest lib used within python version
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
2adb05bb518bbb18036c8c6ccc353e2381a79d86 | indra/tests/test_rest_api.py | indra/tests/test_rest_api.py | import requests
def test_rest_api_responsive():
stmt_str = '{"statements": [{"sbo": "http://identifiers.org/sbo/SBO:0000526", "type": "Complex", "id": "acc6d47c-f622-41a4-8ae9-d7b0f3d24a2f", "members": [{"db_refs": {"TEXT": "MEK", "BE": "MEK"}, "name": "MEK"}, {"db_refs": {"TEXT": "ERK", "NCIT": "C26360", "BE": "E... | Add smoke test for REST API on Travis | Add smoke test for REST API on Travis
| Python | bsd-2-clause | johnbachman/belpy,bgyori/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/belpy | import requests
def test_rest_api_responsive():
stmt_str = '{"statements": [{"sbo": "http://identifiers.org/sbo/SBO:0000526", "type": "Complex", "id": "acc6d47c-f622-41a4-8ae9-d7b0f3d24a2f", "members": [{"db_refs": {"TEXT": "MEK", "BE": "MEK"}, "name": "MEK"}, {"db_refs": {"TEXT": "ERK", "NCIT": "C26360", "BE": "E... | Add smoke test for REST API on Travis
| |
517e22b331f63e80cb344e257789463627b44508 | utilities/rename-random-number.py | utilities/rename-random-number.py | ''' rename files in local directory with random integer names.
windows screen saver isn't very good at randomizing fotos shown.
Change file names regularly to provide more variety
'''
import os
import re
import random
random.seed()
new_names = set()
original_files = []
for entry in os.listdir():
if os.path.is... | #! python3
''' rename files in local directory with random integer names.
windows screen saver isn't very good at randomizing fotos shown.
Change file names regularly to provide more variety
'''
import os
import re
import random
import time
random.seed()
new_names = set()
original_files = []
for entry in os.lis... | Increase namespace, sleep before cmd window closes | Increase namespace, sleep before cmd window closes | Python | mit | daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various | #! python3
''' rename files in local directory with random integer names.
windows screen saver isn't very good at randomizing fotos shown.
Change file names regularly to provide more variety
'''
import os
import re
import random
import time
random.seed()
new_names = set()
original_files = []
for entry in os.lis... | Increase namespace, sleep before cmd window closes
''' rename files in local directory with random integer names.
windows screen saver isn't very good at randomizing fotos shown.
Change file names regularly to provide more variety
'''
import os
import re
import random
random.seed()
new_names = set()
original_files... |
1983885acfccfe4ffa010401fd9ef0971bb6c12c | etcd3/__init__.py | etcd3/__init__.py | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
| from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', '... | Make Member part of the public api | Make Member part of the public api
| Python | apache-2.0 | kragniz/python-etcd3 | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', '... | Make Member part of the public api
from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils'... |
f7c7cf55b6536fd5646272b700ce42cc02936fbb | st2common/st2common/transport/__init__.py | st2common/st2common/transport/__init__.py | from st2common.transport import actionexecution, publishers
__all__ = ['actionexecution', 'publishers']
| from st2common.transport import actionexecution, publishers
# TODO(manas) : Exchanges, Queues and RoutingKey design discussion pending.
__all__ = ['actionexecution', 'publishers']
| Add TODO to capture the fact that design discussion is pending. | Add TODO to capture the fact that design discussion is pending.
| Python | apache-2.0 | pixelrebel/st2,StackStorm/st2,pinterb/st2,jtopjian/st2,tonybaloney/st2,pinterb/st2,Itxaka/st2,emedvedev/st2,jtopjian/st2,lakshmi-kannan/st2,pixelrebel/st2,Plexxi/st2,alfasin/st2,nzlosh/st2,punalpatel/st2,StackStorm/st2,dennybaa/st2,Itxaka/st2,emedvedev/st2,dennybaa/st2,punalpatel/st2,armab/st2,StackStorm/st2,Plexxi/st2... | from st2common.transport import actionexecution, publishers
# TODO(manas) : Exchanges, Queues and RoutingKey design discussion pending.
__all__ = ['actionexecution', 'publishers']
| Add TODO to capture the fact that design discussion is pending.
from st2common.transport import actionexecution, publishers
__all__ = ['actionexecution', 'publishers']
|
f58cce56103b98e783fa0df5bae0ae0985f7dc8e | rmake_plugins/multinode_client/nodetypes.py | rmake_plugins/multinode_client/nodetypes.py | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, d):
return class_(**d)
class Cli... | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
_nodeTypes = {}
class _NodeTypeRegistrar(type):
def __init__(self, name, bases, dict):
type.__init__(self, name, bases, dict)
_nodeTypes[self.nodeType] = self
class NodeType(object):
__metaclass__ = _NodeType... | Use metaclasses to register node types. | Use metaclasses to register node types.
| Python | apache-2.0 | sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake,sassoftware/rmake,sassoftware/rmake3,sassoftware/rmake | import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
_nodeTypes = {}
class _NodeTypeRegistrar(type):
def __init__(self, name, bases, dict):
type.__init__(self, name, bases, dict)
_nodeTypes[self.nodeType] = self
class NodeType(object):
__metaclass__ = _NodeType... | Use metaclasses to register node types.
import inspect
import sys
import types
from rmake.lib.apiutils import thaw, freeze
class NodeType(object):
nodeType = 'UNKNOWN'
def __init__(self):
pass
def freeze(self):
return (self.nodeType, self.__dict__)
@classmethod
def thaw(class_, ... |
abd3daed5cd0c70d76bf8fa1cfdda93efcda3e70 | knights/compat/django.py | knights/compat/django.py |
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return datetime.datetime.now().strftime(fmt)
@register.helper
def url(name, *args, **kwargs):
try:
ret... |
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return timezone.now().strftime(fmt)
@register.helper
def url(name, *args, **kwar... | Make the `now` helper timezone aware | Make the `now` helper timezone aware
Thanks @tysonclugg | Python | mit | funkybob/knights-templater,funkybob/knights-templater |
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return timezone.now().strftime(fmt)
@register.helper
def url(name, *args, **kwar... | Make the `now` helper timezone aware
Thanks @tysonclugg
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return datetime.datetime.now().strftime(fmt)
@register.he... |
9b9e1872bf3281249a318c69b18e60cd6995ad2d | elmo/elmo/urls.py | elmo/elmo/urls.py | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | Add support for Django debug sidebar. | Add support for Django debug sidebar.
| Python | mit | StephenSwat/eve_lunar_mining_organiser,StephenSwat/eve_lunar_mining_organiser | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | Add support for Django debug sidebar.
"""elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$... |
dce5c6f7f7cfd2b7384aba5d887700bb90ab2e39 | app/timetables/admin.py | app/timetables/admin.py | from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site.register(models.Admin)
| from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site.register(models.Admin)
| Add extra space below ending of import | Add extra space below ending of import
| Python | mit | teamtaverna/core | from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site.register(models.Admin)
| Add extra space below ending of import
from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site... |
c7c54f6d3afdd8b63775a4f2177275817143d423 | tests/TestProfileRequirements.py | tests/TestProfileRequirements.py | import configparser #To read the profiles.
import os #To join paths.
import pytest
## Makes sure that the variants for the Ultimaker 3 Extended are exactly the
# same as for the Ultimaker 3.
#
# Once we have specialised profiles or a mechanism to inherit variants too, we
# may remove this test and have differen... | Add test to ensure that UM3 and UM3E variants are kept the same | Add test to ensure that UM3 and UM3E variants are kept the same
It's a bit chunky, but functional.
| Python | agpl-3.0 | Curahelper/Cura,Curahelper/Cura | import configparser #To read the profiles.
import os #To join paths.
import pytest
## Makes sure that the variants for the Ultimaker 3 Extended are exactly the
# same as for the Ultimaker 3.
#
# Once we have specialised profiles or a mechanism to inherit variants too, we
# may remove this test and have differen... | Add test to ensure that UM3 and UM3E variants are kept the same
It's a bit chunky, but functional.
| |
ef72b229732610c3b6c8ccdd9c599002986707f3 | test_knot.py | test_knot.py | # -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_app()
dic = Knot(app)
... | # -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot, get_container
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_app()
di... | Add test for shared container. | Add test for shared container. | Python | mit | jaapverloop/flask-knot | # -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot, get_container
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_app()
di... | Add test for shared container.
# -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_... |
82bca5898d753638536abdd965c799bd947163e5 | scipy/ndimage/tests/test_regression.py | scipy/ndimage/tests/test_regression.py | import numpy as np
from numpy.testing import *
import scipy.ndimage as ndimage
def test_byte_order_median():
"""Regression test for #413: median_filter does not handle bytes orders."""
a = np.arange(9, dtype='<f4').reshape(3, 3)
ref = ndimage.filters.median_filter(a,(3, 3))
b = np.arange(9, dtype='>f4... | import numpy as np
from numpy.testing import *
import scipy.ndimage as ndimage
def test_byte_order_median():
"""Regression test for #413: median_filter does not handle bytes orders."""
a = np.arange(9, dtype='<f4').reshape(3, 3)
ref = ndimage.filters.median_filter(a,(3, 3))
b = np.arange(9, dtype='>f4... | Use run_module_suite instead of deprecated NumpyTest. | Use run_module_suite instead of deprecated NumpyTest.
| Python | bsd-3-clause | teoliphant/scipy,gef756/scipy,ChanderG/scipy,raoulbq/scipy,petebachant/scipy,dch312/scipy,zaxliu/scipy,gertingold/scipy,ndchorley/scipy,zxsted/scipy,sonnyhu/scipy,ortylp/scipy,jsilter/scipy,rgommers/scipy,jseabold/scipy,surhudm/scipy,vhaasteren/scipy,jamestwebber/scipy,piyush0609/scipy,ales-erjavec/scipy,WillieMaddox/s... | import numpy as np
from numpy.testing import *
import scipy.ndimage as ndimage
def test_byte_order_median():
"""Regression test for #413: median_filter does not handle bytes orders."""
a = np.arange(9, dtype='<f4').reshape(3, 3)
ref = ndimage.filters.median_filter(a,(3, 3))
b = np.arange(9, dtype='>f4... | Use run_module_suite instead of deprecated NumpyTest.
import numpy as np
from numpy.testing import *
import scipy.ndimage as ndimage
def test_byte_order_median():
"""Regression test for #413: median_filter does not handle bytes orders."""
a = np.arange(9, dtype='<f4').reshape(3, 3)
ref = ndimage.filters.... |
0866706165f9312f91577d716a7bb55551b1097f | scripts/SearchAndReplace.py | scripts/SearchAndReplace.py | # Copyright (c) 2017 Ruben Dulek
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import re #To perform the search and replace.
from ..Script import Script
## Performs a search-and-replace on all g-code.
#
# Due to technical limitations, the search can't cross the border between
# ... | Add search and replace script | Add search and replace script
| Python | agpl-3.0 | nallath/PostProcessingPlugin | # Copyright (c) 2017 Ruben Dulek
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import re #To perform the search and replace.
from ..Script import Script
## Performs a search-and-replace on all g-code.
#
# Due to technical limitations, the search can't cross the border between
# ... | Add search and replace script
| |
a84ce4c8215cced7a64253453a3530911b8518f8 | job_runner/apps/job_runner/management/commands/broadcast_queue.py | job_runner/apps/job_runner/management/commands/broadcast_queue.py | import json
import logging
import time
from datetime import datetime
import zmq
from django.conf import settings
from django.core.management.base import NoArgsCommand
from job_runner.apps.job_runner.models import Run
logger = logging.getLogger(__name__)
class Command(NoArgsCommand):
help = 'Broadcast runs in ... | import json
import logging
import time
from datetime import datetime
import zmq
from django.conf import settings
from django.core.management.base import NoArgsCommand
from job_runner.apps.job_runner.models import Run
logger = logging.getLogger(__name__)
class Command(NoArgsCommand):
help = 'Broadcast runs in ... | Add time.sleep after binding publisher to give subscribers time to (re-)connect. | Add time.sleep after binding publisher to give subscribers time to (re-)connect.
| Python | bsd-3-clause | spilgames/job-runner,spilgames/job-runner | import json
import logging
import time
from datetime import datetime
import zmq
from django.conf import settings
from django.core.management.base import NoArgsCommand
from job_runner.apps.job_runner.models import Run
logger = logging.getLogger(__name__)
class Command(NoArgsCommand):
help = 'Broadcast runs in ... | Add time.sleep after binding publisher to give subscribers time to (re-)connect.
import json
import logging
import time
from datetime import datetime
import zmq
from django.conf import settings
from django.core.management.base import NoArgsCommand
from job_runner.apps.job_runner.models import Run
logger = logging.... |
0313743781fd046a587936545f030938beb71364 | dataset/dataset/spiders/dataset_spider.py | dataset/dataset/spiders/dataset_spider.py | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
pages = 9466
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = []
for i in... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
pages = 9466
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = []
for i in... | Add regex to filter out tab/space/newline | Add regex to filter out tab/space/newline
| Python | mit | MaxLikelihood/CODE | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
pages = 9466
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = []
for i in... | Add regex to filter out tab/space/newline
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
pages = 9466
name = 'dataset'
allowed_domains = ['dat... |
1c16c8e98845550b19f6c75db5253805f656c636 | http_requests.py | http_requests.py | import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
request = self.view.substr(self.view.line(self.view.sel()[0]))
response = eval(r... | import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
selections = self.get_selections()
for s in selections:
response = e... | Allow multiple requests to be made at once by iterating over selections | Allow multiple requests to be made at once by iterating over selections
| Python | mit | kylebebak/Requester,kylebebak/Requester | import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
selections = self.get_selections()
for s in selections:
response = e... | Allow multiple requests to be made at once by iterating over selections
import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
request = self.... |
3bf41213abc7ddd8421e11c2149b536c255c13eb | pixpack/utils.py | pixpack/utils.py | #!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # system default language
if sys_lang == 'en_EN' or sys... | #!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # system default language
if sys_lang == 'en_EN' or sys... | Store the duplicated items separately in related folder | Store the duplicated items separately in related folder
| Python | mit | OrhanOdabasi/PixPack,OrhanOdabasi/PixPack | #!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # system default language
if sys_lang == 'en_EN' or sys... | Store the duplicated items separately in related folder
#!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.