commit
stringlengths 40
40
| old_file
stringlengths 4
264
| new_file
stringlengths 4
264
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
624
| message
stringlengths 15
4.7k
| lang
stringclasses 3
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
---|---|---|---|---|---|---|---|---|---|
3446db734ce669e98f8cdeedbabf13dac62c777f | edgedb/lang/build.py | edgedb/lang/build.py | import os.path
from distutils.command import build
class build(build.build):
def _compile_parsers(self):
import parsing
import edgedb
import edgedb.server.main
edgedb.server.main.init_import_system()
import edgedb.lang.edgeql.parser.grammar.single as edgeql_spec
import edgedb.lang.edgeql.parser.grammar.block as edgeql_spec2
import edgedb.server.pgsql.parser.pgsql as pgsql_spec
import edgedb.lang.schema.parser.grammar.declarations as schema_spec
import edgedb.lang.graphql.parser.grammar.document as graphql_spec
base_path = os.path.dirname(
os.path.dirname(os.path.dirname(__file__)))
for spec in (edgeql_spec, edgeql_spec2, pgsql_spec,
schema_spec, graphql_spec):
subpath = os.path.dirname(spec.__file__)[len(base_path) + 1:]
cache_dir = os.path.join(self.build_lib, subpath)
os.makedirs(cache_dir)
cache = os.path.join(
cache_dir, spec.__name__.rpartition('.')[2] + '.pickle')
parsing.Spec(spec, pickleFile=cache, verbose=True)
def run(self, *args, **kwargs):
super().run(*args, **kwargs)
self._compile_parsers()
| import os.path
from distutils.command import build
class build(build.build):
def _compile_parsers(self):
import parsing
import edgedb
import edgedb.server.main
edgedb.server.main.init_import_system()
import edgedb.lang.edgeql.parser.grammar.single as edgeql_spec
import edgedb.lang.edgeql.parser.grammar.block as edgeql_spec2
import edgedb.server.pgsql.parser.pgsql as pgsql_spec
import edgedb.lang.schema.parser.grammar.declarations as schema_spec
import edgedb.lang.graphql.parser.grammar.document as graphql_spec
base_path = os.path.dirname(
os.path.dirname(os.path.dirname(__file__)))
for spec in (edgeql_spec, edgeql_spec2, pgsql_spec,
schema_spec, graphql_spec):
subpath = os.path.dirname(spec.__file__)[len(base_path) + 1:]
cache_dir = os.path.join(self.build_lib, subpath)
os.makedirs(cache_dir, exist_ok=True)
cache = os.path.join(
cache_dir, spec.__name__.rpartition('.')[2] + '.pickle')
parsing.Spec(spec, pickleFile=cache, verbose=True)
def run(self, *args, **kwargs):
super().run(*args, **kwargs)
self._compile_parsers()
| Fix the creation of parser cache directory | setup.py: Fix the creation of parser cache directory
| Python | apache-2.0 | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb |
13a73fd7762e0e176fc8d6d51016cfbd982f05bf | openedx/core/djangoapps/django_comment_common/migrations/0005_coursediscussionsettings.py | openedx/core/djangoapps/django_comment_common/migrations/0005_coursediscussionsettings.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
('django_comment_common', '0004_auto_20161117_1209'),
]
operations = [
migrations.CreateModel(
name='CourseDiscussionSettings',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', CourseKeyField(help_text=b'Which course are these settings associated with?', unique=True, max_length=255, db_index=True)),
('always_divide_inline_discussions', models.BooleanField(default=False)),
('_divided_discussions', models.TextField(null=True, db_column=b'divided_discussions', blank=True)),
('division_scheme', models.CharField(default=b'none', max_length=20, choices=[(b'none', b'None'), (b'cohort', b'Cohort'), (b'enrollment_track', b'Enrollment Track')])),
],
options={
'db_table': 'django_comment_common_coursediscussionsettings',
},
),
]
| # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
('django_comment_common', '0004_auto_20161117_1209'),
]
operations = [
migrations.CreateModel(
name='CourseDiscussionSettings',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', CourseKeyField(help_text='Which course are these settings associated with?', unique=True, max_length=255, db_index=True)),
('always_divide_inline_discussions', models.BooleanField(default=False)),
('_divided_discussions', models.TextField(null=True, db_column='divided_discussions', blank=True)),
('division_scheme', models.CharField(default='none', max_length=20, choices=[('none', 'None'), ('cohort', 'Cohort'), ('enrollment_track', 'Enrollment Track')])),
],
options={
'db_table': 'django_comment_common_coursediscussionsettings',
},
),
]
| Fix type mismatches in the django_comment_common migrations. | Fix type mismatches in the django_comment_common migrations.
Mixing byte and unicode strings causes migrations to fail.
| Python | agpl-3.0 | msegado/edx-platform,eduNEXT/edunext-platform,cpennington/edx-platform,cpennington/edx-platform,msegado/edx-platform,angelapper/edx-platform,mitocw/edx-platform,eduNEXT/edx-platform,arbrandes/edx-platform,mitocw/edx-platform,mitocw/edx-platform,appsembler/edx-platform,arbrandes/edx-platform,edx-solutions/edx-platform,appsembler/edx-platform,angelapper/edx-platform,stvstnfrd/edx-platform,angelapper/edx-platform,angelapper/edx-platform,edx-solutions/edx-platform,eduNEXT/edx-platform,stvstnfrd/edx-platform,msegado/edx-platform,arbrandes/edx-platform,edx/edx-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform,edx-solutions/edx-platform,eduNEXT/edx-platform,eduNEXT/edunext-platform,cpennington/edx-platform,stvstnfrd/edx-platform,edx/edx-platform,appsembler/edx-platform,stvstnfrd/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,msegado/edx-platform,EDUlib/edx-platform,mitocw/edx-platform,EDUlib/edx-platform,cpennington/edx-platform,appsembler/edx-platform,eduNEXT/edx-platform,edx-solutions/edx-platform,edx/edx-platform,edx/edx-platform,msegado/edx-platform,EDUlib/edx-platform |
7cd2f582c444c483b9f8a677063f03dfe9ce0e0a | lingcod/raster_stats/views.py | lingcod/raster_stats/views.py | # Create your views here.
from django.http import HttpResponse
from lingcod.raster_stats.models import zonal_stats, RasterDataset, ZonalStatsCache
from django.core import serializers
from django.contrib.gis.geos import fromstr
def stats_for_geom(request, raster_name):
# Confirm that we have a valid polygon geometry
if 'geom_txt' in request.REQUEST:
geom_txt = str(request.REQUEST['geom_txt'])
else:
return HttpResponse("Must supply a geom_txt parameter", status=404)
try:
geom = fromstr(geom_txt)
except:
return HttpResponse("Must supply a parsable geom_txt parameter (wkt or json)", status=404)
# Confirm raster with pk exists
try:
raster = RasterDataset.objects.get(name=raster_name)
except:
return HttpResponse("No raster with pk of %s" % pk, status=404)
#TODO check if continuous
zonal = zonal_stats(geom, raster)
zonal.save()
zqs = ZonalStatsCache.objects.filter(pk=zonal.pk)
data = serializers.serialize("json", zqs)
return HttpResponse(data, mimetype='application/javascript')
def raster_list(request):
rasts = RasterDataset.objects.all()
data = serializers.serialize("json", rasts)
return HttpResponse(data, mimetype='application/javascript')
| # Create your views here.
from django.http import HttpResponse
from lingcod.raster_stats.models import zonal_stats, RasterDataset, ZonalStatsCache
from django.core import serializers
from django.contrib.gis.geos import fromstr
def stats_for_geom(request, raster_name):
# Confirm that we have a valid polygon geometry
if 'geom_txt' in request.REQUEST:
geom_txt = str(request.REQUEST['geom_txt'])
else:
return HttpResponse("Must supply a geom_txt parameter", status=404)
try:
geom = fromstr(geom_txt)
except:
return HttpResponse("Must supply a parsable geom_txt parameter (wkt or json)", status=404)
# Confirm raster with pk exists
try:
raster = RasterDataset.objects.get(name=raster_name)
except:
return HttpResponse("No raster with pk of %s" % pk, status=404)
#TODO check if continuous
zonal = zonal_stats(geom, raster)
zonal.save()
zqs = ZonalStatsCache.objects.filter(pk=zonal.pk)
data = serializers.serialize("json", zqs, fields=('avg','min','max','median','mode','stdev','nulls','pixels','date_modified','raster'))
return HttpResponse(data, mimetype='application/json')
def raster_list(request):
rasts = RasterDataset.objects.all()
data = serializers.serialize("json", rasts, fields=('name','type'))
return HttpResponse(data, mimetype='application/json')
| Exclude certain fields from json serialization in raster_stats web service | Exclude certain fields from json serialization in raster_stats web service
| Python | bsd-3-clause | underbluewaters/marinemap,underbluewaters/marinemap,underbluewaters/marinemap |
3421fe2542a5b71f6b604e30f2c800400b5e40d8 | datawire/store/common.py | datawire/store/common.py | import json
from datawire.views.util import JSONEncoder
class Store(object):
def __init__(self, url):
self.url = url
def store(self, frame):
urn = frame.get('urn')
data = json.dumps(frame, cls=JSONEncoder)
return self._store(urn, data)
def load(self, urn):
data = self._load(urn)
if data is not None:
data = json.loads(data)
return data
| import json
from datawire.views.util import JSONEncoder
class Store(object):
def __init__(self, url):
self.url = url
def store(self, frame):
urn = frame.get('urn')
data = JSONEncoder().encode(frame)
return self._store(urn, data)
def load(self, urn):
data = self._load(urn)
if data is not None:
data = json.loads(data)
return data
| Fix encoding of store serialisation. | Fix encoding of store serialisation. | Python | mit | arc64/datawi.re,arc64/datawi.re,arc64/datawi.re |
9131a9f2349261900f056c1f920307b0fce176ad | icekit/plugins/image/content_plugins.py | icekit/plugins/image/content_plugins.py | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from . import models
@plugin_pool.register
class ImagePlugin(ContentPlugin):
model = models.ImageItem
category = _('Image')
render_template = 'icekit/plugins/image/default.html'
raw_id_fields = ['image', ]
| """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from django.template import loader
from fluent_contents.extensions import ContentPlugin, plugin_pool
from . import models
@plugin_pool.register
class ImagePlugin(ContentPlugin):
model = models.ImageItem
category = _('Image')
raw_id_fields = ['image', ]
def get_render_template(self, request, instance, **kwargs):
template = loader.select_template([
'icekit/plugins/image/%s_%s.html' % (
type(instance.parent)._meta.app_label,
type(instance.parent)._meta.model_name
),
'icekit/plugins/image/%s.html' % type(
instance.parent)._meta.app_label,
'icekit/plugins/image/default.html'])
return template.name
| Implement per-app/model template overrides for ImagePlugin. | Implement per-app/model template overrides for ImagePlugin.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit |
596b71f3015235e34fa740875a565c9a82f46a6b | setup.py | setup.py | from setuptools import setup, find_packages
try:
long_description = open("README.rst").read()
except IOError:
long_description = ""
setup(
name='odin',
version='0.5.6',
url='https://github.com/timsavage/odin',
license='LICENSE',
author='Tim Savage',
author_email='[email protected]',
description='Object Data Mapping for Python',
long_description=long_description,
packages=find_packages(),
install_requires=['six'],
extras_require={
# Documentation generation
'doc_gen': ["jinja2>=2.7"],
# Pint integration
'pint': ["pint"],
},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| from setuptools import setup, find_packages
try:
long_description = open("README.rst").read()
except IOError:
long_description = ""
setup(
name='odin',
version='0.5.6',
url='https://github.com/timsavage/odin',
license='LICENSE',
author='Tim Savage',
author_email='[email protected]',
description='Object Data Mapping for Python',
long_description=long_description,
packages=find_packages(),
install_requires=['six'],
extras_require={
# Documentation generation
'doc_gen': ["jinja2>=2.7"],
# Pint integration
'pint': ["pint"],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| Change Development status to 5 - Production/Stable for next release | Change Development status to 5 - Production/Stable for next release
| Python | bsd-3-clause | python-odin/odin |
31bff8f5bbb7e7005a2de4f6f9ef8dad2e6663e5 | setup.py | setup.py | from setuptools import setup
from kafka_info import __version__
setup(
name="kafka_info",
version=__version__,
author="Federico Giraud",
author_email="[email protected]",
description="Shows kafka cluster information and metrics",
packages=["kafka_info", "kafka_info.utils", "kafka_info.commands", "kafka_consumer_manager", "kafka_consumer_manager.commands"],
data_files=[("bash_completion.d", ["kafka-info", "kafka-consumer-manager"])],
scripts=["kafka-info", "kafka-consumer-manager"],
install_requires=[
"argparse",
"argcomplete",
"kazoo",
"PyYAML",
"yelp-kafka",
],
)
| from setuptools import setup
from kafka_info import __version__
setup(
name="kafka_info",
version=__version__,
author="Federico Giraud",
author_email="[email protected]",
description="Shows kafka cluster information and metrics",
packages=["kafka_info", "kafka_info.utils", "kafka_info.commands", "kafka_consumer_manager", "kafka_consumer_manager.commands"],
data_files=[("bash_completion.d", ["kafka-info"])],
scripts=["kafka-info", "kafka-consumer-manager"],
install_requires=[
"argparse",
"argcomplete",
"kazoo",
"PyYAML",
"yelp-kafka",
],
)
| Remove bash_completition references in consumer-manager | Remove bash_completition references in consumer-manager
| Python | apache-2.0 | Yelp/kafka-utils,anthonysandrin/kafka-utils,Yelp/kafka-utils,anthonysandrin/kafka-utils |
e948500e45314f9ae7f11426e163e3f4fa760c51 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='[email protected]',
license='BSD',
description='todoist-python - The official Todoist Python API library',
long_description = read('README.md'),
install_requires=[
'requests',
],
# see here for complete list of classifiers
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=(
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
),
)
| # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.13',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='[email protected]',
license='BSD',
description='todoist-python - The official Todoist Python API library',
long_description = read('README.md'),
install_requires=[
'requests',
],
# see here for complete list of classifiers
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=(
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
),
)
| Update the PyPI version to 7.0.13. | Update the PyPI version to 7.0.13.
| Python | mit | Doist/todoist-python |
80001f7947c3fabac9d2c22613e0d73b652b8d5c | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='exchangerates',
version='0.3.3',
description="A module to make it easier to handle historical exchange rates",
long_description="",
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
'Programming Language :: Python :: 3.7.5'
],
author='Mark Brough',
author_email='[email protected]',
url='http://github.com/markbrough/exchangerates',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples']),
namespace_packages=[],
include_package_data=True,
zip_safe=False,
install_requires=[
'lxml >= 4.4.0',
'requests >= 2.22.0',
'six >= 1.12.0'
],
entry_points={
}
)
| from setuptools import setup, find_packages
setup(
name='exchangerates',
version='0.3.3',
description="A module to make it easier to handle historical exchange rates",
long_description="",
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
author='Mark Brough',
author_email='[email protected]',
url='http://github.com/markbrough/exchangerates',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples']),
namespace_packages=[],
include_package_data=True,
zip_safe=False,
install_requires=[
'lxml >= 4.4.0',
'requests >= 2.22.0',
'six >= 1.12.0'
],
entry_points={
}
)
| Fix specification of Python 3.6 and 3.7 | Fix specification of Python 3.6 and 3.7
| Python | mit | markbrough/exchangerates |
37f5d7e0648bbc4a6682395ab213c87965c12c23 | setup.py | setup.py |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='file2dna',
version='0.1',
author = 'Allan Inocencio de Souza Costa',
author_email = '[email protected]',
description = 'A script o encode/decode arbitrary computer files into DNA sequences.',
packages=['dna',],
license='MIT',
keywords= 'dna encoding decoding file',
long_description=read('README.md'),
entry_points = {
'console_scripts': ['dna=dna.dna:main'],
}
) |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='file2dna',
version='0.2',
author = 'Allan Inocencio de Souza Costa',
author_email = '[email protected]',
description = 'A script to encode/decode arbitrary computer files into DNA sequences.',
packages=['dna',],
license='MIT',
keywords= 'dna encoding decoding file',
long_description=read('README.rst'),
entry_points = {
'console_scripts': ['dna=dna.dna:main'],
}
) | Fix build errors because of README extension | Fix build errors because of README extension
| Python | mit | allanino/DNA |
7bdb5b717560a147dc70b6c566cad6fa621a8902 | setup.py | setup.py | #!/usr/bin/env python
import os
import codecs
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='rds-log',
use_scm_version=True,
description='A utility to download AWS RDS logs',
author='Andreas Pelme',
author_email='[email protected]',
url='https://github.com/pelme/rds-log',
packages=find_packages(),
long_description=read('README.rst'),
install_requires=[
'boto3==1.1.2',
'click==5.1',
],
setup_requires=[
'setuptools_scm==1.7.0',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3.4',
],
entry_points={
'console_scripts': 'rds-log-stream=_rds_log.commands.rds_log_stream:main'
},
)
| #!/usr/bin/env python
import os
import codecs
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='rds-log',
use_scm_version=True,
description='A utility to download AWS RDS logs',
author='Andreas Pelme',
author_email='[email protected]',
url='https://github.com/pelme/rds-log',
packages=find_packages(),
long_description=read('README.rst'),
install_requires=[
'boto3==1.4.7',
'click==5.1',
],
setup_requires=[
'setuptools_scm==1.7.0',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3.4',
],
entry_points={
'console_scripts': 'rds-log-stream=_rds_log.commands.rds_log_stream:main'
},
)
| Update boto3 requirement to latest version | Update boto3 requirement to latest version
| Python | bsd-3-clause | pelme/rds-log,pelme/rds-log |
3032a68c560ec9ee5eaf6308ebc6f61b38f933ab | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
# Use quickphotos.VERSION for version numbers
version_tuple = __import__('quickphotos').VERSION
version = '.'.join([str(v) for v in version_tuple])
setup(
name='django-quick-photos',
version=version,
description='Latest Photos from Instagram for Django',
long_description=open('README.rst').read(),
url='https://github.com/blancltd/django-quick-photos',
maintainer='Blanc Ltd',
maintainer_email='[email protected]',
platforms=['any'],
install_requires=[
'python-instagram>=0.8.0',
],
packages=find_packages(),
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
license='BSD',
)
| #!/usr/bin/env python
from setuptools import find_packages, setup
# Use quickphotos.VERSION for version numbers
version_tuple = __import__('quickphotos').VERSION
version = '.'.join([str(v) for v in version_tuple])
setup(
name='django-quick-photos',
version=version,
description='Latest Photos from Instagram for Django',
long_description=open('README.rst').read(),
url='https://github.com/blancltd/django-quick-photos',
maintainer='Blanc Ltd',
maintainer_email='[email protected]',
platforms=['any'],
install_requires=[
'python-instagram>=0.8.0',
],
packages=find_packages(),
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
license='BSD',
)
| Add more Python version classifiers | Add more Python version classifiers
| Python | bsd-3-clause | blancltd/django-quick-photos,kmlebedev/mezzanine-instagram-quickphotos |
f0046e84e9ddae502d135dc7f59f98a14b969b31 | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import backlog
with open('README.rst') as readme_file:
README = readme_file.read()
setup(
name='backlog',
version=backlog.__version__,
description=backlog.__doc__,
long_description=README,
author='David Tucker',
author_email='[email protected]',
license='LGPLv2+',
url='https://github.com/dmtucker/backlog',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
include_package_data=True,
test_suite="backlog.test",
entry_points={'console_scripts': ['backlog = backlog.__main__:main']},
keywords='notes backlog todo lists',
classifiers=[
'License :: OSI Approved :: '
'GNU Lesser General Public License v2 or later (LGPLv2+)',
'Intended Audience :: End Users/Desktop',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta',
],
)
| #!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import backlog
with open('README.rst') as readme_file:
README = readme_file.read()
setup(
name='backlog',
version=backlog.__version__,
description=backlog.__doc__,
long_description=README,
author='David Tucker',
author_email='[email protected]',
license='LGPLv2+',
url='https://github.com/dmtucker/backlog',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
include_package_data=True,
test_suite="backlog.test",
entry_points={'console_scripts': ['backlog = backlog.__main__:main']},
keywords='notes backlog todo lists',
classifiers=[
'License :: OSI Approved :: '
'GNU Lesser General Public License v2 or later (LGPLv2+)',
'Intended Audience :: End Users/Desktop',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Development Status :: 4 - Beta',
],
)
| Add more Python 3 classifiers | Add more Python 3 classifiers | Python | lgpl-2.1 | dmtucker/backlog |
28c52ee84f139b8fef912a5c04327e69d05dd098 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='yargy',
version='0.4.0',
description='Tiny rule-based facts extraction package',
url='https://github.com/bureaucratic-labs/yargy',
author='Dmitry Veselov',
author_email='[email protected]',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7'
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='natural language processing, russian morphology, tomita',
packages=find_packages(),
install_requires=[
'pymorphy2',
'enum34',
'backports.functools-lru-cache',
],
)
| from sys import version_info
from setuptools import setup, find_packages
BASE_REQUIREMENTS = [
'pymorphy2'
]
BACKPORT_REQUIREMENTS = [
'enum34',
'backports.functools-lru-cache',
]
if version_info.major == 2 or (version_info.major == 3 and version_info.minor < 4):
BASE_REQUIREMENTS.append(BACKPORT_REQUIREMENTS)
setup(
name='yargy',
version='0.4.0',
description='Tiny rule-based facts extraction package',
url='https://github.com/bureaucratic-labs/yargy',
author='Dmitry Veselov',
author_email='[email protected]',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7'
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='natural language processing, russian morphology, tomita',
packages=find_packages(),
install_requires=BASE_REQUIREMENTS,
)
| Split python 3 and python 2 requirements | Split python 3 and python 2 requirements
| Python | mit | bureaucratic-labs/yargy |
7cca1f96abc8c5b4fed2984d5a1141ce14691187 | setup.py | setup.py | from setuptools import setup
VERSION="0.1"
try:
long_description=open('DESCRIPTION.rst', 'rt').read()
except Exception:
long_description="Universal Analytics in Python; an implementation of Google's Universal Analytics Measurement Protocol"
setup(
name = "universal-analytics-python",
description = "Universal Analytics Python Module",
long_description = long_description,
version = VERSION,
author = 'Sam Briesemeister',
author_email = '[email protected]',
url = 'https://github.com/analytics-pros/universal-analytics-python',
download_url = "https://github.com/analytics-pros/universal-analytics-python/tarball/" + VERSION,
license = 'BSD',
packages = ["UniversalAnalytics"],
zip_safe = True,
)
| from setuptools import setup
VERSION="0.2"
try:
long_description=open('DESCRIPTION.rst', 'rt').read()
except Exception:
long_description="Universal Analytics in Python; an implementation of Google's Universal Analytics Measurement Protocol"
setup(
name = "universal-analytics-python",
description = "Universal Analytics Python Module",
long_description = long_description,
version = VERSION,
author = 'Sam Briesemeister',
author_email = '[email protected]',
url = 'https://github.com/analytics-pros/universal-analytics-python',
download_url = "https://github.com/analytics-pros/universal-analytics-python/tarball/" + VERSION,
license = 'BSD',
packages = ["UniversalAnalytics"],
zip_safe = True,
)
| Update package version for PyPI | Update package version for PyPI
| Python | bsd-3-clause | analytics-pros/universal-analytics-python |
37c85b21311098fc4746924edfbb0c478255ca8c | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='qmpy',
version='0.4.9a',
author='S. Kirklin',
author_email='[email protected]',
license='LICENSE.txt',
classifiers=["Programming Language :: Python :: 2.7"],
packages=find_packages(),
scripts=['bin/oqmd', 'bin/qmpy'],
url='http://pypi.python.org/pypi/qmpy',
description='Suite of computational materials science tools',
include_package_data=True,
long_description=open('README.md').read(),
install_requires=[
"Django >=1.6.2, <1.7",
"PuLP",
"numpy",
"scipy",
"MySQL-python",
"matplotlib",
"networkx",
"pytest",
"python-memcached",
"ase",
"django-extensions",
"lxml",
"pyspglib == 1.8.3.1",
"PyCifRW >= 4.3",
"pexpect",
"pyparsing",
"PyYAML",
"scikit-learn"
],
)
| from setuptools import setup, find_packages
setup(
name='qmpy',
version='0.4.9a',
author='S. Kirklin',
author_email='[email protected]',
license='LICENSE.txt',
classifiers=["Programming Language :: Python :: 2.7"],
packages=find_packages(),
scripts=['bin/oqmd', 'bin/qmpy'],
url='http://pypi.python.org/pypi/qmpy',
description='Suite of computational materials science tools',
include_package_data=True,
long_description=open('README.md').read(),
install_requires=[
"Django >=1.6.2, <1.7",
"PuLP",
"numpy",
"scipy",
"MySQL-python",
"matplotlib",
"networkx",
"pytest",
"python-memcached",
"ase",
"django-extensions < 1.6.8",
"lxml",
"pyspglib == 1.8.3.1",
"PyCifRW >= 4.3",
"pexpect",
"pyparsing",
"PyYAML",
"scikit-learn"
],
)
| Fix django_extensions < 1.6.8 as higher versions do not support Django 1.6* | Fix django_extensions < 1.6.8 as higher versions do not support Django 1.6*
| Python | mit | wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy |
9a3a32548a864c623aa4af22875f7142420d9410 | setup.py | setup.py | from setuptools import setup
version = '0.1'
setup(
name='python-editor',
version=version,
description="Programmatically open an editor, capture the result.",
#long_description='',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries',
],
keywords='editor library vim emacs',
author='Peter Ruibal',
author_email='[email protected]',
url='https://github.com/fmoo/python-editor',
license='Apache',
py_modules=[
'editor',
],
requires=[
#'six',
],
)
| from setuptools import setup
version = '0.1'
setup(
name='python-editor',
version=version,
description="Programmatically open an editor, capture the result.",
#long_description='',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
],
keywords='editor library vim emacs',
author='Peter Ruibal',
author_email='[email protected]',
url='https://github.com/fmoo/python-editor',
license='Apache',
py_modules=[
'editor',
],
requires=[
#'six',
],
)
| Add python 3.4 to trove classifiers | Add python 3.4 to trove classifiers
| Python | apache-2.0 | hguemar/python-editor,fmoo/python-editor |
6af50ebf7ea3c63109ceb4be8f8b1c0ba9c3fcd0 | setup.py | setup.py | from setuptools import setup, find_packages
long_description = open('./README.rst').read()
setup(
name='ebi',
version='0.6.2',
install_requires=[
'awsebcli==3.7.3',
'boto3==1.2.6',
],
description='Simple CLI tool for ElasticBeanstalk with Docker',
long_description=long_description,
url='https://github.com/hirokiky/ebi',
author='Hiroki KIYOHARA',
author_email='[email protected]',
license='MIT',
packages=find_packages(),
entry_points={
'console_scripts': [
'ebi = ebi.core:main',
]
}
)
| from setuptools import setup, find_packages
long_description = open('./README.rst').read()
setup(
name='ebi',
version='0.6.2',
install_requires=[
'awsebcli>=3.7.3,<4',
'boto3>==1.2.6,<2',
],
description='Simple CLI tool for ElasticBeanstalk with Docker',
long_description=long_description,
url='https://github.com/hirokiky/ebi',
author='Hiroki KIYOHARA',
author_email='[email protected]',
license='MIT',
packages=find_packages(),
entry_points={
'console_scripts': [
'ebi = ebi.core:main',
]
}
)
| Allow new version of requires | Allow new version of requires | Python | mit | hirokiky/ebi |
47f49f41944310ccfaa4f41f79e6fb3172962f99 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, Extension
from ifconfigpy import get_version
modules = []
if os.uname()[0].lower().startswith('freebsd'):
modules.append(
Extension(
'ifconfigpy/driver/_freebsd',
sources=['ifconfigpy/driver/_freebsd.c'],
extra_compile_args=["-Wall"],
)
)
setup(
name='ifconfigpy',
version=get_version(),
url='http://bitbucket.org/williambr/ifconfigpy',
license='BSD',
author='William Grzybowski',
author_email='[email protected]',
description=('ifconfigpy is a python library to manipulate interfaces '
'like ifconfig'),
long_description=open(
os.path.join(os.path.dirname(__file__),
'README')).read(),
keywords='ifconfig',
packages=('ifconfigpy', 'ifconfigpy.driver'),
#package_data={ 'ifconfigpy': ['ifconfigpy.rst'] },
platforms='any',
classifiers=[
'Development Status :: 1 - Planning',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Programming Language :: Python',
],
ext_modules=modules,
)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, Extension
from ifconfigpy import get_version
modules = []
if os.uname()[0].lower().startswith('freebsd'):
modules.append(
Extension(
'ifconfigpy/driver/_freebsd',
sources=['ifconfigpy/driver/_freebsd.c'],
extra_compile_args=["-Wall"],
)
)
setup(
name='ifconfigpy',
version=get_version(),
url='https://github.com/williambr/ifconfigpy',
license='BSD',
author='William Grzybowski',
author_email='[email protected]',
description=('ifconfigpy is a python library to manipulate interfaces '
'like ifconfig(8)'),
long_description=open(
os.path.join(os.path.dirname(__file__),
'README')).read(),
keywords='ifconfig',
packages=('ifconfigpy', 'ifconfigpy.driver'),
platforms='any',
classifiers=[
'Development Status :: 1 - Planning',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Programming Language :: Python',
],
ext_modules=modules,
)
| Change metadata of the project | Change metadata of the project
| Python | bsd-2-clause | williambr/ifconfigpy,williambr/ifconfigpy |
01bacd50f41e3c40254a15953bf7a9f0120755ec | setup.py | setup.py | # encoding=utf8
from setuptools import setup
setup(
name='django-form-designer-ai',
version='0.9.2',
url='http://github.com/andersinno/django-form-designer-ai',
license='BSD',
maintainer='Anders Innovations Ltd',
maintainer_email='[email protected]',
packages=[
'form_designer',
'form_designer.migrations',
'form_designer.templatetags',
'form_designer.contrib',
'form_designer.contrib.exporters',
'form_designer.contrib.cms_plugins',
'form_designer.contrib.cms_plugins.form_designer_form',
],
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP',
],
install_requires=[
'django-picklefield>=0.3.2,<0.4',
],
zip_safe=False,
)
| # encoding=utf8
from setuptools import setup, find_packages
setup(
name='django-form-designer-ai',
version='0.9.3',
url='http://github.com/andersinno/django-form-designer-ai',
license='BSD',
maintainer='Anders Innovations Ltd',
maintainer_email='[email protected]',
packages=find_packages('.', include=[
'form_designer',
'form_designer.*',
]),
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP',
],
install_requires=[
'django-picklefield>=0.3.2,<0.4',
],
zip_safe=False,
)
| Include all packages (and become 0.9.3 in the process) | Include all packages (and become 0.9.3 in the process)
| Python | bsd-3-clause | andersinno/django-form-designer-ai,andersinno/django-form-designer,andersinno/django-form-designer-ai,kcsry/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer |
6058bc795563d482ce1672b3eb933e1c409c6ac8 | setup.py | setup.py | from distutils.core import setup
setup(
name='Juju XaaS CLI',
version='0.1.0',
author='Justin SB',
author_email='[email protected]',
packages=['jxaas'],
url='http://pypi.python.org/pypi/jxaas/',
license='LICENSE.txt',
description='CLI for Juju XaaS.',
long_description=open('README.md').read(),
install_requires=[
],
scripts=[
'bin/jxaas'
]
) | from distutils.core import setup
setup(
name='Juju XaaS CLI',
version='0.1.0',
author='Justin SB',
author_email='[email protected]',
packages=['jxaas'],
url='http://pypi.python.org/pypi/jxaas/',
license='LICENSE.txt',
description='CLI for Juju XaaS.',
long_description=open('README.md').read(),
install_requires=[
'cliff'
],
scripts=[
'bin/jxaas'
]
) | Add cliff as a requirement | Add cliff as a requirement
| Python | apache-2.0 | jxaas/cli |
6d2fb88570a627e255792cbb2bb5ff38e9b6cf3c | setup.py | setup.py | #!/usr/bin/env python
# from distutils.core import setup
from setuptools import setup, find_packages
import multiprocessing # nopep8
setup(name='orlo',
version='0.0.1',
description='Deployment data capture API',
author='Alex Forbes',
author_email='[email protected]',
license='GPL',
long_description=open('README.md').read(),
url='https://github.com/eBayClassifiedsGroup/orlo',
packages=find_packages(),
include_package_data=True,
install_requires=[
'arrow',
'Flask',
'Flask-SQLAlchemy',
'Flask-Testing',
'Flask-Migrate',
'gunicorn',
'psycopg2',
'pytz',
'sqlalchemy-utils',
],
test_suite='tests',
)
| #!/usr/bin/env python
# from distutils.core import setup
from setuptools import setup, find_packages
import multiprocessing # nopep8
setup(name='orlo',
version='0.0.1',
description='Deployment data capture API',
author='Alex Forbes',
author_email='[email protected]',
license='GPL',
long_description=open('README.md').read(),
url='https://github.com/eBayClassifiedsGroup/orlo',
packages=find_packages(),
include_package_data=True,
install_requires=[
'arrow',
'Flask',
'Flask-SQLAlchemy',
'Flask-Testing',
'Flask-Migrate',
'gunicorn',
'psycopg2',
'pytz',
'sphinxcontrib-httpdomain',
'sqlalchemy-utils',
],
test_suite='tests',
)
| Add sphinxcontrib-httpdomain for readthedocs build | Add sphinxcontrib-httpdomain for readthedocs build
| Python | mit | eBayClassifiedsGroup/orlo,al4/sponge,eBayClassifiedsGroup/sponge,eBayClassifiedsGroup/sponge,al4/orlo,al4/orlo,eBayClassifiedsGroup/sponge,eBayClassifiedsGroup/orlo,al4/sponge,al4/sponge |
6dfe73163224d6d129fef2c6ac8545611f90e7fc | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='zeit.push',
version='1.21.0.dev0',
author='gocept, Zeit Online',
author_email='[email protected]',
url='http://www.zeit.de/',
description="Sending push notifications through various providers",
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,
license='BSD',
namespace_packages=['zeit'],
install_requires=[
'fb',
'gocept.testing',
'grokcore.component',
'mock',
'pytz',
'requests',
'setuptools',
'tweepy',
'urbanairship >= 1.0',
'zc.sourcefactory',
'zeit.cms >= 2.102.0.dev0',
'zeit.content.article',
'zeit.content.image',
'zeit.objectlog',
'zope.app.appsetup',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.schema',
],
entry_points={
'console_scripts': [
'facebook-access-token = zeit.push.facebook:create_access_token',
'ua-payload-doc = zeit.push.urbanairship:print_payload_documentation',
],
'fanstatic.libraries': [
'zeit_push=zeit.push.browser.resources:lib',
],
},
)
| from setuptools import setup, find_packages
setup(
name='zeit.push',
version='1.21.0.dev0',
author='gocept, Zeit Online',
author_email='[email protected]',
url='http://www.zeit.de/',
description="Sending push notifications through various providers",
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,
license='BSD',
namespace_packages=['zeit'],
install_requires=[
'fb',
'gocept.testing',
'grokcore.component',
'mock',
'pytz',
'requests',
'setuptools',
'tweepy',
'urbanairship >= 1.0',
'zc.sourcefactory',
'zeit.cms >= 2.102.0.dev0',
'zeit.content.article',
'zeit.content.image',
'zeit.content.text',
'zeit.objectlog',
'zope.app.appsetup',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.schema',
],
entry_points={
'console_scripts': [
'facebook-access-token = zeit.push.facebook:create_access_token',
'ua-payload-doc = zeit.push.urbanairship:print_payload_documentation',
],
'fanstatic.libraries': [
'zeit_push=zeit.push.browser.resources:lib',
],
},
)
| Declare dependency (belongs to commit:6791185) | ZON-4007: Declare dependency (belongs to commit:6791185)
| Python | bsd-3-clause | ZeitOnline/zeit.push,ZeitOnline/zeit.push |
181983f9d79816d7b0d706ad58a497889175a945 | setup.py | setup.py | from setuptools import setup
setup(
name = 'marquee-composer',
version = '0.2.3-dev',
description = '',
long_description = file('README.md').read(),
url = 'https://github.com/marquee/composer',
author = 'Alec Perkins',
author_email = '[email protected]',
license = 'UNLICENSE',
packages = ['composer'],
zip_safe = False,
keywords = '',
install_requires = ['content==0.1.0'],
dependency_links = [
'git+https://github.com/marquee/[email protected]#egg=content-0.1.0',
],
package_data = {
'droptype-composer': ['../stylesheets/*'],
},
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: Public Domain',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| from setuptools import setup
setup(
name = 'marquee-composer',
version = '0.2.3-dev',
description = '',
long_description = file('README.md').read(),
url = 'https://github.com/marquee/composer',
author = 'Alec Perkins',
author_email = '[email protected]',
license = 'UNLICENSE',
packages = ['composer'],
zip_safe = False,
keywords = '',
install_requires = ['content==0.1.0'],
dependency_links = [
'git+https://github.com/marquee/content@master#egg=content-0.1.0',
],
package_data = {
'droptype-composer': ['../stylesheets/*'],
},
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: Public Domain',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| Use master branch of content instead of specific release | Use master branch of content instead of specific release | Python | unlicense | marquee/composer |
ee43700a05d2f4943d255b98f624de0e649cfa0c | grazer/run.py | grazer/run.py | import click
import logging
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
@click.option("--log_level", default="INFO")
def main(env, config, log_level):
logging.basicConfig(level=getattr(logging, log_level))
load_dotenv(env)
cfg = Config(config)
for record, link in crawler.create(cfg):
print(record)
if __name__ == "__main__":
main()
| import click
import logging
from dotenv import load_dotenv, find_dotenv
from grazer.config import Config
from grazer.core import crawler
@click.command()
@click.option("--env", default=find_dotenv())
@click.option("--config")
@click.option("--log_level", default="INFO")
@click.option("--debug/--info", default=False)
def main(env, config, log_level, debug):
if debug:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=getattr(logging, log_level))
load_dotenv(env)
cfg = Config(config)
for record, link in crawler.create(cfg):
print(record)
if __name__ == "__main__":
main()
| Make it easier to enter DEBUG mode | Make it easier to enter DEBUG mode
| Python | mit | CodersOfTheNight/verata |
2936906f54529f0df61dd44796042fe131842d01 | setup.py | setup.py | from setuptools import setup
import changes
setup(
name=changes.__name__,
version=changes.__version__,
description=changes.__doc__,
author=changes.__author__
author_email=changes.__email__,
url=changes.__url__,
packages=[changes.__name__],
install_requires=[
'docopt < 1.0.0',
'semantic_version < 1.0.0'
],
test_suite='nose.collector',
license=open('LICENSE'),
)
| from setuptools import setup
import changes
setup(
name=changes.__name__,
version=changes.__version__,
description=changes.__doc__,
author=changes.__author__,
author_email=changes.__email__,
url=changes.__url__,
packages=[changes.__name__],
install_requires=[
'docopt < 1.0.0',
'semantic_version < 1.0.0'
],
test_suite='nose.collector',
license=open('LICENSE').read(),
)
| Read license and fix missing comma | Read license and fix missing comma
| Python | mit | goldsborough/changes |
573bf086a09da16925fe01c3016161a478e5a2af | shifter.py | shifter.py | from image import ImageWithWCS
import numpy as np
from os import path
def shift_images(files, source_dir, output_file='_shifted'):
"""Align images based on astrometry."""
ref = files[0] # TODO: make reference image an input
ref_im = ImageWithWCS(path.join(source_dir, ref))
ref_pix = np.int32(np.array(ref_im.data.shape) / 2)
ref_ra_dec = ref_im.wcs_pix2sky(ref_pix)
for fil in files[1:]:
img = ImageWithWCS(path.join(source_dir, fil))
ra_dec_pix = img.wcs_sky2pix(ref_ra_dec)
shift = ref_pix - np.int32(ra_dec_pix)
print shift
img.shift(shift, in_place=True)
base, ext = path.splitext(fil)
img.save(path.join(source_dir, base + output_file + ext))
| from image import ImageWithWCS
import numpy as np
from os import path
def shift_images(files, source_dir, output_file='_shifted'):
"""Align images based on astrometry."""
ref = files[0] # TODO: make reference image an input
ref_im = ImageWithWCS(path.join(source_dir, ref))
ref_pix = np.int32(np.array(ref_im.data.shape) / 2)
ref_ra_dec = ref_im.wcs_pix2sky(ref_pix)
base, ext = path.splitext(files[0])
ref_im.save(path.join(source_dir, base + output_file + ext))
for fil in files[1:]:
img = ImageWithWCS(path.join(source_dir, fil))
ra_dec_pix = img.wcs_sky2pix(ref_ra_dec)
shift = ref_pix - np.int32(ra_dec_pix)
print shift
img.shift(shift, in_place=True)
base, ext = path.splitext(fil)
img.save(path.join(source_dir, base + output_file + ext))
| Make copy of reference image with same name modification as the rest of the images | Make copy of reference image with same name modification as the rest of the images
| Python | bsd-3-clause | mwcraig/msumastro |
57d3b3cf0309222aafbd493cbdc26f30e06f05c1 | tests/test_parsing.py | tests/test_parsing.py | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvnamer
#repository:http://github.com/dbr/tvnamer
#license:Creative Commons GNU GPL v2
# http://creativecommons.org/licenses/GPL/2.0/
"""Test tvnamer's filename parser
"""
import os
import sys
from copy import copy
import unittest
sys.path.append(os.path.join(os.path.abspath(sys.path[0]), ".."))
from utils import FileParser
from test_files import files
def check_test(curtest):
"""Runs test case, used by test_generator
"""
parser = FileParser(curtest['input'])
theep = parser.parse()
assert theep.seriesname.lower() == curtest['seriesname'].lower()
assert theep.seasonnumber == curtest['seasonnumber']
assert theep.episodenumber == curtest['episodenumber']
def test_generator():
"""Generates test for each test case in test_files.py
"""
for category, testcases in files.items():
for testindex, curtest in enumerate(testcases):
cur_tester = lambda x: check_test(x)
cur_tester.description = '%s_%d' % (category, testindex)
yield (cur_tester, curtest)
if __name__ == '__main__':
import nose
nose.main()
| #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvnamer
#repository:http://github.com/dbr/tvnamer
#license:Creative Commons GNU GPL v2
# http://creativecommons.org/licenses/GPL/2.0/
"""Test tvnamer's filename parser
"""
import os
import sys
from copy import copy
import unittest
sys.path.append(os.path.join(os.path.abspath(sys.path[0]), ".."))
from utils import FileParser
from test_files import files
def check_case(curtest):
"""Runs test case, used by test_generator
"""
parser = FileParser(curtest['input'])
theep = parser.parse()
assert(theep.seriesname.lower() == curtest['seriesname'].lower(),
"%s == %s" % (theep.seriesname.lower(), curtest['seriesname'].lower()))
assert (theep.seasonnumber == curtest['seasonnumber'],
"%s == %s" % (theep.seasonnumber, curtest['seasonnumber']))
assert (theep.episodenumber == curtest['episodenumber'],
"%s == %s" % (theep.episodenumber, curtest['episodenumber']))
def test_generator():
"""Generates test for each test case in test_files.py
"""
for category, testcases in files.items():
for testindex, curtest in enumerate(testcases):
cur_tester = lambda x: check_case(x)
cur_tester.description = '%s_%d' % (category, testindex)
yield (cur_tester, curtest)
if __name__ == '__main__':
import nose
nose.main()
| Fix utility being picked up as test, display expected-and-got values in assertion error | Fix utility being picked up as test, display expected-and-got values in assertion error | Python | unlicense | m42e/tvnamer,lahwaacz/tvnamer,dbr/tvnamer |
eee003627856ce3f0a19ad18c8fe6b0a5408c3b6 | make_index.py | make_index.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 18:29:35 2013
@author: stuart
"""
import os
import glob
wheels = glob.glob("./wheelhouse/*whl")
outf = open("./wheelhouse/index.html",'w')
header = [
'<html>\n',
'<head>\n',
'<title>SunPy Wheelhouse</title>\n',
'</head>\n',
'<body>\n'
]
outf.writelines(header)
for wheel in wheels:
outf.write("<a href=%s>%s</a></br>\n"%(os.path.basename(wheel),os.path.basename(wheel)))
outf.write("</body>\n")
outf.write("</html>\n")
| # -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 18:29:35 2013
@author: stuart
"""
import os
from ftplib import FTP
ftp = FTP('ftp.servage.net')
ftp.login(user=os.environ['FTP_USER'], passwd=os.environ['FTP_PASS'])
files = ftp.nlst()
wheels = []
for file in files:
if os.path.splitext(file)[1] == '.whl':
wheels.append(file)
print wheels
outf = open("index.html",'w')
header = [
'<html>\n',
'<head>\n',
'<title>SunPy Wheelhouse</title>\n',
'</head>\n',
'<body>\n'
]
outf.writelines(header)
for wheel in wheels:
outf.write("<a href=%s>%s</a></br>\n"%(os.path.basename(wheel),os.path.basename(wheel)))
outf.write("</body>\n")
outf.write("</html>\n") | Make index now lists all wheels on FTP server | Make index now lists all wheels on FTP server
| Python | bsd-2-clause | kejbaly2/travis_wheels,Cadair/travis_wheels,kejbaly2/travis_wheels,Cadair/travis_wheels |
31691ca909fe0b1816d89bb4ccf69974eca882a6 | allauth/app_settings.py | allauth/app_settings.py | import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
def check_context_processors():
allauth_ctx = 'allauth.socialaccount.context_processors.socialaccount'
ctx_present = False
if django.VERSION < (1, 8,):
if allauth_ctx in settings.TEMPLATE_CONTEXT_PROCESSORS:
ctx_present = True
else:
for engine in settings.TEMPLATES:
if allauth_ctx in engine.get('OPTIONS', {})\
.get('context_processors', []):
ctx_present = True
break
if not ctx_present:
excmsg = ("socialaccount context processor "
"not found in settings.TEMPLATE_CONTEXT_PROCESSORS."
"See settings.py instructions here: "
"https://github.com/pennersr/django-allauth#installation")
raise ImproperlyConfigured(excmsg)
if SOCIALACCOUNT_ENABLED:
check_context_processors()
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
| import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django import template
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
def check_context_processors():
allauth_ctx = 'allauth.socialaccount.context_processors.socialaccount'
ctx_present = False
if django.VERSION < (1, 8,):
if allauth_ctx in settings.TEMPLATE_CONTEXT_PROCESSORS:
ctx_present = True
else:
for engine in template.engines.templates.values():
if allauth_ctx in engine.get('OPTIONS', {})\
.get('context_processors', []):
ctx_present = True
break
if not ctx_present:
excmsg = ("socialaccount context processor "
"not found in settings.TEMPLATE_CONTEXT_PROCESSORS."
"See settings.py instructions here: "
"https://github.com/pennersr/django-allauth#installation")
raise ImproperlyConfigured(excmsg)
if SOCIALACCOUNT_ENABLED:
check_context_processors()
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
| Fix for checking the context processors on Django 1.8 | Fix for checking the context processors on Django 1.8
If the user has not migrated their settings file to use the new TEMPLATES
method in Django 1.8, settings.TEMPLATES is an empty list.
Instead, if we check django.templates.engines it will be populated with the
automatically migrated data from settings.TEMPLATE*.
| Python | mit | cudadog/django-allauth,bitcity/django-allauth,petersanchez/django-allauth,bittner/django-allauth,manran/django-allauth,jscott1989/django-allauth,petersanchez/django-allauth,JshWright/django-allauth,italomaia/django-allauth,yarbelk/django-allauth,pankeshang/django-allauth,sih4sing5hong5/django-allauth,ZachLiuGIS/django-allauth,fabiocerqueira/django-allauth,aexeagmbh/django-allauth,dincamihai/django-allauth,italomaia/django-allauth,jscott1989/django-allauth,wli/django-allauth,80vs90/django-allauth,agriffis/django-allauth,igorgai/django-allauth,rsalmaso/django-allauth,spool/django-allauth,7WebPages/django-allauth,pennersr/django-allauth,ankitjain87/django-allauth,neo/django-allauth,yarbelk/django-allauth,pankeshang/django-allauth,agriffis/django-allauth,beswarm/django-allauth,manran/django-allauth,lmorchard/django-allauth,concentricsky/django-allauth,bopo/django-allauth,bitcity/django-allauth,hanasoo/django-allauth,aexeagmbh/django-allauth,github-account-because-they-want-it/django-allauth,erueloi/django-allauth,vuchau/django-allauth,bjorand/django-allauth,janusnic/django-allauth,janusnic/django-allauth,payamsm/django-allauth,SakuradaJun/django-allauth,rulz/django-allauth,davidrenne/django-allauth,beswarm/django-allauth,erueloi/django-allauth,alacritythief/django-allauth,wli/django-allauth,zhangziang/django-allauth,concentricsky/django-allauth,willharris/django-allauth,github-account-because-they-want-it/django-allauth,pankeshang/django-allauth,tigeraniya/django-allauth,github-account-because-they-want-it/django-allauth,kingofsystem/django-allauth,joshowen/django-allauth,bjorand/django-allauth,bitcity/django-allauth,kingofsystem/django-allauth,pztrick/django-allauth,ashwoods/django-allauth,alacritythief/django-allauth,fuzzpedal/django-allauth,hanasoo/django-allauth,tigeraniya/django-allauth,pennersr/django-allauth,beswarm/django-allauth,7WebPages/django-allauth,tigeraniya/django-allauth,avsd/django-allauth,janusnic/django-allauth,jscott1989/django-allauth,carltongibson/django-allauth,dincamihai/django-allauth,ashwoods/django-allauth,rulz/django-allauth,wayward710/django-allauth,owais/django-allauth,patricio-astudillo/django-allauth,80vs90/django-allauth,moreati/django-allauth,dincamihai/django-allauth,lmorchard/django-allauth,fabiocerqueira/django-allauth,italomaia/django-allauth,JshWright/django-allauth,lukeburden/django-allauth,payamsm/django-allauth,socialsweethearts/django-allauth,pranjalpatil/django-allauth,patricio-astudillo/django-allauth,zhangziang/django-allauth,nimbis/django-allauth,nimbis/django-allauth,davidrenne/django-allauth,rsalmaso/django-allauth,80vs90/django-allauth,AltSchool/django-allauth,joshowen/django-allauth,lukeburden/django-allauth,bopo/django-allauth,joshowen/django-allauth,AltSchool/django-allauth,aexeagmbh/django-allauth,carltongibson/django-allauth,sih4sing5hong5/django-allauth,hanasoo/django-allauth,igorgai/django-allauth,jwhitlock/django-allauth,payamsm/django-allauth,zhangziang/django-allauth,fuzzpedal/django-allauth,alacritythief/django-allauth,ZachLiuGIS/django-allauth,rsalmaso/django-allauth,cudadog/django-allauth,vuchau/django-allauth,wayward710/django-allauth,avsd/django-allauth,pranjalpatil/django-allauth,spool/django-allauth,petersanchez/django-allauth,wayward710/django-allauth,JshWright/django-allauth,sih4sing5hong5/django-allauth,owais/django-allauth,kingofsystem/django-allauth,7WebPages/django-allauth,concentricsky/django-allauth,ankitjain87/django-allauth,neo/django-allauth,lukeburden/django-allauth,SakuradaJun/django-allauth,willharris/django-allauth,yarbelk/django-allauth,agriffis/django-allauth,bopo/django-allauth,AltSchool/django-allauth,moreati/django-allauth,vuchau/django-allauth,pennersr/django-allauth,pztrick/django-allauth,erueloi/django-allauth,fabiocerqueira/django-allauth,davidrenne/django-allauth,pranjalpatil/django-allauth,pztrick/django-allauth,fuzzpedal/django-allauth,socialsweethearts/django-allauth,bittner/django-allauth,ZachLiuGIS/django-allauth,spool/django-allauth,lmorchard/django-allauth,carltongibson/django-allauth,ankitjain87/django-allauth,moreati/django-allauth,neo/django-allauth,cudadog/django-allauth,socialsweethearts/django-allauth,owais/django-allauth,ashwoods/django-allauth,rulz/django-allauth,jwhitlock/django-allauth,manran/django-allauth,SakuradaJun/django-allauth,nimbis/django-allauth,jwhitlock/django-allauth,patricio-astudillo/django-allauth,wli/django-allauth,avsd/django-allauth,bittner/django-allauth,willharris/django-allauth,igorgai/django-allauth,bjorand/django-allauth |
f941989ef9663ebbb3ba33709dd3c723c86bd2cc | action_log/views.py | action_log/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from .models import ActionRecord
@csrf_exempt
def get_action_records(request):
action = request.GET.get('action', None)
limit = int(request.GET.get('limit', 0))
max_limit = settings.ACTION_LOG_QUERY_LIMIT
if request.user.is_superuser:
max_limit = settings.ACTION_LOG_ADMIN_QUERY_LIMIT
if (limit == 0) and (max_limit == 0):
limit = 0
elif limit == 0:
limit = max_limit
elif limit > max_limit:
limit = max_limit
# filter out records
records = ActionRecord.objects.all()
if action is not None:
records = records.filter(action_type__name=action)
if limit != 0:
records = records.all()[:limit]
return HttpResponse(
json.dumps([
record.dump(settings.ACTION_LOG_ALOWED_FIELDS)
for record in records
]), content_type='application/json'
)
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from .models import ActionRecord
@csrf_exempt
def get_action_records(request):
action = request.GET.get('action', None)
limit = int(request.GET.get('limit', 0))
max_limit = settings.ACTION_LOG_QUERY_LIMIT
if request.user.is_superuser:
max_limit = settings.ACTION_LOG_ADMIN_QUERY_LIMIT
if (limit == 0) and (max_limit == 0):
limit = 0
elif limit == 0:
limit = max_limit
elif limit > max_limit:
limit = max_limit
# filter out records
records = ActionRecord.objects.all().order_by('-id')
if action is not None:
records = records.filter(action_type__name=action)
if limit != 0:
records = records.all()[:limit]
return HttpResponse(
json.dumps([
record.dump(settings.ACTION_LOG_ALOWED_FIELDS)
for record in records
]), content_type='application/json'
)
| Make it DESC order by id. | Make it DESC order by id.
| Python | mit | bradojevic/django-action-log |
21f08d30bf23056ea3e4fc9804715a57a8978c02 | gitdir/host/localhost.py | gitdir/host/localhost.py | import gitdir.host
class LocalHost(gitdir.host.Host):
def __iter__(self):
for repo_dir in sorted(self.dir.iterdir()):
if repo_dir.is_dir():
yield self.repo(repo_dir.name)
def __repr__(self):
return 'gitdir.host.localhost.LocalHost()'
def __str__(self):
return 'localhost'
def clone(self, repo_spec):
repo_dir = self.repo_path(repo_spec)
if not repo_dir.exists():
raise ValueError('No such repo on localhost: {!r}'.format(repo_spec))
return super().clone(repo_spec)
def clone_stage(self, repo_spec):
repo_dir = self.repo_path(repo_spec)
if not repo_dir.exists():
raise ValueError('No such repo on localhost: {!r}'.format(repo_spec))
return super().clone_stage(repo_spec)
def repo_remote(self, repo_spec, stage=False):
return '/opt/git/localhost/{}/{}.git'.format(repo_spec, repo_spec)
| import gitdir.host
class LocalHost(gitdir.host.Host):
def __iter__(self):
for repo_dir in sorted(self.dir.iterdir()):
if repo_dir.is_dir():
yield self.repo(repo_dir.name)
def __repr__(self):
return 'gitdir.host.localhost.LocalHost()'
def __str__(self):
return 'localhost'
def clone(self, repo_spec, *, branch=None):
repo_dir = self.repo_path(repo_spec)
if not repo_dir.exists():
raise ValueError('No such repo on localhost: {!r}'.format(repo_spec))
return super().clone(repo_spec, branch=branch)
def clone_stage(self, repo_spec):
repo_dir = self.repo_path(repo_spec)
if not repo_dir.exists():
raise ValueError('No such repo on localhost: {!r}'.format(repo_spec))
return super().clone_stage(repo_spec)
def repo_remote(self, repo_spec, stage=False):
return '/opt/git/localhost/{}/{}.git'.format(repo_spec, repo_spec)
| Add support for branch arg to LocalHost.clone | Add support for branch arg to LocalHost.clone
| Python | mit | fenhl/gitdir |
90f7bcb7ab6a43e0d116d6c9e71cc94977c6479c | cutplanner/planner.py | cutplanner/planner.py | import collections
from stock import Stock
# simple structure to keep track of a specific piece
Piece = collections.namedtuple('Piece', 'id, length')
class Planner(object):
def __init__(self, sizes, needed, loss=0.25):
self.stock = []
self.stock_sizes = sorted(sizes)
self.pieces_needed = needed.reverse
self.cut_loss = loss
self.cur_stock = None
@property
def largest_stock(self):
return self.stock_sizes[-1]
def cut_piece(self, piece):
""" Record the cut for the given piece """
self.cur_stock.cut(piece, self.cut_loss)
def finalize_stock(self):
""" Takes current stock out of use, attempts to shrink """
# shrink as much as possible
for smaller in self.stock_sizes[-2::-1]:
if self.cur_stock.shrink(smaller) is None:
break
self.stock.append(self.cur_stock)
| import collections
from stock import Stock
# simple structure to keep track of a specific piece
Piece = collections.namedtuple('Piece', 'id, length')
class Planner(object):
def __init__(self, sizes, needed, loss=0.25):
self.stock = []
self.stock_sizes = sorted(sizes)
self.pieces_needed = needed.reverse
self.cut_loss = loss
self.cur_stock = None
@property
def largest_stock(self):
return self.stock_sizes[-1]
def cut_piece(self, piece):
""" Record the cut for the given piece """
self.cur_stock.cut(piece, self.cut_loss)
def finalize_stock(self):
""" Takes current stock out of use, attempts to shrink """
# shrink as much as possible
for smaller in self.stock_sizes[-2::-1]:
if self.cur_stock.shrink(smaller) is None:
break
self.stock.append(self.cur_stock)
def apply_next_fit(self, piece):
""" Cut from current stock until unable, then move to new stock """
if self.cur_stock.remaining_length < piece.length + self.cut_loss:
# finalize current stock and get fresh stock
self.finalize_stock()
cur_stock = Stock(self.largest_stock)
self.cur_stock.cut(piece, self.cut_loss)
| Add function for next_fit algorithm | Add function for next_fit algorithm
| Python | mit | alanc10n/py-cutplanner |
b5133e7a3e7d51a31deef46e786b241b63ebd7de | planetstack/model_policies/__init__.py | planetstack/model_policies/__init__.py | from .model_policy_Slice import *
from .model_policy_User import *
from .model_policy_Network import *
from .model_policy_Site import *
from .model_policy_SitePrivilege import *
from .model_policy_SlicePrivilege import *
from .model_policy_ControllerSlice import *
from .model_policy_Controller import *
from .model_policy_Image import *
| from .model_policy_Slice import *
from .model_policy_User import *
from .model_policy_Network import *
from .model_policy_Site import *
from .model_policy_SitePrivilege import *
from .model_policy_SlicePrivilege import *
from .model_policy_ControllerSlice import *
from .model_policy_ControllerSite import *
from .model_policy_ControllerUser import *
from .model_policy_Controller import *
from .model_policy_Image import *
| Enable user and site model policies | Enable user and site model policies
| Python | apache-2.0 | wathsalav/xos,wathsalav/xos,wathsalav/xos,wathsalav/xos |
df5a0c3c0d5058fe9e3c4c00ecfb86da3136144c | frameworks/Java/grizzly-bm/setup.py | frameworks/Java/grizzly-bm/setup.py | import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
try:
subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="grizzly-bm", stderr=errfile, stdout=logfile)
subprocess.Popen("java -Dorg.glassfish.grizzly.nio.transport.TCPNIOTransport.max-receive-buffer-size=16384 -Dorg.glassfish.grizzly.http.io.OutputBuffer.default-buffer-size=1024 -Dorg.glassfish.grizzly.memory.BuffersBuffer.bb-cache-size=32 -jar grizzly-bm-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="grizzly-bm/target", stderr=errfile, stdout=logfile)
return 0
except subprocess.CalledProcessError:
return 1
def stop(logfile, errfile):
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if 'grizzly-bm' in line:
pid = int(line.split(None, 2)[1])
os.kill(pid, 15)
return 0 | import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
try:
subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="grizzly-bm", stderr=errfile, stdout=logfile)
subprocess.Popen("java -Dorg.glassfish.grizzly.nio.transport.TCPNIOTransport.max-receive-buffer-size=16384 -Dorg.glassfish.grizzly.http.io.OutputBuffer.default-buffer-size=1024 -Dorg.glassfish.grizzly.memory.BuffersBuffer.bb-cache-size=32 -jar grizzly-bm-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="grizzly-bm/target", stderr=errfile, stdout=logfile)
return 0
except subprocess.CalledProcessError:
return 1
def stop(logfile, errfile):
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if 'grizzly-bm' in line and 'run-tests' not in line and 'run-ci' not in line:
pid = int(line.split(None, 2)[1])
os.kill(pid, 15)
return 0 | Stop killing run-tests and run-ci | Stop killing run-tests and run-ci
| Python | bsd-3-clause | greg-hellings/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,sxend/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,grob/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,methane/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,sgml/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,doom369/FrameworkBenchmarks,valyala/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,jamming/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,valyala/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,zapov/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,jamming/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zapov/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,zloster/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,zloster/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,methane/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,testn/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,testn/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,sxend/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,Verber/FrameworkBenchmarks,actframework/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,sxend/FrameworkBenchmarks,herloct/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,denkab/FrameworkBenchmarks,grob/FrameworkBenchmarks,sgml/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,khellang/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,herloct/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,doom369/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zapov/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zloster/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,grob/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,actframework/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,methane/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,herloct/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zapov/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,zapov/FrameworkBenchmarks,herloct/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,methane/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,actframework/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,doom369/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,jamming/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,herloct/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,zloster/FrameworkBenchmarks,methane/FrameworkBenchmarks,zloster/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,valyala/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,herloct/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,herloct/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,herloct/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,testn/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,zloster/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,doom369/FrameworkBenchmarks,valyala/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,Verber/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zloster/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,zloster/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,actframework/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,khellang/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,testn/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,khellang/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,denkab/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,valyala/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,sxend/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zapov/FrameworkBenchmarks,methane/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,valyala/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,grob/FrameworkBenchmarks,sgml/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,khellang/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,Verber/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,khellang/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,methane/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,valyala/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,sgml/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Verber/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,sgml/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,khellang/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,sxend/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,methane/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,sxend/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,denkab/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,doom369/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,khellang/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,actframework/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,grob/FrameworkBenchmarks,jamming/FrameworkBenchmarks,joshk/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,doom369/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,khellang/FrameworkBenchmarks,Verber/FrameworkBenchmarks,Verber/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,denkab/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,actframework/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,khellang/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,actframework/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,testn/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,denkab/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,doom369/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,denkab/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sxend/FrameworkBenchmarks,sgml/FrameworkBenchmarks,khellang/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,zloster/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,joshk/FrameworkBenchmarks,joshk/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Verber/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,testn/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,zapov/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,herloct/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,jamming/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,testn/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,denkab/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,herloct/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jamming/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,zapov/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,actframework/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,sxend/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,valyala/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,denkab/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,joshk/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,methane/FrameworkBenchmarks,actframework/FrameworkBenchmarks,jamming/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,denkab/FrameworkBenchmarks,joshk/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,methane/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,grob/FrameworkBenchmarks,jamming/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zapov/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,grob/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,sgml/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,grob/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,sgml/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,sgml/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,valyala/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,testn/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,jamming/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,khellang/FrameworkBenchmarks,herloct/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,sxend/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,jamming/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,sgml/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,zapov/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,joshk/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,doom369/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,doom369/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,joshk/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,methane/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,doom369/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,khellang/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,testn/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,sgml/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,grob/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,joshk/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,joshk/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,sxend/FrameworkBenchmarks,doom369/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,testn/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,zloster/FrameworkBenchmarks,grob/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,valyala/FrameworkBenchmarks,grob/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,joshk/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,herloct/FrameworkBenchmarks,actframework/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,denkab/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,denkab/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,Verber/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,grob/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sxend/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,khellang/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sgml/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,doom369/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,testn/FrameworkBenchmarks,herloct/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,zapov/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,grob/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,zloster/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,sxend/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,testn/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,sgml/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,testn/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,doom369/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zapov/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,actframework/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,denkab/FrameworkBenchmarks,joshk/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,methane/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,jamming/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,khellang/FrameworkBenchmarks,herloct/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,actframework/FrameworkBenchmarks,Verber/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,zapov/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,methane/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,testn/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,zloster/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,sxend/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,actframework/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,sgml/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,valyala/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,actframework/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,valyala/FrameworkBenchmarks,valyala/FrameworkBenchmarks,grob/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,joshk/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,sxend/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,valyala/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,Verber/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,doom369/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,denkab/FrameworkBenchmarks,methane/FrameworkBenchmarks,denkab/FrameworkBenchmarks,herloct/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,Verber/FrameworkBenchmarks,joshk/FrameworkBenchmarks,martin-g/FrameworkBenchmarks |
838895500f8046b06718c184a4e8b12b42add516 | wp2hugo.py | wp2hugo.py | #!/usr/bin/env python3
import sys
from pprint import pprint
from lxml import etree
import html2text
from wp_parser import WordpressXMLParser
from hugo_printer import HugoPrinter
def main():
wp_xml_parser = WordpressXMLParser(sys.argv[1])
meta = wp_xml_parser.get_meta()
cats = wp_xml_parser.get_categories()
tags = wp_xml_parser.get_tags()
posts = wp_xml_parser.get_public_posts()
drafts = wp_xml_parser.get_drafts()
pprint(posts[-1])
if __name__ == '__main__':
main()
| #!/usr/bin/env python3
import sys
from pprint import pprint
from lxml import etree
import html2text
from wp_parser import WordpressXMLParser
from hugo_printer import HugoPrinter
def main():
wp_xml_parser = WordpressXMLParser(sys.argv[1])
wp_site_info = {
"meta": wp_xml_parser.get_meta(),
"cats": wp_xml_parser.get_categories(),
"tags": wp_xml_parser.get_tags(),
"posts": wp_xml_parser.get_public_posts(),
"drafts": wp_xml_parser.get_drafts(),
}
hugo_printer = HugoPrinter(**wp_site_info)
hugo_printer.gen_config()
if __name__ == '__main__':
main()
| Call HugoPrinter to save config file | Call HugoPrinter to save config file
| Python | mit | hzmangel/wp2hugo |
71fef8b9696d79f7d6fd024320bc23ce1b7425f3 | greatbigcrane/preferences/models.py | greatbigcrane/preferences/models.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from django.db import models
class Preference(models.Model):
name = models.CharField(max_length=32, unique=True)
value = models.CharField(max_length=512)
| """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from django.db import models
class PreferenceManager(models.Manager):
def get_preference(self, name, default=None):
try:
value = Preference.objects.get(name="projects_directory").value
except Preference.DoesNotExist:
return default
class Preference(models.Model):
name = models.CharField(max_length=32, unique=True)
value = models.CharField(max_length=512)
objects = PreferenceManager()
| Add a manager to make getting preferences prettier. | Add a manager to make getting preferences prettier.
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane |
018acc1817cedf8985ffc81e4fe7e98d85a644da | instructions/base.py | instructions/base.py | class InstructionBase(object):
BEFORE=None
AFTER=None
def __init__(self, search_string):
self.search_string = search_string
@property
def search_string(self):
return self._search_string
@search_string.setter
def search_string(self, value):
if value.startswith(self.INSTRUCTION):
self._search_string = value[(len(self.INSTRUCTION) + 1):]
else:
self._search_string = value
def __str__(self):
return self.INSTRUCTION + " " + self.search_string
def run(self, inputcontainer):
return (None, False)
def _search(self, inputcontainer):
text = inputcontainer.get_at_pointer()
if text == inputcontainer.EOF:
return inputcontainer.EOF
offset = text.find(self.search_string)
if offset == -1:
return inputcontainer.EOF
else:
return offset
def _copy(self, inputcontainer):
text = inputcontainer.get_at_pointer()
offset = self._search(inputcontainer)
if offset == inputcontainer.EOF:
inputcontainer.move_to_eof()
else:
inputcontainer.move_pointer(offset)
text = text[:offset]
return text
def _if(self, inputcontainer):
text = inputcontainer.get_at_pointer()
if text.startswith(self.search_string):
return True
else:
return False
| class InstructionBase(object):
BEFORE=None
AFTER=None
def __init__(self, search_string):
self.search_string = search_string
@property
def search_string(self):
return self._search_string
@search_string.setter
def search_string(self, value):
if value.startswith(self.INSTRUCTION):
temp = value[(len(self.INSTRUCTION) + 1):]
else:
temp = value
self._search_string = temp.replace("\\n", "\n")
def __str__(self):
return self.INSTRUCTION + " " + self.search_string
def run(self, inputcontainer):
return (None, False)
def _search(self, inputcontainer):
text = inputcontainer.get_at_pointer()
if text == inputcontainer.EOF:
return inputcontainer.EOF
offset = text.find(self.search_string)
if offset == -1:
return inputcontainer.EOF
else:
return offset
def _copy(self, inputcontainer):
text = inputcontainer.get_at_pointer()
offset = self._search(inputcontainer)
if offset == inputcontainer.EOF:
inputcontainer.move_to_eof()
else:
inputcontainer.move_pointer(offset)
text = text[:offset]
return text
def _if(self, inputcontainer):
text = inputcontainer.get_at_pointer()
if text.startswith(self.search_string):
return True
else:
return False
| Add hack to allow specifying newlines in scripts | Add hack to allow specifying newlines in scripts
| Python | unlicense | djmattyg007/IdiotScript |
ed0f115e600a564117ed540e7692e0efccf5826b | server/nso.py | server/nso.py | from flask import request, Response
from .base import *
from server import app
import requests
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
@app.route('/nso')
def get_nso_events():
r = requests.get("http://www.nso.upenn.edu/event-calendar.rss")
split = r.text.split("\n")
filtered = [i if "<pubDate" not in i else "<pubDate>Wed, 02 Aug 2016 08:00:00 EST</pubDate>" for i in split]
output = "\n".join(filtered)
return Response(output, mimetype="text/xml")
| from flask import request, Response
from .base import *
from server import app
import requests
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
@app.route('/nso')
def get_nso_events():
r = requests.get("http://www.nso.upenn.edu/event-calendar.rss")
split = r.text.split("\n")
filtered = [i if "<pubDate" not in i else "<pubDate>Wed, 02 Aug 2016 08:00:00 EST</pubDate>" for i in split]
filtered = [i if ("<title" not in i or "NSO Event Calendar" in i) else changeTitle(i) for i in filtered]
output = "\n".join(filtered)
return Response(output, mimetype="text/xml")
def changeTitle(a):
index = a.index("event") + 17
a = subFour(a,index)
if a[index+6] == '-':
a = subFour(a,index + 18)
return a
def subFour(string, index):
val = string[index:index+6]
new_val = str(int(val) - 40000)
if len(new_val) < 6:
new_val = "0" + new_val
return string.replace(val, new_val)
| Set time back four hours to EST | Set time back four hours to EST
| Python | mit | pennlabs/penn-mobile-server,pennlabs/penn-mobile-server |
01b03d46d32dd7f9e027220df0681c4f82fe7217 | cumulusci/conftest.py | cumulusci/conftest.py | from pytest import fixture
from cumulusci.core.github import get_github_api
@fixture
def gh_api():
return get_github_api("TestOwner", "TestRepo")
| import os
from pytest import fixture
from cumulusci.core.github import get_github_api
@fixture
def gh_api():
return get_github_api("TestOwner", "TestRepo")
@fixture(scope="class", autouse=True)
def restore_cwd():
d = os.getcwd()
try:
yield
finally:
os.chdir(d)
| Add pytest fixture to avoid leakage of cwd changes | Add pytest fixture to avoid leakage of cwd changes
| Python | bsd-3-clause | SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI |
1d55fe7b1f4f3d70da6867ef7465ac44f8d2da38 | keyring/tests/backends/test_OS_X.py | keyring/tests/backends/test_OS_X.py | import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
@unittest.expectedFailure
def test_delete_present(self):
"""Not implemented"""
super(OSXKeychainTestCase, self).test_delete_present()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
| import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
| Test passes on OS X | Test passes on OS X
| Python | mit | jaraco/keyring |
7c62526c5cdfdf80439a9bd034e2bf49b2a421b8 | markovify/__version__.py | markovify/__version__.py | VERSION_TUPLE = (0, 9, 2)
__version__ = ".".join(map(str, VERSION_TUPLE))
| VERSION_TUPLE = (0, 9, 3)
__version__ = ".".join(map(str, VERSION_TUPLE))
| Bump to v0.9.3 (MANIFEST.in fix) | Bump to v0.9.3 (MANIFEST.in fix)
| Python | mit | jsvine/markovify |
e55c5b80d67edcde6c6f31665f39ebfb70660bc1 | scripts/update_lookup_stats.py | scripts/update_lookup_stats.py | #!/usr/bin/env python
# Copyright (C) 2012 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import re
from contextlib import closing
from acoustid.script import run_script
from acoustid.data.stats import update_lookup_stats
def main(script, opts, args):
db = script.engine.connect()
redis = script.redis
for key, count in redis.hgetall('lookups').iteritems():
count = int(count)
date, hour, application_id, type = key.split(':')
if not count:
# the only way this could be 0 is if we already processed it and
# nothing touched it since then, so it's safe to delete
redis.hdel('lookups', key)
else:
update_lookup_stats(db, application_id, date, hour, type, count)
redis.hincrby('lookups', key, -count)
run_script(main)
| #!/usr/bin/env python
# Copyright (C) 2012 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import re
import urllib
import urllib2
from contextlib import closing
from acoustid.script import run_script
from acoustid.data.stats import update_lookup_stats
def call_internal_api(func, **kwargs):
url = script.config.cluster.base_master_url.rstrip('/') + '/v2/internal/' + func
data = dict(kwargs)
data['secret'] = script.config.cluster.secret
urllib2.urlopen(url, urllib.urlencode(data))
def main(script, opts, args):
db = script.engine.connect()
redis = script.redis
for key, count in redis.hgetall('lookups').iteritems():
count = int(count)
date, hour, application_id, type = key.split(':')
if not count:
# the only way this could be 0 is if we already processed it and
# nothing touched it since then, so it's safe to delete
redis.hdel('lookups', key)
else:
if script.config.cluster.role == 'master':
update_lookup_stats(db, application_id, date, hour, type, count)
else:
call_internal_api('update_lookup_stats', date=date, hour=hour,
application_id=application_id, type=type, count=count)
redis.hincrby('lookups', key, -count)
run_script(main)
| Handle lookup stats update on a slave server | Handle lookup stats update on a slave server
| Python | mit | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server |
affcc28c652b5d31b52f7f520ca72a060bc2661d | {{cookiecutter.package_name}}/setup.py | {{cookiecutter.package_name}}/setup.py | import setuptools
setuptools.setup(
name="{{ cookiecutter.package_name }}",
version="{{ cookiecutter.package_version }}",
url="{{ cookiecutter.package_url }}",
author="{{ cookiecutter.author_name }}",
author_email="{{ cookiecutter.author_email }}",
description="{{ cookiecutter.package_description }}",
long_description=open('README.rst').read(),
packages=setuptools.find_packages(),
install_requires=[],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
)
| import setuptools
setuptools.setup(
name="{{ cookiecutter.package_name }}",
version="{{ cookiecutter.package_version }}",
url="{{ cookiecutter.package_url }}",
author="{{ cookiecutter.author_name }}",
author_email="{{ cookiecutter.author_email }}",
description="{{ cookiecutter.package_description }}",
long_description=open('README.rst').read(),
packages=setuptools.find_packages(),
install_requires=[],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)
| Add python 3.5 to trove classifiers | Add python 3.5 to trove classifiers | Python | mit | kragniz/cookiecutter-pypackage-minimal |
5eb765ee3ad9bdad53b76e07c2114121a56036f7 | version.py | version.py | major = 0
minor=0
patch=18
branch="master"
timestamp=1376526164.38 | major = 0
minor=0
patch=19
branch="master"
timestamp=1376526199.16 | Tag commit for v0.0.19-master generated by gitmake.py | Tag commit for v0.0.19-master generated by gitmake.py
| Python | mit | ryansturmer/gitmake |
4623c8f0de7ff41f78754df6811570a4d4367728 | Cauldron/ext/commandkeywords/__init__.py | Cauldron/ext/commandkeywords/__init__.py | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boolean writes as 1, and will always be set to 0.
Actions can then be performed in callbacks, etc., every time this keyword is triggered.
"""
KTL_REGISTERED = False
KTL_TYPE = 'boolean'
def __init__(self, *args, **kwargs):
kwargs['initial'] = '0'
super(CommandKeyword, self).__init__(*args, **kwargs)
def prewrite(self, value):
"""Before writing, trigger no-write-necssary if value is False"""
if self.translate(value) == '0':
raise NoWriteNecessary("No write needed, command not triggered.")
return super(CommandKeyword, self).prewrite(value)
def postwrite(self, value):
"""Special postwrite that always sets the value to '0'."""
self.set('0', force=True)
# We don't have to do anything else here.
| # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
from Cauldron.utils.callbacks import Callbacks
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boolean writes as 1, and will always be set to 0.
Actions can then be performed in callbacks, etc., every time this keyword is triggered.
"""
KTL_REGISTERED = False
KTL_TYPE = 'boolean'
def __init__(self, *args, **kwargs):
kwargs['initial'] = '0'
super(CommandKeyword, self).__init__(*args, **kwargs)
self._cbs = Callbacks()
def command(self, func):
"""Add command items."""
self._cbs.add(func)
def prewrite(self, value):
"""Before writing, trigger no-write-necssary if value is False"""
if self.translate(value) == '0':
raise NoWriteNecessary("No write needed, command not triggered.")
return super(CommandKeyword, self).prewrite(value)
def write(self, value):
"""Write to the commands."""
if str(value) == '1':
self._cbs(self)
def postwrite(self, value):
"""Special postwrite that always sets the value to '0'."""
self.set('0', force=True)
# We don't have to do anything else here.
| Make command-keyword compatible with DFW implementation | Make command-keyword compatible with DFW implementation
| Python | bsd-3-clause | alexrudy/Cauldron |
30793e322363a6bcf0712a1645e149bafaf76865 | DebianDevelChangesBot/messages/popcon.py | DebianDevelChangesBot/messages/popcon.py | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from DebianDevelChangesBot import Message
class Popcon(Message):
FIELDS = ('package', 'inst', 'vote', 'old', 'recent', 'nofiles')
def format(self):
msg = "Popcon for [package]%d[reset] - " % self.package
for field in ('inst', 'vote', 'old', 'recent', 'nofiles'):
msg += "[category]%s[/category]: %s " % (field, getattr(self, field))
msg += u"- [url]http://qa.debian.org/developer.php?popcon=%s[/url]" % self.package
return msg
| # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from DebianDevelChangesBot import Message
class Popcon(Message):
FIELDS = ('package', 'inst', 'vote', 'old', 'recent', 'nofiles')
def format(self):
msg = "Popcon for [package]%s[reset] - " % self.package
for field in ('inst', 'vote', 'old', 'recent', 'nofiles'):
msg += "[category]%s[/category]: %d " % (field, getattr(self, field))
msg += u"- [url]http://qa.debian.org/developer.php?popcon=%s[/url]" % self.package
return msg
| Correct typing issues in string interp. | Correct typing issues in string interp.
Signed-off-by: Chris Lamb <[email protected]>
| Python | agpl-3.0 | lamby/debian-devel-changes-bot,xtaran/debian-devel-changes-bot,xtaran/debian-devel-changes-bot,lamby/debian-devel-changes-bot,sebastinas/debian-devel-changes-bot,lamby/debian-devel-changes-bot |
f91a39b7d85021459c865a6b7a74aae21085f19d | test/conftest.py | test/conftest.py | # Copyright 2015 SAP SE.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: //www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from sqlalchemy import event, Column, Sequence
from sqlalchemy.dialects import registry
registry.register("hana", "sqlalchemy_hana.dialect", "HANAHDBCLIDialect")
registry.register("hana.hdbcli", "sqlalchemy_hana.dialect", "HANAHDBCLIDialect")
registry.register("hana.pyhdb", "sqlalchemy_hana.dialect", "HANAPyHDBDialect")
@event.listens_for(Column, "after_parent_attach")
def add_test_seq(column, table):
if column.info.get('test_needs_autoincrement', False):
column._init_items(
Sequence(table.name + '_' + column.name + '_seq')
)
from sqlalchemy.testing.plugin.pytestplugin import *
| # Copyright 2015 SAP SE.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: //www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import logging
from sqlalchemy import event, Column, Sequence
from sqlalchemy.dialects import registry
logging.getLogger('sqlalchemy.engine').setLevel(logging.DEBUG)
registry.register("hana", "sqlalchemy_hana.dialect", "HANAHDBCLIDialect")
registry.register("hana.hdbcli", "sqlalchemy_hana.dialect", "HANAHDBCLIDialect")
registry.register("hana.pyhdb", "sqlalchemy_hana.dialect", "HANAPyHDBDialect")
@event.listens_for(Column, "after_parent_attach")
def add_test_seq(column, table):
if column.info.get('test_needs_autoincrement', False):
column._init_items(
Sequence(table.name + '_' + column.name + '_seq')
)
from sqlalchemy.testing.plugin.pytestplugin import *
| Increase loglevel during test execution | Increase loglevel during test execution
| Python | apache-2.0 | SAP/sqlalchemy-hana |
a797f4862ccfdb84ff87f0f64a6abdc405823215 | tests/app/na_celery/test_email_tasks.py | tests/app/na_celery/test_email_tasks.py | from app.na_celery.email_tasks import send_emails
class WhenProcessingSendEmailsTask:
def it_calls_send_email_to_task(self, mocker, db, db_session, sample_admin_user, sample_email):
mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email')
send_emails(sample_email.id)
assert mock_send_email.call_args[0][0] == '[email protected]'
assert mock_send_email.call_args[0][1] == 'workshop: test title'
def it_sends_an_email_to_members_up_to_email_limit(self):
pass
def it_does_not_send_an_email_if_not_between_start_and_expiry(self):
pass
def it_sends_email_with_correct_template(self):
pass
| from app.na_celery.email_tasks import send_emails
class WhenProcessingSendEmailsTask:
def it_calls_send_email_to_task(self, mocker, db, db_session, sample_email, sample_member):
mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email', return_value=200)
send_emails(sample_email.id)
assert mock_send_email.call_args[0][0] == sample_member.email
assert mock_send_email.call_args[0][1] == 'workshop: test title'
def it_sends_an_email_to_members_up_to_email_limit(self):
pass
def it_does_not_send_an_email_if_not_between_start_and_expiry(self):
pass
def it_sends_email_with_correct_template(self):
pass
| Update email task test for members | Update email task test for members
| Python | mit | NewAcropolis/api,NewAcropolis/api,NewAcropolis/api |
05fc957280fecbc99c8f58897a06e23dcc4b9453 | elections/uk/forms.py | elections/uk/forms.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from candidates.mapit import BaseMapItException
from popolo.models import Area
from compat import text_type
from .mapit import get_areas_from_postcode
class PostcodeForm(forms.Form):
q = forms.CharField(
label='Enter a candidate name or postcode',
max_length=200,
widget=forms.TextInput(attrs={'placeholder': 'Enter a name'})
)
def clean_postcode(self):
postcode = self.cleaned_data['postcode']
try:
# Go to MapIt to check if this postcode is valid and
# contained in a constituency. (If it's valid then the
# result is cached, so this doesn't cause a double lookup.)
get_areas_from_postcode(postcode)
except BaseMapItException as e:
raise ValidationError(text_type(e))
return postcode
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from candidates.mapit import BaseMapItException
from popolo.models import Area
from compat import text_type
from .mapit import get_areas_from_postcode
class PostcodeForm(forms.Form):
q = forms.CharField(
label='Enter a candidate name or postcode',
max_length=200,
widget=forms.TextInput(attrs={'placeholder': 'Enter a name'})
)
def clean_q(self):
postcode = self.cleaned_data['q']
try:
# Go to MapIt to check if this postcode is valid and
# contained in a constituency. (If it's valid then the
# result is cached, so this doesn't cause a double lookup.)
get_areas_from_postcode(postcode)
except BaseMapItException as e:
raise ValidationError(text_type(e))
return postcode
| Fix the postcode form so that it's actually validating the input | Fix the postcode form so that it's actually validating the input
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative |
0c50fa3feaf61b2cafddf6a7a530e4181d21105d | stackdio/core/templatetags/stackdio.py | stackdio/core/templatetags/stackdio.py | # -*- coding: utf-8 -*-
# Copyright 2016, Digital Reasoning
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Need this so the stackdio import below doesn't get confused
from __future__ import absolute_import
from django import template
from django.conf import settings
from django.shortcuts import resolve_url
from stackdio.server import __version__
register = template.Library()
@register.simple_tag
def stackdio_version():
return '<span class="version">{0}</span>'.format(__version__)
@register.simple_tag
def main_file():
if settings.JAVASCRIPT_DEBUG:
return resolve_url('ui:js-main')
else:
return '{0}stackdio/build/main.js'.format(settings.STATIC_URL)
| # -*- coding: utf-8 -*-
# Copyright 2016, Digital Reasoning
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Need this so the stackdio import below doesn't get confused
from __future__ import absolute_import
from django import template
from django.conf import settings
from django.shortcuts import resolve_url
from django.contrib.staticfiles.templatetags.staticfiles import static
from stackdio.server import __version__
register = template.Library()
@register.simple_tag
def stackdio_version():
return '<span class="version">{0}</span>'.format(__version__)
@register.simple_tag
def main_file():
if settings.JAVASCRIPT_DEBUG:
return resolve_url('ui:js-main')
else:
return static('stackdio/build/main.js')
| Use the build in static() method instead of building a static URL manually | Use the build in static() method instead of building a static URL manually
| Python | apache-2.0 | stackdio/stackdio,stackdio/stackdio,clarkperkins/stackdio,clarkperkins/stackdio,clarkperkins/stackdio,clarkperkins/stackdio,stackdio/stackdio,stackdio/stackdio |
18541b80ea1a7e2d6a73bf58e40bac53b97b02fd | openid_provider/lib/utils/params.py | openid_provider/lib/utils/params.py |
class Params(object):
'''
The purpose of this class is for accesing params via dot notation.
'''
pass |
class Params(object):
'''
The purpose of this class is for accesing params via dot notation.
'''
pass | Change tabs with spaces. Sorry. | Change tabs with spaces. Sorry.
| Python | mit | bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oidc-provider,Sjord/django-oidc-provider,django-py/django-openid-provider,Sjord/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,torreco/django-oidc-provider,django-py/django-openid-provider,nmohoric/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oidc-provider,juanifioren/django-oidc-provider,nmohoric/django-oidc-provider,torreco/django-oidc-provider,wayward710/django-oidc-provider |
5a7b3e024eba2e279ada9aa33352046ab35b28f5 | tests/test_io.py | tests/test_io.py | """ Test the virtual IO system. """
from StringIO import StringIO
import sys
import os
from mock import call
from mock import patch
import pytest
sys.path.append(os.path.join('..', '..', 'snake'))
from snake.vm import System
@pytest.fixture()
def system():
""" Fixture to load a new VM. """
return System()
def test_io_load_file(system):
""" Test loading a file. """
test_file = StringIO("hello world")
system.load_file(test_file)
assert system.get_input() == 'hello world'
def test_io_stdout(system):
""" Test IO output. """
with patch('__builtin__.print') as mock_print:
system.stdout('hello world')
mock_print.assert_has_calls([
call('hello world')
])
| """ Test the virtual IO system. """
from io import BytesIO
import sys
import os
from mock import call
from mock import patch
import pytest
sys.path.append(os.path.join('..', '..', 'snake'))
from snake.vm import System
@pytest.fixture()
def system():
""" Fixture to load a new VM. """
return System()
def test_io_load_file(system):
""" Test loading a file. """
test_file = BytesIO("hello world")
system.load_file(test_file)
assert system.get_input() == 'hello world'
def test_io_stdout(system):
""" Test IO output. """
with patch('__builtin__.print') as mock_print:
system.stdout('hello world')
mock_print.assert_has_calls([
call('hello world')
])
| Remove StringIO in favor of BytesIO. | Remove StringIO in favor of BytesIO.
| Python | bsd-3-clause | travcunn/snake-vm |
07d2ffe3c14a6c908a7bf138f40ba8d49bf7b2c3 | examples/plot_grow.py | examples/plot_grow.py | # -*- coding: utf-8 -*-
"""
====================================
Plotting simple exponential function
====================================
A simple example of the plot of a exponential function
in order to test the autonomy of the gallery
"""
# Code source: Óscar Nájera
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 2, 100)
y = np.exp(x)
plt.plot(x, y)
plt.xlabel('$x$')
plt.ylabel('$exp(x)$')
plt.show()
| # -*- coding: utf-8 -*-
"""
=================================
Plotting the exponential function
=================================
A simple example for ploting two figures of a exponential
function in order to test the autonomy of the gallery
stacking multiple images.
"""
# Code source: Óscar Nájera
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 2, 100)
y = np.exp(x)
plt.figure()
plt.plot(x, y)
plt.xlabel('$x$')
plt.ylabel('$\exp(x)$')
plt.figure()
plt.plot(x, -np.exp(-x))
plt.xlabel('$x$')
plt.ylabel('$-\exp(-x)$')
plt.show()
| Update example for image stacking CSS instuction | Update example for image stacking CSS instuction
| Python | bsd-3-clause | lesteve/sphinx-gallery,Eric89GXL/sphinx-gallery,sphinx-gallery/sphinx-gallery,Titan-C/sphinx-gallery,lesteve/sphinx-gallery,Titan-C/sphinx-gallery,Eric89GXL/sphinx-gallery,sphinx-gallery/sphinx-gallery |
be517c8df23826d343b187a4a5cc3d1f81a06b53 | test/framework/utils.py | test/framework/utils.py | # Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
import os, re
from os.path import join as jp
from .config import flow_graph_root_dir
_http_re = re.compile(r'https?://[^/]*/')
def replace_host_port(contains_url):
return _http_re.sub('http://x.x/', contains_url)
def flow_graph_dir(flow_name):
"""
Put the generated graph in the workspace root if running from Jenkins
If running from commandline put it under config.flow_graph_root_dir/flow_name
return: dir-name
"""
return '.' if os.environ.get('JOB_NAME') else jp(flow_graph_root_dir, flow_name)
| # Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
import os, re
from os.path import join as jp
from .config import flow_graph_root_dir
_http_re = re.compile(r'https?://.*?/job/')
def replace_host_port(contains_url):
return _http_re.sub('http://x.x/job/', contains_url)
def flow_graph_dir(flow_name):
"""
Put the generated graph in the workspace root if running from Jenkins
If running from commandline put it under config.flow_graph_root_dir/flow_name
return: dir-name
"""
return '.' if os.environ.get('JOB_NAME') else jp(flow_graph_root_dir, flow_name)
| Test framework fix - url replacing handles jenkins url with 'prefix' | Test framework fix - url replacing handles jenkins url with 'prefix'
| Python | bsd-3-clause | lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow |
7418079606a6e24cb0dccfa148b47c3f736e985f | zou/app/blueprints/persons/resources.py | zou/app/blueprints/persons/resources.py | from flask import abort
from flask_restful import Resource, reqparse
from flask_jwt_extended import jwt_required
from zou.app.services import persons_service
from zou.app.utils import auth, permissions
class NewPersonResource(Resource):
@jwt_required
def post(self):
permissions.check_admin_permissions()
data = self.get_arguments()
person = persons_service.create_person(
data["email"],
auth.encrypt_password("default"),
data["first_name"],
data["last_name"],
data["phone"]
)
return person, 201
def get_arguments(self):
parser = reqparse.RequestParser()
parser.add_argument(
"email",
help="The email is required.",
required=True
)
parser.add_argument(
"first_name",
help="The first name is required.",
required=True
)
parser.add_argument(
"last_name",
help="The last name is required.",
required=True
)
parser.add_argument("phone", default="")
args = parser.parse_args()
return args
| from flask import abort
from flask_restful import Resource, reqparse
from flask_jwt_extended import jwt_required
from zou.app.services import persons_service
from zou.app.utils import auth, permissions
class NewPersonResource(Resource):
@jwt_required
def post(self):
permissions.check_admin_permissions()
data = self.get_arguments()
person = persons_service.create_person(
data["email"],
auth.encrypt_password("default"),
data["first_name"],
data["last_name"],
data["phone"],
role=data["role"]
)
return person, 201
def get_arguments(self):
parser = reqparse.RequestParser()
parser.add_argument(
"email",
help="The email is required.",
required=True
)
parser.add_argument(
"first_name",
help="The first name is required.",
required=True
)
parser.add_argument(
"last_name",
help="The last name is required.",
required=True
)
parser.add_argument("phone", default="")
parser.add_argument("role", default="user")
args = parser.parse_args()
return args
| Allow to set role while creating a person | Allow to set role while creating a person
| Python | agpl-3.0 | cgwire/zou |
a95b1b2b5331e4248fe1d80244c763df4d3aca41 | taiga/urls.py | taiga/urls.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from .routers import router
admin.autodiscover()
urlpatterns = patterns('',
url(r'^api/v1/', include(router.urls)),
url(r'^api/v1/api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^admin/', include(admin.site.urls)),
)
def mediafiles_urlpatterns():
"""
Method for serve media files with runserver.
"""
_media_url = settings.MEDIA_URL
if _media_url.startswith('/'):
_media_url = _media_url[1:]
from django.views.static import serve
return patterns('',
(r'^%s(?P<path>.*)$' % 'media', serve,
{'document_root': settings.MEDIA_ROOT})
)
urlpatterns += staticfiles_urlpatterns()
urlpatterns += mediafiles_urlpatterns()
| # -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from .routers import router
admin.autodiscover()
urlpatterns = patterns('',
url(r'^api/v1/', include(router.urls)),
url(r'^api/v1/api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^admin/', include(admin.site.urls)),
)
def mediafiles_urlpatterns():
"""
Method for serve media files with runserver.
"""
_media_url = settings.MEDIA_URL
if _media_url.startswith('/'):
_media_url = _media_url[1:]
from django.views.static import serve
return patterns('',
(r'^%s(?P<path>.*)$' % 'media', serve,
{'document_root': settings.MEDIA_ROOT})
)
urlpatterns += staticfiles_urlpatterns(prefix="/static/")
urlpatterns += mediafiles_urlpatterns()
| Set prefix to static url patterm call | Set prefix to static url patterm call
| Python | agpl-3.0 | jeffdwyatt/taiga-back,bdang2012/taiga-back-casting,WALR/taiga-back,seanchen/taiga-back,gam-phon/taiga-back,EvgeneOskin/taiga-back,CoolCloud/taiga-back,WALR/taiga-back,Rademade/taiga-back,seanchen/taiga-back,taigaio/taiga-back,astronaut1712/taiga-back,astronaut1712/taiga-back,taigaio/taiga-back,xdevelsistemas/taiga-back-community,coopsource/taiga-back,astagi/taiga-back,coopsource/taiga-back,CMLL/taiga-back,gauravjns/taiga-back,Rademade/taiga-back,EvgeneOskin/taiga-back,dycodedev/taiga-back,CMLL/taiga-back,astagi/taiga-back,dayatz/taiga-back,19kestier/taiga-back,19kestier/taiga-back,coopsource/taiga-back,obimod/taiga-back,rajiteh/taiga-back,crr0004/taiga-back,bdang2012/taiga-back-casting,gauravjns/taiga-back,gam-phon/taiga-back,forging2012/taiga-back,CoolCloud/taiga-back,astagi/taiga-back,19kestier/taiga-back,CoolCloud/taiga-back,bdang2012/taiga-back-casting,dayatz/taiga-back,Rademade/taiga-back,forging2012/taiga-back,dycodedev/taiga-back,jeffdwyatt/taiga-back,taigaio/taiga-back,dayatz/taiga-back,crr0004/taiga-back,xdevelsistemas/taiga-back-community,Tigerwhit4/taiga-back,Tigerwhit4/taiga-back,obimod/taiga-back,Zaneh-/bearded-tribble-back,jeffdwyatt/taiga-back,crr0004/taiga-back,rajiteh/taiga-back,Zaneh-/bearded-tribble-back,obimod/taiga-back,rajiteh/taiga-back,dycodedev/taiga-back,bdang2012/taiga-back-casting,frt-arch/taiga-back,dycodedev/taiga-back,joshisa/taiga-back,Zaneh-/bearded-tribble-back,astronaut1712/taiga-back,forging2012/taiga-back,CoolCloud/taiga-back,Rademade/taiga-back,Tigerwhit4/taiga-back,gauravjns/taiga-back,CMLL/taiga-back,WALR/taiga-back,joshisa/taiga-back,obimod/taiga-back,jeffdwyatt/taiga-back,forging2012/taiga-back,astagi/taiga-back,xdevelsistemas/taiga-back-community,gauravjns/taiga-back,coopsource/taiga-back,joshisa/taiga-back,crr0004/taiga-back,EvgeneOskin/taiga-back,EvgeneOskin/taiga-back,frt-arch/taiga-back,CMLL/taiga-back,seanchen/taiga-back,gam-phon/taiga-back,gam-phon/taiga-back,Tigerwhit4/taiga-back,Rademade/taiga-back,frt-arch/taiga-back,seanchen/taiga-back,WALR/taiga-back,astronaut1712/taiga-back,joshisa/taiga-back,rajiteh/taiga-back |
31af4bf93b8177e8ac03ef96bec926551b40fdcb | cogs/common/types.py | cogs/common/types.py | """
Copyright (c) 2017 Genome Research Ltd.
Authors:
* Simon Beal <[email protected]>
* Christopher Harrison <[email protected]>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from multidict import MultiDictProxy as Cookies # Type of aiohttp.web.BaseRequest.cookies
from sqlalchemy.orm import Session as DBSession # Return from sqlalchemy.orm.sessionmaker
| """
Copyright (c) 2017 Genome Research Ltd.
Authors:
* Simon Beal <[email protected]>
* Christopher Harrison <[email protected]>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from aiohttp.web import Application # aiohttp web server application
from multidict import MultiDictProxy as Cookies # Type of aiohttp.web.BaseRequest.cookies
from sqlalchemy.orm import Session as DBSession # Return from sqlalchemy.orm.sessionmaker
| Add aiohttp.web.Application into type aliases | Add aiohttp.web.Application into type aliases
| Python | agpl-3.0 | wtsi-hgi/CoGS-Webapp,wtsi-hgi/CoGS-Webapp,wtsi-hgi/CoGS-Webapp |
f9d4fae5dd16c6bc386f6ef0453d2713d916a9f5 | invocations/checks.py | invocations/checks.py | """
Shortcuts for common development check tasks
"""
from __future__ import unicode_literals
from invoke import task
@task(name='blacken', iterable=['folder'])
def blacken(c, line_length=79, folder=None):
"""Run black on the current source"""
folders = ['.'] if not folder else folder
black_command_line = "black -l {0}".format(line_length)
cmd = "find {0} -name '*.py' | xargs {1}".format(
" ".join(folders), black_command_line
)
c.run(cmd, pty=True)
| """
Shortcuts for common development check tasks
"""
from __future__ import unicode_literals
from invoke import task
@task(name='blacken', iterable=['folder'])
def blacken(c, line_length=79, folder=None):
"""Run black on the current source"""
default_folders = ["."]
configured_folders = c.config.get("blacken", {}).get("folders", default_folders)
folders = configured_folders if not folder else folder
black_command_line = "black -l {0}".format(line_length)
cmd = "find {0} -name '*.py' | xargs {1}".format(
" ".join(folders), black_command_line
)
c.run(cmd, pty=True)
| Add a 'blacken/folders' configuration flag for blacken | Add a 'blacken/folders' configuration flag for blacken
| Python | bsd-2-clause | pyinvoke/invocations |
d495d9500377bad5c7ccfd15037fb4d03fd7bff3 | videolog/user.py | videolog/user.py | from datetime import datetime
import time
import json
from videolog.core import Videolog
class User(Videolog):
def find_videos(self, user):
content = self._make_request('GET', '/usuario/%s/videos.json' % user)
usuario = json.loads(content)
response = []
for video in usuario['usuario']['videos']:
video['criacao'] = datetime.strptime(video['criacao'], "%Y-%m-%dT%H:%M:%S")
video["duracao"] = time.strptime("00:00:05", "%H:%M:%S")
if video['mobile'].lower() == "s":
video['mobile'] = True
else:
video['mobile'] = False
response.append(video)
return response | from datetime import datetime
import time
import json
from videolog.core import Videolog
class User(Videolog):
def find_videos(self, user, privacy=None):
path = '/usuario/%s/videos.json' % user
if privacy is not None:
path = "%s?privacidade=%s" % (path, privacy)
content = self._make_request('GET', path)
usuario = json.loads(content)
response = []
for video in usuario['usuario']['videos']:
video['criacao'] = datetime.strptime(video['criacao'], "%Y-%m-%dT%H:%M:%S")
video["duracao"] = time.strptime("00:00:05", "%H:%M:%S")
if video['mobile'].lower() == "s":
video['mobile'] = True
else:
video['mobile'] = False
response.append(video)
return response | Add privacy parameter to User.find_videos | Add privacy parameter to User.find_videos
| Python | mit | rcmachado/pyvideolog |
70f0e1b1112713a95f6d22db95fbb0368f079a18 | opps/containers/forms.py | opps/containers/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ContainerAdminForm, self).__init__(*args, **kwargs)
if not settings.OPPS_MIRROR_CHANNEL:
self.fields['mirror_channel'].widget = forms.HiddenInput()
self.fields['json'] = JSONFormField(
widget=JSONField(
attrs={'_model': self._meta.model.__name__}),
required=False)
for field in Field.objects.filter(application__contains=
self._meta.model.__name__):
if field.type == 'checkbox':
for fo in FieldOption.objects.filter(field=field):
self.fields[
'json_{}_{}'.format(
field.slug, fo.option.slug
)] = forms.CharField(required=False)
else:
self.fields[
'json_{}'.format(field.slug)
] = forms.CharField(required=False)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
from .models import Container
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ContainerAdminForm, self).__init__(*args, **kwargs)
if not settings.OPPS_MIRROR_CHANNEL:
self.fields['mirror_channel'].widget = forms.HiddenInput()
self.fields['json'] = JSONFormField(
widget=JSONField(
attrs={'_model': self._meta.model.__name__}),
required=False)
for field in Field.objects.filter(application__contains=
self._meta.model.__name__):
if field.type == 'checkbox':
for fo in FieldOption.objects.filter(field=field):
self.fields[
'json_{}_{}'.format(
field.slug, fo.option.slug
)] = forms.CharField(required=False)
else:
self.fields[
'json_{}'.format(field.slug)
] = forms.CharField(required=False)
class Meta:
model = Container
| Set Meta class model default on ContainerAdminForm | Set Meta class model default on ContainerAdminForm
| Python | mit | williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps |
9d1a53fea17dfc8d48324e510273259615fbee01 | pivoteer/writer/hosts.py | pivoteer/writer/hosts.py | """
Classes and functions for writing Host Records.
Host Records are IndicatorRecords with a record type of "HR."
"""
import dateutil.parser
from pivoteer.writer.core import CsvWriter
from core.lookups import geolocate_ip
class HostCsvWriter(CsvWriter):
"""
A CsvWriter implementation for IndicatorRecord objects with a record type of "HR" (Host Record)
"""
def __init__(self, writer):
"""
Create a new CsvWriter for Host Records using the given writer.
:param writer: The writer
"""
super(HostCsvWriter, self).__init__(writer)
def create_header(self):
return ["Date", "Source", "Domain", "IP", "IP Location", "First Seen", "Last Seen"]
def create_rows(self, record):
if record is not None:
yield [record["info_date"],
record["get_info_source_display"],
record["domain"],
record["ip"],
record["location"]["country"],
record["firstseen"],
record["lastseen"]]
| """
Classes and functions for writing Host Records.
Host Records are IndicatorRecords with a record type of "HR."
"""
import dateutil.parser
from pivoteer.writer.core import CsvWriter
from core.lookups import geolocate_ip
class HostCsvWriter(CsvWriter):
"""
A CsvWriter implementation for IndicatorRecord objects with a record type of "HR" (Host Record)
"""
def __init__(self, writer):
"""
Create a new CsvWriter for Host Records using the given writer.
:param writer: The writer
"""
super(HostCsvWriter, self).__init__(writer)
def create_header(self):
return ["Date", "Source", "Domain", "IP", "IP Location", "First Seen", "Last Seen"]
def create_rows(self, record):
if record is not None:
yield [record["info_date"],
record["get_info_source_display"],
record["info"]["domain"],
record["info"]["ip"],
record["location"]["country"],
record["info"]["firstseen"],
record["info"]["lastseen"]]
| Update historical export with latest data model changes | Update historical export with latest data model changes
| Python | mit | LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID |
06eabe9986edfb3c26b2faebb9e07ede72e4781d | wush/utils.py | wush/utils.py | import rq
import redis
import django
from django.conf import settings
REDIS_CLIENT = redis.Redis(settings.REDIS_HOST, settings.REDIS_PORT, db=0)
class CustomJob(rq.job.Job):
def _unpickle_data(self):
django.setup()
super(CustomJob, self)._unpickle_data()
class CustomQueue(rq.Queue):
def __init__(self, *args, **kwargs):
kwargs["connection"] = REDIS_CLIENT
kwargs["job_class"] = CustomJob
super(CustomQueue, self).__init__(*args, **kwargs)
| import rq
import redis
import django
from django.conf import settings
REDIS_CLIENT = redis.Redis(settings.REDIS_HOST, settings.REDIS_PORT, db=0)
class CustomJob(rq.job.Job):
def _unpickle_data(self):
django.setup()
super(CustomJob, self)._unpickle_data()
class CustomQueue(rq.Queue):
job_class = CustomJob
def __init__(self, *args, **kwargs):
kwargs["connection"] = REDIS_CLIENT
super(CustomQueue, self).__init__(*args, **kwargs)
| Use the existing class property job_class. | Use the existing class property job_class.
| Python | mit | theju/wush |
d9447b070e655126bc143cbe817ed727e3794352 | crm_capital/models/crm_turnover_range.py | crm_capital/models/crm_turnover_range.py | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class CrmTurnoverRange(models.Model):
_name = 'crm.turnover_range'
_order = "parent_left"
_parent_order = "name"
_parent_store = True
_description = "Turnover range"
name = fields.Char(required=True)
parent_id = fields.Many2one(comodel_name='crm.turnover_range')
children = fields.One2many(comodel_name='crm.turnover_range',
inverse_name='parent_id')
parent_left = fields.Integer('Parent Left', select=True)
parent_right = fields.Integer('Parent Right', select=True)
| # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class CrmTurnoverRange(models.Model):
_name = 'crm.turnover_range'
_order = "parent_left"
_parent_order = "name"
_parent_store = True
_description = "Turnover range"
name = fields.Char(required=True, translate=True)
parent_id = fields.Many2one(comodel_name='crm.turnover_range')
children = fields.One2many(comodel_name='crm.turnover_range',
inverse_name='parent_id')
parent_left = fields.Integer('Parent Left', select=True)
parent_right = fields.Integer('Parent Right', select=True)
| Set some fields as tranlate | Set some fields as tranlate
| Python | agpl-3.0 | Therp/partner-contact,open-synergy/partner-contact,acsone/partner-contact,diagramsoftware/partner-contact,Endika/partner-contact |
5c3900e12216164712c9e7fe7ea064e70fae8d1b | enumfields/enums.py | enumfields/enums.py | import inspect
from django.utils.encoding import force_bytes, python_2_unicode_compatible
from enum import Enum as BaseEnum, EnumMeta as BaseEnumMeta
import six
class EnumMeta(BaseEnumMeta):
def __new__(cls, name, bases, attrs):
Labels = attrs.get('Labels')
if Labels is not None and inspect.isclass(Labels):
del attrs['Labels']
obj = BaseEnumMeta.__new__(cls, name, bases, attrs)
for m in obj:
try:
m.label = getattr(Labels, m.name)
except AttributeError:
m.label = m.name.replace('_', ' ').title()
return obj
@python_2_unicode_compatible
class Enum(six.with_metaclass(EnumMeta, BaseEnum)):
@classmethod
def choices(cls):
"""
Returns a list formatted for use as field choices.
(See https://docs.djangoproject.com/en/dev/ref/models/fields/#choices)
"""
return tuple((m.value, m.label) for m in cls)
def __str__(self):
"""
Show our label when Django uses the Enum for displaying in a view
"""
return force_bytes(self.label)
| import inspect
from django.utils.encoding import force_bytes, python_2_unicode_compatible
from enum import Enum as BaseEnum, EnumMeta as BaseEnumMeta
import six
class EnumMeta(BaseEnumMeta):
def __new__(cls, name, bases, attrs):
Labels = attrs.get('Labels')
if Labels is not None and inspect.isclass(Labels):
del attrs['Labels']
if hasattr(attrs, '_member_names'):
attrs._member_names.remove('Labels')
obj = BaseEnumMeta.__new__(cls, name, bases, attrs)
for m in obj:
try:
m.label = getattr(Labels, m.name)
except AttributeError:
m.label = m.name.replace('_', ' ').title()
return obj
@python_2_unicode_compatible
class Enum(six.with_metaclass(EnumMeta, BaseEnum)):
@classmethod
def choices(cls):
"""
Returns a list formatted for use as field choices.
(See https://docs.djangoproject.com/en/dev/ref/models/fields/#choices)
"""
return tuple((m.value, m.label) for m in cls)
def __str__(self):
"""
Show our label when Django uses the Enum for displaying in a view
"""
return force_bytes(self.label)
| Fix 'Labels' class in Python 3. | Fix 'Labels' class in Python 3.
In Python 3, the attrs dict will already be an _EnumDict, which has a
separate list of member names (in Python 2, it is still a plain dict at this
point).
| Python | mit | suutari-ai/django-enumfields,jackyyf/django-enumfields,bxm156/django-enumfields,jessamynsmith/django-enumfields |
9d3c2946106a7d40281df0038cbc9d81704b3ee7 | yolk/__init__.py | yolk/__init__.py | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.4'
| Increment patch version to 0.7.4 | Increment patch version to 0.7.4
| Python | bsd-3-clause | myint/yolk,myint/yolk |
e0d811f5146ba2c97af3da4ac904db4d16b5d9bb | python/ctci_big_o.py | python/ctci_big_o.py | p = int(input().strip())
for a0 in range(p):
n = int(input().strip())
| from collections import deque
class Sieve(object):
def __init__(self, upper_bound):
self.upper_bound = upper_bound + 1
self.primes = []
self.populate_primes()
# print("Primes " + str(self.primes))
def is_prime(self, potential_prime):
return potential_prime in self.primes
def populate_primes(self,):
remaining = deque(range(2, self.upper_bound))
while remaining:
prime = remaining.popleft()
self.primes.append(prime)
for multiple in self.multiples(prime):
if multiple in remaining:
remaining.remove(multiple)
def multiples(self, num):
return range(num, self.upper_bound, num)
NUM_CASES = int(input().strip())
TEST_CASES = []
for _ in range(NUM_CASES):
TEST_CASES.append(int(input().strip()))
# print("Max: " + str(max(TEST_CASES)))
SIEVE = Sieve(max(TEST_CASES))
for test_case in TEST_CASES:
if SIEVE.is_prime(test_case):
print("Prime")
else:
print("Not prime")
| Solve all test cases but 2 | Solve all test cases but 2
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank |
ed92a324cceddce96f2cff51a103c6ca15f62d8e | asterix/test.py | asterix/test.py | # encoding: utf-8
""" Utility functions to help testing. """
from unittest.mock import Mock
class dummy(object):
def __init__(self):
self.components = {}
def get(self, name, default):
if name not in self.components:
self.components[name] = Mock()
return self.components[name]
class dummy_master(object):
def __init__(self):
setattr(self, "__components", dummy())
| # encoding: utf-8
""" Utility functions to help testing. """
from unittest.mock import Mock
class dummy(object):
def __init__(self):
self.components = {}
def get(self, name, default=None):
if name not in self.components:
self.components[name] = Mock()
return self.components[name]
class dummy_master(object):
def __init__(self):
setattr(self, "__components", dummy())
def get(self, name):
return self.__components.components.get(name)
| Add facade to mocked components | Add facade to mocked components
| Python | mit | hkupty/asterix |
adc92c01ef72cd937de7448da515caf6c2704cc3 | app/task.py | app/task.py | from mongoengine import Document, DateTimeField, EmailField, IntField, \
ReferenceField, StringField
import datetime, enum
class Priority(enum.IntEnum):
LOW = 0,
MIDDLE = 1,
HIGH = 2
"""
This defines the basic model for a Task as we want it to be stored in the
MongoDB.
"""
class Task(Document):
title = StringField(max_length=150, required=True)
description = StringField(max_length=800, required=True)
creator = EmailField(max_length=120, required=True)
assigne = EmailField(max_length=120, required=True)
created_at = DateTimeField(default=datetime.datetime.now, required=True)
closed_at = DateTimeField(required=False)
status = IntField(default=0, required=True)
priority = IntField(default=Priority.LOW, required=True)
| from mongoengine import Document, DateTimeField, EmailField, IntField, \
ReferenceField, StringField
import datetime, enum
class Priority(enum.IntEnum):
LOW = 0,
MIDDLE = 1,
HIGH = 2
"""
This defines the basic model for a Task as we want it to be stored in the
MongoDB.
"""
class Task(Document):
title = StringField(max_length=150, required=True)
description = StringField(max_length=800, required=True)
creator = EmailField(max_length=120, required=True)
assigne = EmailField(max_length=120, required=True)
created_at = DateTimeField(default=datetime.datetime.now, required=True)
status = IntField(default=0, required=True)
priority = IntField(default=Priority.LOW, required=True)
| Remove closed_at field from Task model | Remove closed_at field from Task model
| Python | mit | Zillolo/lazy-todo |
953ffccae266f123a3b50f260af259bed1d1d336 | registration/__init__.py | registration/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.core.exceptions.ImproperlyConfigured`` if the specified
backend cannot be located.
"""
i = settings.REGISTRATION_BACKEND.rfind('.')
module, attr = settings.REGISTRATION_BACKEND[:i], settings.REGISTRATION_BACKEND[i+1:]
try:
mod = import_module(module)
except ImportError, e:
raise ImproperlyConfigured('Error loading registration backend %s: "%s"' % (module, e))
try:
backend_class = getattr(mod, attr)
except AttributeError:
raise ImproperlyConfigured('Module "%s" does not define a registration backend named "%s"' % (module, attr))
return backend_class()
| Add utility function for retrieving the active registration backend. | Add utility function for retrieving the active registration backend.
| Python | bsd-3-clause | lubosz/django-registration,lubosz/django-registration |
|
435d5d21c2bd2b14998fd206035cc93fd897f6c8 | tests/testclasses.py | tests/testclasses.py | from datetime import datetime
import unittest
from normalize import (
JsonCollectionProperty,
JsonProperty,
JsonRecord,
Record,
RecordList,
)
class MockChildRecord(JsonRecord):
name = JsonProperty()
class MockDelegateJsonRecord(JsonRecord):
other = JsonProperty()
class MockJsonRecord(JsonRecord):
name = JsonProperty()
age = JsonProperty(isa=int)
seen = JsonProperty(
json_name='last_seen', isa=datetime,
coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
)
children = JsonCollectionProperty(of=MockChildRecord)
class MockUnsanitizedJsonRecord(JsonRecord):
count = JsonProperty(isa=int)
last_updated = JsonProperty(
isa=datetime,
coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
extraneous=False,
)
class MockRecordList(RecordList):
record_cls = MockUnsanitizedJsonRecord
def all_diff_types_equal(record, diff_type):
"""
Returns True if the given Record's DiffType and Record's Properties'
DiffTypes are the same as the specified DiffType.
"""
if record.diff_type != diff_type:
return False
for field_name, prop in record._fields.iteritems():
prop_diff_type = prop.get_diff_info(record).diff_type
# Property doesn't have a DiffType
if prop_diff_type is None:
continue
if prop_diff_type != diff_type:
return False
prop_value = getattr(record, field_name)
if isinstance(prop_value, Record):
if not all_diff_types_equal(prop_value, diff_type):
return False
#elif isinstance(prop_value, JsonCollectionProperty):
#if not all(all_diff_types_equal(v, diff_type)
# for v in prop_value):
#return False
return True
class StructableTestCase(unittest.TestCase):
def assertAllDiffTypesEqual(self, record, diff_type):
self.assertTrue(all_diff_types_equal(record, diff_type))
| from datetime import datetime
import unittest
from normalize import (
JsonCollectionProperty,
JsonProperty,
JsonRecord,
Record,
RecordList,
)
class MockChildRecord(JsonRecord):
name = JsonProperty()
class MockDelegateJsonRecord(JsonRecord):
other = JsonProperty()
class MockJsonRecord(JsonRecord):
name = JsonProperty()
age = JsonProperty(isa=int)
seen = JsonProperty(
json_name='last_seen', isa=datetime,
coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
)
children = JsonCollectionProperty(of=MockChildRecord)
class MockExtraneousJsonRecord(JsonRecord):
count = JsonProperty(isa=int)
last_updated = JsonProperty(
isa=datetime,
coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
extraneous=False,
)
class MockRecordList(RecordList):
itemtype = MockExtraneousJsonRecord
| Remove some traces of this module's predecessor | Remove some traces of this module's predecessor
| Python | mit | samv/normalize,tomo-otsuka/normalize,hearsaycorp/normalize |
e53c572af6f9ee2808ef682cfcfc842fe650ab4b | gribapi/__init__.py | gribapi/__init__.py | from .gribapi import * # noqa
from .gribapi import __version__
from .gribapi import bindings_version
| from .gribapi import * # noqa
from .gribapi import __version__
from .gribapi import bindings_version
# The minimum required version for the ecCodes package
min_reqd_version_str = '2.14.0'
min_reqd_version_int = 21400
if lib.grib_get_api_version() < min_reqd_version_int:
raise RuntimeError('ecCodes %s or higher is required. You are running version %s' % (
min_reqd_version_str, __version__))
| Check minimum required version of ecCodes engine | Check minimum required version of ecCodes engine
| Python | apache-2.0 | ecmwf/eccodes-python,ecmwf/eccodes-python |
da5479f4db905ea632009728864793812d56be81 | test/test_bill_history.py | test/test_bill_history.py | import unittest
import bill_info
import fixtures
import datetime
class BillHistory(unittest.TestCase):
def test_normal_enacted_bill(self):
history = fixtures.bill("hr3590-111")['history']
self.assertEqual(history['house_passage_result'], 'pass')
self.assertEqual(self.to_date(history['house_passage_result_at']), "2010-03-21 22:48")
self.assertEqual(history['senate_passage_result'], 'pass')
self.assertEqual(self.to_date(history['senate_passage_result_at']), "2009-12-24 00:00")
self.assertEqual(history['vetoed'], False)
self.assertEqual(history['awaiting_signature'], False)
self.assertEqual(history['enacted'], True)
self.assertEqual(self.to_date(history["enacted_at"]), "2010-03-23 00:00")
def to_date(self, time):
return datetime.datetime.strftime(time, "%Y-%m-%d %H:%M") | import unittest
import bill_info
import fixtures
import datetime
class BillHistory(unittest.TestCase):
def test_normal_enacted_bill(self):
history = fixtures.bill("hr3590-111")['history']
self.assertEqual(history['house_passage_result'], 'pass')
self.assertEqual(self.to_date(history['house_passage_result_at']), "2010-03-21 22:48")
self.assertEqual(history['senate_passage_result'], 'pass')
self.assertEqual(self.to_date(history['senate_passage_result_at']), "2009-12-24")
self.assertEqual(history['vetoed'], False)
self.assertEqual(history['awaiting_signature'], False)
self.assertEqual(history['enacted'], True)
self.assertEqual(self.to_date(history["enacted_at"]), "2010-03-23")
def to_date(self, time):
if isinstance(time, str):
return time
else:
return datetime.datetime.strftime(time, "%Y-%m-%d %H:%M") | Fix failing test since switching to use bare dates and not full timestamps when appropriate | Fix failing test since switching to use bare dates and not full timestamps when appropriate
| Python | cc0-1.0 | boblannon/congress,Nolawee/congress,Nolawee/congress,chriscondon/billtext,sunlightlabs/congress-opencongress,boblannon/congress,chriscondon/billtext,unitedstates/congress,sunlightlabs/congress-opencongress,unitedstates/congress |
881875537cf1fcb27c89cf5ba8bfeba625239ef5 | GitHub_test.py | GitHub_test.py | #This is a test to see how GitHub will react when I change things from this webpage instead of as usual.
print "Hello, world!"
| #This is a test to see how GitHub will react when I change things from this webpage instead of as usual.
print "Hello, world!"
print "Test"
| Test for GitHub Paste reaction. | Test for GitHub Paste reaction. | Python | mit | ieguinoa/tools-iuc,loraine-gueguen/tools-iuc,lparsons/tools-iuc,nekrut/tools-iuc,nsoranzo/tools-iuc,Delphine-L/tools-iuc,Delphine-L/tools-iuc,nekrut/tools-iuc,galaxyproject/tools-iuc,davebx/tools-iuc,loraine-gueguen/tools-iuc,natefoo/tools-iuc,gvlproject/tools-iuc,mvdbeek/tools-iuc,Delphine-L/tools-iuc,nekrut/tools-iuc,nsoranzo/tools-iuc,ieguinoa/tools-iuc,blankenberg/tools-iuc,SANBI-SA/tools-iuc,mvdbeek/tools-iuc,lparsons/tools-iuc,SANBI-SA/tools-iuc,davebx/tools-iuc,blankenberg/tools-iuc,gregvonkuster/tools-iuc,bimbam23/tools-iuc,pjbriggs/tools-iuc,abretaud/tools-iuc,pavanvidem/tools-iuc,nekrut/tools-iuc,gvlproject/tools-iuc,gregvonkuster/tools-iuc,mblue9/tools-iuc,jj-umn/tools-iuc,Delphine-L/tools-iuc,mblue9/tools-iuc,Delphine-L/tools-iuc,galaxyproject/tools-iuc,mblue9/tools-iuc,pavanvidem/tools-iuc,pjbriggs/tools-iuc,abretaud/tools-iuc,jj-umn/tools-iuc,pjbriggs/tools-iuc,nsoranzo/tools-iuc,Delphine-L/tools-iuc,ieguinoa/tools-iuc,gregvonkuster/tools-iuc,pavanvidem/tools-iuc,gregvonkuster/tools-iuc,galaxyproject/tools-iuc,natefoo/tools-iuc,blankenberg/tools-iuc,galaxyproject/tools-iuc,natefoo/tools-iuc,Delphine-L/tools-iuc,nsoranzo/tools-iuc,pavanvidem/tools-iuc,galaxyproject/tools-iuc,martenson/tools-iuc,bimbam23/tools-iuc,SANBI-SA/tools-iuc,gvlproject/tools-iuc,loraine-gueguen/tools-iuc,nsoranzo/tools-iuc,pavanvidem/tools-iuc,lparsons/tools-iuc,nsoranzo/tools-iuc,nsoranzo/tools-iuc,jj-umn/tools-iuc,abretaud/tools-iuc,davebx/tools-iuc,nekrut/tools-iuc,pavanvidem/tools-iuc,ieguinoa/tools-iuc,jj-umn/tools-iuc,mvdbeek/tools-iuc,gvlproject/tools-iuc,galaxyproject/tools-iuc,davebx/tools-iuc,mvdbeek/tools-iuc,bimbam23/tools-iuc,loraine-gueguen/tools-iuc,loraine-gueguen/tools-iuc,natefoo/tools-iuc,blankenberg/tools-iuc,bimbam23/tools-iuc,davebx/tools-iuc,bimbam23/tools-iuc,dpryan79/tools-iuc,blankenberg/tools-iuc,bimbam23/tools-iuc,abretaud/tools-iuc,davebx/tools-iuc,pjbriggs/tools-iuc,mblue9/tools-iuc,ieguinoa/tools-iuc,davebx/tools-iuc,mblue9/tools-iuc,gregvonkuster/tools-iuc,lparsons/tools-iuc,jj-umn/tools-iuc,dpryan79/tools-iuc,loraine-gueguen/tools-iuc,mblue9/tools-iuc,mvdbeek/tools-iuc,blankenberg/tools-iuc,pjbriggs/tools-iuc,natefoo/tools-iuc,dpryan79/tools-iuc,pjbriggs/tools-iuc,lparsons/tools-iuc,galaxyproject/tools-iuc,jj-umn/tools-iuc,dpryan79/tools-iuc,abretaud/tools-iuc,dpryan79/tools-iuc,gregvonkuster/tools-iuc,abretaud/tools-iuc,gregvonkuster/tools-iuc,blankenberg/tools-iuc,ieguinoa/tools-iuc,ieguinoa/tools-iuc,pavanvidem/tools-iuc,dpryan79/tools-iuc,mvdbeek/tools-iuc,gvlproject/tools-iuc,jj-umn/tools-iuc,lparsons/tools-iuc,SANBI-SA/tools-iuc,mvdbeek/tools-iuc,natefoo/tools-iuc,loraine-gueguen/tools-iuc,natefoo/tools-iuc,nekrut/tools-iuc,gvlproject/tools-iuc,nekrut/tools-iuc,abretaud/tools-iuc |
45abd54dcb14f3dbf45622c493f37e3726b53755 | models/waifu_model.py | models/waifu_model.py | from models.base_model import BaseModel
from datetime import datetime
from models.user_model import UserModel
from peewee import CharField, TextField, DateTimeField, IntegerField, ForeignKeyField
WAIFU_SHARING_STATUS_PRIVATE = 1
WAIFU_SHARING_STATUS_PUBLIC_MODERATION = 2
WAIFU_SHARING_STATUS_PUBLIC = 3
class WaifuModel(BaseModel):
class Meta:
db_table = 'waifus'
name = CharField(max_length=128, null=False)
description = TextField(null=False)
pic = CharField(max_length=128, null=False)
created_at = DateTimeField(null=False, default=datetime.now)
updated_at = DateTimeField(null=False, default=datetime.now)
rating = IntegerField(null=False, default=0)
sharing_status = IntegerField(null=False, default=WAIFU_SHARING_STATUS_PRIVATE)
owner = ForeignKeyField(UserModel, related_name='waifus_created_by_me')
def to_json(self):
json = super(WaifuModel, self).to_json()
json['users_count'] = self.users.count()
return json
| from models.base_model import BaseModel
from datetime import datetime
from models.user_model import UserModel
from peewee import CharField, TextField, DateTimeField, IntegerField, ForeignKeyField
WAIFU_SHARING_STATUS_PRIVATE = 1
WAIFU_SHARING_STATUS_PUBLIC_MODERATION = 2
WAIFU_SHARING_STATUS_PUBLIC = 3
class WaifuModel(BaseModel):
class Meta:
db_table = 'waifus'
name = CharField(max_length=128, null=False)
description = TextField(null=False)
pic = CharField(max_length=128, null=False)
created_at = DateTimeField(null=False, default=datetime.now)
updated_at = DateTimeField(null=False, default=datetime.now)
rating = IntegerField(null=False, default=0)
sharing_status = IntegerField(null=False, default=WAIFU_SHARING_STATUS_PRIVATE)
owner = ForeignKeyField(UserModel, related_name='waifus_created_by_me')
def to_json(self):
json = super(WaifuModel, self).to_json()
json['users_count'] = self.users.count()
return json
@classmethod
def get_by_id_and_user(cls, id, user):
try:
waifu = cls.get(
(cls.id == id) &
((cls.owner == user) |
(cls.sharing_status == WAIFU_SHARING_STATUS_PUBLIC))
)
except ValueError:
# id не int, что ж, у нас явно нет такого документа.
return None
return waifu
| Add method to get waifu according user and sharing status. | Add method to get waifu according user and sharing status.
| Python | cc0-1.0 | sketchturnerr/WaifuSim-backend,sketchturnerr/WaifuSim-backend |
61a4743b62914559fea18a945f7a780e1394da2f | test/test_export_flow.py | test/test_export_flow.py | import netlib.tutils
from libmproxy import flow_export
from . import tutils
req_get = netlib.tutils.treq(
method='GET',
headers=None,
content=None,
)
req_post = netlib.tutils.treq(
method='POST',
headers=None,
)
def test_request_simple():
flow = tutils.tflow(req=req_get)
assert flow_export.curl_command(flow)
flow = tutils.tflow(req=req_post)
assert flow_export.curl_command(flow)
| import netlib.tutils
from libmproxy import flow_export
from . import tutils
req_get = netlib.tutils.treq(
method='GET',
content=None,
)
req_post = netlib.tutils.treq(
method='POST',
headers=None,
)
req_patch = netlib.tutils.treq(
method='PATCH',
path=b"/path?query=param",
)
def test_curl_command():
flow = tutils.tflow(req=req_get)
result = """curl -H 'header:qvalue' 'http://address/path'"""
assert flow_export.curl_command(flow) == result
flow = tutils.tflow(req=req_post)
result = """curl -X POST 'http://address/path' --data-binary 'content'"""
assert flow_export.curl_command(flow) == result
flow = tutils.tflow(req=req_patch)
result = """curl -H 'header:qvalue' -X PATCH 'http://address/path?query=param' --data-binary 'content'"""
assert flow_export.curl_command(flow) == result
| Test exact return value of flow_export.curl_command | Test exact return value of flow_export.curl_command
| Python | mit | jvillacorta/mitmproxy,tdickers/mitmproxy,ddworken/mitmproxy,StevenVanAcker/mitmproxy,cortesi/mitmproxy,vhaupert/mitmproxy,tdickers/mitmproxy,mosajjal/mitmproxy,mosajjal/mitmproxy,fimad/mitmproxy,fimad/mitmproxy,ujjwal96/mitmproxy,vhaupert/mitmproxy,dwfreed/mitmproxy,ParthGanatra/mitmproxy,xaxa89/mitmproxy,mhils/mitmproxy,mhils/mitmproxy,tdickers/mitmproxy,StevenVanAcker/mitmproxy,mitmproxy/mitmproxy,ikoz/mitmproxy,dufferzafar/mitmproxy,mitmproxy/mitmproxy,tdickers/mitmproxy,vhaupert/mitmproxy,StevenVanAcker/mitmproxy,Kriechi/mitmproxy,zlorb/mitmproxy,gzzhanghao/mitmproxy,ikoz/mitmproxy,MatthewShao/mitmproxy,mhils/mitmproxy,mosajjal/mitmproxy,gzzhanghao/mitmproxy,mitmproxy/mitmproxy,xaxa89/mitmproxy,cortesi/mitmproxy,ujjwal96/mitmproxy,jvillacorta/mitmproxy,ddworken/mitmproxy,MatthewShao/mitmproxy,cortesi/mitmproxy,laurmurclar/mitmproxy,zlorb/mitmproxy,dwfreed/mitmproxy,dwfreed/mitmproxy,laurmurclar/mitmproxy,dwfreed/mitmproxy,mitmproxy/mitmproxy,mosajjal/mitmproxy,dufferzafar/mitmproxy,Kriechi/mitmproxy,dufferzafar/mitmproxy,ikoz/mitmproxy,jvillacorta/mitmproxy,ikoz/mitmproxy,mhils/mitmproxy,MatthewShao/mitmproxy,gzzhanghao/mitmproxy,ujjwal96/mitmproxy,ujjwal96/mitmproxy,gzzhanghao/mitmproxy,cortesi/mitmproxy,laurmurclar/mitmproxy,ParthGanatra/mitmproxy,mitmproxy/mitmproxy,zlorb/mitmproxy,fimad/mitmproxy,zlorb/mitmproxy,xaxa89/mitmproxy,mhils/mitmproxy,StevenVanAcker/mitmproxy,Kriechi/mitmproxy,vhaupert/mitmproxy,laurmurclar/mitmproxy,ParthGanatra/mitmproxy,fimad/mitmproxy,Kriechi/mitmproxy,dufferzafar/mitmproxy,ddworken/mitmproxy,ParthGanatra/mitmproxy,jvillacorta/mitmproxy,ddworken/mitmproxy,xaxa89/mitmproxy,MatthewShao/mitmproxy |
37cb987503f336362d629619f6f39165f4d8e212 | utils/snippets.py | utils/snippets.py | #!/usr/bin/env python
# A hacky script to do dynamic snippets.
import sys
import os
import datetime
snippet_map = {
'date' : datetime.datetime.now().strftime('%b %d %G %I:%M%p '),
'time' : datetime.datetime.now().strftime('%I:%M%p '),
}
keys = '\n'.join(snippet_map.keys())
result = os.popen('printf "%s" | rofi -dmenu ' % keys)
selected_key = result.read().strip()
os.system('xdotool type --clearmodifiers -- "%s"' % str(snippet_map[selected_key]))
| #!/usr/bin/env python
# A hacky script to do dynamic snippets.
import sys
import os
import datetime
snippet_map = {
'date' : datetime.datetime.now().strftime('%b %d %G %I:%M%p '),
'time' : datetime.datetime.now().strftime('%I:%M%p '),
'sign' : 'Best,\nSameer',
}
keys = '\n'.join(snippet_map.keys())
result = os.popen('printf "%s" | rofi -dmenu ' % keys)
selected_key = result.read().strip()
os.system('sleep 0.1; xdotool type --clearmodifiers "$(printf "%s")"' % str(snippet_map[selected_key]))
| Update snippet script to work with newlines. | Update snippet script to work with newlines.
| Python | mit | sam33r/dotfiles,sam33r/dotfiles,sam33r/dotfiles,sam33r/dotfiles |
95a6f1fa9e5153d337a3590cea8c7918c88c63e0 | openedx/core/djangoapps/embargo/admin.py | openedx/core/djangoapps/embargo/admin.py | """
Django admin page for embargo models
"""
import textwrap
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .forms import IPFilterForm, RestrictedCourseForm
from .models import CountryAccessRule, IPFilter, RestrictedCourse
class IPFilterAdmin(ConfigurationModelAdmin):
"""Admin for blacklisting/whitelisting specific IP addresses"""
form = IPFilterForm
fieldsets = (
(None, {
'fields': ('enabled', 'whitelist', 'blacklist'),
'description': textwrap.dedent("""Enter specific IP addresses to explicitly
whitelist (not block) or blacklist (block) in the appropriate box below.
Separate IP addresses with a comma. Do not surround with quotes.
""")
}),
)
class CountryAccessRuleInline(admin.StackedInline):
"""Inline editor for country access rules. """
model = CountryAccessRule
extra = 1
def has_delete_permission(self, request, obj=None):
return True
class RestrictedCourseAdmin(admin.ModelAdmin):
"""Admin for configuring course restrictions. """
inlines = [CountryAccessRuleInline]
form = RestrictedCourseForm
admin.site.register(IPFilter, IPFilterAdmin)
admin.site.register(RestrictedCourse, RestrictedCourseAdmin)
| """
Django admin page for embargo models
"""
import textwrap
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .forms import IPFilterForm, RestrictedCourseForm
from .models import CountryAccessRule, IPFilter, RestrictedCourse
class IPFilterAdmin(ConfigurationModelAdmin):
"""Admin for blacklisting/whitelisting specific IP addresses"""
form = IPFilterForm
fieldsets = (
(None, {
'fields': ('enabled', 'whitelist', 'blacklist'),
'description': textwrap.dedent("""Enter specific IP addresses to explicitly
whitelist (not block) or blacklist (block) in the appropriate box below.
Separate IP addresses with a comma. Do not surround with quotes.
""")
}),
)
class CountryAccessRuleInline(admin.StackedInline):
"""Inline editor for country access rules. """
model = CountryAccessRule
extra = 1
def has_delete_permission(self, request, obj=None):
return True
class RestrictedCourseAdmin(admin.ModelAdmin):
"""Admin for configuring course restrictions. """
inlines = [CountryAccessRuleInline]
form = RestrictedCourseForm
search_fields = ('course_key',)
admin.site.register(IPFilter, IPFilterAdmin)
admin.site.register(RestrictedCourse, RestrictedCourseAdmin)
| Allow searching restricted courses by key | Allow searching restricted courses by key
| Python | agpl-3.0 | a-parhom/edx-platform,a-parhom/edx-platform,a-parhom/edx-platform,edx/edx-platform,msegado/edx-platform,philanthropy-u/edx-platform,edx-solutions/edx-platform,cpennington/edx-platform,eduNEXT/edx-platform,eduNEXT/edunext-platform,eduNEXT/edx-platform,arbrandes/edx-platform,jolyonb/edx-platform,EDUlib/edx-platform,mitocw/edx-platform,angelapper/edx-platform,ESOedX/edx-platform,mitocw/edx-platform,ESOedX/edx-platform,philanthropy-u/edx-platform,EDUlib/edx-platform,edx/edx-platform,edx/edx-platform,edx-solutions/edx-platform,ESOedX/edx-platform,jolyonb/edx-platform,arbrandes/edx-platform,stvstnfrd/edx-platform,appsembler/edx-platform,cpennington/edx-platform,msegado/edx-platform,stvstnfrd/edx-platform,stvstnfrd/edx-platform,msegado/edx-platform,EDUlib/edx-platform,jolyonb/edx-platform,angelapper/edx-platform,appsembler/edx-platform,mitocw/edx-platform,arbrandes/edx-platform,msegado/edx-platform,jolyonb/edx-platform,eduNEXT/edx-platform,philanthropy-u/edx-platform,ESOedX/edx-platform,eduNEXT/edunext-platform,stvstnfrd/edx-platform,edx/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,edx-solutions/edx-platform,eduNEXT/edx-platform,eduNEXT/edunext-platform,angelapper/edx-platform,EDUlib/edx-platform,a-parhom/edx-platform,cpennington/edx-platform,appsembler/edx-platform,cpennington/edx-platform,edx-solutions/edx-platform,msegado/edx-platform,mitocw/edx-platform,philanthropy-u/edx-platform,appsembler/edx-platform,eduNEXT/edunext-platform |
8b6d285f60caa77677aaf3076642a47c525a3b24 | parsers/nmapingest.py | parsers/nmapingest.py | import pandas as pd
import logging, os
import IPy as IP
log = logging.getLogger(__name__)
df3 = pd.read_csv('nmap.tsv', delimiter='\t')
df3.columns = ['host_and_fingerprint', 'port']
df3['host_and_fingerprint'] = df3['host_and_fingerprint'].map(lambda x: x.lstrip('Host:').rstrip(''))
df3['port'] = df3['port'].map(lambda x: x.lstrip('Ports:').rstrip(''))
df3_hostfp = df3[['host_and_fingerprint']]
#df3_hostfp_check = df3.applymap(lambda x: IP(df3_hostfp).iptype())
df3['ip'] = df3['host_and_fingerprint'].apply(lambda x: x.split(' ')[1])
#df3['host_and_fingerprint'] = df3['host_and_fingerprint'].apply(lambda x: IP(df3_hostfp).iptype())
print (df3_hostfp_check)
#def logwrite():
#df3 = df3.to_csv('nmap.csv', index=None, encoding='utf-8')
| import pandas as pd
import logging, os
import IPy as IP
log = logging.getLogger(__name__)
df3 = pd.read_csv('data/nmap/nmap.tsv', delimiter='\t')
df3.columns = ['host_and_fingerprint', 'port']
df3['host_and_fingerprint'] = df3['host_and_fingerprint'].map(lambda x: x.lstrip('Host:').rstrip(''))
df3['port'] = df3['port'].map(lambda x: x.lstrip('Ports:').rstrip(''))
#df3_hostfp_check = df3.applymap(lambda x: IP(df3_hostfp).iptype())
df3['ip'] = df3['host_and_fingerprint'].apply(lambda x: x.split(' ')[1])
#df3['host_and_fingerprint'] = df3['host_and_fingerprint'].apply(lambda x: IP(df3_hostfp).iptype())
print (df3)
#def logwrite():
#df3 = df3.to_csv('nmap.csv', index=None, encoding='utf-8')
| Fix problem lines in nmap parsing. | Fix problem lines in nmap parsing.
| Python | apache-2.0 | jzadeh/chiron-elk |
4ddce41a126395141738f4cd02b2c0589f0f1577 | test/utils.py | test/utils.py | from contextlib import contextmanager
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
@contextmanager
def captured_output():
"""Allows to safely capture stdout and stderr in a context manager."""
new_out, new_err = StringIO(), StringIO()
old_out, old_err = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = new_out, new_err
yield sys.stdout, sys.stderr
finally:
sys.stdout, sys.stderr = old_out, old_err
| from contextlib import contextmanager
import sys
from io import StringIO
@contextmanager
def captured_output():
"""Allows to safely capture stdout and stderr in a context manager."""
new_out, new_err = StringIO(), StringIO()
old_out, old_err = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = new_out, new_err
yield sys.stdout, sys.stderr
finally:
sys.stdout, sys.stderr = old_out, old_err
| Remove conditional import for py2 support | Remove conditional import for py2 support
| Python | mit | bertrandvidal/parse_this |
6be3a40010b7256cb5b8fadfe4ef40b6c5691a06 | jungle/session.py | jungle/session.py | # -*- coding: utf-8 -*-
import boto3
def create_session(profile_name):
if not profile_name:
return boto3
else:
return boto3.Session(profile_name=profile_name)
| # -*- coding: utf-8 -*-
import sys
import boto3
import botocore
import click
def create_session(profile_name):
if profile_name is None:
return boto3
else:
try:
session = boto3.Session(profile_name=profile_name)
return session
except botocore.exceptions.ProfileNotFound as e:
click.echo("Invalid profile name: {0}".format(profile_name, e), err=True)
sys.exit(2)
| Add error message when wrong AWS Profile Name is given | Add error message when wrong AWS Profile Name is given
| Python | mit | achiku/jungle |
a71c6c03b02a15674fac0995d120f5c2180e8767 | plugin/floo/sublime.py | plugin/floo/sublime.py | from collections import defaultdict
import time
TIMEOUTS = defaultdict(list)
def windows(*args, **kwargs):
return []
def set_timeout(func, timeout, *args, **kwargs):
then = time.time() + timeout
TIMEOUTS[then].append(lambda: func(*args, **kwargs))
def call_timeouts():
now = time.time()
to_remove = []
for t, timeouts in TIMEOUTS.items():
if now >= t:
for timeout in timeouts:
timeout()
to_remove.append(t)
for k in to_remove:
del TIMEOUTS[k]
def error_message(*args, **kwargs):
print(args, kwargs)
class Region(object):
def __init__(*args, **kwargs):
pass
| from collections import defaultdict
import time
TIMEOUTS = defaultdict(list)
def windows(*args, **kwargs):
return []
def set_timeout(func, timeout, *args, **kwargs):
then = time.time() + (timeout / 1000.0)
TIMEOUTS[then].append(lambda: func(*args, **kwargs))
def call_timeouts():
now = time.time()
to_remove = []
for t, timeouts in TIMEOUTS.items():
if now >= t:
for timeout in timeouts:
timeout()
to_remove.append(t)
for k in to_remove:
del TIMEOUTS[k]
def error_message(*args, **kwargs):
print(args, kwargs)
class Region(object):
def __init__(*args, **kwargs):
pass
| Fix off by 1000 error | Fix off by 1000 error
| Python | apache-2.0 | Floobits/floobits-neovim,Floobits/floobits-neovim-old,Floobits/floobits-vim |
d347f8a42bdf66eeb0e56b3de1ad941b65ba1681 | web/app/wiki/__main__.py | web/app/wiki/__main__.py | # Get a reference to the Application class.
from web.core import Application
# This is our WSGI application instance.
app = Application("Hi.")
# If we're run as the "main script", serve our application over HTTP.
if __name__ == "__main__":
app.serve('wsgiref')
| # Get a reference to the Application class.
from web.core import Application
# Get references to web framework extensions.
from web.ext.annotation import AnnotationExtension
from web.ext.debug import DebugExtension
from web.ext.serialize import SerializationExtension
from web.ext.db import DBExtension
# Get a reference to our database connection adapter.
from web.db.mongo import MongoDBConnection
# Get a reference to our Wiki root object.
from web.app.wiki.root import Wiki
# This is our WSGI application instance.
app = Application(Wiki, extensions=[
AnnotationExtension(),
DebugExtension(),
SerializationExtension(),
DBExtension(MongoDBConnection("mongodb://localhost/test")),
])
# If we're run as the "main script", serve our application over HTTP.
if __name__ == "__main__":
app.serve('wsgiref')
| Make use of root object and WebCore extensions. | Make use of root object and WebCore extensions.
The Wiki root object is now the root of the sample application and the
following extensions have been configured:
- [`AnnotationExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/annotation.py)
- [`DebugExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/debug.py)
- [`SerializationExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/serialize.py)
- [`DBExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/db.py)
The default databse has been configured to use the
[`marrow.mongo`](https://github.com/marrow/mongo) WebCore adapter,
connecting to a MongoDB database named `test` on the local machine.
| Python | mit | amcgregor/WebCore-Tutorial |
d0e7c8ec73e36d6391ec57802e6186608196901a | aldryn_apphooks_config/templatetags/namespace_extras.py | aldryn_apphooks_config/templatetags/namespace_extras.py | # -*- coding: utf-8 -*-
from django import template
from django.core import urlresolvers
from ..utils import get_app_instance
register = template.Library()
@register.simple_tag(takes_context=True)
def namespace_url(context, view_name, *args, **kwargs):
"""
Returns an absolute URL matching given view with its parameters.
"""
namespace, config = get_app_instance(context['request'])
if not 'current_app' in kwargs:
kwargs['current_app'] = namespace
return urlresolvers.reverse('%s:%s' % (config.namespace, view_name),
args=args,
kwargs=kwargs)
| # -*- coding: utf-8 -*-
from django import template
from django.core import urlresolvers
from ..utils import get_app_instance
register = template.Library()
@register.simple_tag(takes_context=True)
def namespace_url(context, view_name, *args, **kwargs):
"""
Returns an absolute URL matching given view with its parameters.
"""
namespace, config = get_app_instance(context['request'])
if not 'current_app' in kwargs:
kwargs['current_app'] = namespace
return urlresolvers.reverse(
'{0:s}:{1:s}'.format(config.namespace, view_name),
args=args,
kwargs=kwargs)
| Use string.format for performance reasons | Use string.format for performance reasons
| Python | bsd-3-clause | aldryn/aldryn-apphooks-config,aldryn/aldryn-apphooks-config,aldryn/aldryn-apphooks-config |
d68bdfe0b89137efc6b0c167663a0edf7decb4cd | nashvegas/management/commands/syncdb.py | nashvegas/management/commands/syncdb.py | from django.core.management import call_command
from django.core.management.commands.syncdb import Command as SyncDBCommand
class Command(SyncDBCommand):
def handle_noargs(self, **options):
# Run migrations first
if options.get('database'):
databases = [options.get('database')]
else:
databases = None
call_command("upgradedb",
do_execute=True,
databases=databases,
interactive=options.get('interactive'),
verbosity=options.get('verbosity'),
)
# Follow up with a syncdb on anything that wasnt included in migrations
# (this catches things like test-only models)
super(Command, self).handle_noargs(**options)
| from django.core.management import call_command
from django.core.management.commands.syncdb import Command as SyncDBCommand
class Command(SyncDBCommand):
def handle_noargs(self, **options):
# Run migrations first
if options.get("database"):
databases = [options.get("database")]
else:
databases = None
call_command("upgradedb",
do_execute=True,
databases=databases,
interactive=options.get("interactive"),
verbosity=options.get("verbosity"),
)
# Follow up with a syncdb on anything that wasnt included in migrations
# (this catches things like test-only models)
super(Command, self).handle_noargs(**options)
| Update style to be consistent with project | Update style to be consistent with project | Python | mit | dcramer/nashvegas,iivvoo/nashvegas,paltman/nashvegas,paltman-archive/nashvegas,jonathanchu/nashvegas |
6c98f48acd3cc91faeee2d6e24784275eedbd1ea | saw-remote-api/python/tests/saw/test_basic_java.py | saw-remote-api/python/tests/saw/test_basic_java.py | import unittest
from pathlib import Path
import saw_client as saw
from saw_client.jvm import Contract, java_int, cryptol
class Add(Contract):
def __init__(self) -> None:
super().__init__()
def specification(self) -> None:
x = self.fresh_var(java_int, "x")
y = self.fresh_var(java_int, "y")
self.execute_func(x, y)
self.returns(cryptol("(+)")(x,y))
class AddTest(unittest.TestCase):
def test_add(self):
saw.connect(reset_server=True)
if __name__ == "__main__": saw.view(saw.LogResults())
cls = saw.jvm_load_class("Add")
result = saw.jvm_verify(cls, 'add', Add())
self.assertIs(result.is_success(), True)
if __name__ == "__main__":
unittest.main()
| import unittest
from pathlib import Path
import saw_client as saw
from saw_client.jvm import Contract, java_int, cryptol
class Add(Contract):
def __init__(self) -> None:
super().__init__()
def specification(self) -> None:
x = self.fresh_var(java_int, "x")
y = self.fresh_var(java_int, "y")
self.execute_func(x, y)
self.returns(cryptol("(+)")(x,y))
class Double(Contract):
def __init__(self) -> None:
super().__init__()
def specification(self) -> None:
x = self.fresh_var(java_int, "x")
self.execute_func(x)
self.returns(cryptol("(+)")(x,x))
class AddTest(unittest.TestCase):
def test_add(self):
saw.connect(reset_server=True)
if __name__ == "__main__": saw.view(saw.LogResults())
cls = saw.jvm_load_class("Add")
add_result1 = saw.jvm_verify(cls, 'add', Add())
self.assertIs(add_result1.is_success(), True)
add_result2 = saw.jvm_assume(cls, 'add', Add())
self.assertIs(add_result2.is_success(), True)
dbl_result1 = saw.jvm_verify(cls, 'dbl', Double(), lemmas=[add_result1])
self.assertIs(dbl_result1.is_success(), True)
dbl_result2 = saw.jvm_verify(cls, 'dbl', Double(), lemmas=[add_result2])
self.assertIs(dbl_result2.is_success(), True)
if __name__ == "__main__":
unittest.main()
| Test assumption, composition for RPC Java proofs | Test assumption, composition for RPC Java proofs
| Python | bsd-3-clause | GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script |
36e034749e8f99e457f5f272d886577e41bb0fb2 | services/ingest-file/ingestors/email/outlookpst.py | services/ingest-file/ingestors/email/outlookpst.py | import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
class OutlookPSTIngestor(Ingestor, TempFileSupport, OLESupport, ShellSupport):
MIME_TYPES = ['application/vnd.ms-outlook']
EXTENSIONS = ['pst', 'ost', 'pab']
BASE_SCORE = 5
COMMAND_TIMEOUT = 12 * 60 * 60
def ingest(self, file_path, entity):
entity.schema = model.get('Package')
self.extract_ole_metadata(file_path, entity)
temp_dir = self.make_empty_directory()
try:
self.exec_command('readpst',
'-e', # make subfolders, files per message
'-D', # include deleted
'-r', # recursive structure
'-8', # utf-8 where possible
'-b',
'-q', # quiet
'-o', temp_dir,
file_path)
self.manager.delegate(DirectoryIngestor, temp_dir, entity)
except Exception:
log.exception("Failed to unpack PST.")
# Handle partially extracted archives.
self.manager.delegate(DirectoryIngestor, temp_dir, entity)
raise
| import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
class OutlookPSTIngestor(Ingestor, TempFileSupport, OLESupport, ShellSupport):
MIME_TYPES = ['application/vnd.ms-outlook']
EXTENSIONS = ['pst', 'ost', 'pab']
BASE_SCORE = 5
COMMAND_TIMEOUT = 12 * 60 * 60
def ingest(self, file_path, entity):
entity.schema = model.get('Package')
self.extract_ole_metadata(file_path, entity)
temp_dir = self.make_empty_directory()
try:
self.exec_command('readpst',
'-e', # make subfolders, files per message
'-S', # single files
'-D', # include deleted
# '-r', # recursive structure
'-8', # utf-8 where possible
'-cv', # export vcards
# '-q', # quiet
'-o', temp_dir,
file_path)
self.manager.delegate(DirectoryIngestor, temp_dir, entity)
except Exception:
log.exception("Failed to unpack PST.")
# Handle partially extracted archives.
self.manager.delegate(DirectoryIngestor, temp_dir, entity)
raise
| Make outlook emit single files | Make outlook emit single files
| Python | mit | pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph |
3e30ccba76655ecc23002c328885d55780ee55b4 | src/tenyksafk/main.py | src/tenyksafk/main.py | from tenyksservice import TenyksService, run_service
class AFK(TenyksService):
direct_only = False
irc_message_filters = {
'depart': [r'^(?i)(xopa|away|afk|brb)'],
'return': [r'^(?i)(xoka|back)']
}
def handle_depart(self, data, match):
self.logger.debug('{nick} went AFK.'.format(nick=data['nick']))
self.send('{nick} is now AFK.'.format(nick=data['nick']), data)
def handle_return(self, data, match):
self.logger.debug('{nick} is no longer AFK.'.format(nick=data['nick']))
self.send('{nick} is no longer AFK.'.format(nick=data['nick']), data)
def main():
run_service(AFK)
if __name__ == '__main__':
main()
| from tenyksservice import TenyksService, run_service
away = {}
class AFK(TenyksService):
direct_only = False
irc_message_filters = {
'depart': [r'^(?i)(xopa|away|afk|brb)'],
'return': [r'^(?i)(xoka|back)'],
'query': [r'(?P<nick>(.*))\?$']
}
def handle_depart(self, data, match):
self.logger.debug('{nick} went AFK.'.format(nick=data['nick']))
self.send('{nick} is now AFK.'.format(nick=data['nick']), data)
away[data['nick']] = True
def handle_return(self, data, match):
self.logger.debug('{nick} is no longer AFK.'.format(nick=data['nick']))
self.send('{nick} is no longer AFK.'.format(nick=data['nick']), data)
away[data['nick']] = False
def handle_query(self, data, match):
nick = match.groupdict()['nick']
if nick in away:
status = 'AFK' if away[nick] else 'present'
self.logger.debug('{nick} is currently {status}'.format(nick=nick, status=status))
self.send('{nick} is currently {status}.'.format(nick=nick, status=status), data)
else:
self.logger.debug('{nick}\' status is unknown.'.format(nick=nick))
self.send('{nick}\'s status is unknown.'.format(nick=nick), data)
def main():
run_service(AFK)
if __name__ == '__main__':
main()
| Add ability to query if a user is away | Add ability to query if a user is away
| Python | mit | cblgh/tenyks-contrib,colby/tenyks-contrib,kyleterry/tenyks-contrib |
e7f1c49216a7b609dbe8ea283cdf689cfa575f85 | openacademy/model/openacademy_course.py | openacademy/model/openacademy_course.py | from openerp import models, fields, api
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True)
description = fields.Text(string='Description')
responsible_id = fields.Many2one('res.users',
ondelete = 'set null',
string = "Responsible",
index = True)
session_ids = fields.One2many('openacademy.session',
'course_id', string="Sessions")
_sql_constraints = [
('name_description_check',
'CHECK(name != description)',
"The title of the course should not be the description"),
('name_unique',
'UNIQUE(name)',
"The course title must be unique"),
]
| from openerp import api, models, fields, api
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True)
description = fields.Text(string='Description')
responsible_id = fields.Many2one('res.users',
ondelete = 'set null',
string = "Responsible",
index = True)
session_ids = fields.One2many('openacademy.session',
'course_id', string="Sessions")
_sql_constraints = [
('name_description_check',
'CHECK(name != description)',
"The title of the course should not be the description"),
('name_unique',
'UNIQUE(name)',
"The course title must be unique"),
]
@api.multi
def copy(self, default=None):
default = dict(default or {})
copied_count = self.search_count(
[('name', '=like', u"Copy of {}%".format(self.name))])
if not copied_count:
new_name = u"Copy of {}".format(self.name)
else:
new_name = u"Copy of {} ({})".format(self.name, copied_count)
default['name'] = new_name
return super(Course, self).copy(default)
| Modify copy method into inherit | [REF] openacademy: Modify copy method into inherit
| Python | apache-2.0 | maitaoriana/openacademy-project |
4b62f6545dd962ad4b323454901ccf12a7ce9910 | pyelevator/elevator.py | pyelevator/elevator.py | from .base import Client
class RangeIter(object):
def __init__(self, range_datas):
self._container = range_datas if self._valid_range(range_datas) else None
def _valid_range(self, range_datas):
if (not isinstance(range_datas, tuple) or
any(not isinstance(pair, tuple) for pair in range_datas)):
raise ValueError("Range datas format not recognized")
return True
def __iter__(self):
return self.forward()
def forward(self):
current_item = 0
while (current_item < len(self._container)):
container = self._container[current_item]
current_item += 1
yield container
class Elevator(Client):
def Get(self, key):
return self.send(self.db_uid, 'GET', [key])
def MGet(self, keys):
return self.send(self.db_uid, 'MGET', [keys])
def Put(self, key, value):
return self.send(self.db_uid, 'PUT', [key, value])
def Delete(self, key):
return self.send(self.db_uid, 'DELETE', [key])
def Range(self, start=None, limit=None):
return self.send(self.db_uid, 'RANGE', [start, limit])
def RangeIter(self, key_from=None, key_to=None):
range_datas = self.Range(key_from, key_to)
return RangeIter(range_datas)
| from .base import Client
class RangeIter(object):
def __init__(self, range_datas):
self._container = range_datas if self._valid_range(range_datas) else None
def _valid_range(self, range_datas):
if (not isinstance(range_datas, (list, tuple)) or
any(not isinstance(pair, (list, tuple)) for pair in range_datas)):
raise ValueError("Range datas format not recognized")
return True
def __iter__(self):
return self.forward()
def forward(self):
current_item = 0
while (current_item < len(self._container)):
container = self._container[current_item]
current_item += 1
yield container
class Elevator(Client):
def Get(self, key):
return self.send(self.db_uid, 'GET', [key])
def MGet(self, keys):
return self.send(self.db_uid, 'MGET', [keys])
def Put(self, key, value):
return self.send(self.db_uid, 'PUT', [key, value])
def Delete(self, key):
return self.send(self.db_uid, 'DELETE', [key])
def Range(self, start=None, limit=None):
return self.send(self.db_uid, 'RANGE', [start, limit])
def RangeIter(self, key_from=None, key_to=None):
range_datas = self.Range(key_from, key_to)
return RangeIter(range_datas)
| Fix : range output datas format validation | Fix : range output datas format validation
| Python | mit | oleiade/py-elevator |
9c94c7c48f932e2134c2d520403fbfb09e464d95 | pygameMidi_extended.py | pygameMidi_extended.py | #import pygame.midi.Output
from pygame.midi import Output
class Output(Output):#pygame.midi.Output):
def set_pan(self, pan, channel):
assert (0 <= channel <= 15)
assert pan <= 127
self.write_short(0xB0 + channel, 0x0A, pan) | #import pygame.midi.Output
from pygame.midi import Output
class Output(Output):#pygame.midi.Output):
def set_pan(self, pan, channel):
assert (0 <= channel <= 15)
assert pan <= 127
self.write_short(0xB0 + channel, 0x0A, pan)
def set_volume(self, volume, channel):
assert (0 <= channel <= 15)
assert volume <= 127
self.write_short(0xB0 + channel, 0x07, volume)
def set_pitch(self, pitch, channel):
assert (0 <= channel <= 15)
assert pitch <= (2**14-1)
# the 7 least significant bits come into the first data byte,
# the 7 most significant bits come into the second data byte
pitch_lsb = (pitch >> 7) & 127
pitch_msb = pitch & 127
self.write_short(0xE0 + channel, pitch_lsb, pitch_msb) | Add Volume and Pitch methods | Add Volume and Pitch methods
| Python | bsd-3-clause | RenolY2/py-playBMS |
fe4d3f7f734c2d8c6a21932a50ad1d86519ef6ff | clowder/clowder/cli/diff_controller.py | clowder/clowder/cli/diff_controller.py | from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
class DiffController(AbstractBaseController):
class Meta:
label = 'diff'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Show git diff for projects'
@expose(help="second-controller default command", hide=True)
def default(self):
print("Inside SecondController.default()")
| from cement.ext.ext_argparse import expose
from clowder.cli.abstract_base_controller import AbstractBaseController
from clowder.commands.util import (
filter_groups,
filter_projects_on_project_names,
run_group_command,
run_project_command
)
from clowder.util.decorators import (
print_clowder_repo_status,
valid_clowder_yaml_required
)
class DiffController(AbstractBaseController):
class Meta:
label = 'diff'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Show git diff for projects'
@expose(help="second-controller default command", hide=True)
@valid_clowder_yaml_required
@print_clowder_repo_status
def default(self):
if self.app.pargs.projects is None:
groups = filter_groups(self.clowder.groups, self.app.pargs.groups)
for group in groups:
run_group_command(group, [], 'diff')
return
projects = filter_projects_on_project_names(self.clowder.groups, self.app.pargs.projects)
for project in projects:
run_project_command(project, [], 'diff')
| Add `clowder diff` logic to Cement controller | Add `clowder diff` logic to Cement controller
| Python | mit | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder |
c7046df0f24aadbeb8e491a9b61c6cc4e49e59c6 | common/djangoapps/util/json_request.py | common/djangoapps/util/json_request.py | from functools import wraps
import copy
import json
def expect_json(view_function):
"""
View decorator for simplifying handing of requests that expect json. If the request's
CONTENT_TYPE is application/json, parses the json dict from request.body, and updates
request.POST with the contents.
"""
@wraps(view_function)
def expect_json_with_cloned_request(request, *args, **kwargs):
# cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information
# e.g. 'charset', so we can't do a direct string compare
if request.META.get('CONTENT_TYPE', '').lower().startswith("application/json"):
cloned_request = copy.copy(request)
cloned_request.POST = cloned_request.POST.copy()
cloned_request.POST.update(json.loads(request.body))
return view_function(cloned_request, *args, **kwargs)
else:
return view_function(request, *args, **kwargs)
return expect_json_with_cloned_request
| from functools import wraps
import copy
import json
def expect_json(view_function):
"""
View decorator for simplifying handing of requests that expect json. If the request's
CONTENT_TYPE is application/json, parses the json dict from request.body, and updates
request.POST with the contents.
"""
@wraps(view_function)
def expect_json_with_cloned_request(request, *args, **kwargs):
# cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information
# e.g. 'charset', so we can't do a direct string compare
if request.META.get('CONTENT_TYPE', '').lower().startswith("application/json"):
cloned_request = copy.copy(request)
cloned_request.POST = json.loads(request.body)
return view_function(cloned_request, *args, **kwargs)
else:
return view_function(request, *args, **kwargs)
return expect_json_with_cloned_request
| Make request.POST be only json content when using expect_json | Make request.POST be only json content when using expect_json
| Python | agpl-3.0 | ZLLab-Mooc/edx-platform,SivilTaram/edx-platform,xuxiao19910803/edx,cecep-edu/edx-platform,shurihell/testasia,eemirtekin/edx-platform,EduPepperPDTesting/pepper2013-testing,PepperPD/edx-pepper-platform,kxliugang/edx-platform,UXE/local-edx,raccoongang/edx-platform,romain-li/edx-platform,hmcmooc/muddx-platform,mtlchun/edx,JioEducation/edx-platform,teltek/edx-platform,antoviaque/edx-platform,Shrhawk/edx-platform,bigdatauniversity/edx-platform,hkawasaki/kawasaki-aio8-1,mcgachey/edx-platform,benpatterson/edx-platform,xingyepei/edx-platform,wwj718/ANALYSE,PepperPD/edx-pepper-platform,kursitet/edx-platform,jbassen/edx-platform,jamiefolsom/edx-platform,B-MOOC/edx-platform,dsajkl/123,DNFcode/edx-platform,sameetb-cuelogic/edx-platform-test,cognitiveclass/edx-platform,chand3040/cloud_that,EduPepperPDTesting/pepper2013-testing,antonve/s4-project-mooc,xingyepei/edx-platform,AkA84/edx-platform,romain-li/edx-platform,OmarIthawi/edx-platform,Ayub-Khan/edx-platform,bigdatauniversity/edx-platform,mahendra-r/edx-platform,AkA84/edx-platform,chrisndodge/edx-platform,rue89-tech/edx-platform,dkarakats/edx-platform,AkA84/edx-platform,etzhou/edx-platform,hkawasaki/kawasaki-aio8-1,jamesblunt/edx-platform,synergeticsedx/deployment-wipro,jazkarta/edx-platform-for-isc,y12uc231/edx-platform,kmoocdev/edx-platform,morenopc/edx-platform,rue89-tech/edx-platform,inares/edx-platform,utecuy/edx-platform,carsongee/edx-platform,cecep-edu/edx-platform,jbzdak/edx-platform,msegado/edx-platform,pku9104038/edx-platform,simbs/edx-platform,jruiperezv/ANALYSE,DNFcode/edx-platform,rue89-tech/edx-platform,ovnicraft/edx-platform,motion2015/edx-platform,nttks/jenkins-test,UOMx/edx-platform,benpatterson/edx-platform,nagyistoce/edx-platform,iivic/BoiseStateX,jamiefolsom/edx-platform,nanolearningllc/edx-platform-cypress,UOMx/edx-platform,mcgachey/edx-platform,cognitiveclass/edx-platform,stvstnfrd/edx-platform,ubc/edx-platform,bdero/edx-platform,mjg2203/edx-platform-seas,alu042/edx-platform,edx-solutions/edx-platform,longmen21/edx-platform,apigee/edx-platform,DefyVentures/edx-platform,jruiperezv/ANALYSE,abdoosh00/edx-rtl-final,nanolearning/edx-platform,ESOedX/edx-platform,mbareta/edx-platform-ft,openfun/edx-platform,jazztpt/edx-platform,jazztpt/edx-platform,edry/edx-platform,mjirayu/sit_academy,eduNEXT/edx-platform,fintech-circle/edx-platform,MSOpenTech/edx-platform,LICEF/edx-platform,hastexo/edx-platform,zhenzhai/edx-platform,pomegranited/edx-platform,gsehub/edx-platform,alexthered/kienhoc-platform,rationalAgent/edx-platform-custom,Edraak/circleci-edx-platform,hkawasaki/kawasaki-aio8-0,atsolakid/edx-platform,10clouds/edx-platform,xuxiao19910803/edx,jazkarta/edx-platform,longmen21/edx-platform,synergeticsedx/deployment-wipro,mjg2203/edx-platform-seas,Edraak/edraak-platform,jswope00/GAI,shubhdev/openedx,IITBinterns13/edx-platform-dev,apigee/edx-platform,appliedx/edx-platform,cpennington/edx-platform,ahmedaljazzar/edx-platform,mjirayu/sit_academy,pabloborrego93/edx-platform,edry/edx-platform,unicri/edx-platform,chrisndodge/edx-platform,mtlchun/edx,dsajkl/reqiop,Semi-global/edx-platform,cognitiveclass/edx-platform,chauhanhardik/populo,nanolearning/edx-platform,appsembler/edx-platform,EDUlib/edx-platform,romain-li/edx-platform,jbzdak/edx-platform,chand3040/cloud_that,stvstnfrd/edx-platform,dcosentino/edx-platform,CourseTalk/edx-platform,Edraak/circleci-edx-platform,rismalrv/edx-platform,dcosentino/edx-platform,don-github/edx-platform,RPI-OPENEDX/edx-platform,DefyVentures/edx-platform,chauhanhardik/populo_2,fly19890211/edx-platform,angelapper/edx-platform,benpatterson/edx-platform,knehez/edx-platform,ovnicraft/edx-platform,nttks/jenkins-test,a-parhom/edx-platform,defance/edx-platform,edx/edx-platform,prarthitm/edxplatform,amir-qayyum-khan/edx-platform,CredoReference/edx-platform,devs1991/test_edx_docmode,morenopc/edx-platform,LearnEra/LearnEraPlaftform,zofuthan/edx-platform,waheedahmed/edx-platform,mushtaqak/edx-platform,shubhdev/edx-platform,jolyonb/edx-platform,jazkarta/edx-platform,sameetb-cuelogic/edx-platform-test,nanolearningllc/edx-platform-cypress-2,bitifirefly/edx-platform,jazkarta/edx-platform-for-isc,jonathan-beard/edx-platform,hmcmooc/muddx-platform,cpennington/edx-platform,defance/edx-platform,zhenzhai/edx-platform,pelikanchik/edx-platform,hkawasaki/kawasaki-aio8-2,martynovp/edx-platform,pku9104038/edx-platform,Shrhawk/edx-platform,B-MOOC/edx-platform,pabloborrego93/edx-platform,louyihua/edx-platform,nikolas/edx-platform,knehez/edx-platform,JCBarahona/edX,fintech-circle/edx-platform,tiagochiavericosta/edx-platform,tanmaykm/edx-platform,antoviaque/edx-platform,ovnicraft/edx-platform,kxliugang/edx-platform,pdehaye/theming-edx-platform,Endika/edx-platform,eduNEXT/edx-platform,CourseTalk/edx-platform,marcore/edx-platform,Endika/edx-platform,playm2mboy/edx-platform,dkarakats/edx-platform,zhenzhai/edx-platform,EDUlib/edx-platform,cpennington/edx-platform,solashirai/edx-platform,chauhanhardik/populo,chauhanhardik/populo,iivic/BoiseStateX,EduPepperPDTesting/pepper2013-testing,kmoocdev/edx-platform,Semi-global/edx-platform,gymnasium/edx-platform,IndonesiaX/edx-platform,nanolearning/edx-platform,auferack08/edx-platform,msegado/edx-platform,ahmedaljazzar/edx-platform,zerobatu/edx-platform,proversity-org/edx-platform,raccoongang/edx-platform,chand3040/cloud_that,procangroup/edx-platform,jazkarta/edx-platform-for-isc,mjirayu/sit_academy,SravanthiSinha/edx-platform,deepsrijit1105/edx-platform,jruiperezv/ANALYSE,IITBinterns13/edx-platform-dev,fintech-circle/edx-platform,shabab12/edx-platform,y12uc231/edx-platform,chauhanhardik/populo_2,kalebhartje/schoolboost,kmoocdev/edx-platform,atsolakid/edx-platform,andyzsf/edx,IONISx/edx-platform,devs1991/test_edx_docmode,TeachAtTUM/edx-platform,jolyonb/edx-platform,jswope00/griffinx,chrisndodge/edx-platform,BehavioralInsightsTeam/edx-platform,andyzsf/edx,rismalrv/edx-platform,jamesblunt/edx-platform,MSOpenTech/edx-platform,beni55/edx-platform,appliedx/edx-platform,ZLLab-Mooc/edx-platform,vismartltd/edx-platform,polimediaupv/edx-platform,hkawasaki/kawasaki-aio8-0,nikolas/edx-platform,nanolearningllc/edx-platform-cypress,Unow/edx-platform,chauhanhardik/populo,mtlchun/edx,nttks/edx-platform,nttks/edx-platform,peterm-itr/edx-platform,deepsrijit1105/edx-platform,motion2015/edx-platform,shurihell/testasia,bitifirefly/edx-platform,edx/edx-platform,ubc/edx-platform,IndonesiaX/edx-platform,eemirtekin/edx-platform,lduarte1991/edx-platform,Kalyzee/edx-platform,ZLLab-Mooc/edx-platform,mcgachey/edx-platform,wwj718/edx-platform,UXE/local-edx,mbareta/edx-platform-ft,ak2703/edx-platform,utecuy/edx-platform,kalebhartje/schoolboost,TsinghuaX/edx-platform,eduNEXT/edunext-platform,LearnEra/LearnEraPlaftform,kmoocdev/edx-platform,WatanabeYasumasa/edx-platform,ahmadiga/min_edx,itsjeyd/edx-platform,leansoft/edx-platform,motion2015/a3,antoviaque/edx-platform,edx-solutions/edx-platform,hastexo/edx-platform,tanmaykm/edx-platform,10clouds/edx-platform,edry/edx-platform,JioEducation/edx-platform,PepperPD/edx-pepper-platform,hmcmooc/muddx-platform,appliedx/edx-platform,abdoosh00/edraak,msegado/edx-platform,Kalyzee/edx-platform,polimediaupv/edx-platform,CredoReference/edx-platform,stvstnfrd/edx-platform,cognitiveclass/edx-platform,wwj718/ANALYSE,gymnasium/edx-platform,kursitet/edx-platform,doganov/edx-platform,abdoosh00/edraak,amir-qayyum-khan/edx-platform,MakeHer/edx-platform,valtech-mooc/edx-platform,longmen21/edx-platform,antonve/s4-project-mooc,leansoft/edx-platform,rationalAgent/edx-platform-custom,appliedx/edx-platform,ahmadiga/min_edx,eduNEXT/edunext-platform,mitocw/edx-platform,shubhdev/edxOnBaadal,appsembler/edx-platform,DefyVentures/edx-platform,arbrandes/edx-platform,WatanabeYasumasa/edx-platform,yokose-ks/edx-platform,pepeportela/edx-platform,xuxiao19910803/edx-platform,hamzehd/edx-platform,rue89-tech/edx-platform,atsolakid/edx-platform,simbs/edx-platform,zadgroup/edx-platform,ampax/edx-platform,tanmaykm/edx-platform,angelapper/edx-platform,nanolearningllc/edx-platform-cypress-2,hkawasaki/kawasaki-aio8-1,philanthropy-u/edx-platform,louyihua/edx-platform,deepsrijit1105/edx-platform,proversity-org/edx-platform,xuxiao19910803/edx-platform,4eek/edx-platform,ahmadiga/min_edx,ovnicraft/edx-platform,andyzsf/edx,shubhdev/edx-platform,teltek/edx-platform,ahmadio/edx-platform,arbrandes/edx-platform,10clouds/edx-platform,nttks/edx-platform,nanolearningllc/edx-platform-cypress-2,longmen21/edx-platform,tiagochiavericosta/edx-platform,cselis86/edx-platform,chauhanhardik/populo_2,LICEF/edx-platform,shabab12/edx-platform,jelugbo/tundex,gsehub/edx-platform,naresh21/synergetics-edx-platform,EduPepperPDTesting/pepper2013-testing,EduPepperPDTesting/pepper2013-testing,franosincic/edx-platform,utecuy/edx-platform,Unow/edx-platform,Kalyzee/edx-platform,sudheerchintala/LearnEraPlatForm,itsjeyd/edx-platform,eemirtekin/edx-platform,jazkarta/edx-platform,valtech-mooc/edx-platform,y12uc231/edx-platform,zerobatu/edx-platform,Ayub-Khan/edx-platform,xingyepei/edx-platform,alexthered/kienhoc-platform,mahendra-r/edx-platform,torchingloom/edx-platform,jbzdak/edx-platform,shabab12/edx-platform,xuxiao19910803/edx,B-MOOC/edx-platform,CredoReference/edx-platform,jonathan-beard/edx-platform,jamesblunt/edx-platform,nikolas/edx-platform,OmarIthawi/edx-platform,devs1991/test_edx_docmode,ak2703/edx-platform,LearnEra/LearnEraPlaftform,olexiim/edx-platform,msegado/edx-platform,playm2mboy/edx-platform,dsajkl/reqiop,beacloudgenius/edx-platform,playm2mboy/edx-platform,adoosii/edx-platform,fintech-circle/edx-platform,Ayub-Khan/edx-platform,morenopc/edx-platform,msegado/edx-platform,Edraak/edx-platform,zofuthan/edx-platform,TeachAtTUM/edx-platform,peterm-itr/edx-platform,hastexo/edx-platform,kursitet/edx-platform,pomegranited/edx-platform,jamiefolsom/edx-platform,nttks/edx-platform,wwj718/edx-platform,ak2703/edx-platform,cyanna/edx-platform,fly19890211/edx-platform,bitifirefly/edx-platform,morpheby/levelup-by,mitocw/edx-platform,kmoocdev2/edx-platform,IndonesiaX/edx-platform,miptliot/edx-platform,nttks/jenkins-test,Edraak/circleci-edx-platform,vismartltd/edx-platform,ahmadio/edx-platform,Softmotions/edx-platform,cselis86/edx-platform,Edraak/circleci-edx-platform,openfun/edx-platform,solashirai/edx-platform,a-parhom/edx-platform,rue89-tech/edx-platform,jbassen/edx-platform,leansoft/edx-platform,rationalAgent/edx-platform-custom,auferack08/edx-platform,caesar2164/edx-platform,gsehub/edx-platform,doismellburning/edx-platform,doismellburning/edx-platform,iivic/BoiseStateX,PepperPD/edx-pepper-platform,louyihua/edx-platform,zerobatu/edx-platform,LICEF/edx-platform,antonve/s4-project-mooc,motion2015/a3,jswope00/GAI,pepeportela/edx-platform,DNFcode/edx-platform,franosincic/edx-platform,kamalx/edx-platform,vismartltd/edx-platform,olexiim/edx-platform,marcore/edx-platform,peterm-itr/edx-platform,mahendra-r/edx-platform,ahmadiga/min_edx,caesar2164/edx-platform,torchingloom/edx-platform,SravanthiSinha/edx-platform,xuxiao19910803/edx,ampax/edx-platform-backup,ampax/edx-platform-backup,vikas1885/test1,ubc/edx-platform,praveen-pal/edx-platform,kmoocdev2/edx-platform,EduPepperPD/pepper2013,eduNEXT/edunext-platform,DefyVentures/edx-platform,chand3040/cloud_that,tiagochiavericosta/edx-platform,SivilTaram/edx-platform,jjmiranda/edx-platform,pdehaye/theming-edx-platform,WatanabeYasumasa/edx-platform,10clouds/edx-platform,pomegranited/edx-platform,jzoldak/edx-platform,naresh21/synergetics-edx-platform,vasyarv/edx-platform,MakeHer/edx-platform,eduNEXT/edunext-platform,WatanabeYasumasa/edx-platform,shubhdev/edxOnBaadal,mcgachey/edx-platform,sameetb-cuelogic/edx-platform-test,inares/edx-platform,vismartltd/edx-platform,doganov/edx-platform,adoosii/edx-platform,jelugbo/tundex,nagyistoce/edx-platform,shubhdev/edx-platform,xingyepei/edx-platform,xinjiguaike/edx-platform,ESOedX/edx-platform,kalebhartje/schoolboost,jjmiranda/edx-platform,cpennington/edx-platform,pelikanchik/edx-platform,chudaol/edx-platform,jswope00/griffinx,Shrhawk/edx-platform,sudheerchintala/LearnEraPlatForm,J861449197/edx-platform,torchingloom/edx-platform,Edraak/edraak-platform,pabloborrego93/edx-platform,beacloudgenius/edx-platform,jamesblunt/edx-platform,bdero/edx-platform,hkawasaki/kawasaki-aio8-0,alexthered/kienhoc-platform,bdero/edx-platform,jazkarta/edx-platform-for-isc,syjeon/new_edx,4eek/edx-platform,itsjeyd/edx-platform,praveen-pal/edx-platform,Stanford-Online/edx-platform,BehavioralInsightsTeam/edx-platform,kmoocdev2/edx-platform,unicri/edx-platform,Unow/edx-platform,CourseTalk/edx-platform,ferabra/edx-platform,Endika/edx-platform,morenopc/edx-platform,inares/edx-platform,ferabra/edx-platform,wwj718/ANALYSE,praveen-pal/edx-platform,dcosentino/edx-platform,shubhdev/edx-platform,tiagochiavericosta/edx-platform,beacloudgenius/edx-platform,SravanthiSinha/edx-platform,nanolearningllc/edx-platform-cypress-2,Lektorium-LLC/edx-platform,apigee/edx-platform,adoosii/edx-platform,vikas1885/test1,edx/edx-platform,peterm-itr/edx-platform,LICEF/edx-platform,ampax/edx-platform,waheedahmed/edx-platform,defance/edx-platform,zerobatu/edx-platform,motion2015/edx-platform,hkawasaki/kawasaki-aio8-2,ferabra/edx-platform,miptliot/edx-platform,leansoft/edx-platform,hkawasaki/kawasaki-aio8-2,xinjiguaike/edx-platform,rhndg/openedx,jbassen/edx-platform,jswope00/griffinx,zhenzhai/edx-platform,xinjiguaike/edx-platform,mushtaqak/edx-platform,inares/edx-platform,mtlchun/edx,shubhdev/openedx,halvertoluke/edx-platform,shabab12/edx-platform,ZLLab-Mooc/edx-platform,eestay/edx-platform,jazztpt/edx-platform,jolyonb/edx-platform,kamalx/edx-platform,sudheerchintala/LearnEraPlatForm,openfun/edx-platform,jswope00/griffinx,cognitiveclass/edx-platform,nanolearning/edx-platform,rhndg/openedx,syjeon/new_edx,chudaol/edx-platform,fly19890211/edx-platform,nikolas/edx-platform,auferack08/edx-platform,openfun/edx-platform,iivic/BoiseStateX,cyanna/edx-platform,IndonesiaX/edx-platform,analyseuc3m/ANALYSE-v1,sudheerchintala/LearnEraPlatForm,eestay/edx-platform,morenopc/edx-platform,don-github/edx-platform,rationalAgent/edx-platform-custom,cecep-edu/edx-platform,shurihell/testasia,ubc/edx-platform,IONISx/edx-platform,tanmaykm/edx-platform,leansoft/edx-platform,unicri/edx-platform,unicri/edx-platform,arifsetiawan/edx-platform,bitifirefly/edx-platform,EduPepperPD/pepper2013,devs1991/test_edx_docmode,zofuthan/edx-platform,unicri/edx-platform,procangroup/edx-platform,nttks/edx-platform,olexiim/edx-platform,shashank971/edx-platform,romain-li/edx-platform,Edraak/edraak-platform,EDUlib/edx-platform,Unow/edx-platform,AkA84/edx-platform,miptliot/edx-platform,prarthitm/edxplatform,SivilTaram/edx-platform,benpatterson/edx-platform,ZLLab-Mooc/edx-platform,zadgroup/edx-platform,kmoocdev2/edx-platform,gsehub/edx-platform,solashirai/edx-platform,ovnicraft/edx-platform,jazkarta/edx-platform,jzoldak/edx-platform,mjg2203/edx-platform-seas,alu042/edx-platform,dsajkl/123,UOMx/edx-platform,alu042/edx-platform,beacloudgenius/edx-platform,deepsrijit1105/edx-platform,mitocw/edx-platform,ak2703/edx-platform,mahendra-r/edx-platform,shashank971/edx-platform,pepeportela/edx-platform,jbzdak/edx-platform,EDUlib/edx-platform,chauhanhardik/populo_2,beni55/edx-platform,apigee/edx-platform,adoosii/edx-platform,shubhdev/edxOnBaadal,cselis86/edx-platform,Stanford-Online/edx-platform,xinjiguaike/edx-platform,abdoosh00/edraak,shashank971/edx-platform,Lektorium-LLC/edx-platform,antonve/s4-project-mooc,shashank971/edx-platform,zubair-arbi/edx-platform,Stanford-Online/edx-platform,miptliot/edx-platform,polimediaupv/edx-platform,iivic/BoiseStateX,solashirai/edx-platform,alexthered/kienhoc-platform,J861449197/edx-platform,Livit/Livit.Learn.EdX,SravanthiSinha/edx-platform,gymnasium/edx-platform,zofuthan/edx-platform,BehavioralInsightsTeam/edx-platform,RPI-OPENEDX/edx-platform,playm2mboy/edx-platform,ahmadiga/min_edx,motion2015/a3,fly19890211/edx-platform,bigdatauniversity/edx-platform,solashirai/edx-platform,J861449197/edx-platform,EduPepperPDTesting/pepper2013-testing,mitocw/edx-platform,dkarakats/edx-platform,nikolas/edx-platform,eduNEXT/edx-platform,jzoldak/edx-platform,xingyepei/edx-platform,alu042/edx-platform,knehez/edx-platform,jjmiranda/edx-platform,cselis86/edx-platform,nanolearning/edx-platform,mahendra-r/edx-platform,SivilTaram/edx-platform,etzhou/edx-platform,hamzehd/edx-platform,wwj718/ANALYSE,sameetb-cuelogic/edx-platform-test,cyanna/edx-platform,valtech-mooc/edx-platform,dsajkl/123,LearnEra/LearnEraPlaftform,knehez/edx-platform,olexiim/edx-platform,chauhanhardik/populo_2,utecuy/edx-platform,eemirtekin/edx-platform,jruiperezv/ANALYSE,ahmadio/edx-platform,xuxiao19910803/edx-platform,motion2015/edx-platform,TsinghuaX/edx-platform,UOMx/edx-platform,pku9104038/edx-platform,nanolearningllc/edx-platform-cypress-2,ahmedaljazzar/edx-platform,ak2703/edx-platform,Softmotions/edx-platform,jonathan-beard/edx-platform,halvertoluke/edx-platform,martynovp/edx-platform,kamalx/edx-platform,edx-solutions/edx-platform,angelapper/edx-platform,Edraak/edx-platform,utecuy/edx-platform,devs1991/test_edx_docmode,jelugbo/tundex,don-github/edx-platform,ampax/edx-platform,yokose-ks/edx-platform,4eek/edx-platform,kmoocdev2/edx-platform,rismalrv/edx-platform,RPI-OPENEDX/edx-platform,simbs/edx-platform,IONISx/edx-platform,abdoosh00/edx-rtl-final,franosincic/edx-platform,zubair-arbi/edx-platform,vasyarv/edx-platform,playm2mboy/edx-platform,arifsetiawan/edx-platform,valtech-mooc/edx-platform,doganov/edx-platform,mushtaqak/edx-platform,motion2015/edx-platform,mushtaqak/edx-platform,analyseuc3m/ANALYSE-v1,ferabra/edx-platform,prarthitm/edxplatform,MSOpenTech/edx-platform,BehavioralInsightsTeam/edx-platform,arbrandes/edx-platform,synergeticsedx/deployment-wipro,vasyarv/edx-platform,morpheby/levelup-by,jamesblunt/edx-platform,y12uc231/edx-platform,torchingloom/edx-platform,Ayub-Khan/edx-platform,jzoldak/edx-platform,jazkarta/edx-platform,DNFcode/edx-platform,vasyarv/edx-platform,EduPepperPD/pepper2013,atsolakid/edx-platform,franosincic/edx-platform,naresh21/synergetics-edx-platform,naresh21/synergetics-edx-platform,kalebhartje/schoolboost,zubair-arbi/edx-platform,devs1991/test_edx_docmode,Ayub-Khan/edx-platform,IITBinterns13/edx-platform-dev,Lektorium-LLC/edx-platform,kxliugang/edx-platform,chand3040/cloud_that,hkawasaki/kawasaki-aio8-0,etzhou/edx-platform,Lektorium-LLC/edx-platform,stvstnfrd/edx-platform,ahmedaljazzar/edx-platform,itsjeyd/edx-platform,shubhdev/openedx,jbzdak/edx-platform,hmcmooc/muddx-platform,xinjiguaike/edx-platform,B-MOOC/edx-platform,rhndg/openedx,shurihell/testasia,chudaol/edx-platform,motion2015/a3,nanolearningllc/edx-platform-cypress,defance/edx-platform,waheedahmed/edx-platform,wwj718/edx-platform,syjeon/new_edx,bdero/edx-platform,devs1991/test_edx_docmode,jruiperezv/ANALYSE,eestay/edx-platform,doismellburning/edx-platform,mbareta/edx-platform-ft,MakeHer/edx-platform,caesar2164/edx-platform,tiagochiavericosta/edx-platform,TsinghuaX/edx-platform,zadgroup/edx-platform,romain-li/edx-platform,JCBarahona/edX,zofuthan/edx-platform,edry/edx-platform,pdehaye/theming-edx-platform,vismartltd/edx-platform,MSOpenTech/edx-platform,shubhdev/openedx,rationalAgent/edx-platform-custom,DNFcode/edx-platform,pabloborrego93/edx-platform,cyanna/edx-platform,MSOpenTech/edx-platform,a-parhom/edx-platform,lduarte1991/edx-platform,RPI-OPENEDX/edx-platform,SravanthiSinha/edx-platform,kamalx/edx-platform,kxliugang/edx-platform,bitifirefly/edx-platform,MakeHer/edx-platform,valtech-mooc/edx-platform,caesar2164/edx-platform,Endika/edx-platform,EduPepperPD/pepper2013,kursitet/edx-platform,jamiefolsom/edx-platform,don-github/edx-platform,sameetb-cuelogic/edx-platform-test,yokose-ks/edx-platform,nttks/jenkins-test,jjmiranda/edx-platform,halvertoluke/edx-platform,CourseTalk/edx-platform,kalebhartje/schoolboost,wwj718/edx-platform,pomegranited/edx-platform,wwj718/edx-platform,Semi-global/edx-platform,etzhou/edx-platform,proversity-org/edx-platform,syjeon/new_edx,zadgroup/edx-platform,adoosii/edx-platform,xuxiao19910803/edx-platform,procangroup/edx-platform,jbassen/edx-platform,nanolearningllc/edx-platform-cypress,eemirtekin/edx-platform,kamalx/edx-platform,doismellburning/edx-platform,J861449197/edx-platform,nagyistoce/edx-platform,mjirayu/sit_academy,lduarte1991/edx-platform,pdehaye/theming-edx-platform,mtlchun/edx,Semi-global/edx-platform,ampax/edx-platform-backup,rismalrv/edx-platform,kxliugang/edx-platform,nagyistoce/edx-platform,mushtaqak/edx-platform,4eek/edx-platform,olexiim/edx-platform,alexthered/kienhoc-platform,dcosentino/edx-platform,JCBarahona/edX,ampax/edx-platform-backup,hamzehd/edx-platform,vikas1885/test1,marcore/edx-platform,beni55/edx-platform,motion2015/a3,halvertoluke/edx-platform,TeachAtTUM/edx-platform,torchingloom/edx-platform,antoviaque/edx-platform,RPI-OPENEDX/edx-platform,pelikanchik/edx-platform,hkawasaki/kawasaki-aio8-2,halvertoluke/edx-platform,zubair-arbi/edx-platform,cselis86/edx-platform,J861449197/edx-platform,longmen21/edx-platform,jelugbo/tundex,JioEducation/edx-platform,dcosentino/edx-platform,franosincic/edx-platform,UXE/local-edx,ferabra/edx-platform,doismellburning/edx-platform,cecep-edu/edx-platform,shashank971/edx-platform,IndonesiaX/edx-platform,ahmadio/edx-platform,cecep-edu/edx-platform,knehez/edx-platform,beni55/edx-platform,cyanna/edx-platform,OmarIthawi/edx-platform,mbareta/edx-platform-ft,mcgachey/edx-platform,LICEF/edx-platform,gymnasium/edx-platform,Livit/Livit.Learn.EdX,jswope00/GAI,jazztpt/edx-platform,amir-qayyum-khan/edx-platform,don-github/edx-platform,PepperPD/edx-pepper-platform,carsongee/edx-platform,abdoosh00/edx-rtl-final,marcore/edx-platform,angelapper/edx-platform,rhndg/openedx,yokose-ks/edx-platform,JioEducation/edx-platform,carsongee/edx-platform,chauhanhardik/populo,dsajkl/reqiop,simbs/edx-platform,vikas1885/test1,appliedx/edx-platform,Edraak/edx-platform,zubair-arbi/edx-platform,abdoosh00/edraak,B-MOOC/edx-platform,JCBarahona/edX,nttks/jenkins-test,DefyVentures/edx-platform,kursitet/edx-platform,dsajkl/123,vasyarv/edx-platform,Softmotions/edx-platform,EduPepperPD/pepper2013,Edraak/circleci-edx-platform,beni55/edx-platform,polimediaupv/edx-platform,jazztpt/edx-platform,openfun/edx-platform,xuxiao19910803/edx-platform,morpheby/levelup-by,waheedahmed/edx-platform,benpatterson/edx-platform,bigdatauniversity/edx-platform,shubhdev/edxOnBaadal,morpheby/levelup-by,raccoongang/edx-platform,shurihell/testasia,MakeHer/edx-platform,carsongee/edx-platform,shubhdev/openedx,Kalyzee/edx-platform,etzhou/edx-platform,jolyonb/edx-platform,mjirayu/sit_academy,ubc/edx-platform,louyihua/edx-platform,Edraak/edraak-platform,edx/edx-platform,SivilTaram/edx-platform,beacloudgenius/edx-platform,Livit/Livit.Learn.EdX,rismalrv/edx-platform,kmoocdev/edx-platform,edry/edx-platform,mjg2203/edx-platform-seas,jswope00/GAI,yokose-ks/edx-platform,pomegranited/edx-platform,TeachAtTUM/edx-platform,xuxiao19910803/edx,waheedahmed/edx-platform,fly19890211/edx-platform,Softmotions/edx-platform,chrisndodge/edx-platform,chudaol/edx-platform,appsembler/edx-platform,jonathan-beard/edx-platform,IONISx/edx-platform,philanthropy-u/edx-platform,pepeportela/edx-platform,Livit/Livit.Learn.EdX,Shrhawk/edx-platform,ampax/edx-platform-backup,ampax/edx-platform,jamiefolsom/edx-platform,Shrhawk/edx-platform,eduNEXT/edx-platform,zerobatu/edx-platform,andyzsf/edx,ESOedX/edx-platform,jonathan-beard/edx-platform,amir-qayyum-khan/edx-platform,appsembler/edx-platform,simbs/edx-platform,teltek/edx-platform,bigdatauniversity/edx-platform,raccoongang/edx-platform,nanolearningllc/edx-platform-cypress,teltek/edx-platform,ahmadio/edx-platform,martynovp/edx-platform,praveen-pal/edx-platform,Edraak/edx-platform,ESOedX/edx-platform,chudaol/edx-platform,CredoReference/edx-platform,inares/edx-platform,jazkarta/edx-platform-for-isc,Stanford-Online/edx-platform,hkawasaki/kawasaki-aio8-1,procangroup/edx-platform,devs1991/test_edx_docmode,Semi-global/edx-platform,arbrandes/edx-platform,prarthitm/edxplatform,dsajkl/reqiop,martynovp/edx-platform,arifsetiawan/edx-platform,pelikanchik/edx-platform,pku9104038/edx-platform,vikas1885/test1,y12uc231/edx-platform,wwj718/ANALYSE,jbassen/edx-platform,shubhdev/edx-platform,AkA84/edx-platform,JCBarahona/edX,analyseuc3m/ANALYSE-v1,IITBinterns13/edx-platform-dev,IONISx/edx-platform,Edraak/edx-platform,polimediaupv/edx-platform,dkarakats/edx-platform,atsolakid/edx-platform,OmarIthawi/edx-platform,rhndg/openedx,nagyistoce/edx-platform,philanthropy-u/edx-platform,jelugbo/tundex,Kalyzee/edx-platform,analyseuc3m/ANALYSE-v1,doganov/edx-platform,hamzehd/edx-platform,a-parhom/edx-platform,TsinghuaX/edx-platform,martynovp/edx-platform,antonve/s4-project-mooc,arifsetiawan/edx-platform,UXE/local-edx,proversity-org/edx-platform,zhenzhai/edx-platform,4eek/edx-platform,eestay/edx-platform,abdoosh00/edx-rtl-final,hastexo/edx-platform,dsajkl/123,Softmotions/edx-platform,hamzehd/edx-platform,doganov/edx-platform,shubhdev/edxOnBaadal,zadgroup/edx-platform,edx-solutions/edx-platform,philanthropy-u/edx-platform,synergeticsedx/deployment-wipro,dkarakats/edx-platform,eestay/edx-platform,jswope00/griffinx,lduarte1991/edx-platform,arifsetiawan/edx-platform,auferack08/edx-platform |
f83fa635769bd2fe72c55d87e6900fe66268a9d4 | behind/rungame.py | behind/rungame.py | import sge
from . import config
from . import game
from . import player
from . import rooms
def initialize(config):
"""Load assets and initialize the game objects"""
sge.game = game.Game(
width=config.GAME_WINDOW_WIDTH,
height=config.GAME_WINDOW_HEIGHT,
fps=config.GAME_FPS,
window_text=config.GAME_WINDOW_TITLE)
player_obj = player.Player(
config.PLAYER_SPRITES,
sge.game.width / 2,
sge.game.height / 2)
sge.game.start_room = rooms.ScrollableLevel(
player=player_obj, width=10000, ruler=True)
sge.game.mouse_visible = False
def run():
"""Start the game running"""
sge.game.start()
if __name__ == '__main__':
initialize(config)
run()
| import sge
from . import config
from . import game
from . import player
from . import rooms
def initialize(config):
"""Load assets and initialize the game objects"""
sge.game = game.Game(
width=config.GAME_WINDOW_WIDTH,
height=config.GAME_WINDOW_HEIGHT,
fps=config.GAME_FPS,
window_text=config.GAME_WINDOW_TITLE)
player_obj = player.Player(
config.PLAYER_SPRITES,
sge.game.width / 2,
sge.game.height / 2)
sge.game.start_room = rooms.ScrollableLevel(
player=player_obj, width=2000, ruler=True)
sge.game.mouse_visible = False
def run():
"""Start the game running"""
sge.game.start()
if __name__ == '__main__':
initialize(config)
run()
| Make test room shorter for ease of testing | Startup: Make test room shorter for ease of testing
| Python | mit | jrrickerson/pyweek24 |
e289d6ec6b1e31ca87bc6675caeb62f6e04cea10 | odo/run_migrations.py | odo/run_migrations.py | import os
import re
migration_filter = re.compile('migration_[0-9]{14}.*')
def extract_version(name):
try:
version = int(name.split("_")[1])
return version
except ValueError:
return None
def get_migration_versions(path):
migration_files = [filename for filename in os.listdir(path) if migration_filter.match(filename)]
versions = [extract_version(filename) for filename in migration_files]
return sorted(versions)
| import os
import re
migration_filter = re.compile('migration_[0-9]{14}.*')
def extract_version(name):
try:
version = int(name.split("_")[1])
return version
#TODO make this more accurate
except ValueError:
return None
def get_migration_versions(path):
migration_files = [filename for filename in os.listdir(path) if migration_filter.match(filename)]
versions = [extract_version(filename) for filename in migration_files]
return sorted(versions)
| Add todo item for handling extract_version errors better | Add todo item for handling extract_version errors better
| Python | mit | ustudio/armus,ustudio/armus |
1541af9052d9c12fb3d23832838fce69fcc02761 | pywal/export_colors.py | pywal/export_colors.py | """
Export colors in various formats.
"""
import os
import pathlib
from pywal.settings import CACHE_DIR, TEMPLATE_DIR
from pywal import util
def template(colors, input_file):
"""Read template file, substitute markers and
save the file elsewhere."""
template_file = pathlib.Path(TEMPLATE_DIR).joinpath(input_file)
export_file = pathlib.Path(CACHE_DIR).joinpath(input_file)
# Import the template.
with open(template_file) as file:
template_data = file.readlines()
# Format the markers.
template_data = "".join(template_data).format(**colors)
# Export the template.
with open(export_file, "w") as file:
file.write(template_data)
def export_all_templates(colors):
"""Export all template files."""
# Merge both dicts.
colors["colors"].update(colors["special"])
# pylint: disable=W0106
[template(colors["colors"], file.name)
for file in os.scandir(TEMPLATE_DIR)]
| """
Export colors in various formats.
"""
import os
import pathlib
from pywal.settings import CACHE_DIR, TEMPLATE_DIR
from pywal import util
def template(colors, input_file):
"""Read template file, substitute markers and
save the file elsewhere."""
template_file = pathlib.Path(TEMPLATE_DIR).joinpath(input_file)
export_file = pathlib.Path(CACHE_DIR).joinpath(input_file)
# Import the template.
with open(template_file) as file:
template_data = file.readlines()
# Format the markers.
template_data = "".join(template_data).format(**colors)
# Export the template.
with open(export_file, "w") as file:
file.write(template_data)
def export_all_templates(colors):
"""Export all template files."""
# Exclude these templates from the loop.
# The excluded templates need color
# conversion or other intervention.
exclude = ["colors-putty.reg"]
# Merge both dicts.
colors["colors"].update(colors["special"])
# Convert colors to other format.
colors_rgb = {k: util.hex_to_rgb(v) for k, v in colors["colors"].items()}
# pylint: disable=W0106
[template(colors["colors"], file.name)
for file in os.scandir(TEMPLATE_DIR)
if file not in exclude]
# Call 'putty' manually since it needs RGB colors.
template(colors_rgb, "colors-putty.reg")
| Convert colors to rgb for putty. | colors: Convert colors to rgb for putty.
| Python | mit | dylanaraps/pywal,dylanaraps/pywal,dylanaraps/pywal |
6fa924d73df148ad3cfe41b01e277d944071e4dd | equajson.py | equajson.py | #! /usr/bin/env python
from __future__ import print_function
import os
import sys
import json
def pretty_print(equation):
print(equation["description"]["terse"])
eqn_dict = equation["unicode-pretty-print"]
equation_text = eqn_dict["multiline"]
for line in equation_text:
print(line)
if "parameters" in eqn_dict:
print("where:")
for param, param_dict in eqn_dict["parameters"].iteritems():
label = param_dict["label"]
print(param,'=',label)
def main(query):
here = sys.path[0]
json_dir = os.path.join(here, 'equajson')
for filename in os.listdir(json_dir):
if not filename.endswith('.json'):
continue
filepath = os.path.join(json_dir, filename)
with open(filepath) as json_file:
try:
equation = json.load(json_file)
except ValueError:
sys.stderr.write("Invalid JSON for file: `{}'\n".format(json_file.name))
continue # try the next file
description = equation["description"]["verbose"]
if query.lower() in description.lower():
pretty_print(equation)
if __name__ == '__main__':
num_args = len(sys.argv) - 1
if num_args != 1:
sys.stderr.write("Usage: python "+sys.argv[0]+" query"+'\n')
sys.exit(1)
main(sys.argv[1])
| #! /usr/bin/env python
from __future__ import print_function
import os
import sys
import json
def pretty_print(equation):
print(equation["description"]["terse"])
eqn_dict = equation["unicode-pretty-print"]
equation_text = eqn_dict["multiline"]
for line in equation_text:
print(line)
if "parameters" in eqn_dict:
print("where:")
for param, param_dict in eqn_dict["parameters"].iteritems():
label = param_dict["label"]
print(param,'=',label)
def main(query):
here = sys.path[0]
json_dir = os.path.join(here, 'equajson')
for filename in os.listdir(json_dir):
if not filename.endswith('.json'):
continue
filepath = os.path.join(json_dir, filename)
with open(filepath) as json_file:
try:
equation = json.load(json_file)
except ValueError:
sys.stderr.write("Invalid JSON for file: `{}'\n".format(json_file.name))
continue # try the next file
description = equation["description"]["verbose"]
if query.lower() in description.lower():
pretty_print(equation)
print()
if __name__ == '__main__':
num_args = len(sys.argv) - 1
if num_args != 1:
sys.stderr.write("Usage: python "+sys.argv[0]+" query"+'\n')
sys.exit(1)
main(sys.argv[1])
| Add a line between outputs. | Add a line between outputs.
| Python | mit | nbeaver/equajson |
8fb15f3a072d516e477449c2b751226494ee14c5 | perfkitbenchmarker/benchmarks/__init__.py | perfkitbenchmarker/benchmarks/__init__.py | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Contains all benchmark imports and a list of benchmarks."""
import pkgutil
def _LoadModules():
result = []
for importer, modname, ispkg in pkgutil.iter_modules(__path__):
result.append(importer.find_module(modname).load_module(modname))
return result
BENCHMARKS = _LoadModules()
| # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Contains benchmark imports and a list of benchmarks.
All modules within this package are considered benchmarks, and are loaded
dynamically. Add non-benchmark code to other packages.
"""
import importlib
import pkgutil
def _LoadModulesForPath(path, package_prefix=None):
"""Load all modules on 'path', with prefix 'package_prefix'.
Example usage:
_LoadModulesForPath(__path__, __name__)
Args:
path: Path containing python modules.
package_prefix: prefix (e.g., package name) to prefix all modules.
'path' and 'package_prefix' will be joined with a '.'.
Yields:
Imported modules.
"""
prefix = ''
if package_prefix:
prefix = package_prefix + '.'
module_iter = pkgutil.iter_modules(path, prefix=prefix)
for _, modname, ispkg in module_iter:
if not ispkg:
yield importlib.import_module(modname)
def _LoadBenchmarks():
return list(_LoadModulesForPath(__path__, __name__))
BENCHMARKS = _LoadBenchmarks()
| Fix a bug in dynamic benchmark loading. | Fix a bug in dynamic benchmark loading.
perfkitbenchmarker/benchmarks/__init__.py used ImpImporter.load_module
to import benchmarks, which caused an error when they were later
imported directly by an import statement. Switched to 'importlib' to resolve.
| Python | apache-2.0 | GoogleCloudPlatform/PerfKitBenchmarker,lleszczu/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,msurovcak/PerfKitBenchmarker,tvansteenburgh/PerfKitBenchmarker,ksasi/PerfKitBenchmarker,juju-solutions/PerfKitBenchmarker,gablg1/PerfKitBenchmarker,juju-solutions/PerfKitBenchmarker,msurovcak/PerfKitBenchmarker,syed/PerfKitBenchmarker,askdaddy/PerfKitBenchmarker,ehankland/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,ksasi/PerfKitBenchmarker,askdaddy/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,tvansteenburgh/PerfKitBenchmarker,lleszczu/PerfKitBenchmarker,kivio/PerfKitBenchmarker,syed/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,ehankland/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,kivio/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,emaeliena/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,emaeliena/PerfKitBenchmarker,gablg1/PerfKitBenchmarker |
7b1a5cf088aa5842beffd25719ea0a1fa029345d | openacademy/model/openacademy_session.py | openacademy/model/openacademy_session.py | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
instructor_id = fields.Many2one('res.partner', string="Instructor")
course_id = fields.Many2one('openacademy.course',
ondelete='cascade', string="Course", required=True)
attendee_ids = fields.Many2many('res.partner', string="Attendees")
| # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
instructor_id = fields.Many2one('res.partner', string="Instructor",
domain=['|', ('instructor', '=', True),
('category_id.name', 'ilike', "Teacher")])
course_id = fields.Many2one('openacademy.course',
ondelete='cascade', string="Course",
required=True)
attendee_ids = fields.Many2many('res.partner', string="Attendees")
| Add domain or and ilike | [REF] openacademy: Add domain or and ilike
| Python | apache-2.0 | GavyMG/openacademy-proyect |
63f06147303b305554e0ba1e514305a4c93488f4 | neronet/nerotest.py | neronet/nerotest.py | # dmntest.py
from .core import Daemon
class TestDmn(Daemon):
pass
def main():
td = TestDmn('testd')
td.start() | # dmntest.py
#from .core import Daemon
#class TestDmn(Daemon):
# pass
#def main():
# td = TestDmn('testd')
# td.start() | Work on daemons and TCP servers. | Work on daemons and TCP servers.
| Python | mit | smarisa/sdpt11,smarisa/neronet,smarisa/neronet,smarisa/sdpt11 |
Subsets and Splits