commit
stringlengths 40
40
| subject
stringlengths 4
1.73k
| repos
stringlengths 5
127k
| old_file
stringlengths 2
751
| new_file
stringlengths 2
751
| new_contents
stringlengths 1
8.98k
| old_contents
stringlengths 0
6.59k
| license
stringclasses 13
values | lang
stringclasses 23
values |
---|---|---|---|---|---|---|---|---|
f2864289f02a6e221d6fafbb1885d20aa26417fd | Add default conftest | buddly27/champollion | test/unit/conftest.py | test/unit/conftest.py | # :coding: utf-8
import os
import shutil
import tempfile
import uuid
import pytest
@pytest.fixture()
def unique_name():
"""Return a unique name."""
return "unique-{0}".format(uuid.uuid4())
@pytest.fixture()
def temporary_file(request):
"""Return a temporary file path."""
file_handle, path = tempfile.mkstemp()
os.close(file_handle)
def cleanup():
"""Remove temporary file."""
try:
os.remove(path)
except OSError:
pass
request.addfinalizer(cleanup)
return path
@pytest.fixture()
def temporary_directory(request):
"""Return a temporary directory path."""
path = tempfile.mkdtemp()
def cleanup():
"""Remove temporary directory."""
shutil.rmtree(path)
request.addfinalizer(cleanup)
return path
@pytest.fixture()
def code_folder():
return os.path.join(os.path.dirname(__file__), "example")
@pytest.fixture()
def docs_folder(temporary_directory):
path = os.path.join(temporary_directory, "docs")
os.makedirs(path)
# Create minimal conf.py file
conf_file = os.path.join(path, "conf.py")
with open(conf_file, "w") as f:
f.write(
"# :coding: utf-8\n"
"extensions=['sphinxcontrib.es6']\n"
"source_suffix = '.rst'\n"
"master_doc = 'index'\n"
"author = u'Jeremy Retailleau'\n"
"exclude_patterns = ['Thumbs.db', '.DS_Store']\n"
"js_source='./example'"
)
return path
| apache-2.0 | Python |
|
1dba0fb24f98bb09bd0c918439c0457c603e1386 | Create ullman.py | mryalamanchi/Ullman-Foundations-of-CS | ullman.py | ullman.py | import requests
from multiprocessing import Pool
import time
startURL = 'http://i.stanford.edu/~ullman/focs/ch'
extension = '.pdf'
savePath = '' #enter the path for the pdfs to be stored on your system
chapters = range(1,15) #chapters 1-14
def chapterStringManipulate(chapter):
if chapter < 10 :
download('0{}'.format(chapter))
else :
download('{}'.format(chapter))
return None
def download(chapter):
url = '{}{}{}'.format(startURL, chapter, extension)
r = requests.get(url, stream=True)
path = '{}{}{}'.format(savePath, chapter, extension)
with open(path, 'wb') as fd:
for chunk in r.iter_content(2048):
fd.write(chunk)
print '{} downloaded'.format(chapter)
return None
if __name__ == '__main__':
pool = Pool(processes=len(chapters))
results = pool.map(chapterStringManipulate, chapters)
| mit | Python |
|
9d3925c4809791d2366bc1d6fd6b04bc8a710c9b | add fmt to repo | brentp/toolshed,pombredanne/toolshed | toolshed/fmt.py | toolshed/fmt.py | import re
def fmt2header(fmt):
"""
Turn a python format string into a usable header:
>>> fmt = "{chrom}\t{start:d}\t{end:d}\t{pvalue:.4g}"
>>> fmt2header(fmt)
'chrom start end pvalue'
>>> fmt.format(chrom='chr1', start=1234, end=3456, pvalue=0.01232432)
'chr1 1234 3456 0.01232'
"""
return re.sub("{|(?:\:.+?)?}", "", fmt)
if __name__ == "__main__":
import doctest
print(doctest.testmod())
| bsd-2-clause | Python |
|
dd9b683b24cea02c93a6e23a163065c0f26f6a68 | Test manager | stanfordnmbl/osim-rl,vzhuang/osim-rl | tests/test.manager.py | tests/test.manager.py | import opensim
model_path = "../osim/models/arm2dof6musc.osim"
model = opensim.Model(model_path)
model.setUseVisualizer(True)
state = model.initSystem()
manager = opensim.Manager(model)
muscleSet = model.getMuscles()
stepsize = 0.01
for i in range(10):
for j in range(muscleSet.getSize()):
# muscleSet.get(j).setActivation(state, 1.0)
muscleSet.get(j).setExcitation(state, 1.0)
t = state.getTime()
manager.setInitialTime(stepsize * i)
manager.setFinalTime(stepsize * (i + 1))
manager.integrate(state)
model.realizeDynamics(state)
print("%f %f" % (t,muscleSet.get(0).getActivation(state)))
| mit | Python |
|
5d18f7c7145bf8d5e7248392d644e521222929b8 | add tests for _extras | myint/rstcheck,myint/rstcheck | tests/test__extras.py | tests/test__extras.py | """Tests for ``_extras`` module."""
import pytest
from rstcheck import _compat, _extras
class TestInstallChecker:
"""Test ``is_installed_with_supported_version``."""
@staticmethod
@pytest.mark.skipif(_extras.SPHINX_INSTALLED, reason="Test for absence of sphinx.")
def test_false_on_missing_sphinx_package() -> None:
"""Test install-checker returns ``False`` when ``sphinx`` is missing."""
result = _extras.is_installed_with_supported_version("sphinx")
assert result is False
@staticmethod
@pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Test for presence of sphinx.")
def test_true_on_installed_sphinx_package() -> None:
"""Test install-checker returns ``True`` when ``sphinx`` is installed with good version."""
result = _extras.is_installed_with_supported_version("sphinx")
assert result is True
@staticmethod
@pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Test for presence of sphinx.")
def test_false_on_installed_sphinx_package_too_old(monkeypatch: pytest.MonkeyPatch) -> None:
"""Test install-checker returns ``False`` when ``sphinx`` is installed with bad version."""
monkeypatch.setattr(_compat, "metadata", lambda _: {"Version": "0.0"})
result = _extras.is_installed_with_supported_version("sphinx")
assert result is False
class TestInstallGuard:
"""Test ``install_guard``."""
@staticmethod
@pytest.mark.skipif(_extras.SPHINX_INSTALLED, reason="Test for absence of sphinx.")
def test_false_on_missing_sphinx_package() -> None:
"""Test install-guard raises exception when ``sphinx`` is missing."""
with pytest.raises(ModuleNotFoundError):
_extras.install_guard("sphinx") # act
@staticmethod
@pytest.mark.skipif(not _extras.SPHINX_INSTALLED, reason="Test for presence of sphinx.")
def test_true_on_installed_sphinx_package() -> None:
"""Test install-guard doesn't raise when ``sphinx`` is installed."""
_extras.install_guard("sphinx") # act
| mit | Python |
|
eb1c7d1c2bfaa063c98612d64bbe35dedf217143 | Add initial tests for alerter class | jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor | tests/test_alerter.py | tests/test_alerter.py | import unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(['a', 'b', 'c'], a.groups)
def test_times_always(self):
config_options = {'times_type': 'always'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(a.times_type, 'always')
self.assertEqual(a.time_info, [None, None])
def test_times_only(self):
config_options = {
'times_type': 'only',
'time_lower': '10:00',
'time_upper': '11:00'
}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(a.times_type, 'only')
self.assertEqual(a.time_info, [
datetime.time(10, 00), datetime.time(11, 00)
])
| bsd-3-clause | Python |
|
33658163b909073aae074b5b2cdae40a0e5c44e8 | Add unit tests for asyncio coroutines | overcastcloud/trollius,overcastcloud/trollius,overcastcloud/trollius | tests/test_asyncio.py | tests/test_asyncio.py | from trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" syntax cannot be used directly, because Python 2 should be able
# to execute this file (to raise SkipTest)
code = '''
@asyncio.coroutine
def asyncio_noop(value):
yield from []
return (value,)
@asyncio.coroutine
def asyncio_coroutine(coro, value):
res = yield from coro
return res + (value,)
'''
exec(code)
@trollius.coroutine
def trollius_noop(value):
yield From(None)
raise Return((value,))
@trollius.coroutine
def trollius_coroutine(coro, value):
res = yield trollius.From(coro)
raise trollius.Return(res + (value,))
class AsyncioTests(test_utils.TestCase):
def setUp(self):
policy = trollius.get_event_loop_policy()
self.loop = policy.new_event_loop()
self.set_event_loop(self.loop)
asyncio_policy = asyncio.get_event_loop_policy()
self.addCleanup(asyncio.set_event_loop_policy, asyncio_policy)
asyncio.set_event_loop_policy(policy)
def test_policy(self):
trollius.set_event_loop(self.loop)
self.assertIs(asyncio.get_event_loop(), self.loop)
def test_asyncio(self):
coro = asyncio_noop("asyncio")
res = self.loop.run_until_complete(coro)
self.assertEqual(res, ("asyncio",))
def test_asyncio_in_trollius(self):
coro1 = asyncio_noop(1)
coro2 = asyncio_coroutine(coro1, 2)
res = self.loop.run_until_complete(trollius_coroutine(coro2, 3))
self.assertEqual(res, (1, 2, 3))
def test_trollius_in_asyncio(self):
coro1 = trollius_noop(4)
coro2 = trollius_coroutine(coro1, 5)
res = self.loop.run_until_complete(asyncio_coroutine(coro2, 6))
self.assertEqual(res, (4, 5, 6))
if __name__ == '__main__':
unittest.main()
| apache-2.0 | Python |
|
72ff3bfcbfb9e4144d43ca03c77f0692cccd0fc2 | add small interface for DHT Adafruit lib (in rpi.py) | enavarro222/gsensors | gsensors/rpi.py | gsensors/rpi.py | #-*- coding:utf-8 -*-
""" Drivers for common sensors on a rPi
"""
import sys
import gevent
from gsensors import AutoUpdateValue
class DHTTemp(AutoUpdateValue):
def __init__(self, pin, stype="2302", name=None):
update_freq = 10 #seconds
super(DHTTemp, self).__init__(name=name, unit="°C", update_freq=update_freq)
import Adafruit_DHT
self.Adafruit_DHT = Adafruit_DHT #XXX:mv dans un module a part pour éviter import merdique ici
TYPES = {
'11': Adafruit_DHT.DHT11,
'22': Adafruit_DHT.DHT22,
'2302': Adafruit_DHT.AM2302
}
self.sensor = TYPES.get(stype, stype) #TODO: check stype
self.pin = pin
def update(self):
humidity, temperature = self.Adafruit_DHT.read_retry(self.sensor, self.pin)
self.value = temperature
def main():
sources = [
DHTTemp(18, "22"),
]
def change_callback(src):
print("%s: %s %s" % (src.name, src.value, src.unit))
# plug change callback
for src in sources:
src.on_change(change_callback)
for src in sources:
src.start()
gevent.wait()
if __name__ == '__main__':
sys.exit(main())
| agpl-3.0 | Python |
|
3bc341036730ab8e9fd5ac61e10556af028813e2 | Add migration -Remove dupes -Add index preventing dupe creation | TomBaxter/osf.io,icereval/osf.io,leb2dg/osf.io,felliott/osf.io,chrisseto/osf.io,aaxelb/osf.io,leb2dg/osf.io,binoculars/osf.io,leb2dg/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,caseyrollins/osf.io,felliott/osf.io,chennan47/osf.io,icereval/osf.io,crcresearch/osf.io,chennan47/osf.io,TomBaxter/osf.io,binoculars/osf.io,brianjgeiger/osf.io,sloria/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,cslzchen/osf.io,sloria/osf.io,caseyrollins/osf.io,mattclark/osf.io,aaxelb/osf.io,caneruguz/osf.io,crcresearch/osf.io,laurenrevere/osf.io,Johnetordoff/osf.io,pattisdr/osf.io,aaxelb/osf.io,erinspace/osf.io,caseyrollins/osf.io,cslzchen/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,chrisseto/osf.io,Johnetordoff/osf.io,icereval/osf.io,felliott/osf.io,pattisdr/osf.io,saradbowman/osf.io,aaxelb/osf.io,Johnetordoff/osf.io,HalcyonChimera/osf.io,chrisseto/osf.io,CenterForOpenScience/osf.io,adlius/osf.io,mattclark/osf.io,laurenrevere/osf.io,erinspace/osf.io,binoculars/osf.io,brianjgeiger/osf.io,mfraezz/osf.io,chrisseto/osf.io,TomBaxter/osf.io,adlius/osf.io,felliott/osf.io,baylee-d/osf.io,erinspace/osf.io,caneruguz/osf.io,cslzchen/osf.io,crcresearch/osf.io,saradbowman/osf.io,mfraezz/osf.io,pattisdr/osf.io,adlius/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,adlius/osf.io,baylee-d/osf.io,mattclark/osf.io,leb2dg/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,chennan47/osf.io,laurenrevere/osf.io,mfraezz/osf.io,sloria/osf.io,CenterForOpenScience/osf.io,caneruguz/osf.io | osf/migrations/0044_basefilenode_uniqueness_index.py | osf/migrations/0044_basefilenode_uniqueness_index.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.db import connection
from django.db import migrations
logger = logging.getLogger(__name__)
def remove_duplicate_filenodes(*args):
from osf.models.files import BaseFileNode
sql = """
SELECT id
FROM (SELECT
*,
LEAD(row, 1)
OVER () AS nextrow
FROM (SELECT
*,
ROW_NUMBER()
OVER (w) AS row
FROM (SELECT *
FROM osf_basefilenode
WHERE (node_id IS NULL OR name IS NULL OR parent_id IS NULL OR type IS NULL OR _path IS NULL) AND
type NOT IN ('osf.trashedfilenode', 'osf.trashedfile', 'osf.trashedfolder')) AS null_files
WINDOW w AS (
PARTITION BY node_id, name, parent_id, type, _path
ORDER BY id )) AS x) AS y
WHERE row > 1 OR nextrow > 1;
"""
visited = []
with connection.cursor() as cursor:
cursor.execute(sql)
dupes = BaseFileNode.objects.filter(id__in=[t[0] for t in cursor.fetchall()])
logger.info('\nFound {} dupes, merging and removing'.format(dupes.count()))
for dupe in dupes:
visited.append(dupe.id)
force = False
next_dupe = dupes.exclude(id__in=visited).filter(node_id=dupe.node_id, name=dupe.name, parent_id=dupe.parent_id, type=dupe.type, _path=dupe._path).first()
if dupe.node_id is None:
# Bad data, force-delete
force = True
if not next_dupe:
# Last one, don't delete
continue
if dupe.versions.count() > 1:
logger.warn('{} Expected 0 or 1 versions, got {}'.format(dupe.id, dupe.versions.count()))
# Don't modify versioned files
continue
for guid in list(dupe.guids.all()):
guid.referent = next_dupe
guid.save()
if force:
BaseFileNode.objects.filter(id=dupe.id).delete()
else:
dupe.delete()
with connection.cursor() as cursor:
logger.info('Validating clean-up success...')
cursor.execute(sql)
dupes = BaseFileNode.objects.filter(id__in=cursor.fetchall())
if dupes.exists():
logger.error('Dupes exist after migration, failing\n{}'.format(dupes.values_list('id', flat=True)))
logger.info('Indexing...')
def noop(*args):
pass
class Migration(migrations.Migration):
dependencies = [
('osf', '0043_set_share_title'),
]
operations = [
migrations.RunPython(remove_duplicate_filenodes, noop),
migrations.RunSQL(
[
"""
CREATE UNIQUE INDEX active_file_node_path_name_type_unique_index
ON public.osf_basefilenode (node_id, _path, name, type)
WHERE (type NOT IN ('osf.trashedfilenode', 'osf.trashedfile', 'osf.trashedfolder')
AND parent_id IS NULL);
"""
], [
"""
DROP INDEX IF EXISTS active_file_node_path_name_type_unique_index RESTRICT;
"""
]
)
]
| apache-2.0 | Python |
|
e322daa6d92a9dad8db9b8c9b6085aded90bef39 | add beta release script | mixpanel/mixpanel-iphone,mixpanel/mixpanel-iphone,mixpanel/mixpanel-iphone,mixpanel/mixpanel-iphone,mixpanel/mixpanel-iphone | scripts/release_beta.py | scripts/release_beta.py |
import argparse
import subprocess
parser = argparse.ArgumentParser(description='Release Mixpanel Objective-C SDK')
parser.add_argument('--old', help='old version number', action="store")
parser.add_argument('--new', help='new version number for the release', action="store")
args = parser.parse_args()
def bump_version():
replace_version('Mixpanel.podspec', args.old, args.new)
replace_version('Mixpanel/Mixpanel.m', args.old, args.new)
subprocess.call('git add Mixpanel.podspec', shell=True)
subprocess.call('git add Mixpanel/Mixpanel.m', shell=True)
subprocess.call('git commit -m "Version {}"'.format(args.new), shell=True)
subprocess.call('git push', shell=True)
def replace_version(file_name, old_version, new_version):
with open(file_name) as f:
file_str = f.read()
assert(old_version in file_str)
file_str = file_str.replace(old_version, new_version)
with open(file_name, "w") as f:
f.write(file_str)
def add_tag():
subprocess.call('git tag -a v{} -m "version {}"'.format(args.new, args.new), shell=True)
subprocess.call('git push origin --tags', shell=True)
def main():
bump_version()
add_tag()
print("Congratulations, done!")
if __name__ == '__main__':
main() | apache-2.0 | Python |
|
c783c26c6362cdd0702211552578a09f380e9dac | Add tags module. | kivhift/pu | src/pu/tags.py | src/pu/tags.py | #
# Copyright (c) 2013 Joshua Hughes <[email protected]>
#
import sys
class Tag(object):
_name = ''
def __init__(self, *a, **kw):
super(Tag, self).__init__()
self.content = list(a)
self.attributes = kw
def __str__(self):
name = self._name
content = ''.join(str(c) for c in self.content)
atts = ''.join(
' {}="{}"'.format(k, v) for k, v in self.attributes.iteritems())
if content:
return '<{0}{1}>{2}</{0}>'.format(name, atts, content)
else:
return '<{0}{1}/>'.format(name, atts)
def add(self, *content):
self.content.extend(content)
if 1 == len(content):
return content[0]
else:
return content
@staticmethod
def factory(name):
class NT(Tag): _name = name
NT.__name__ = name.replace('-', '_').replace('.', '_')
return NT.__name__, NT
@staticmethod
def vivify(tags, into = None):
if into is None:
into = sys.modules[__name__]
for tag in tags:
setattr(into, *Tag.factory(tag))
| mit | Python |
|
9c6130b5f9337b428f530cfae7036b7be2a9eea4 | test commit | usc-isi-i2/etk,usc-isi-i2/etk,usc-isi-i2/etk | etk2/DefaultDocumentSelector.py | etk2/DefaultDocumentSelector.py | import json
import jsonpath_rw
import re
from document import Document
class DefaultDocumentSelector(DocumentSelector):
def __init__(self):
pass
"""
A concrete implementation of DocumentSelector that supports commonly used methods for
selecting documents.
"""
"""
Args:
document ():
datasets (List[str]): test the "dataset" attribute in the doc contains any of the strings provided
url_patterns (List[str]): test the "url" of the doc matches any of the regexes using regex.search
website_patterns (List[str]): test the "website" of the doc contains any of the regexes using regex.search
json_paths (List[str]): test existence of any of the given JSONPaths in a document
json_paths_regex(List[str]): test that any of the values selected in 'json_paths' satisfy any of
the regexex provided using regex.search
Returns: True if the document satisfies all non None arguments.
Each of the arguments can be a list, in which case satisfaction means
that one of the elements in the list is satisfied, i.e., it is an AND of ORs
For efficiency, the class caches compiled representations of all regexes and json_paths given
that the same selectors will be used for consuming all documents in a stream.
"""
def select_document(self,
document: Document,
datasets: List[str] = None,
url_patterns: List[str] = None,
website_patterns: List[str] = None,
json_paths: List[str] = None,
json_paths_regex: List[str] = None) -> bool:
if (json_paths_regex is not None) and (json_paths is None):
# TODO: print out some error message here
if url_patterns is not None:
rw_url_patterns = map(lambda re: re.compile(), url_patterns)
if website_patterns is not None:
rw_website_patterns = map(lambda re: re.compile(), website_patterns)
if json_paths is not None:
rw_json_paths = map(lambda jsonpath_rw: jsonpath_rw.parse(), json_paths)
if json_paths_regex is not None:
rw_json_paths_regex = map(lambda re: re.compile(), json_paths_regex)
doc = Document.cdr_document
return False;
raise NotImplementedError
def check_datasets_condition(self, json_doc: dict, datasets: List[str]) -> bool:
raise NotImplementedError
def check_url_patterns_condition(self, json_doc: dict,
compiled_url_patterns: List[str]) -> bool:
raise NotImplementedError
def check_website_patterns_condition(self, json_doc: dict,
compiled_website_patterns: List[str]) -> bool:
raise NotImplementedError
def check_json_path_codition(self, json_doc: dict,
rw_json_paths: List[jsonpath_rw.jsonpath.Child],
compiled_json_paths_regex: List[str]) -> bool:
for json_path_expr in rw_json_paths:
json_path_values = [match.value for match in json_path_expr.find(json_doc)]
for
pass
raise NotImplementedError
| mit | Python |
|
e5f77ccc2f51fdcaa32c55b56f6b801b3ae2e0e2 | Add triggered oscilloscope example | pyacq/pyacq,pyacq/pyacq | example/pyaudio_triggerscope.py | example/pyaudio_triggerscope.py | """
Simple demonstration of streaming data from a PyAudio device to a QOscilloscope
viewer.
Both device and viewer nodes are created locally without a manager.
"""
from pyacq.devices.audio_pyaudio import PyAudio
from pyacq.viewers import QTriggeredOscilloscope
import pyqtgraph as pg
# Start Qt application
app = pg.mkQApp()
# Create PyAudio device node
dev = PyAudio()
# Print a list of available input devices (but ultimately we will just use the
# default device).
default_input = dev.default_input_device()
print("\nAvaliable devices:")
for device in dev.list_device_specs():
index = device['index']
star = "*" if index == default_input else " "
print(" %s %d: %s" % (star, index, device['name']))
# Configure PyAudio device with a single (default) input channel.
dev.configure(nb_channel=1, sample_rate=44100., input_device_index=default_input,
format='int16', chunksize=1024)
dev.output.configure(protocol='tcp', interface='127.0.0.1', transfertmode='plaindata')
dev.initialize()
# Create a triggered oscilloscope to display data.
viewer = QTriggeredOscilloscope()
viewer.configure(with_user_dialog = True)
# Connect audio stream to oscilloscope
viewer.input.connect(dev.output)
viewer.initialize()
viewer.show()
#viewer.params['decimation_method'] = 'min_max'
#viewer.by_channel_params['Signal0', 'gain'] = 0.001
viewer.trigger.params['threshold'] = 1.
viewer.trigger.params['debounce_mode'] = 'after-stable'
viewer.trigger.params['front'] = '+'
viewer.trigger.params['debounce_time'] = 0.1
viewer.triggeraccumulator.params['stack_size'] = 3
viewer.triggeraccumulator.params['left_sweep'] = -.2
viewer.triggeraccumulator.params['right_sweep'] = .5
# Start both nodes
dev.start()
viewer.start()
if __name__ == '__main__':
import sys
if sys.flags.interactive == 0:
app.exec_()
| bsd-3-clause | Python |
|
5c5c2e9ae69b6543830975239068d34620205119 | add context logger | pingf/PyModulesLearning,pingf/PyModulesLearning | logging/logger_reload_with_context.py | logging/logger_reload_with_context.py | import logging
import traceback
from yaml_config import yaml_config
yaml_config('yaml.conf')
class ContextLogger(object):
def __init__(self, name):
self.logger = logging.getLogger(name)
def _context(self):
stack = traceback.extract_stack()
(filename, line, procname, text) = stack[-3]
return ' [loc] ' + filename + ':' + procname + ':' + str(line)
def critical(self, msg):
self.logger.critical('[msg] ' + str(msg) + self._context())
def error(self, msg):
self.logger.error('[msg] ' + str(msg) + self._context())
def warning(self, msg):
self.logger.warning('[msg] ' + str(msg) + self._context())
def info(self, msg):
self.logger.info('[msg] ' + str(msg) + self._context())
def debug(self, msg):
self.logger.debug('[msg] ' + str(msg) + self._context())
logger = ContextLogger('root') # logging.getLogger('test')
class A(object):
def test(self):
try:
raise Exception('WTF!')
except Exception as e:
logger.error(e)
a = A()
a.test()
| mit | Python |
|
bc7f1363a7da1375b62f70caf441423af2718641 | Create example.py | BobStevens/micropython | BMP085/example.py | BMP085/example.py | # Continuously polls the BMP180 Pressure Sensor
import pyb
import BMP085
# creating objects
blue = pyb.LED(4)
bmp180 = BMP085.BMP085(port=2,address=0x77,mode=3,debug=False)
while 1:
blue.toggle()
temperature = bmp180.readTemperature()
print("%f celcius" % temperature)
pressure = bmp180.readPressure()
print("%f pascal" % pressure)
altitude = bmp180.readAltitude()
print("%f meters" % altitude)
pyb.delay(100)
| mit | Python |
|
6c08209ee26210df07b9d80da45d815b595205ae | test for new Wigner function | anubhavvardhan/qutip,zasdfgbnm/qutip,cgranade/qutip,cgranade/qutip,anubhavvardhan/qutip,qutip/qutip,zasdfgbnm/qutip,qutip/qutip | test_wigner.py | test_wigner.py | from qutip import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from pylab import *
N = 20;
psi=(coherent(N,-2-2j)+coherent(N,2+2j)).unit()
#psi = ket2dm(basis(N,0))
xvec = linspace(-5.,5.,200)
yvec = xvec
X,Y = meshgrid(xvec, yvec)
W = wigner(psi,xvec,xvec);
fig2 = plt.figure(figsize=(9, 6))
ax = Axes3D(fig2,azim=-107,elev=49)
surf=ax.plot_surface(X, Y, W, rstride=1, cstride=1, cmap=cm.jet, alpha=1.0,linewidth=0.05)
fig2.colorbar(surf, shrink=0.65, aspect=20)
savefig("test.png")
#show()
| bsd-3-clause | Python |
|
1ffdfc3c7ae11c583b2ea4d45b50136996bcf3e3 | Add mock HTTP server to respond to requests from web UI | jmlong1027/multiscanner,jmlong1027/multiscanner,mitre/multiscanner,mitre/multiscanner,mitre/multiscanner,jmlong1027/multiscanner,MITRECND/multiscanner,MITRECND/multiscanner,jmlong1027/multiscanner | tests/mocks.py | tests/mocks.py | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class MockHTTPServerRequestHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
# add response codes
self.send_response(requests.codes.okay)
# add response headers
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Access-Control-Allow-Credentials', 'true')
self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
self.send_header('Access-Control-Allow-Headers', 'dataType, accept, authoriziation')
self.end_headers()
def do_GET(self):
# add response codes
self.send_response(requests.codes.ok)
# add response headers
self.send_header('Content-Type', 'application/json; charset=utf-8')
self.end_headers()
# add response content
response_content = json.dumps({'Message': 'Success'})
self.wfile.write(response_content.encode('utf-8'))
return
def do_POST(self):
# add response codes
self.send_response(requests.codes.created)
# add response headers
self.send_header('Content-Type', 'application/json; charset=utf-8')
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Access=Control-Allow-Methods', 'POST, GET, OPTIONS, DELETE, PUT')
self.end_headers()
# add response content
response_content = json.dumps({'Message': {'task_ids': [1234]}})
self.wfile.write(response_content.encode('utf-8'))
return
def get_free_server_port():
s = socket.socket(socket.AF_INET, type=socket.SOCK_STREAM)
s.bind(('localhost', 0))
address, port = s.getsockname()
s.close()
return port
def start_mock_server(port=8080):
mock_server = HTTPServer(('localhost', port), MockHTTPServerRequestHandler)
mock_server_thread = Thread(target=mock_server.serve_forever)
mock_server_thread.setDaemon(True)
mock_server_thread.start()
| mpl-2.0 | Python |
|
481b822125de1d29de09975a6607c4fa038b98df | Add model List | ajoyoommen/zerrenda,ajoyoommen/zerrenda | todo/models.py | todo/models.py | from django.db import models
from django.utils.text import slugify
from common.models import TimeStampedModel
class List(TimeStampedModel):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50, editable=False)
def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super(List, self).save(*args, **kwargs)
| mit | Python |
|
d64e28b6aabf83711faca5853a01b590c5f89548 | Create topicmining.py | psyllost/02819 | topicmining.py | topicmining.py |
from gensim import corpora, models
from itertools import chain
from urllib import urlopen
from operator import itemgetter
import csv
import simplejson as json
#The code for extracting entities from referata was taken by fnielsen git repository
# Define a url as a Python string (note we are only getting 100 documents)
url = "http://wikilit.referata.com/" + \
"wiki/Special:Ask/" + \
"-5B-5BCategory:Publications-5D-5D/" + \
"-3FHas-20author%3DAuthor(s)/-3FYear/" + \
"-3FPublished-20in/-3FAbstract/-3FHas-20topic%3DTopic(s)/" + \
"-3FHas-20domain%3DDomain(s)/" + \
"format%3D-20csv/limit%3D-20100/offset%3D0"
# Get and read the web page
doc = urlopen(url).read() # Object from urlopen has read function
# Show the first 1000 characters
#print(doc[:1000])
web = urlopen(url)
# 'web' is now a file-like handle
lines = csv.reader(web, delimiter=',', quotechar='"')
# JSON format instead that Semantic MediaWiki also exports
url_json = "http://wikilit.referata.com/" + \
"wiki/Special:Ask/" + \
"-5B-5BCategory:Publications-5D-5D/" + \
"-3FHas-20author/-3FYear/" + \
"-3FPublished-20in/-3FAbstract/-3FHas-20topic)/" + \
"-3FHas-20domain/" + \
"format%3D-20json"
# Read JSON into a Python structure
response = json.load(urlopen(url_json))
# response['printrequests'] is a list, map iterates over the list
columns = map(lambda item: item['label'], response['printrequests'])
# gives ['', 'Has author', 'Year', 'Published in', 'Abstract',
# 'Has topic)', 'Has domain']
# Reread CSV
lines = csv.reader(urlopen(url), delimiter=',', quotechar='"')
# Iterate over 'lines' and insert the into a list of dictionaries
header = []
papers = []
for row in lines: # csv module lacks unicode support!
line = [unicode(cell, 'utf-8') for cell in row]
if not header: # Read the first line as header
header = line
continue
papers.append(dict(zip(header, line)))
# 'papers' is now an list of dictionaries
abstracts=[]
for abstract,i in enumerate(papers):
abstracts.append(papers[abstract]['Abstract'])
stoplist = set('for a of the and to in'.split())
texts = [[word for word in abstract.lower().split() if word not in stoplist]
for abstract in abstracts]
all_tokens = sum(texts, [])
tokens_once = set(word for word in set(all_tokens) if all_tokens.count(word) == 1)
texts = [[word for word in text if word not in tokens_once]
for text in texts]
#print texts
dictionary = corpora.Dictionary(texts)
dictionary.save('C:/Users/Ioanna/abstracts.dict')
corpus = [dictionary.doc2bow(text) for text in texts]
corpora.MmCorpus.serialize('C:/Users/Ioanna/abstracts.mm', corpus) # store to disk, for later use
dictionary = corpora.Dictionary.load('C:/Users/Ioanna/abstracts.dict')
corpus = corpora.MmCorpus('C:/Users/Ioanna/abstracts.mm')
tfidf = models.TfidfModel(corpus) # step 1 -- initialize a model
corpus_tfidf = tfidf[corpus]
#lsi = models.LsiModel(corpus_tfidf, id2word=dictionary, num_topics=50)
#corpus_lsi = lsi[corpus_tfidf]
#lsi.print_topics(20)
lda = models.LdaModel(corpus=corpus_tfidf, id2word=dictionary, num_topics=50)
for i in range(0, 50):
temp = lda.show_topic(i, 10)
terms = []
for term in temp:
terms.append(term[1])
print "Top 10 terms for topic #" + str(i) + ": "+ ", ".join(terms)
print
print 'Which LDA topic maximally describes a document?\n'
print 'Original document: ' + abstracts[0]
print 'Preprocessed document: ' + str(texts[0])
print 'Matrix Market format: ' + str(corpus[0])
print 'Topic probability mixture: ' + str(lda[corpus[0]])
print 'Maximally probable topic: topic #' + str(max(lda[corpus[0]],key=itemgetter(0))[0])
| apache-2.0 | Python |
|
744d7971926bf7672ce01388b8617be1ee35df0e | Add missing test data folder | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | # Copyright 2020 Google LLC.
#
# 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.
# [START main_method]
def main():
return 'main method'
# [START_EXCLUDE]
# [END_EXCLUDE]
def not_main():
return 'not main'
# [END main_method]
| apache-2.0 | Python |
|
c2f1a5b84497132c6b7b15797493082c865e737d | add twitter_bot | lambdan/lambblog,lambdan/lambblog | twitter_bot.py | twitter_bot.py | import tweepy
import feedparser
import re
import requests
import os
# pip3 install tweepy feedparser
feed_url = "https://lambdan.se/blog/rss.xml"
database_file = "./tweeted_by_twitter_bot.txt" # txt with urls that have been tweeted (one url per line)
twitter_consumer_api_key = ""
twitter_api_secret_key = ""
twitter_access_token = ""
twitter_access_token_secret = ""
def auth_twitter():
auth = tweepy.OAuthHandler(twitter_consumer_api_key, twitter_api_secret_key)
auth.set_access_token(twitter_access_token, twitter_access_token_secret)
api = tweepy.API(auth)
return api
# read already tweeted links
already_tweeted = []
if os.path.isfile(database_file):
with open(database_file) as f:
lines = f.readlines()
for line in lines:
already_tweeted.append(line.rstrip())
print(len(already_tweeted), "urls in", database_file)
# read rss
print ("Grabbing rss feed", feed_url)
feed = feedparser.parse(feed_url)
print("Got", len(feed.entries), "posts")
for entry in reversed(feed.entries): # reverse it to get newest last (makes sense if posting a backlog)
title = entry.title
url = entry.link
text = entry.summary
tweet_text = str(title) + " " + str(url)
# check here if url in tweeted links
if url not in already_tweeted:
print(">>> Tweeting", title, url)
# auth twitter
twitter_api = auth_twitter()
# find first image
images = []
images = re.findall('src="([^"]+)"', text)
# dont tweet if first pic is a gif
if len(images) > 0 and str(os.path.splitext(images[0])[1]).lower() == '.gif':
print("*** First image is a gif, not dealing with that. Posting without image instead.")
images = []
if len(images) > 0: # tweet with image
picture_url = images[0]
# download image - https://stackoverflow.com/a/31748691
temp_filename = "twitter_temp_" + os.path.basename(picture_url) # this should get us the file extension etc
req = requests.get(picture_url, stream=True)
if req.status_code == 200:
with open(temp_filename, 'wb') as img:
for chunk in req:
img.write(chunk)
twitter_api.update_with_media(temp_filename, status=tweet_text)
os.remove(temp_filename)
else:
print("!!! ERROR: Unable to download image")
sys.exit(1)
else: # tweet without image
twitter_api.update_status(tweet_text)
with open(database_file, 'a') as d:
d.write(str(url) + '\n')
else:
print("Already tweeted:", title, "-", url)
| mit | Python |
|
156c0b09930bd7700cb7348197a9e167831dca6d | ADD initial syft.lib.util tests | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/tests/syft/lib/util_test.py | packages/syft/tests/syft/lib/util_test.py | #absolute
from syft.lib.util import full_name_with_name
from syft.lib.util import full_name_with_qualname
class TSTClass:
pass
class FromClass:
@staticmethod
def static_method():
pass
def not_static_method(self):
pass
class ToClass:
pass
def test_full_name_with_name():
assert full_name_with_name(TSTClass) == f"{TSTClass.__module__}.{TSTClass.__name__}"
def test_full_name_with_qualname():
class LocalTSTClass:
pass
assert full_name_with_qualname(LocalTSTClass) == f"{LocalTSTClass.__module__}.{LocalTSTClass.__qualname__}"
| apache-2.0 | Python |
|
2eb849578b7306762f1e9dc4962a9db2ad651fc9 | add solution for Linked List Cycle II | zhyu/leetcode,zhyu/leetcode | src/linkedListCycleII.py | src/linkedListCycleII.py | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param head, a ListNode
# @return a list node
def detectCycle(self, head):
slow = fast = head
no_loop = True
while fast and fast.next:
slow = slow.next
fast = fast.next.next
if slow == fast:
no_loop = False
break
if no_loop:
return None
fast = head
while slow != fast:
slow = slow.next
fast = fast.next
return slow
| mit | Python |
|
855f9afa6e8d7afba020dc5c1dc8fabfc84ba2d4 | add new package : jafka (#14304) | iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/jafka/package.py | var/spack/repos/builtin/packages/jafka/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Jafka(Package):
"""
Jafka is a distributed publish-subscribe messaging system.
"""
homepage = "https://github.com/adyliu/jafka"
url = "https://github.com/adyliu/jafka/releases/download/3.0.6/jafka-3.0.6.tgz"
version('3.0.6', sha256='89c9456360ace5d43c3af52b5d2e712fc49be2f88b1b3dcfe0c8f195a3244e17')
version('3.0.5', sha256='43f1b4188a092c30f48f9cdd0bddd3074f331a9b916b6cb566da2e9e40bc09a7')
version('3.0.4', sha256='a5334fc9280764f9fd4b5eb156154c721f074c1bcc1e5496189af7c06cd16b45')
version('3.0.3', sha256='226e902af7754bb0df2cc0f30195e4f8f2512d9935265d40633293014582c7e2')
version('3.0.2', sha256='c7194476475a9c3cc09ed5a4e84eecf47a8d75011f413b26fd2c0b66c598f467')
version('3.0.1', sha256='3a75e7e5bb469b6d9061985a1ce3b5d0b622f44268da71cab4a854bce7150d41')
version('3.0.0', sha256='4c4bacdd5fba8096118f6e842b4731a3f7b3885514fe1c6b707ea45c86c7c409')
version('1.6.2', sha256='fbe5d6a3ce5e66282e27c7b71beaeeede948c598abb452abd2cae41149f44196')
depends_on('java@7:', type='run')
def install(self, spec, prefix):
install_tree('.', prefix)
| lgpl-2.1 | Python |
|
665a373f12f030d55a5d004cbce51e9a86428a55 | Add the main rohrpost handler | axsemantics/rohrpost,axsemantics/rohrpost | rohrpost/main.py | rohrpost/main.py | import json
from functools import partial
from . import handlers # noqa
from .message import send_error
from .registry import HANDLERS
REQUIRED_FIELDS = ['type', 'id']
def handle_rohrpost_message(message):
"""
Handling of a rohrpost message will validate the required format:
A valid JSON object including at least an "id" and "type" field.
It then hands off further handling to the registered handler (if any).
"""
_send_error = partial(send_error, message, None, None)
if not message.content['text']:
return _send_error('Received empty message.')
try:
request = json.loads(message.content['text'])
except json.JSONDecodeError as e:
return _send_error('Could not decode JSON message. Error: {}'.format(str(e)))
if not isinstance(request, dict):
return _send_error('Expected a JSON object as message.')
for field in REQUIRED_FIELDS:
if field not in request:
return _send_error("Missing required field '{}'.".format(field))
if not request['type'] in HANDLERS:
return send_error(
message, request['id'], request['type'],
"Unknown message type '{}'.".format(request['type']),
)
HANDLERS[request['type']](message, request)
| mit | Python |
|
8084a3be60e35e5737047f5b2d2daf8dce0cec1a | Update sliding-window-maximum.py | kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015 | Python/sliding-window-maximum.py | Python/sliding-window-maximum.py | # Time: O(n)
# Space: O(k)
# Given an array nums, there is a sliding window of size k
# which is moving from the very left of the array to the
# very right. You can only see the k numbers in the window.
# Each time the sliding window moves right by one position.
#
# For example,
# Given nums = [1,3,-1,-3,5,3,6,7], and k = 3.
#
# Window position Max
# --------------- -----
# [1 3 -1] -3 5 3 6 7 3
# 1 [3 -1 -3] 5 3 6 7 3
# 1 3 [-1 -3 5] 3 6 7 5
# 1 3 -1 [-3 5 3] 6 7 5
# 1 3 -1 -3 [5 3 6] 7 6
# 1 3 -1 -3 5 [3 6 7] 7
# Therefore, return the max sliding window as [3,3,5,5,6,7].
#
# Note:
# You may assume k is always valid, ie: 1 <= k <= input array's size for non-empty array.
#
# Follow up:
# Could you solve it in linear time?
from collections import deque
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
dq = deque()
max_numbers = []
for i in xrange(len(nums)):
while dq and nums[i] >= nums[dq[-1]]:
dq.pop()
dq.append(i)
if i >= k and dq and dq[0] == i - k:
dq.popleft()
if i >= k - 1:
max_numbers.append(nums[dq[0]])
return max_numbers
| # Time: O(n)
# Space: O(k)
# Given an array nums, there is a sliding window of size k
# which is moving from the very left of the array to the
# very right. You can only see the k numbers in the window.
# Each time the sliding window moves right by one position.
#
# For example,
# Given nums = [1,3,-1,-3,5,3,6,7], and k = 3.
#
# Window position Max
# --------------- -----
# [1 3 -1] -3 5 3 6 7 3
# 1 [3 -1 -3] 5 3 6 7 3
# 1 3 [-1 -3 5] 3 6 7 5
# 1 3 -1 [-3 5 3] 6 7 5
# 1 3 -1 -3 [5 3 6] 7 6
# 1 3 -1 -3 5 [3 6 7] 7
# Therefore, return the max sliding window as [3,3,5,5,6,7].
#
# Note:
# You may assume k is always valid, ie: 1 <= k <= input array's size for non-empty array.
#
# Follow up:
# Could you solve it in linear time?
from collections import deque
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
dq = deque()
max_numbers = []
for i in xrange(len(nums)):
while dq and nums[i] >= nums[dq[-1]]:
dq.pop()
dq.append(i)
if i >= k and dq and dq[0] <= i - k:
dq.popleft()
if i >= k - 1:
max_numbers.append(nums[dq[0]])
return max_numbers
| mit | Python |
f8bd2205e57e7a3b457e20b678d69065b620c965 | Create __init__.py | cmccomb/vote-sim | votesim/__init__.py | votesim/__init__.py | mit | Python |
||
24baf3e5e7a608d0b34d74be25f96f1b74b7622e | Add feed update task for social app | kansanmuisti/datavaalit,kansanmuisti/datavaalit | web/social/tasks.py | web/social/tasks.py | from celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = self.get_logger()
updater = FeedUpdater(logger)
print "Updating feeds"
updater.update_feeds()
print "Feed update done"
| agpl-3.0 | Python |
|
b5dfae3c80b08616401604aad211cedd31783f33 | Add benchmarks.py script | fonttools/skia-pathops | benchmarks.py | benchmarks.py | from pathops import union as pathops_union
from booleanOperations import union as boolops_union
from defcon import Font as DefconFont
from ufoLib2 import Font as UfoLib2Font
import math
import timeit
REPEAT = 10
NUMBER = 1
def remove_overlaps(font, union_func, pen_getter, **kwargs):
for glyph in font:
contours = list(glyph)
if not contours:
continue
glyph.clearContours()
pen = getattr(glyph, pen_getter)()
union_func(contours, pen, **kwargs)
def mean_and_stdev(runs, loops):
timings = [t / loops for t in runs]
n = len(runs)
mean = math.fsum(timings) / n
stdev = (math.fsum([(x - mean) ** 2 for x in timings]) / n) ** 0.5
return mean, stdev
def run(
ufo,
FontClass,
union_func,
pen_getter,
repeat=REPEAT,
number=NUMBER,
**kwargs,
):
all_runs = timeit.repeat(
stmt="remove_overlaps(font, union_func, pen_getter, **kwargs)",
setup="font = FontClass(ufo); list(font)",
repeat=repeat,
number=number,
globals={
"ufo": ufo,
"FontClass": FontClass,
"union_func": union_func,
"pen_getter": pen_getter,
"remove_overlaps": remove_overlaps,
"kwargs": kwargs,
},
)
mean, stdev = mean_and_stdev(all_runs, number)
class_module = FontClass.__module__.split(".")[0]
func_module = union_func.__module__.split(".")[0]
print(
f"{class_module}::{func_module}: {mean:.3f} s +- {stdev:.3f} s per loop "
f"(mean +- std. dev. of {repeat} run(s), {number} loop(s) each)"
)
def main():
import sys
try:
ufo = sys.argv[1]
except IndexError:
sys.exit("usage: %s FONT.ufo [N]" % sys.argv[0])
if len(sys.argv) > 2:
repeat = int(sys.argv[2])
else:
repeat = REPEAT
for FontClass in [DefconFont, UfoLib2Font]:
for union_func, pen_getter, kwargs in [
(boolops_union, "getPointPen", {}),
(pathops_union, "getPen", {}),
# (pathops_union, "getPen", {"keep_starting_points": True}),
]:
run(
ufo, FontClass, union_func, pen_getter, repeat=repeat, **kwargs
)
# import os
# import shutil
# font = UfoLib2Font(ufo)
# font = DefconFont(ufo)
# union_func = pathops_union
# pen_getter = "getPen"
# union_func = boolops_union
# pen_getter = "getPointPen"
# remove_overlaps(font, union_func, pen_getter)
# output = ufo.rsplit(".", 1)[0] + "_ro.ufo"
# if os.path.isdir(output):
# shutil.rmtree(output)
# font.save(output)
if __name__ == "__main__":
main()
| bsd-3-clause | Python |
|
a62e0bb3bfe192dcf080f28405a41ce7eb298b9b | Add tests for soc.logic.helper.prefixes. | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | tests/app/soc/logic/helper/test_prefixes.py | tests/app/soc/logic/helper/test_prefixes.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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.
"""Tests for soc.logic.helper.prefixes.
"""
__authors__ = [
'"Praveen Kumar" <[email protected]>',
]
import unittest
from google.appengine.api import users
from soc.logic.helper import prefixes
from soc.models.organization import Organization
from soc.models.program import Program
from soc.models.site import Site
from soc.models.user import User
from soc.modules.gci.models.organization import GCIOrganization
from soc.modules.gci.models.program import GCIProgram
from soc.modules.gsoc.models.organization import GSoCOrganization
from soc.modules.gsoc.models.program import GSoCProgram
from soc.modules.gsoc.models.timeline import GSoCTimeline
from soc.modules.seeder.logic.seeder import logic as seeder_logic
class TestPrefixes(unittest.TestCase):
"""Tests for prefix helper functions for models with document prefixes.
"""
def setUp(self):
self.user = seeder_logic.seed(User)
self.program_timeline = seeder_logic.seed(GSoCTimeline)
program_properties = {'timeline': self.program_timeline, 'scope': self.user}
self.program = seeder_logic.seed(Program, program_properties)
self.gsoc_program = seeder_logic.seed(GSoCProgram, program_properties)
self.gci_program = seeder_logic.seed(GCIProgram, program_properties)
self.site = seeder_logic.seed(Site,)
self.organization = seeder_logic.seed(Organization)
self.gsoc_organization = seeder_logic.seed(GSoCOrganization)
self.gci_organization = seeder_logic.seed(GCIOrganization)
self.user_key_name = self.user.key().name()
self.program_key_name = self.program.key().name()
self.gsoc_program_key_name = self.gsoc_program.key().name()
self.gci_program_key_name = self.gci_program.key().name()
self.site_key_name = self.site.key().name()
self.org_key_name = self.organization.key().name()
self.gsoc_org_key_name = self.gsoc_organization.key().name()
self.gci_org_key_name = self.gci_organization.key().name()
def testGetOrSetScope(self):
"""Not tested because it is used in soc.logic.models.survey and
soc.logic.models.document and soc.logic.models will be removed.
"""
pass
def testGetScopeForPrefix(self):
"""Tests if the scope for a given prefix and key_name is returned.
"""
prefix = 'user'
key_name = self.user_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.user))
prefix = 'site'
key_name = self.site_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.site))
prefix = 'org'
key_name = self.org_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.organization))
prefix = 'gsoc_org'
key_name = self.gsoc_org_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.gsoc_organization))
prefix = 'gci_org'
key_name = self.gci_org_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.gci_organization))
prefix = 'program'
key_name = self.program_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.program))
prefix = 'gsoc_program'
key_name = self.gsoc_program_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.gsoc_program))
prefix = 'gci_program'
key_name = self.gci_program_key_name
scope_returned = prefixes.getScopeForPrefix(prefix, key_name)
self.assertEqual(scope_returned.key().name(), key_name)
self.assertEqual(type(scope_returned), type(self.gci_program))
#When prefix is invalid.
prefix = 'invalid_prefix'
key_name = 'some_key_name'
self.assertRaises(
AttributeError, prefixes.getScopeForPrefix, prefix, key_name)
| apache-2.0 | Python |
|
115145da5063c47009e93f19aa5645e0dbb2580f | add missing migration for tests | fcurella/django-fakery | tests/migrations/0002_auto_20210712_1629.py | tests/migrations/0002_auto_20210712_1629.py | # Generated by Django 2.2.24 on 2021-07-12 21:29
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tests', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Pizzeria',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('hq', django.contrib.gis.db.models.fields.PointField(srid=4326)),
('directions', django.contrib.gis.db.models.fields.LineStringField(srid=4326)),
('floor_plan', django.contrib.gis.db.models.fields.PolygonField(srid=4326)),
('locations', django.contrib.gis.db.models.fields.MultiPointField(srid=4326)),
('routes', django.contrib.gis.db.models.fields.MultiLineStringField(srid=4326)),
('delivery_areas', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326)),
('all_the_things', django.contrib.gis.db.models.fields.GeometryCollectionField(srid=4326)),
('rast', django.contrib.gis.db.models.fields.RasterField(srid=4326)),
],
),
migrations.AlterField(
model_name='chef',
name='email_address',
field=models.EmailField(max_length=254),
),
migrations.AlterField(
model_name='chef',
name='twitter_profile',
field=models.URLField(),
),
migrations.AlterField(
model_name='pizza',
name='thickness',
field=models.CharField(choices=[(0, 'thin'), (1, 'thick'), (2, 'deep dish')], max_length=50),
),
migrations.AlterField(
model_name='pizza',
name='toppings',
field=models.ManyToManyField(related_name='pizzas', to='tests.Topping'),
),
]
| mit | Python |
|
319d74685a0bd44ca0c62bf41dae2f9515b5e327 | Add tests for nilrt_ip._load_config | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/pytests/unit/modules/test_nilrt_ip.py | tests/pytests/unit/modules/test_nilrt_ip.py | import io
import pytest
import salt.modules.nilrt_ip as nilrt_ip
from tests.support.mock import patch
@pytest.fixture(autouse=True)
def setup_loader(request):
setup_loader_modules = {nilrt_ip: {}}
with pytest.helpers.loader_mock(request, setup_loader_modules) as loader_mock:
yield loader_mock
@pytest.fixture
def patched_config_file():
config_file = io.StringIO(
"""
[some_section]
name = thing
fnord = bar
icanhazquotes = "this string is quoted"
icannothazquotes = this string is unquoted
number_value = 42
"""
)
with patch("salt.utils.files.fopen", return_value=config_file):
yield
def test_when_config_has_quotes_around_string_they_should_be_removed(
patched_config_file,
):
expected_value = "this string is quoted"
option = "icanhazquotes"
actual_value = nilrt_ip._load_config("some_section", [option])[option]
assert actual_value == expected_value
def test_when_config_has_no_quotes_around_string_it_should_be_returned_as_is(
patched_config_file,
):
expected_value = "this string is unquoted"
option = "icannothazquotes"
actual_value = nilrt_ip._load_config("some_section", [option])[option]
assert actual_value == expected_value
@pytest.mark.parametrize(
"default_value",
[
42,
-99.9,
('"', "some value", 42, '"'),
['"', "a weird list of values", '"'],
{"this": "dictionary", "has": "multiple values", 0: '"', -1: '"'},
],
)
def test_when_default_value_is_not_a_string_and_option_is_missing_the_default_value_should_be_returned(
patched_config_file, default_value
):
option = "non existent option"
actual_value = nilrt_ip._load_config(
"some_section", options=[option], default_value=default_value
)[option]
assert actual_value == default_value
| apache-2.0 | Python |
|
e810ecb5362496f72485220ab4e9cecd5467b3a6 | kill leftover webpagereplay servers. | ChromiumWebApps/chromium,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Just-D/chromium-1,ChromiumWebApps/chromium,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,littlstar/chromium.src,anirudhSK/chromium,Fireblend/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,patrickm/chromium.src,M4sse/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,patrickm/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,ltilve/chromium,Fireblend/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,M4sse/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,M4sse/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,dushu1203/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,axinging/chromium-crosswalk,Chilledheart/chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,littlstar/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,jaruba/chromium.src,Just-D/chromium-1,Chilledheart/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,ltilve/chromium,ondra-novak/chromium.src,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,patrickm/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,littlstar/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,markYoungH/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src | build/android/pylib/utils/test_environment.py | build/android/pylib/utils/test_environment.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import psutil
import signal
from pylib import android_commands
def _KillWebServers():
for s in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT, signal.SIGKILL]:
signalled = []
for server in ['lighttpd', 'webpagereplay']:
for p in psutil.process_iter():
try:
if not server in ' '.join(p.cmdline):
continue
logging.info('Killing %s %s %s', s, server, p.pid)
p.send_signal(s)
signalled.append(p)
except Exception as e:
logging.warning('Failed killing %s %s %s', server, p.pid, e)
for p in signalled:
try:
p.wait(1)
except Exception as e:
logging.warning('Failed waiting for %s to die. %s', p.pid, e)
def CleanupLeftoverProcesses():
"""Clean up the test environment, restarting fresh adb and HTTP daemons."""
_KillWebServers()
did_restart_host_adb = False
for device in android_commands.GetAttachedDevices():
adb = android_commands.AndroidCommands(device, api_strict_mode=True)
# Make sure we restart the host adb server only once.
if not did_restart_host_adb:
adb.RestartAdbServer()
did_restart_host_adb = True
adb.RestartAdbdOnDevice()
adb.EnableAdbRoot()
adb.WaitForDevicePm()
| # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import psutil
from pylib import android_commands
def _KillWebServers():
for retry in xrange(5):
for server in ['lighttpd', 'web-page-replay']:
pids = [p.pid for p in psutil.process_iter() if server in p.name]
for pid in pids:
try:
logging.warning('Killing %s %s', server, pid)
os.kill(pid, signal.SIGQUIT)
except Exception as e:
logging.warning('Failed killing %s %s %s', server, pid, e)
def CleanupLeftoverProcesses():
"""Clean up the test environment, restarting fresh adb and HTTP daemons."""
_KillWebServers()
did_restart_host_adb = False
for device in android_commands.GetAttachedDevices():
adb = android_commands.AndroidCommands(device, api_strict_mode=True)
# Make sure we restart the host adb server only once.
if not did_restart_host_adb:
adb.RestartAdbServer()
did_restart_host_adb = True
adb.RestartAdbdOnDevice()
adb.EnableAdbRoot()
adb.WaitForDevicePm()
| bsd-3-clause | Python |
082f28198b76c93ee7dc06ed3ea68bfe9a596b97 | create Spider for France website of McDonalds | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/mcdonalds_fr.py | locations/spiders/mcdonalds_fr.py | # -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
class McDonalsFRSpider(scrapy.Spider):
name = "mcdonalds_fr"
allowed_domains = ["www.mcdonalds.fr"]
start_urls = (
'https://prod-dot-mcdonaldsfrance-storelocator.appspot.com/api/store/nearest?center=2.695842500000026:47.0169289&limit=1000&authToken=26938DBF9169A7F39C92BDCF1BA7A&db=prod',
)
def store_hours(self, data):
day_groups = []
this_day_group = {}
weekdays = ['Su', 'Mo', 'Th', 'We', 'Tu', 'Fr', 'Sa']
for day_hour in data:
if day_hour['idx'] > 7:
continue
hours = ''
start, end = day_hour['value'].split("-")[0].strip(), day_hour['value'].split("-")[1].strip()
short_day = weekdays[day_hour['idx'] - 1]
hours = '{}:{}-{}:{}'.format(start[:2], start[3:], end[:2], end[3:])
if not this_day_group:
this_day_group = {
'from_day': short_day,
'to_day': short_day,
'hours': hours,
}
elif hours == this_day_group['hours']:
this_day_group['to_day'] = short_day
elif hours != this_day_group['hours']:
day_groups.append(this_day_group)
this_day_group = {
'from_day': short_day,
'to_day': short_day,
'hours': hours,
}
day_groups.append(this_day_group)
if not day_groups:
return None
opening_hours = ''
if len(day_groups) == 1 and not day_groups[0]:
return None
if len(day_groups) == 1 and day_groups[0]['hours'] in ('00:00-23:59', '00:00-00:00'):
opening_hours = '24/7'
else:
for day_group in day_groups:
if day_group['from_day'] == day_group['to_day']:
opening_hours += '{from_day} {hours}; '.format(**day_group)
else:
opening_hours += '{from_day}-{to_day} {hours}; '.format(**day_group)
opening_hours = opening_hours [:-2]
return opening_hours
def parse(self, response):
match = re.search(r'(HTTPResponseLoaded\()({.*})(\))', response.body_as_unicode())
if not match:
return
results = json.loads(match.groups()[1])
results = results["poiList"]
for item in results:
data = item["poi"]
properties = {
'city': data['location']['city'],
'ref': data['id'],
'addr_full': data['location']['streetLabel'],
'phone': data['datasheet']['tel'],
'state': data['location']['countryISO'],
'postcode': data['location']['postalCode'],
'name': data['name'],
'lat': data['location']['coords']['lat'],
'lon': data['location']['coords']['lon'],
'website': 'https://www.restaurants.mcdonalds.fr' + data['datasheet']['web']
}
opening_hours = self.store_hours(data['datasheet']['descList'])
if opening_hours:
properties['opening_hours'] = opening_hours
yield GeojsonPointItem(**properties)
| mit | Python |
|
d77cb643c7762401209f1f9d9693ee352e6672cb | Create mqttEampleRemoteBrain.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/kyleclinton/mqttEampleRemoteBrain.py | home/kyleclinton/mqttEampleRemoteBrain.py | from java.lang import String
from time import sleep
pi = Runtime.createAndStart("pi","RasPi")
#Load Pub/Sub Service (MQTT)
execfile("../py_scripts/mqttPubSubConfig.py")
# Add in controller for head, neck and antenna servos SHOULD be using i2c 16 servo controller
#Load Juniors mouth!
execfile("../py_scripts/juniors_voice.py")
#Load Juniors Eyes!
execfile("../py_scripts/juniors_eyes_4.py")
#####for testing
mouth.speakBlocking("Testing 1, 2, 3")
drawEyes()
sleep(2)
drawClosedEyes()
sleep(1)
drawEyes()
mqtt.subscribe("myrobotlab/speaking", 0)
#mqtt.publish("hello myrobotlab world")
python.subscribe("mqtt", "publishMqttMsgString")
# or mqtt.addListener("publishMqttMsgString", "python")
# MQTT call-back
# publishMqttMsgString --> onMqttMsgString(msg)
def onMqttMsgString(msg):
# print "message : ", msg
mouth.speakBlocking(msg[0])
print "message : ",msg[0]
print "topic : ",msg[1]
mqtt.publish("What is your name?")
| apache-2.0 | Python |
|
188c4af91f2a3dbb98997da6cdc3e43df488e791 | add ALCE examples | ntucllab/libact,ntucllab/libact,ntucllab/libact | examples/alce.py | examples/alce.py | #!/usr/bin/env python3
"""
Cost-Senstive Multi-Class Active Learning`
"""
import copy
import os
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit
import sklearn.datasets
from sklearn.linear_model import LinearRegression
# libact classes
from libact.base.dataset import Dataset, import_libsvm_sparse
from libact.models import LogisticRegression
from libact.query_strategies import ActiveLearningWithCostEmbedding as ALCE
from libact.query_strategies import UncertaintySampling, RandomSampling
from libact.labelers import IdealLabeler
from libact.utils import calc_cost
def run(trn_ds, tst_ds, lbr, model, qs, quota, cost_matrix):
C_in, C_out = [], []
for _ in range(quota):
# Standard usage of libact objects
ask_id = qs.make_query()
X, _ = zip(*trn_ds.data)
lb = lbr.label(X[ask_id])
trn_ds.update(ask_id, lb)
model.train(trn_ds)
trn_X, trn_y = zip(*trn_ds.get_labeled_entries())
tst_X, tst_y = zip(*tst_ds.get_labeled_entries())
C_in = np.append(C_in, calc_cost(trn_y, model.predict(trn_X), cost_matrix))
C_out = np.append(C_out, calc_cost(tst_y, model.predict(tst_X), cost_matrix))
return C_in, C_out
def split_train_test(test_size, n_labeled):
data = sklearn.datasets.fetch_mldata('segment')
X = data['data']
target = np.unique(data['target'])
# mapping the targets to 0 to n_classes-1
y = np.array([np.where(target == i)[0][0] for i in data['target']])
sss = StratifiedShuffleSplit(1, test_size=test_size, random_state=1126)
for trn_idx, tst_idx in sss.split(X, y):
X_trn, X_tst = X[trn_idx], X[tst_idx]
y_trn, y_tst = y[trn_idx], y[tst_idx]
trn_ds = Dataset(X_trn, np.concatenate(
[y_trn[:n_labeled], [None] * (len(y_trn) - n_labeled)]))
tst_ds = Dataset(X_tst, y_tst)
fully_labeled_trn_ds = Dataset(X_trn, y_trn)
return trn_ds, tst_ds, y_trn, fully_labeled_trn_ds
def main():
# Specifiy the parameters here:
test_size = 0.33 # the percentage of samples in the dataset that will be
# randomly selected and assigned to the test set
n_labeled = 10 # number of samples that are initially labeled
# Load dataset
trn_ds, tst_ds, y_train, fully_labeled_trn_ds = \
split_train_test(test_size, n_labeled)
trn_ds2 = copy.deepcopy(trn_ds)
trn_ds3 = copy.deepcopy(trn_ds)
lbr = IdealLabeler(fully_labeled_trn_ds)
n_classes = len(np.unique(y_train)) # = 7
cost_matrix = np.random.RandomState(1126).rand(n_classes, n_classes)
np.fill_diagonal(cost_matrix, 0)
quota = 500 # number of samples to query
# Comparing UncertaintySampling strategy with RandomSampling.
# model is the base learner, e.g. LogisticRegression, SVM ... etc.
qs = UncertaintySampling(trn_ds, method='lc', model=LogisticRegression())
model = LogisticRegression()
E_in_1, E_out_1 = run(trn_ds, tst_ds, lbr, model, qs, quota, cost_matrix)
qs2 = RandomSampling(trn_ds2)
model = LogisticRegression()
E_in_2, E_out_2 = run(trn_ds2, tst_ds, lbr, model, qs2, quota, cost_matrix)
qs3 = ALCE(trn_ds3, cost_matrix, LinearRegression())
model = LogisticRegression()
E_in_3, E_out_3 = run(trn_ds3, tst_ds, lbr, model, qs3, quota, cost_matrix)
print("Uncertainty: ", E_out_1[::20].tolist())
print("Random: ", E_out_2[::20].tolist())
print("ALCE: ", E_out_3[::20].tolist())
if __name__ == '__main__':
main()
| bsd-2-clause | Python |
|
3fb4d7b630fb7a4b34dcc4e1b72947e61f73a80f | Create script to dowload requisite test urls. | cielling/jupyternbs | TestData/download_test_data.py | TestData/download_test_data.py | def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ('test_idx.db')
def download_test_data():
import sqlite3
from datetime import datetime
import pandas as pd
testDir = "..\\TestData\\"
testTickers = {
"AAPL": [datetime(2014, 8, 1), datetime(2018, 8, 1)],
"ACLS": [datetime(2014, 8, 31), datetime(2018, 8, 31)],
"ADSK": [datetime(2014, 4, 15), datetime(2018, 4, 15)],
"ALEX": [datetime(2015, 12, 31), datetime(2019, 12, 31)],
"MMM": [datetime(2015, 7, 1), datetime(2019, 7, 1)],
"NRP": [datetime(2015, 12, 31), datetime(2019, 12, 31)],
"NVDA": [datetime(2015, 12, 31), datetime(2019, 12, 31)]
}
conn3 = sqlite3.connect('test_idx.db')
cursor = conn3.cursor()
for ticker in testTickers:
#cursor.execute('''SELECT * FROM idx WHERE Symbol=?;''', ("ABBV",))
cursor.execute('''SELECT * FROM cik_ticker_name WHERE ticker=?;''',(ticker,))
res = cursor.fetchall()
print(res)
cursor.execute('''SELECT * FROM idx WHERE cik=?;''', (res[0][0],))
recs = cursor.fetchall()
print(len(recs))
names = list(map(lambda x: x[0], cursor.description))
#print(names)
df = pd.DataFrame(data=recs, columns=names)
df['date'] = pd.to_datetime(df['date'])
beginDate = testTickers[ticker][0]
endDate = testTickers[ticker][1]
df1 = df[(df.date >= beginDate) & (df.date <= endDate)]
## Sort by date in descending order (most recent is first)
df1.sort_values(by=['date'], inplace=True, ascending=False)
df1[df1.type == "10-Q"].to_csv(testDir+ticker.lower()+"_all_10qs.csv", index=None)
df1[df1.type == "10-K"].to_csv(testDir+ticker.lower()+"_all_10ks.csv", index=None)
conn3.close()
if __name__ == "__main__":
#set_test_db()
download_test_data() | agpl-3.0 | Python |
|
df8206b01eb2298651099c5e701d269a0e6cd8c6 | add test case for tuple attribute error #35 | zedlander/flake8-commas,zedlander/flake8-commas | test/test_flake8.py | test/test_flake8.py | import subprocess
def test_call_flake8(tmpdir):
tmp = tmpdir.join('tmp.py')
tmp.write('')
output = subprocess.check_output(
['flake8', str(tmp)],
stderr=subprocess.STDOUT,
)
assert output == b''
| mit | Python |
|
ecae1fa205c88d1d503663c5fbec80a1943146ad | add resources comparator | gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl | pynodegl-utils/pynodegl_utils/tests/cmp_resources.py | pynodegl-utils/pynodegl_utils/tests/cmp_resources.py | #!/usr/bin/env python
#
# Copyright 2020 GoPro Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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 os
import csv
import tempfile
import pynodegl as ngl
from .cmp import CompareSceneBase, get_test_decorator
_COLS = (
'Textures memory',
'Buffers count',
'Buffers total',
'Blocks count',
'Blocks total',
'Medias count',
'Medias total',
'Textures count',
'Textures total',
'Computes',
'GraphicCfgs',
'Renders',
'RTTs',
)
class _CompareResources(CompareSceneBase):
def __init__(self, scene_func, columns=_COLS, **kwargs):
super(_CompareResources, self).__init__(scene_func, width=320, height=240,
scene_wrap=self._scene_wrap,
**kwargs)
self._columns = columns
def _scene_wrap(self, scene):
# We can't use NamedTemporaryFile because we may not be able to open it
# twice on some systems
fd, self._csvfile = tempfile.mkstemp(suffix='.csv', prefix='ngl-test-resources-')
os.close(fd)
return ngl.HUD(scene, export_filename=self._csvfile)
def get_out_data(self):
for frame in self.render_frames():
pass
# filter columns
with open(self._csvfile) as csvfile:
reader = csv.DictReader(csvfile)
data = [self._columns]
for row in reader:
data.append([v for k, v in row.items() if k in self._columns])
# rely on base string diff
ret = ''
for row in data:
ret += ','.join(row) + '\n'
os.remove(self._csvfile)
return ret
test_resources = get_test_decorator(_CompareResources)
| apache-2.0 | Python |
|
885aac79c2e31fc74dc143fc2527e02c2c0a8941 | add duckduckgo crawler | citationfinder/scholarly_citation_finder | scholarly_citation_finder/api/crawler/Duckduckgo.py | scholarly_citation_finder/api/crawler/Duckduckgo.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
class Duckduckgo:
API_URL = 'https://duckduckgo.com/html/'
CSS_RESULT_ELEMENT = 'a'
CSS_RESULT_ELEMENT_CLASS = 'large'
CSS_RESULT_TYPE_ELEMENT = 'span'
CSS_RESULT_TYPE_ELEMENT_CLASS = 'result__type'
def __init__(self):
pass
def query(self, keywords, filetype='pdf'):
'''
:see: https://duck.co/help/results/syntax
:see: https://duckduckgo.com/params
:param keywords:
:param filetype:
'''
if filetype:
keywords = 'filetype:{} {}'.format(filetype, keywords)
r = requests.get(self.API_URL, {'q': keywords})
if r.status_code != 200:
raise Exception('Expected response code 200, but is {}'.format(r.status_code))
self.__get_links(r.text)
def __get_links(self, html):
soup = BeautifulSoup(html, 'lxml')
for link in soup.findAll(self.CSS_RESULT_ELEMENT, class_=self.CSS_RESULT_ELEMENT_CLASS):
url, title, type = self.__get_link_items(link)
print('%s: %s "%s"' % (type, url, title))
def __get_link_items(self, html_a_element):
url = html_a_element.get('href')
title = html_a_element.text
if url:
soup = BeautifulSoup(str(html_a_element), 'lxml')
type = soup.find(self.CSS_RESULT_TYPE_ELEMENT, class_=self.CSS_RESULT_TYPE_ELEMENT_CLASS)
if type:
type = type.text
return url, title, type
if __name__ == '__main__':
searchengine = Duckduckgo()
searchengine.query('kernel completion for learning consensus support vector machines in bandwidth limited sensor networks')
| mit | Python |
|
60f01c055405fea9e3672821a1188774f7517707 | add 140 | EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,zeyuanxy/project-euler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler | vol3/140.py | vol3/140.py | if __name__ == "__main__":
L = 30
sqrt5 = 5 ** 0.5
f = [7, 14, 50, 97]
for i in range(L - 4):
f.append(7 * f[-2] - f[-4])
print sum(int(x / sqrt5) - 1 for x in f)
| mit | Python |
|
7d6b04bc60270d357fdf9401174ece249f9f3568 | add 153 | EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,zeyuanxy/project-euler | vol4/153.py | vol4/153.py | import math
import fractions
if __name__ == "__main__":
L = 10 ** 8
ans = 0
for i in xrange(1, L + 1):
ans += (L / i) * i
if i * i < L:
j = 1
while j <= i:
if fractions.gcd(i, j) == 1:
div = i * i + j * j
k = 1
v = 2 * i if i == j else 2 * (i + j)
while div * k <= L:
ans += (L / (div * k)) * k * v
k += 1
j += 1
print ans
| mit | Python |
|
b67250ca02705d47a124353207a1f60546919c0f | add versiondb.Manifest class | lsst-sqre/sqre-codekit,lsst-sqre/sqre-codekit | codekit/versiondb.py | codekit/versiondb.py | """versionDB related utility functions."""
from codekit.codetools import debug
from public import public
import logging
import re
import requests
import textwrap
default_base_url =\
'https://raw.githubusercontent.com/lsst/versiondb/master/manifests'
@public
def setup_logging(verbosity=0):
# enable requests debugging
# based on http://docs.python-requests.org/en/latest/api/?highlight=debug
if verbosity > 1:
from http.client import HTTPConnection
HTTPConnection.debuglevel = 1
requests_log = logging.getLogger("urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True
# ~duplicates the Manifest class in lsst_buid/python/lsst/ci/prepare.py but
# operates over http rather than on a local git clone
class Manifest(object):
"""Representation of a "versionDB" manifest. AKA `bNNNN`. AKA `bxxxx`. AKA
`BUILD`. AKA `BUILD_ID`. AKA `manifest`.
Parameters
----------
name: str
Name of the manifest . Eg., `b1234`
base_url: str
Base url to the path for `manifest` files`. Optional.
Eg.:
`https://raw.githubusercontent.com/lsst/versiondb/master/manifests`
"""
def __init__(self, name, base_url=None):
self.name = name
self.base_url = default_base_url
if base_url:
self.base_url = base_url
def __fetch_manifest_file(self):
# construct url
tag_url = '/'.join((self.base_url, self.name + '.txt'))
debug("fetching: {url}".format(url=tag_url))
r = requests.get(tag_url)
r.raise_for_status()
self.__text = r.text
def __parse_manifest_text(self):
products = {}
for line in self.__text.splitlines():
if not isinstance(line, str):
line = str(line, 'utf-8')
# skip commented out and blank lines
if line.startswith('#') or line == '':
continue
if line.startswith('BUILD'):
pat = r'^BUILD=(b\d{4})$'
m = re.match(pat, line)
if not m:
raise RuntimeError(textwrap.dedent("""
Unparsable versiondb manifest:
{line}
""").format(
line=line,
))
parsed_name = m.group(1)
continue
# min of 3, max of 4 fields
fields = line.split()[0:4]
(name, sha, eups_version) = fields[0:3]
products[name] = {
'name': name,
'sha': sha,
'eups_version': eups_version,
'dependencies': [],
}
# the 4th field, if present, is a csv list of deps
if len(fields) == 4:
dependencies = fields[3:4][0].split(',')
products[name]['dependencies'] = dependencies
# sanity check tag name in the file
if not self.name == parsed_name:
raise RuntimeError(textwrap.dedent("""
name in data : ({dname})
does not match file name: ({fname})\
""").format(
dname=parsed_name,
fname=self.name,
))
self.__products = products
def __process(self):
self.__fetch_manifest_file()
self.__parse_manifest_text()
@property
def products(self):
"""Return Dict of products described by the manifest"""
# check for cached data
try:
return self.__products
except AttributeError:
pass
self.__process()
return self.__products
| mit | Python |
|
f6f12b1194fde3fc4dc355535ca88f472962d3a3 | add camera color histogram | miguelinux/ejemplos-opencv,miguelinux/ejemplos-opencv | python/ocv4/camera_color_histogram.py | python/ocv4/camera_color_histogram.py | #!/usr/bin/env python
'''
Video histogram sample to show live histogram of video
Keys:
ESC - exit
'''
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
# built-in modules
import sys
# local modules
import video
class App():
def set_scale(self, val):
self.hist_scale = val
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
hsv_map[:,:,1] = s
hsv_map[:,:,2] = 255
hsv_map = cv.cvtColor(hsv_map, cv.COLOR_HSV2BGR)
cv.imshow('hsv_map', hsv_map)
cv.namedWindow('hist', 0)
self.hist_scale = 10
cv.createTrackbar('scale', 'hist', self.hist_scale, 32, self.set_scale)
try:
fn = sys.argv[1]
except:
fn = 0
cam = video.create_capture(fn, fallback='synth:bg=baboon.jpg:class=chess:noise=0.05')
while True:
flag, frame = cam.read()
cv.imshow('camera', frame)
small = cv.pyrDown(frame)
hsv = cv.cvtColor(small, cv.COLOR_BGR2HSV)
dark = hsv[...,2] < 32
hsv[dark] = 0
h = cv.calcHist([hsv], [0, 1], None, [180, 256], [0, 180, 0, 256])
h = np.clip(h*0.005*self.hist_scale, 0, 1)
vis = hsv_map*h[:,:,np.newaxis] / 255.0
cv.imshow('hist', vis)
ch = cv.waitKey(1)
if ch == 27:
break
print('Done')
if __name__ == '__main__':
print(__doc__)
App().run()
cv.destroyAllWindows()
| bsd-3-clause | Python |
|
3ebb2731d6389170e0bef0dab66dc7c4ab41152e | Add a unit-test for thread_pool.py. | graveljp/smugcli | thread_pool_test.py | thread_pool_test.py | import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in range(10):
self.assertEqual(results.get(), i)
def testContextManager(self):
results = queue.Queue(maxsize=1)
with thread_pool.ThreadPool(2) as pool:
pool.add(self._producer_thread, results)
pool.add(self._consumer_thread, results)
def testJoin(self):
results = queue.Queue(maxsize=1)
pool = thread_pool.ThreadPool(2)
pool.add(self._producer_thread, results)
pool.add(self._consumer_thread, results)
pool.join()
| mit | Python |
|
f6d4116ed5122868dbc10bf41dfc44053d0a0edf | write annotation parser for PASCAL VOC 2006 | yassersouri/omgh,yassersouri/omgh | src/pascal_utils.py | src/pascal_utils.py | import re
def which_one(str, arr):
for a in arr:
if a in str:
return a
return ''
class VOC2006AnnotationParser(object):
SKIP_CHARACTER = '#'
OBJECT_SUMMARY = 'Objects with ground truth'
PREPEND = 'PAS'
TRUNC = 'Trunc'
DIFFICULT = 'Difficult'
CLASSES = ['bicycle', 'bus', 'car', 'motorbike', 'cat', 'cow', 'dog', 'horse', 'sheep', 'person']
VIEWS = ['Frontal', 'Rear', 'Left', 'Right']
RE_OBJECT_DEF = r"Original label for object (\d+) \"(\S+)\" : \"(\S+)\""
RE_OBJECT_BB = r"Bounding box for object %d \"%s\" \(Xmin, Ymin\) - \(Xmax, Ymax\) : \((\d+), (\d+)\) - \((\d+), (\d+)\)"
def __init__(self, annotation_file_contet):
self.annotation_file_contet = annotation_file_contet
def get_objects(self, trunc=True, difficult=False):
objects = []
for match in re.finditer(self.RE_OBJECT_DEF, self.annotation_file_contet):
obj_index, obj_label, original_obj_label = match.groups()
obj_index = int(obj_index)
xmin, ymin, xmax, ymax = re.search(self.RE_OBJECT_BB % (obj_index, obj_label), self.annotation_file_contet).groups()
xmin, ymin, xmax, ymax = int(xmin), int(ymin), int(xmax), int(ymax)
if not trunc and self.TRUNC in original_obj_label:
continue
if not difficult and self.DIFFICULT in original_obj_label:
continue
objects.append({'ind': obj_index, 'label': obj_label, 'original_label': original_obj_label, 'xmin': xmin, 'ymin': ymin, 'xmax': xmax, 'ymax': ymax, 'trunc': self.TRUNC in original_obj_label, 'difficult': self.DIFFICULT in original_obj_label, 'class': which_one(original_obj_label, self.CLASSES), 'view': which_one(original_obj_label, self.VIEWS)})
return objects
| mit | Python |
|
c6b1cbddec20fae0daeece0ea859a7227e16e3bf | Add primitive name space registry for event types | fxstein/SentientHome | common/shregistry.py | common/shregistry.py | #!/usr/local/bin/python3 -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
# ALL event types need to be registered here
# ATTENTION: type must be unique to avoid event name space polution
# Registry structure:
# key = unique identifier of event type
# name = unique namespace of event should be same as key in most cases
# class = class of events for grouping and statistics
# desc = description of event types
# tags = list of freeform tags
#
# Notes:
# keys and types should be kept short and shpuld be kept constant for the life
# of the project
shRegistry = {
'autelis' : {'name': 'autelis', 'class': 'Pool', 'desc': 'Autelis Pool Controller', 'tags': ['Pool', 'Autelis', 'Pentair']},
'eagle' : {'name': 'eagle', 'class': 'Power', 'desc': 'Rainforest Eagle Gateway', 'tags':['Rinaforest', 'Eagle', 'Power', 'Electricity']},
'gfinance' : {'name': 'gfinance', 'class': 'Finance', 'desc': 'Google Finance', 'tags': ['Google', 'Finance', 'Stock', 'Currency', 'Index']},
'isy' : {'name': 'isy', 'class': 'Automation', 'desc': 'ISY994 Home Automation Controller', 'tags':['ISY', 'Insteon', 'X10']},
'nesttherm': {'name': 'nesttherm','class': 'Climate', 'desc': 'Nest Thermostat', 'tags':['Nest', 'Thermostat']},
'nestfire' : {'name': 'nestfire', 'class': 'Protection', 'desc': 'Nest Fire & CO Alarm', 'tags':['Nest', 'Protect', 'Fire Alarm', 'CO Alarm']},
'netatmo' : {'name': 'netatmo', 'class': 'Climate', 'desc': 'Netatmo Climate Station', 'tags':['Climate', 'Indoor', 'Outdoor']},
'twitter' : {'name': 'twitter', 'class': 'Social', 'desc': 'Twitter Feed', 'tags':['Twitter', 'Social', 'Tweet']},
'usgsquake': {'name': 'usgsquake','class': 'Geological', 'desc': 'USGS Earthquakes', 'tags':['USGS', 'Earthquake']},
'zillow' : {'name': 'zillow', 'class': 'Finance', 'desc': 'Zillow Home Valuation', 'tags':['Zillow', 'House', 'Home', 'Value', 'Fiance']},
# Sentient Home Internal Event Types
'tracer' : {'name': 'tracer', 'class': 'Internal', 'name': 'Sentient Home Periodic Tracer', 'tags': ['Sentient Home', 'Tracer']},
'loadtest' : {'name': 'loadtest', 'class': 'Internal', 'name': 'Sentient Home Load Test Event Generator', 'tags': ['Sentient Home', 'Test']},
}
#
# Do nothing
# (syntax check)
#
if __name__ == "__main__":
import __main__
print(__main__.__file__)
print("syntax ok")
exit(0)
| apache-2.0 | Python |
|
167872381e16090b1b47184a1a80bbe948d5fd91 | Add test and test_suite function to svm module | ZenDevelopmentSystems/scikit-learn,btabibian/scikit-learn,Akshay0724/scikit-learn,Myasuka/scikit-learn,xwolf12/scikit-learn,macks22/scikit-learn,aminert/scikit-learn,Aasmi/scikit-learn,russel1237/scikit-learn,devanshdalal/scikit-learn,liyu1990/sklearn,fredhusser/scikit-learn,nvoron23/scikit-learn,bigdataelephants/scikit-learn,jayflo/scikit-learn,alexsavio/scikit-learn,jpautom/scikit-learn,larsmans/scikit-learn,Titan-C/scikit-learn,mfjb/scikit-learn,robin-lai/scikit-learn,0x0all/scikit-learn,jakobworldpeace/scikit-learn,pianomania/scikit-learn,zorroblue/scikit-learn,0x0all/scikit-learn,maheshakya/scikit-learn,rexshihaoren/scikit-learn,rohanp/scikit-learn,IshankGulati/scikit-learn,shusenl/scikit-learn,jaidevd/scikit-learn,Garrett-R/scikit-learn,aewhatley/scikit-learn,stylianos-kampakis/scikit-learn,phdowling/scikit-learn,lesteve/scikit-learn,vivekmishra1991/scikit-learn,hainm/scikit-learn,vortex-ape/scikit-learn,Aasmi/scikit-learn,etkirsch/scikit-learn,yonglehou/scikit-learn,fyffyt/scikit-learn,LohithBlaze/scikit-learn,UNR-AERIAL/scikit-learn,jzt5132/scikit-learn,arahuja/scikit-learn,ltiao/scikit-learn,madjelan/scikit-learn,3manuek/scikit-learn,mxjl620/scikit-learn,Djabbz/scikit-learn,espg/scikit-learn,loli/semisupervisedforests,raghavrv/scikit-learn,xavierwu/scikit-learn,sonnyhu/scikit-learn,JosmanPS/scikit-learn,sumspr/scikit-learn,rsivapr/scikit-learn,ky822/scikit-learn,ycaihua/scikit-learn,rexshihaoren/scikit-learn,dhruv13J/scikit-learn,lazywei/scikit-learn,Myasuka/scikit-learn,henridwyer/scikit-learn,trankmichael/scikit-learn,aewhatley/scikit-learn,nrhine1/scikit-learn,fyffyt/scikit-learn,jaidevd/scikit-learn,justincassidy/scikit-learn,Nyker510/scikit-learn,lin-credible/scikit-learn,xavierwu/scikit-learn,liyu1990/sklearn,depet/scikit-learn,vortex-ape/scikit-learn,aabadie/scikit-learn,dingocuster/scikit-learn,aminert/scikit-learn,vermouthmjl/scikit-learn,NelisVerhoef/scikit-learn,khkaminska/scikit-learn,0x0all/scikit-learn,ssaeger/scikit-learn,ldirer/scikit-learn,shikhardb/scikit-learn,devanshdalal/scikit-learn,IndraVikas/scikit-learn,MartinSavc/scikit-learn,huzq/scikit-learn,cauchycui/scikit-learn,trungnt13/scikit-learn,ElDeveloper/scikit-learn,frank-tancf/scikit-learn,mlyundin/scikit-learn,h2educ/scikit-learn,AlexRobson/scikit-learn,ilo10/scikit-learn,evgchz/scikit-learn,trankmichael/scikit-learn,rrohan/scikit-learn,Jimmy-Morzaria/scikit-learn,trungnt13/scikit-learn,smartscheduling/scikit-learn-categorical-tree,pianomania/scikit-learn,vigilv/scikit-learn,BiaDarkia/scikit-learn,alexeyum/scikit-learn,anirudhjayaraman/scikit-learn,NunoEdgarGub1/scikit-learn,saiwing-yeung/scikit-learn,chrisburr/scikit-learn,RachitKansal/scikit-learn,kaichogami/scikit-learn,RPGOne/scikit-learn,ominux/scikit-learn,Achuth17/scikit-learn,RomainBrault/scikit-learn,fabioticconi/scikit-learn,ashhher3/scikit-learn,jseabold/scikit-learn,jjx02230808/project0223,aabadie/scikit-learn,ssaeger/scikit-learn,LiaoPan/scikit-learn,bnaul/scikit-learn,JeanKossaifi/scikit-learn,luo66/scikit-learn,IndraVikas/scikit-learn,shyamalschandra/scikit-learn,q1ang/scikit-learn,vermouthmjl/scikit-learn,vigilv/scikit-learn,andaag/scikit-learn,rajat1994/scikit-learn,hlin117/scikit-learn,fzalkow/scikit-learn,JosmanPS/scikit-learn,glouppe/scikit-learn,q1ang/scikit-learn,aminert/scikit-learn,sgenoud/scikit-learn,hsiaoyi0504/scikit-learn,samzhang111/scikit-learn,r-mart/scikit-learn,anirudhjayaraman/scikit-learn,tawsifkhan/scikit-learn,vibhorag/scikit-learn,mblondel/scikit-learn,dsquareindia/scikit-learn,Djabbz/scikit-learn,mjgrav2001/scikit-learn,cwu2011/scikit-learn,cwu2011/scikit-learn,vybstat/scikit-learn,MatthieuBizien/scikit-learn,Jimmy-Morzaria/scikit-learn,clemkoa/scikit-learn,untom/scikit-learn,mugizico/scikit-learn,shahankhatch/scikit-learn,akionakamura/scikit-learn,loli/semisupervisedforests,rvraghav93/scikit-learn,jkarnows/scikit-learn,ogrisel/scikit-learn,espg/scikit-learn,rahuldhote/scikit-learn,466152112/scikit-learn,nesterione/scikit-learn,ningchi/scikit-learn,hsuantien/scikit-learn,eickenberg/scikit-learn,quheng/scikit-learn,hitszxp/scikit-learn,h2educ/scikit-learn,ngoix/OCRF,ominux/scikit-learn,AIML/scikit-learn,Vimos/scikit-learn,cl4rke/scikit-learn,rsivapr/scikit-learn,CVML/scikit-learn,devanshdalal/scikit-learn,MartinDelzant/scikit-learn,meduz/scikit-learn,vigilv/scikit-learn,ilyes14/scikit-learn,hlin117/scikit-learn,cybernet14/scikit-learn,nomadcube/scikit-learn,PrashntS/scikit-learn,dhruv13J/scikit-learn,pianomania/scikit-learn,huzq/scikit-learn,bnaul/scikit-learn,UNR-AERIAL/scikit-learn,jorik041/scikit-learn,billy-inn/scikit-learn,simon-pepin/scikit-learn,ishanic/scikit-learn,cl4rke/scikit-learn,dsquareindia/scikit-learn,yanlend/scikit-learn,themrmax/scikit-learn,Srisai85/scikit-learn,phdowling/scikit-learn,mayblue9/scikit-learn,sinhrks/scikit-learn,HolgerPeters/scikit-learn,TomDLT/scikit-learn,Obus/scikit-learn,lin-credible/scikit-learn,f3r/scikit-learn,jkarnows/scikit-learn,ky822/scikit-learn,ankurankan/scikit-learn,schets/scikit-learn,toastedcornflakes/scikit-learn,ltiao/scikit-learn,AlexandreAbraham/scikit-learn,beepee14/scikit-learn,Jimmy-Morzaria/scikit-learn,krez13/scikit-learn,jorik041/scikit-learn,Jimmy-Morzaria/scikit-learn,pkruskal/scikit-learn,ClimbsRocks/scikit-learn,lin-credible/scikit-learn,LiaoPan/scikit-learn,mjudsp/Tsallis,michigraber/scikit-learn,eickenberg/scikit-learn,Garrett-R/scikit-learn,pypot/scikit-learn,florian-f/sklearn,eg-zhang/scikit-learn,ningchi/scikit-learn,sonnyhu/scikit-learn,PrashntS/scikit-learn,ephes/scikit-learn,PatrickOReilly/scikit-learn,olologin/scikit-learn,wlamond/scikit-learn,AlexandreAbraham/scikit-learn,anntzer/scikit-learn,rsivapr/scikit-learn,harshaneelhg/scikit-learn,aminert/scikit-learn,zuku1985/scikit-learn,AlexRobson/scikit-learn,ElDeveloper/scikit-learn,nrhine1/scikit-learn,ChanChiChoi/scikit-learn,ephes/scikit-learn,vibhorag/scikit-learn,Garrett-R/scikit-learn,poryfly/scikit-learn,kevin-intel/scikit-learn,Akshay0724/scikit-learn,poryfly/scikit-learn,fabianp/scikit-learn,roxyboy/scikit-learn,0x0all/scikit-learn,icdishb/scikit-learn,dsquareindia/scikit-learn,DSLituiev/scikit-learn,abhishekkrthakur/scikit-learn,jereze/scikit-learn,liberatorqjw/scikit-learn,YinongLong/scikit-learn,tosolveit/scikit-learn,murali-munna/scikit-learn,tomlof/scikit-learn,Vimos/scikit-learn,schets/scikit-learn,untom/scikit-learn,anntzer/scikit-learn,plissonf/scikit-learn,JsNoNo/scikit-learn,terkkila/scikit-learn,mattilyra/scikit-learn,equialgo/scikit-learn,yask123/scikit-learn,shusenl/scikit-learn,elkingtonmcb/scikit-learn,marcocaccin/scikit-learn,cainiaocome/scikit-learn,cainiaocome/scikit-learn,evgchz/scikit-learn,pythonvietnam/scikit-learn,ldirer/scikit-learn,AlexanderFabisch/scikit-learn,alexsavio/scikit-learn,samzhang111/scikit-learn,samuel1208/scikit-learn,siutanwong/scikit-learn,MohammedWasim/scikit-learn,hugobowne/scikit-learn,idlead/scikit-learn,idlead/scikit-learn,altairpearl/scikit-learn,f3r/scikit-learn,JPFrancoia/scikit-learn,MohammedWasim/scikit-learn,cauchycui/scikit-learn,glemaitre/scikit-learn,andrewnc/scikit-learn,jzt5132/scikit-learn,jakirkham/scikit-learn,AlexandreAbraham/scikit-learn,ZenDevelopmentSystems/scikit-learn,kevin-intel/scikit-learn,hugobowne/scikit-learn,fengzhyuan/scikit-learn,OshynSong/scikit-learn,RPGOne/scikit-learn,robbymeals/scikit-learn,mjudsp/Tsallis,mxjl620/scikit-learn,vibhorag/scikit-learn,liangz0707/scikit-learn,zorojean/scikit-learn,toastedcornflakes/scikit-learn,OshynSong/scikit-learn,Akshay0724/scikit-learn,mugizico/scikit-learn,zorroblue/scikit-learn,Barmaley-exe/scikit-learn,ogrisel/scikit-learn,xavierwu/scikit-learn,tomlof/scikit-learn,3manuek/scikit-learn,glemaitre/scikit-learn,ZENGXH/scikit-learn,aewhatley/scikit-learn,aetilley/scikit-learn,thilbern/scikit-learn,iismd17/scikit-learn,hsuantien/scikit-learn,trankmichael/scikit-learn,yonglehou/scikit-learn,thientu/scikit-learn,qifeigit/scikit-learn,MohammedWasim/scikit-learn,btabibian/scikit-learn,hdmetor/scikit-learn,sergeyf/scikit-learn,rvraghav93/scikit-learn,xubenben/scikit-learn,moutai/scikit-learn,PatrickChrist/scikit-learn,mehdidc/scikit-learn,sanketloke/scikit-learn,xwolf12/scikit-learn,tosolveit/scikit-learn,nmayorov/scikit-learn,466152112/scikit-learn,B3AU/waveTree,shusenl/scikit-learn,hrjn/scikit-learn,vivekmishra1991/scikit-learn,jmetzen/scikit-learn,ldirer/scikit-learn,bthirion/scikit-learn,kmike/scikit-learn,kmike/scikit-learn,bigdataelephants/scikit-learn,alvarofierroclavero/scikit-learn,mojoboss/scikit-learn,betatim/scikit-learn,JsNoNo/scikit-learn,RachitKansal/scikit-learn,shikhardb/scikit-learn,loli/semisupervisedforests,arjoly/scikit-learn,michigraber/scikit-learn,nvoron23/scikit-learn,stylianos-kampakis/scikit-learn,walterreade/scikit-learn,ZenDevelopmentSystems/scikit-learn,sarahgrogan/scikit-learn,arjoly/scikit-learn,cybernet14/scikit-learn,etkirsch/scikit-learn,xwolf12/scikit-learn,joernhees/scikit-learn,NunoEdgarGub1/scikit-learn,fabianp/scikit-learn,glemaitre/scikit-learn,michigraber/scikit-learn,vinayak-mehta/scikit-learn,wanggang3333/scikit-learn,abhishekkrthakur/scikit-learn,ephes/scikit-learn,mlyundin/scikit-learn,adamgreenhall/scikit-learn,mikebenfield/scikit-learn,sergeyf/scikit-learn,rexshihaoren/scikit-learn,amueller/scikit-learn,beepee14/scikit-learn,khkaminska/scikit-learn,bthirion/scikit-learn,jseabold/scikit-learn,wlamond/scikit-learn,3manuek/scikit-learn,luo66/scikit-learn,tdhopper/scikit-learn,jakobworldpeace/scikit-learn,larsmans/scikit-learn,JPFrancoia/scikit-learn,ashhher3/scikit-learn,deepesch/scikit-learn,jpautom/scikit-learn,YinongLong/scikit-learn,nmayorov/scikit-learn,mikebenfield/scikit-learn,AnasGhrab/scikit-learn,xiaoxiamii/scikit-learn,aflaxman/scikit-learn,roxyboy/scikit-learn,Achuth17/scikit-learn,YinongLong/scikit-learn,jorge2703/scikit-learn,heli522/scikit-learn,pv/scikit-learn,0asa/scikit-learn,shangwuhencc/scikit-learn,Achuth17/scikit-learn,ngoix/OCRF,qifeigit/scikit-learn,theoryno3/scikit-learn,pompiduskus/scikit-learn,LohithBlaze/scikit-learn,clemkoa/scikit-learn,zuku1985/scikit-learn,anurag313/scikit-learn,UNR-AERIAL/scikit-learn,spallavolu/scikit-learn,xubenben/scikit-learn,kashif/scikit-learn,mjudsp/Tsallis,r-mart/scikit-learn,bthirion/scikit-learn,wanggang3333/scikit-learn,mojoboss/scikit-learn,aabadie/scikit-learn,dingocuster/scikit-learn,Lawrence-Liu/scikit-learn,lbishal/scikit-learn,HolgerPeters/scikit-learn,imaculate/scikit-learn,vinayak-mehta/scikit-learn,jayflo/scikit-learn,kagayakidan/scikit-learn,mhue/scikit-learn,RomainBrault/scikit-learn,smartscheduling/scikit-learn-categorical-tree,zaxtax/scikit-learn,jjx02230808/project0223,simon-pepin/scikit-learn,xuewei4d/scikit-learn,mehdidc/scikit-learn,fbagirov/scikit-learn,glennq/scikit-learn,yonglehou/scikit-learn,YinongLong/scikit-learn,clemkoa/scikit-learn,arahuja/scikit-learn,alexsavio/scikit-learn,anntzer/scikit-learn,spallavolu/scikit-learn,rajat1994/scikit-learn,ominux/scikit-learn,ndingwall/scikit-learn,RomainBrault/scikit-learn,themrmax/scikit-learn,AnasGhrab/scikit-learn,joshloyal/scikit-learn,Sentient07/scikit-learn,ElDeveloper/scikit-learn,deepesch/scikit-learn,frank-tancf/scikit-learn,Titan-C/scikit-learn,maheshakya/scikit-learn,icdishb/scikit-learn,rrohan/scikit-learn,vinayak-mehta/scikit-learn,belltailjp/scikit-learn,jlegendary/scikit-learn,beepee14/scikit-learn,btabibian/scikit-learn,manhhomienbienthuy/scikit-learn,jjx02230808/project0223,liberatorqjw/scikit-learn,thientu/scikit-learn,zihua/scikit-learn,jorge2703/scikit-learn,sarahgrogan/scikit-learn,JsNoNo/scikit-learn,henridwyer/scikit-learn,thientu/scikit-learn,AIML/scikit-learn,rahul-c1/scikit-learn,DSLituiev/scikit-learn,Fireblend/scikit-learn,murali-munna/scikit-learn,lucidfrontier45/scikit-learn,glemaitre/scikit-learn,sanketloke/scikit-learn,amueller/scikit-learn,mblondel/scikit-learn,huzq/scikit-learn,betatim/scikit-learn,huobaowangxi/scikit-learn,aflaxman/scikit-learn,sarahgrogan/scikit-learn,Adai0808/scikit-learn,abhishekkrthakur/scikit-learn,waterponey/scikit-learn,jlegendary/scikit-learn,mhdella/scikit-learn,RayMick/scikit-learn,thientu/scikit-learn,frank-tancf/scikit-learn,mrshu/scikit-learn,lenovor/scikit-learn,mjgrav2001/scikit-learn,phdowling/scikit-learn,siutanwong/scikit-learn,IndraVikas/scikit-learn,scikit-learn/scikit-learn,mattgiguere/scikit-learn,lbishal/scikit-learn,olologin/scikit-learn,jseabold/scikit-learn,maheshakya/scikit-learn,tosolveit/scikit-learn,yyjiang/scikit-learn,robin-lai/scikit-learn,glennq/scikit-learn,wanggang3333/scikit-learn,abhishekgahlot/scikit-learn,wzbozon/scikit-learn,andrewnc/scikit-learn,ngoix/OCRF,kmike/scikit-learn,0asa/scikit-learn,jorik041/scikit-learn,jmschrei/scikit-learn,akionakamura/scikit-learn,raghavrv/scikit-learn,robin-lai/scikit-learn,jereze/scikit-learn,lesteve/scikit-learn,ishanic/scikit-learn,voxlol/scikit-learn,tdhopper/scikit-learn,elkingtonmcb/scikit-learn,r-mart/scikit-learn,0asa/scikit-learn,Srisai85/scikit-learn,adamgreenhall/scikit-learn,ndingwall/scikit-learn,shenzebang/scikit-learn,f3r/scikit-learn,pnedunuri/scikit-learn,shikhardb/scikit-learn,cl4rke/scikit-learn,saiwing-yeung/scikit-learn,hdmetor/scikit-learn,anurag313/scikit-learn,waterponey/scikit-learn,rvraghav93/scikit-learn,heli522/scikit-learn,michigraber/scikit-learn,tomlof/scikit-learn,simon-pepin/scikit-learn,mojoboss/scikit-learn,rohanp/scikit-learn,AIML/scikit-learn,wanggang3333/scikit-learn,toastedcornflakes/scikit-learn,pythonvietnam/scikit-learn,petosegan/scikit-learn,theoryno3/scikit-learn,hainm/scikit-learn,rrohan/scikit-learn,krez13/scikit-learn,deepesch/scikit-learn,luo66/scikit-learn,pkruskal/scikit-learn,vermouthmjl/scikit-learn,etkirsch/scikit-learn,madjelan/scikit-learn,mxjl620/scikit-learn,jlegendary/scikit-learn,manhhomienbienthuy/scikit-learn,victorbergelin/scikit-learn,xyguo/scikit-learn,MartinSavc/scikit-learn,aflaxman/scikit-learn,pnedunuri/scikit-learn,Titan-C/scikit-learn,loli/semisupervisedforests,Obus/scikit-learn,waterponey/scikit-learn,chrsrds/scikit-learn,anurag313/scikit-learn,massmutual/scikit-learn,Fireblend/scikit-learn,herilalaina/scikit-learn,mblondel/scikit-learn,RayMick/scikit-learn,CforED/Machine-Learning,pv/scikit-learn,mwv/scikit-learn,Sentient07/scikit-learn,aetilley/scikit-learn,mattgiguere/scikit-learn,kevin-intel/scikit-learn,vshtanko/scikit-learn,sergeyf/scikit-learn,zihua/scikit-learn,adamgreenhall/scikit-learn,costypetrisor/scikit-learn,robbymeals/scikit-learn,Clyde-fare/scikit-learn,HolgerPeters/scikit-learn,r-mart/scikit-learn,glouppe/scikit-learn,ankurankan/scikit-learn,Vimos/scikit-learn,giorgiop/scikit-learn,fzalkow/scikit-learn,mhue/scikit-learn,jlegendary/scikit-learn,B3AU/waveTree,ilyes14/scikit-learn,Clyde-fare/scikit-learn,theoryno3/scikit-learn,chrsrds/scikit-learn,joernhees/scikit-learn,evgchz/scikit-learn,bikong2/scikit-learn,ZENGXH/scikit-learn,ephes/scikit-learn,fbagirov/scikit-learn,Nyker510/scikit-learn,mwv/scikit-learn,OshynSong/scikit-learn,olologin/scikit-learn,RPGOne/scikit-learn,dsquareindia/scikit-learn,kaichogami/scikit-learn,voxlol/scikit-learn,JeanKossaifi/scikit-learn,themrmax/scikit-learn,manashmndl/scikit-learn,Windy-Ground/scikit-learn,JosmanPS/scikit-learn,ndingwall/scikit-learn,icdishb/scikit-learn,zhenv5/scikit-learn,wlamond/scikit-learn,russel1237/scikit-learn,xyguo/scikit-learn,jakirkham/scikit-learn,djgagne/scikit-learn,kylerbrown/scikit-learn,sgenoud/scikit-learn,eickenberg/scikit-learn,potash/scikit-learn,jereze/scikit-learn,walterreade/scikit-learn,cybernet14/scikit-learn,ChanChiChoi/scikit-learn,hlin117/scikit-learn,mattgiguere/scikit-learn,waterponey/scikit-learn,voxlol/scikit-learn,yunfeilu/scikit-learn,murali-munna/scikit-learn,ankurankan/scikit-learn,andrewnc/scikit-learn,tdhopper/scikit-learn,ivannz/scikit-learn,jjx02230808/project0223,mugizico/scikit-learn,tawsifkhan/scikit-learn,vshtanko/scikit-learn,yunfeilu/scikit-learn,ilyes14/scikit-learn,shangwuhencc/scikit-learn,yyjiang/scikit-learn,Nyker510/scikit-learn,mrshu/scikit-learn,marcocaccin/scikit-learn,elkingtonmcb/scikit-learn,Srisai85/scikit-learn,fredhusser/scikit-learn,sumspr/scikit-learn,mikebenfield/scikit-learn,abimannans/scikit-learn,glouppe/scikit-learn,IssamLaradji/scikit-learn,mwv/scikit-learn,lesteve/scikit-learn,sergeyf/scikit-learn,pnedunuri/scikit-learn,hlin117/scikit-learn,hsiaoyi0504/scikit-learn,untom/scikit-learn,zaxtax/scikit-learn,altairpearl/scikit-learn,treycausey/scikit-learn,nrhine1/scikit-learn,wazeerzulfikar/scikit-learn,shyamalschandra/scikit-learn,roxyboy/scikit-learn,zorojean/scikit-learn,harshaneelhg/scikit-learn,rsivapr/scikit-learn,ycaihua/scikit-learn,poryfly/scikit-learn,iismd17/scikit-learn,equialgo/scikit-learn,glennq/scikit-learn,MatthieuBizien/scikit-learn,kjung/scikit-learn,vortex-ape/scikit-learn,bhargav/scikit-learn,0asa/scikit-learn,466152112/scikit-learn,Clyde-fare/scikit-learn,sgenoud/scikit-learn,AlexanderFabisch/scikit-learn,ankurankan/scikit-learn,appapantula/scikit-learn,deepesch/scikit-learn,ankurankan/scikit-learn,nikitasingh981/scikit-learn,vybstat/scikit-learn,chrisburr/scikit-learn,cauchycui/scikit-learn,evgchz/scikit-learn,RayMick/scikit-learn,JeanKossaifi/scikit-learn,ChanChiChoi/scikit-learn,davidgbe/scikit-learn,kaichogami/scikit-learn,aewhatley/scikit-learn,NelisVerhoef/scikit-learn,jakirkham/scikit-learn,mhdella/scikit-learn,rajat1994/scikit-learn,nesterione/scikit-learn,ashhher3/scikit-learn,ahoyosid/scikit-learn,depet/scikit-learn,dsullivan7/scikit-learn,mrshu/scikit-learn,nhejazi/scikit-learn,simon-pepin/scikit-learn,jmschrei/scikit-learn,aabadie/scikit-learn,pv/scikit-learn,JosmanPS/scikit-learn,treycausey/scikit-learn,fabioticconi/scikit-learn,DonBeo/scikit-learn,madjelan/scikit-learn,smartscheduling/scikit-learn-categorical-tree,macks22/scikit-learn,CforED/Machine-Learning,samuel1208/scikit-learn,JPFrancoia/scikit-learn,Obus/scikit-learn,kylerbrown/scikit-learn,Lawrence-Liu/scikit-learn,ningchi/scikit-learn,pratapvardhan/scikit-learn,andaag/scikit-learn,mfjb/scikit-learn,gclenaghan/scikit-learn,belltailjp/scikit-learn,jayflo/scikit-learn,thilbern/scikit-learn,xubenben/scikit-learn,Aasmi/scikit-learn,fbagirov/scikit-learn,rahul-c1/scikit-learn,rahuldhote/scikit-learn,fyffyt/scikit-learn,carrillo/scikit-learn,quheng/scikit-learn,DonBeo/scikit-learn,jseabold/scikit-learn,mayblue9/scikit-learn,zorroblue/scikit-learn,elkingtonmcb/scikit-learn,xiaoxiamii/scikit-learn,terkkila/scikit-learn,olologin/scikit-learn,MatthieuBizien/scikit-learn,harshaneelhg/scikit-learn,jayflo/scikit-learn,BiaDarkia/scikit-learn,Adai0808/scikit-learn,q1ang/scikit-learn,cdegroc/scikit-learn,NelisVerhoef/scikit-learn,robin-lai/scikit-learn,nomadcube/scikit-learn,rvraghav93/scikit-learn,rohanp/scikit-learn,yyjiang/scikit-learn,pythonvietnam/scikit-learn,q1ang/scikit-learn,hsiaoyi0504/scikit-learn,liangz0707/scikit-learn,hrjn/scikit-learn,liyu1990/sklearn,abimannans/scikit-learn,TomDLT/scikit-learn,sumspr/scikit-learn,pompiduskus/scikit-learn,tawsifkhan/scikit-learn,zaxtax/scikit-learn,ivannz/scikit-learn,justincassidy/scikit-learn,siutanwong/scikit-learn,madjelan/scikit-learn,AnasGhrab/scikit-learn,MartinSavc/scikit-learn,procoder317/scikit-learn,wazeerzulfikar/scikit-learn,lucidfrontier45/scikit-learn,manashmndl/scikit-learn,RachitKansal/scikit-learn,chrisburr/scikit-learn,henrykironde/scikit-learn,mayblue9/scikit-learn,cdegroc/scikit-learn,bnaul/scikit-learn,cainiaocome/scikit-learn,bikong2/scikit-learn,fyffyt/scikit-learn,abhishekgahlot/scikit-learn,vibhorag/scikit-learn,0x0all/scikit-learn,mugizico/scikit-learn,sgenoud/scikit-learn,florian-f/sklearn,PatrickChrist/scikit-learn,pkruskal/scikit-learn,Djabbz/scikit-learn,MartinDelzant/scikit-learn,RPGOne/scikit-learn,kmike/scikit-learn,f3r/scikit-learn,arahuja/scikit-learn,Sentient07/scikit-learn,3manuek/scikit-learn,Myasuka/scikit-learn,Windy-Ground/scikit-learn,mxjl620/scikit-learn,alexeyum/scikit-learn,LiaoPan/scikit-learn,nikitasingh981/scikit-learn,scikit-learn/scikit-learn,mattilyra/scikit-learn,tawsifkhan/scikit-learn,DonBeo/scikit-learn,lucidfrontier45/scikit-learn,yask123/scikit-learn,ssaeger/scikit-learn,iismd17/scikit-learn,ssaeger/scikit-learn,Aasmi/scikit-learn,vigilv/scikit-learn,devanshdalal/scikit-learn,jmetzen/scikit-learn,jakobworldpeace/scikit-learn,ahoyosid/scikit-learn,idlead/scikit-learn,justincassidy/scikit-learn,ilo10/scikit-learn,PatrickChrist/scikit-learn,ElDeveloper/scikit-learn,kashif/scikit-learn,harshaneelhg/scikit-learn,arahuja/scikit-learn,samzhang111/scikit-learn,potash/scikit-learn,meduz/scikit-learn,treycausey/scikit-learn,florian-f/sklearn,mikebenfield/scikit-learn,vshtanko/scikit-learn,iismd17/scikit-learn,loli/sklearn-ensembletrees,vivekmishra1991/scikit-learn,kagayakidan/scikit-learn,Myasuka/scikit-learn,Lawrence-Liu/scikit-learn,Nyker510/scikit-learn,joernhees/scikit-learn,xzh86/scikit-learn,jm-begon/scikit-learn,beepee14/scikit-learn,anntzer/scikit-learn,xubenben/scikit-learn,JeanKossaifi/scikit-learn,meduz/scikit-learn,Titan-C/scikit-learn,B3AU/waveTree,terkkila/scikit-learn,lbishal/scikit-learn,robbymeals/scikit-learn,glouppe/scikit-learn,abhishekgahlot/scikit-learn,djgagne/scikit-learn,abhishekgahlot/scikit-learn,frank-tancf/scikit-learn,rahul-c1/scikit-learn,cauchycui/scikit-learn,khkaminska/scikit-learn,eg-zhang/scikit-learn,billy-inn/scikit-learn,wazeerzulfikar/scikit-learn,wazeerzulfikar/scikit-learn,HolgerPeters/scikit-learn,icdishb/scikit-learn,shenzebang/scikit-learn,davidgbe/scikit-learn,mhdella/scikit-learn,russel1237/scikit-learn,schets/scikit-learn,ngoix/OCRF,cybernet14/scikit-learn,bhargav/scikit-learn,carrillo/scikit-learn,kylerbrown/scikit-learn,terkkila/scikit-learn,pratapvardhan/scikit-learn,arjoly/scikit-learn,scikit-learn/scikit-learn,Srisai85/scikit-learn,anirudhjayaraman/scikit-learn,ngoix/OCRF,fzalkow/scikit-learn,poryfly/scikit-learn,herilalaina/scikit-learn,BiaDarkia/scikit-learn,yanlend/scikit-learn,alvarofierroclavero/scikit-learn,phdowling/scikit-learn,treycausey/scikit-learn,PatrickOReilly/scikit-learn,pianomania/scikit-learn,Fireblend/scikit-learn,yunfeilu/scikit-learn,loli/sklearn-ensembletrees,ChanChiChoi/scikit-learn,Sentient07/scikit-learn,jmschrei/scikit-learn,Djabbz/scikit-learn,andrewnc/scikit-learn,IssamLaradji/scikit-learn,imaculate/scikit-learn,chrisburr/scikit-learn,krez13/scikit-learn,jereze/scikit-learn,zuku1985/scikit-learn,AlexanderFabisch/scikit-learn,joernhees/scikit-learn,Obus/scikit-learn,sonnyhu/scikit-learn,CVML/scikit-learn,andaag/scikit-learn,tmhm/scikit-learn,adamgreenhall/scikit-learn,ogrisel/scikit-learn,liangz0707/scikit-learn,heli522/scikit-learn,gotomypc/scikit-learn,trungnt13/scikit-learn,bikong2/scikit-learn,voxlol/scikit-learn,yask123/scikit-learn,pratapvardhan/scikit-learn,herilalaina/scikit-learn,petosegan/scikit-learn,aetilley/scikit-learn,jm-begon/scikit-learn,hsiaoyi0504/scikit-learn,jblackburne/scikit-learn,cdegroc/scikit-learn,tmhm/scikit-learn,wzbozon/scikit-learn,kylerbrown/scikit-learn,anurag313/scikit-learn,huzq/scikit-learn,alexeyum/scikit-learn,costypetrisor/scikit-learn,jzt5132/scikit-learn,466152112/scikit-learn,procoder317/scikit-learn,altairpearl/scikit-learn,jblackburne/scikit-learn,florian-f/sklearn,vermouthmjl/scikit-learn,raghavrv/scikit-learn,shyamalschandra/scikit-learn,roxyboy/scikit-learn,amueller/scikit-learn,xzh86/scikit-learn,wzbozon/scikit-learn,LohithBlaze/scikit-learn,bikong2/scikit-learn,Clyde-fare/scikit-learn,abimannans/scikit-learn,trankmichael/scikit-learn,jpautom/scikit-learn,rishikksh20/scikit-learn,manashmndl/scikit-learn,sinhrks/scikit-learn,dingocuster/scikit-learn,henrykironde/scikit-learn,ky822/scikit-learn,henrykironde/scikit-learn,massmutual/scikit-learn,kjung/scikit-learn,tosolveit/scikit-learn,potash/scikit-learn,fbagirov/scikit-learn,alvarofierroclavero/scikit-learn,AlexRobson/scikit-learn,AlexandreAbraham/scikit-learn,florian-f/sklearn,chrsrds/scikit-learn,pompiduskus/scikit-learn,joshloyal/scikit-learn,Achuth17/scikit-learn,idlead/scikit-learn,anirudhjayaraman/scikit-learn,billy-inn/scikit-learn,mjgrav2001/scikit-learn,lenovor/scikit-learn,mwv/scikit-learn,petosegan/scikit-learn,lenovor/scikit-learn,ngoix/OCRF,ZenDevelopmentSystems/scikit-learn,hitszxp/scikit-learn,h2educ/scikit-learn,macks22/scikit-learn,sumspr/scikit-learn,mattgiguere/scikit-learn,zihua/scikit-learn,ZENGXH/scikit-learn,rahuldhote/scikit-learn,fabianp/scikit-learn,IshankGulati/scikit-learn,cwu2011/scikit-learn,CforED/Machine-Learning,jorge2703/scikit-learn,maheshakya/scikit-learn,marcocaccin/scikit-learn,manhhomienbienthuy/scikit-learn,luo66/scikit-learn,ChanderG/scikit-learn,loli/sklearn-ensembletrees,liyu1990/sklearn,jblackburne/scikit-learn,xzh86/scikit-learn,cwu2011/scikit-learn,mblondel/scikit-learn,pnedunuri/scikit-learn,pythonvietnam/scikit-learn,kashif/scikit-learn,hainm/scikit-learn,gclenaghan/scikit-learn,samuel1208/scikit-learn,liberatorqjw/scikit-learn,hrjn/scikit-learn,rexshihaoren/scikit-learn,ningchi/scikit-learn,hitszxp/scikit-learn,glennq/scikit-learn,robbymeals/scikit-learn,hsuantien/scikit-learn,belltailjp/scikit-learn,Windy-Ground/scikit-learn,hugobowne/scikit-learn,ky822/scikit-learn,ClimbsRocks/scikit-learn,henridwyer/scikit-learn,raghavrv/scikit-learn,altairpearl/scikit-learn,nesterione/scikit-learn,justincassidy/scikit-learn,sanketloke/scikit-learn,AlexanderFabisch/scikit-learn,shahankhatch/scikit-learn,yyjiang/scikit-learn,loli/sklearn-ensembletrees,zhenv5/scikit-learn,MartinDelzant/scikit-learn,qifeigit/scikit-learn,fengzhyuan/scikit-learn,hdmetor/scikit-learn,cl4rke/scikit-learn,vybstat/scikit-learn,arabenjamin/scikit-learn,billy-inn/scikit-learn,Fireblend/scikit-learn,huobaowangxi/scikit-learn,kashif/scikit-learn,yanlend/scikit-learn,bigdataelephants/scikit-learn,rahul-c1/scikit-learn,yunfeilu/scikit-learn,bnaul/scikit-learn,mjudsp/Tsallis,ahoyosid/scikit-learn,shahankhatch/scikit-learn,lesteve/scikit-learn,fabianp/scikit-learn,krez13/scikit-learn,sanketloke/scikit-learn,nhejazi/scikit-learn,saiwing-yeung/scikit-learn,CVML/scikit-learn,rishikksh20/scikit-learn,nmayorov/scikit-learn,spallavolu/scikit-learn,shangwuhencc/scikit-learn,btabibian/scikit-learn,xiaoxiamii/scikit-learn,rishikksh20/scikit-learn,meduz/scikit-learn,ChanderG/scikit-learn,lucidfrontier45/scikit-learn,mfjb/scikit-learn,depet/scikit-learn,thilbern/scikit-learn,rishikksh20/scikit-learn,rrohan/scikit-learn,nvoron23/scikit-learn,ndingwall/scikit-learn,pypot/scikit-learn,pratapvardhan/scikit-learn,NunoEdgarGub1/scikit-learn,zaxtax/scikit-learn,ilo10/scikit-learn,jaidevd/scikit-learn,PatrickOReilly/scikit-learn,bigdataelephants/scikit-learn,Lawrence-Liu/scikit-learn,nelson-liu/scikit-learn,vivekmishra1991/scikit-learn,ltiao/scikit-learn,joshloyal/scikit-learn,abhishekkrthakur/scikit-learn,jakobworldpeace/scikit-learn,jkarnows/scikit-learn,fabioticconi/scikit-learn,yanlend/scikit-learn,IshankGulati/scikit-learn,Adai0808/scikit-learn,xuewei4d/scikit-learn,ilo10/scikit-learn,NelisVerhoef/scikit-learn,gotomypc/scikit-learn,pompiduskus/scikit-learn,IndraVikas/scikit-learn,toastedcornflakes/scikit-learn,mjudsp/Tsallis,victorbergelin/scikit-learn,costypetrisor/scikit-learn,PatrickOReilly/scikit-learn,jorik041/scikit-learn,giorgiop/scikit-learn,dhruv13J/scikit-learn,zuku1985/scikit-learn,IshankGulati/scikit-learn,hitszxp/scikit-learn,jm-begon/scikit-learn,gclenaghan/scikit-learn,rahuldhote/scikit-learn,lazywei/scikit-learn,kjung/scikit-learn,mlyundin/scikit-learn,OshynSong/scikit-learn,nrhine1/scikit-learn,heli522/scikit-learn,theoryno3/scikit-learn,ashhher3/scikit-learn,scikit-learn/scikit-learn,kevin-intel/scikit-learn,AIML/scikit-learn,jzt5132/scikit-learn,AnasGhrab/scikit-learn,xyguo/scikit-learn,smartscheduling/scikit-learn-categorical-tree,betatim/scikit-learn,vortex-ape/scikit-learn,vinayak-mehta/scikit-learn,appapantula/scikit-learn,abimannans/scikit-learn,nelson-liu/scikit-learn,Garrett-R/scikit-learn,zorojean/scikit-learn,ClimbsRocks/scikit-learn,mojoboss/scikit-learn,mattilyra/scikit-learn,walterreade/scikit-learn,jaidevd/scikit-learn,djgagne/scikit-learn,NunoEdgarGub1/scikit-learn,MechCoder/scikit-learn,procoder317/scikit-learn,larsmans/scikit-learn,dingocuster/scikit-learn,hdmetor/scikit-learn,manashmndl/scikit-learn,TomDLT/scikit-learn,hrjn/scikit-learn,ominux/scikit-learn,samuel1208/scikit-learn,xwolf12/scikit-learn,marcocaccin/scikit-learn,ldirer/scikit-learn,henrykironde/scikit-learn,huobaowangxi/scikit-learn,tomlof/scikit-learn,nmayorov/scikit-learn,lazywei/scikit-learn,equialgo/scikit-learn,AlexRobson/scikit-learn,shusenl/scikit-learn,djgagne/scikit-learn,walterreade/scikit-learn,victorbergelin/scikit-learn,B3AU/waveTree,MohammedWasim/scikit-learn,khkaminska/scikit-learn,eg-zhang/scikit-learn,costypetrisor/scikit-learn,abhishekgahlot/scikit-learn,xyguo/scikit-learn,pypot/scikit-learn,mrshu/scikit-learn,appapantula/scikit-learn,fzalkow/scikit-learn,betatim/scikit-learn,moutai/scikit-learn,hugobowne/scikit-learn,MartinDelzant/scikit-learn,bhargav/scikit-learn,hainm/scikit-learn,0asa/scikit-learn,h2educ/scikit-learn,plissonf/scikit-learn,cainiaocome/scikit-learn,lenovor/scikit-learn,jm-begon/scikit-learn,ClimbsRocks/scikit-learn,dsullivan7/scikit-learn,lin-credible/scikit-learn,wlamond/scikit-learn,wzbozon/scikit-learn,eickenberg/scikit-learn,ChanderG/scikit-learn,Akshay0724/scikit-learn,henridwyer/scikit-learn,mfjb/scikit-learn,evgchz/scikit-learn,mhue/scikit-learn,nomadcube/scikit-learn,aflaxman/scikit-learn,RayMick/scikit-learn,shenzebang/scikit-learn,andaag/scikit-learn,B3AU/waveTree,akionakamura/scikit-learn,gotomypc/scikit-learn,xuewei4d/scikit-learn,pypot/scikit-learn,jmetzen/scikit-learn,bthirion/scikit-learn,spallavolu/scikit-learn,amueller/scikit-learn,mlyundin/scikit-learn,DonBeo/scikit-learn,schets/scikit-learn,sinhrks/scikit-learn,stylianos-kampakis/scikit-learn,kmike/scikit-learn,themrmax/scikit-learn,RachitKansal/scikit-learn,ChanderG/scikit-learn,ivannz/scikit-learn,thilbern/scikit-learn,espg/scikit-learn,CforED/Machine-Learning,russel1237/scikit-learn,pkruskal/scikit-learn,MechCoder/scikit-learn,treycausey/scikit-learn,kagayakidan/scikit-learn,sgenoud/scikit-learn,rajat1994/scikit-learn,sinhrks/scikit-learn,sonnyhu/scikit-learn,procoder317/scikit-learn,DSLituiev/scikit-learn,jmetzen/scikit-learn,ilyes14/scikit-learn,carrillo/scikit-learn,PrashntS/scikit-learn,plissonf/scikit-learn,jorge2703/scikit-learn,dsullivan7/scikit-learn,ogrisel/scikit-learn,alvarofierroclavero/scikit-learn,herilalaina/scikit-learn,giorgiop/scikit-learn,fabioticconi/scikit-learn,yonglehou/scikit-learn,pv/scikit-learn,UNR-AERIAL/scikit-learn,gclenaghan/scikit-learn,BiaDarkia/scikit-learn,depet/scikit-learn,lucidfrontier45/scikit-learn,MatthieuBizien/scikit-learn,tdhopper/scikit-learn,mrshu/scikit-learn,etkirsch/scikit-learn,untom/scikit-learn,lazywei/scikit-learn,Adai0808/scikit-learn,appapantula/scikit-learn,ycaihua/scikit-learn,massmutual/scikit-learn,zihua/scikit-learn,zhenv5/scikit-learn,shenzebang/scikit-learn,fengzhyuan/scikit-learn,tmhm/scikit-learn,zorojean/scikit-learn,chrsrds/scikit-learn,mayblue9/scikit-learn,victorbergelin/scikit-learn,fredhusser/scikit-learn,eg-zhang/scikit-learn,alexsavio/scikit-learn,shikhardb/scikit-learn,maheshakya/scikit-learn,PrashntS/scikit-learn,imaculate/scikit-learn,sarahgrogan/scikit-learn,giorgiop/scikit-learn,jblackburne/scikit-learn,Barmaley-exe/scikit-learn,dhruv13J/scikit-learn,saiwing-yeung/scikit-learn,samzhang111/scikit-learn,nomadcube/scikit-learn,fengzhyuan/scikit-learn,Windy-Ground/scikit-learn,xiaoxiamii/scikit-learn,stylianos-kampakis/scikit-learn,jpautom/scikit-learn,CVML/scikit-learn,RomainBrault/scikit-learn,mjgrav2001/scikit-learn,ivannz/scikit-learn,ZENGXH/scikit-learn,nelson-liu/scikit-learn,zorroblue/scikit-learn,davidgbe/scikit-learn,larsmans/scikit-learn,carrillo/scikit-learn,LohithBlaze/scikit-learn,MartinSavc/scikit-learn,liangz0707/scikit-learn,MechCoder/scikit-learn,murali-munna/scikit-learn,rohanp/scikit-learn,LiaoPan/scikit-learn,xzh86/scikit-learn,bhargav/scikit-learn,nhejazi/scikit-learn,quheng/scikit-learn,DSLituiev/scikit-learn,vshtanko/scikit-learn,nelson-liu/scikit-learn,depet/scikit-learn,alexeyum/scikit-learn,equialgo/scikit-learn,Vimos/scikit-learn,kjung/scikit-learn,ishanic/scikit-learn,aetilley/scikit-learn,ycaihua/scikit-learn,zhenv5/scikit-learn,plissonf/scikit-learn,moutai/scikit-learn,manhhomienbienthuy/scikit-learn,joshloyal/scikit-learn,ltiao/scikit-learn,yask123/scikit-learn,tmhm/scikit-learn,massmutual/scikit-learn,xuewei4d/scikit-learn,ycaihua/scikit-learn,espg/scikit-learn,arabenjamin/scikit-learn,macks22/scikit-learn,petosegan/scikit-learn,loli/sklearn-ensembletrees,nikitasingh981/scikit-learn,Barmaley-exe/scikit-learn,nvoron23/scikit-learn,huobaowangxi/scikit-learn,xavierwu/scikit-learn,nesterione/scikit-learn,belltailjp/scikit-learn,lbishal/scikit-learn,IssamLaradji/scikit-learn,siutanwong/scikit-learn,mehdidc/scikit-learn,shahankhatch/scikit-learn,vybstat/scikit-learn,MechCoder/scikit-learn,kaichogami/scikit-learn,akionakamura/scikit-learn,dsullivan7/scikit-learn,ahoyosid/scikit-learn,davidgbe/scikit-learn,jmschrei/scikit-learn,nhejazi/scikit-learn,JPFrancoia/scikit-learn,clemkoa/scikit-learn,shangwuhencc/scikit-learn,mhdella/scikit-learn,Garrett-R/scikit-learn,qifeigit/scikit-learn,rsivapr/scikit-learn,moutai/scikit-learn,IssamLaradji/scikit-learn,trungnt13/scikit-learn,kagayakidan/scikit-learn,jkarnows/scikit-learn,jakirkham/scikit-learn,mattilyra/scikit-learn,fredhusser/scikit-learn,shyamalschandra/scikit-learn,Barmaley-exe/scikit-learn,mehdidc/scikit-learn,mattilyra/scikit-learn,potash/scikit-learn,larsmans/scikit-learn,arjoly/scikit-learn,liberatorqjw/scikit-learn,quheng/scikit-learn,cdegroc/scikit-learn,arabenjamin/scikit-learn,imaculate/scikit-learn,JsNoNo/scikit-learn,hsuantien/scikit-learn,PatrickChrist/scikit-learn,arabenjamin/scikit-learn,gotomypc/scikit-learn,eickenberg/scikit-learn,mhue/scikit-learn,ishanic/scikit-learn,TomDLT/scikit-learn,hitszxp/scikit-learn,nikitasingh981/scikit-learn | scikits/learn/machine/svm/__init__.py | scikits/learn/machine/svm/__init__.py | """
A Support Vector Machine, this module defines the following classes:
- `LibSvmCClassificationModel`, a model for C-SV classification
- `LibSvmNuClassificationModel`, a model for nu-SV classification
- `LibSvmEpsilonRegressionModel`, a model for epsilon-SV regression
- `LibSvmNuRegressionModel`, a model for nu-SV regression
- `LibSvmOneClassModel`, a model for distribution estimation
(one-class SVM)
Kernel classes:
- `LinearKernel`, a linear kernel
- `PolynomialKernel`, a polynomial kernel
- `RBFKernel`, a radial basis function kernel
- `SigmoidKernel`, a sigmoid kernel
- `CustomKernel`, a kernel that wraps any callable
Dataset classes:
- `LibSvmClassificationDataSet`, a dataset for training classification
models
- `LibSvmRegressionDataSet`, a dataset for training regression models
- `LibSvmOneClassDataSet`, a dataset for training distribution
estimation (one-class SVM) models
- `LibSvmTestDataSet`, a dataset for testing with any model
Data type classes:
- `svm_node_dtype`, the libsvm data type for its arrays
How To Use This Module
======================
(See the individual classes, methods, and attributes for details.)
1. Import it: ``import svm`` or ``from svm import ...``.
2. Create a training dataset for your problem::
traindata = LibSvmClassificationDataSet(labels, x)
traindata = LibSvmRegressionDataSet(y, x)
traindata = LibSvmOneClassDataSet(x)
where x is sequence of NumPy arrays containing scalars or
svm_node_dtype entries.
3. Create a test dataset::
testdata = LibSvmTestDataSet(u)
4. Create a model and fit it to the training data::
model = LibSvmCClassificationModel(kernel)
results = model.fit(traindata)
5. Use the results to make predictions with the test data::
p = results.predict(testdata)
v = results.predict_values(testdata)
"""
from classification import *
from regression import *
from oneclass import *
from dataset import *
from kernel import *
from predict import *
from numpy.testing import NumpyTest
test = NumpyTest().test
def test_suite(*args):
# XXX: this is to avoid recursive call to itself. This is an horrible hack,
# I have no idea why infinite recursion happens otherwise.
if len(args) > 0:
import unittest
return unittest.TestSuite()
return NumpyTest().test(level = -10)
| """
A Support Vector Machine, this module defines the following classes:
- `LibSvmCClassificationModel`, a model for C-SV classification
- `LibSvmNuClassificationModel`, a model for nu-SV classification
- `LibSvmEpsilonRegressionModel`, a model for epsilon-SV regression
- `LibSvmNuRegressionModel`, a model for nu-SV regression
- `LibSvmOneClassModel`, a model for distribution estimation
(one-class SVM)
Kernel classes:
- `LinearKernel`, a linear kernel
- `PolynomialKernel`, a polynomial kernel
- `RBFKernel`, a radial basis function kernel
- `SigmoidKernel`, a sigmoid kernel
- `CustomKernel`, a kernel that wraps any callable
Dataset classes:
- `LibSvmClassificationDataSet`, a dataset for training classification
models
- `LibSvmRegressionDataSet`, a dataset for training regression models
- `LibSvmOneClassDataSet`, a dataset for training distribution
estimation (one-class SVM) models
- `LibSvmTestDataSet`, a dataset for testing with any model
Data type classes:
- `svm_node_dtype`, the libsvm data type for its arrays
How To Use This Module
======================
(See the individual classes, methods, and attributes for details.)
1. Import it: ``import svm`` or ``from svm import ...``.
2. Create a training dataset for your problem::
traindata = LibSvmClassificationDataSet(labels, x)
traindata = LibSvmRegressionDataSet(y, x)
traindata = LibSvmOneClassDataSet(x)
where x is sequence of NumPy arrays containing scalars or
svm_node_dtype entries.
3. Create a test dataset::
testdata = LibSvmTestDataSet(u)
4. Create a model and fit it to the training data::
model = LibSvmCClassificationModel(kernel)
results = model.fit(traindata)
5. Use the results to make predictions with the test data::
p = results.predict(testdata)
v = results.predict_values(testdata)
"""
from classification import *
from regression import *
from oneclass import *
from dataset import *
from kernel import *
from predict import *
| bsd-3-clause | Python |
5a27a8e0c7ae2e0cef787db107305251d096d81f | Add test runner. | rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy | lib/rapidsms/tests/runtests.py | lib/rapidsms/tests/runtests.py | #!/usr/bin/python
from test_component import *
if __name__ == "__main__":
unittest.main()
| bsd-3-clause | Python |
|
2f9152d5cc0ad4123522b054dd2b6458c602b1fd | add script for dataset | molecularsets/moses,molecularsets/moses | moses/scripts/download_dataset.py | moses/scripts/download_dataset.py | import argparse
import os
import pandas as pd
from urllib import request
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--output_dir', type=str, default='./data',
help='Directory for downloaded dataset')
parser.add_argument('--dataset_url', type=str, default='https://media.githubusercontent.com/media/neuromation/mnist4molecules/master-fixes/data/dataset.csv?token=AORf9_1XuBXJjCmYV--t6f1Ui5aVe-WEks5bvLClwA%3D%3D',
help='URL of dataset')
parser.add_argument('--no_subset', action='store_true',
help='Do not create subsets for training and testing')
parser.add_argument('--train_size', type=int, default=200000,
help='Size of training dataset')
parser.add_argument('--test_size', type=int, default=10000,
help='Size of testing dataset')
parser.add_argument('--seed', type=int, default=0,
help='Random state')
return parser
def main(config):
if not os.path.exists(config.output_dir):
os.mkdir(config.output_dir)
dataset_path = os.path.join(config.output_dir, 'dataset.csv')
request.urlretrieve(config.dataset_url, dataset_path)
if config.no_subset:
return
data = pd.read_csv(dataset_path)
train_data = data[data['SPLIT'] == 'train']
test_data = data[data['SPLIT'] == 'test']
test_scaffolds_data = data[data['SPLIT'] == 'test_scaffolds']
train_data = train_data.sample(config.train_size, random_state=config.seed)
test_data = test_data.sample(config.test_size, random_state=config.seed)
test_scaffolds_data = test_scaffolds_data.sample(config.test_size, random_state=config.seed)
train_data.to_csv(os.path.join(config.output_dir, 'train.csv'), index=False)
test_data.to_csv(os.path.join(config.output_dir, 'test.csv'), index=False)
test_scaffolds_data.to_csv(os.path.join(config.output_dir, 'test_scaffolds.csv'), index=False)
if __name__ == '__main__':
parser = get_parser()
config = parser.parse_known_args()[0]
main(config) | mit | Python |
|
19712e8e7b9423d4cb4bb22c37c7d8d2ea0559c5 | Add example to show listing of USB devices | solus-project/linux-driver-management,solus-project/linux-driver-management | examples/list-usb.py | examples/list-usb.py | #!/usr/bin/env python2
#
# This file is Public Domain and provided only for documentation purposes.
#
# Run : python2 ./list-usb.py
#
# Note: This will happily run with Python3 too, I just picked a common baseline
#
import gi
gi.require_version('Ldm', '0.1')
from gi.repository import Ldm, GObject
class PretendyPlugin(Ldm.Plugin):
# Not really needed but good practice
__gtype_name__ = "PretendyPlugin"
def __init__(self):
Ldm.Plugin.__init__(self)
def do_get_provider(self, device):
""" Demonstrate basic matching with custom plugins """
if not device.has_type(Ldm.DeviceType.AUDIO):
return None
return Ldm.Provider.new(self, device, "pretendy-package")
def main():
manager = Ldm.Manager()
manager.add_plugin(PretendyPlugin())
for device in manager.get_devices(Ldm.DeviceType.USB):
# Use gobject properties or methods
print("USB Device: {} {}".format(
device.props.vendor,
device.get_name()))
if device.has_type(Ldm.DeviceType.HID):
print("\tHID Device!")
for provider in manager.get_providers(device):
plugin = provider.get_plugin()
print("\tSuggested package: {}".format(provider.get_package()))
if __name__ == "__main__":
main()
| lgpl-2.1 | Python |
|
b56690d046021e036b5b15c484d86c92f3519600 | Add partial evaluation tool to replace functools module for python < 2.5 | shikhardb/scikit-learn,ClimbsRocks/scikit-learn,bthirion/scikit-learn,samuel1208/scikit-learn,sinhrks/scikit-learn,OshynSong/scikit-learn,ky822/scikit-learn,treycausey/scikit-learn,TomDLT/scikit-learn,RomainBrault/scikit-learn,zuku1985/scikit-learn,icdishb/scikit-learn,arabenjamin/scikit-learn,sarahgrogan/scikit-learn,davidgbe/scikit-learn,mugizico/scikit-learn,MartinDelzant/scikit-learn,pythonvietnam/scikit-learn,q1ang/scikit-learn,djgagne/scikit-learn,xyguo/scikit-learn,kylerbrown/scikit-learn,arjoly/scikit-learn,khkaminska/scikit-learn,bhargav/scikit-learn,xiaoxiamii/scikit-learn,pianomania/scikit-learn,larsmans/scikit-learn,larsmans/scikit-learn,BiaDarkia/scikit-learn,mattilyra/scikit-learn,UNR-AERIAL/scikit-learn,DonBeo/scikit-learn,MohammedWasim/scikit-learn,fabioticconi/scikit-learn,shusenl/scikit-learn,ZENGXH/scikit-learn,ky822/scikit-learn,shangwuhencc/scikit-learn,Adai0808/scikit-learn,depet/scikit-learn,terkkila/scikit-learn,wzbozon/scikit-learn,cainiaocome/scikit-learn,pnedunuri/scikit-learn,Sentient07/scikit-learn,alvarofierroclavero/scikit-learn,ycaihua/scikit-learn,LiaoPan/scikit-learn,shahankhatch/scikit-learn,vermouthmjl/scikit-learn,simon-pepin/scikit-learn,Srisai85/scikit-learn,toastedcornflakes/scikit-learn,ilo10/scikit-learn,lin-credible/scikit-learn,IshankGulati/scikit-learn,loli/sklearn-ensembletrees,terkkila/scikit-learn,dhruv13J/scikit-learn,marcocaccin/scikit-learn,fredhusser/scikit-learn,maheshakya/scikit-learn,henrykironde/scikit-learn,florian-f/sklearn,Aasmi/scikit-learn,samzhang111/scikit-learn,herilalaina/scikit-learn,Achuth17/scikit-learn,YinongLong/scikit-learn,vybstat/scikit-learn,hitszxp/scikit-learn,manashmndl/scikit-learn,zhenv5/scikit-learn,B3AU/waveTree,billy-inn/scikit-learn,kjung/scikit-learn,pompiduskus/scikit-learn,mjudsp/Tsallis,PatrickOReilly/scikit-learn,chrsrds/scikit-learn,OshynSong/scikit-learn,roxyboy/scikit-learn,liyu1990/sklearn,wanggang3333/scikit-learn,anntzer/scikit-learn,zihua/scikit-learn,joernhees/scikit-learn,sonnyhu/scikit-learn,MartinDelzant/scikit-learn,vigilv/scikit-learn,russel1237/scikit-learn,bigdataelephants/scikit-learn,plissonf/scikit-learn,madjelan/scikit-learn,thilbern/scikit-learn,shikhardb/scikit-learn,yask123/scikit-learn,rrohan/scikit-learn,jzt5132/scikit-learn,jseabold/scikit-learn,ashhher3/scikit-learn,fyffyt/scikit-learn,jpautom/scikit-learn,manashmndl/scikit-learn,appapantula/scikit-learn,anurag313/scikit-learn,CforED/Machine-Learning,abhishekgahlot/scikit-learn,Windy-Ground/scikit-learn,hitszxp/scikit-learn,kashif/scikit-learn,Fireblend/scikit-learn,ky822/scikit-learn,theoryno3/scikit-learn,ivannz/scikit-learn,rsivapr/scikit-learn,MohammedWasim/scikit-learn,zorroblue/scikit-learn,xwolf12/scikit-learn,mattilyra/scikit-learn,q1ang/scikit-learn,kjung/scikit-learn,zorroblue/scikit-learn,evgchz/scikit-learn,mblondel/scikit-learn,waterponey/scikit-learn,IssamLaradji/scikit-learn,gotomypc/scikit-learn,adamgreenhall/scikit-learn,hrjn/scikit-learn,rvraghav93/scikit-learn,zorroblue/scikit-learn,mayblue9/scikit-learn,hlin117/scikit-learn,AlexRobson/scikit-learn,JeanKossaifi/scikit-learn,mugizico/scikit-learn,frank-tancf/scikit-learn,rsivapr/scikit-learn,rahuldhote/scikit-learn,mugizico/scikit-learn,russel1237/scikit-learn,treycausey/scikit-learn,RayMick/scikit-learn,ZENGXH/scikit-learn,ndingwall/scikit-learn,bnaul/scikit-learn,meduz/scikit-learn,siutanwong/scikit-learn,olologin/scikit-learn,pv/scikit-learn,smartscheduling/scikit-learn-categorical-tree,scikit-learn/scikit-learn,MartinDelzant/scikit-learn,mjgrav2001/scikit-learn,belltailjp/scikit-learn,sgenoud/scikit-learn,jblackburne/scikit-learn,manhhomienbienthuy/scikit-learn,aminert/scikit-learn,yonglehou/scikit-learn,yask123/scikit-learn,ldirer/scikit-learn,jaidevd/scikit-learn,trankmichael/scikit-learn,harshaneelhg/scikit-learn,jaidevd/scikit-learn,Titan-C/scikit-learn,waterponey/scikit-learn,arabenjamin/scikit-learn,ahoyosid/scikit-learn,walterreade/scikit-learn,Nyker510/scikit-learn,PatrickOReilly/scikit-learn,mehdidc/scikit-learn,anirudhjayaraman/scikit-learn,joshloyal/scikit-learn,IndraVikas/scikit-learn,huobaowangxi/scikit-learn,tdhopper/scikit-learn,JPFrancoia/scikit-learn,adamgreenhall/scikit-learn,ephes/scikit-learn,YinongLong/scikit-learn,Jimmy-Morzaria/scikit-learn,schets/scikit-learn,Titan-C/scikit-learn,joernhees/scikit-learn,maheshakya/scikit-learn,procoder317/scikit-learn,tawsifkhan/scikit-learn,lenovor/scikit-learn,hainm/scikit-learn,bikong2/scikit-learn,nomadcube/scikit-learn,nikitasingh981/scikit-learn,arabenjamin/scikit-learn,walterreade/scikit-learn,untom/scikit-learn,adamgreenhall/scikit-learn,loli/semisupervisedforests,mikebenfield/scikit-learn,h2educ/scikit-learn,vivekmishra1991/scikit-learn,ngoix/OCRF,robbymeals/scikit-learn,cdegroc/scikit-learn,ngoix/OCRF,shikhardb/scikit-learn,pypot/scikit-learn,JosmanPS/scikit-learn,xwolf12/scikit-learn,JosmanPS/scikit-learn,larsmans/scikit-learn,Fireblend/scikit-learn,ahoyosid/scikit-learn,JosmanPS/scikit-learn,tmhm/scikit-learn,yanlend/scikit-learn,anirudhjayaraman/scikit-learn,sanketloke/scikit-learn,Srisai85/scikit-learn,B3AU/waveTree,tawsifkhan/scikit-learn,alexeyum/scikit-learn,vigilv/scikit-learn,murali-munna/scikit-learn,heli522/scikit-learn,themrmax/scikit-learn,dingocuster/scikit-learn,YinongLong/scikit-learn,madjelan/scikit-learn,jayflo/scikit-learn,nesterione/scikit-learn,evgchz/scikit-learn,ndingwall/scikit-learn,JeanKossaifi/scikit-learn,pratapvardhan/scikit-learn,rohanp/scikit-learn,pnedunuri/scikit-learn,nmayorov/scikit-learn,depet/scikit-learn,3manuek/scikit-learn,poryfly/scikit-learn,dsullivan7/scikit-learn,jorge2703/scikit-learn,aminert/scikit-learn,rahuldhote/scikit-learn,shahankhatch/scikit-learn,vivekmishra1991/scikit-learn,zorojean/scikit-learn,jseabold/scikit-learn,tmhm/scikit-learn,wlamond/scikit-learn,yanlend/scikit-learn,saiwing-yeung/scikit-learn,anurag313/scikit-learn,PrashntS/scikit-learn,anirudhjayaraman/scikit-learn,billy-inn/scikit-learn,zorojean/scikit-learn,mattgiguere/scikit-learn,Lawrence-Liu/scikit-learn,shusenl/scikit-learn,Achuth17/scikit-learn,ishanic/scikit-learn,altairpearl/scikit-learn,dingocuster/scikit-learn,robin-lai/scikit-learn,meduz/scikit-learn,ZenDevelopmentSystems/scikit-learn,gotomypc/scikit-learn,Barmaley-exe/scikit-learn,zaxtax/scikit-learn,devanshdalal/scikit-learn,Nyker510/scikit-learn,Garrett-R/scikit-learn,dsquareindia/scikit-learn,elkingtonmcb/scikit-learn,vybstat/scikit-learn,mayblue9/scikit-learn,justincassidy/scikit-learn,equialgo/scikit-learn,elkingtonmcb/scikit-learn,eickenberg/scikit-learn,jereze/scikit-learn,xzh86/scikit-learn,toastedcornflakes/scikit-learn,mxjl620/scikit-learn,IssamLaradji/scikit-learn,mlyundin/scikit-learn,costypetrisor/scikit-learn,ChanChiChoi/scikit-learn,trungnt13/scikit-learn,0asa/scikit-learn,olologin/scikit-learn,shusenl/scikit-learn,f3r/scikit-learn,kashif/scikit-learn,cainiaocome/scikit-learn,xyguo/scikit-learn,huzq/scikit-learn,carrillo/scikit-learn,massmutual/scikit-learn,liberatorqjw/scikit-learn,fabioticconi/scikit-learn,Barmaley-exe/scikit-learn,sanketloke/scikit-learn,mrshu/scikit-learn,0asa/scikit-learn,DSLituiev/scikit-learn,3manuek/scikit-learn,justincassidy/scikit-learn,xavierwu/scikit-learn,ndingwall/scikit-learn,Djabbz/scikit-learn,kmike/scikit-learn,simon-pepin/scikit-learn,0asa/scikit-learn,raghavrv/scikit-learn,YinongLong/scikit-learn,sgenoud/scikit-learn,gclenaghan/scikit-learn,jayflo/scikit-learn,rsivapr/scikit-learn,xzh86/scikit-learn,AnasGhrab/scikit-learn,ilo10/scikit-learn,iismd17/scikit-learn,depet/scikit-learn,Nyker510/scikit-learn,ZenDevelopmentSystems/scikit-learn,lin-credible/scikit-learn,mehdidc/scikit-learn,dhruv13J/scikit-learn,clemkoa/scikit-learn,gclenaghan/scikit-learn,thientu/scikit-learn,belltailjp/scikit-learn,terkkila/scikit-learn,quheng/scikit-learn,yanlend/scikit-learn,ephes/scikit-learn,victorbergelin/scikit-learn,nvoron23/scikit-learn,mjudsp/Tsallis,mlyundin/scikit-learn,dhruv13J/scikit-learn,DSLituiev/scikit-learn,mattgiguere/scikit-learn,ivannz/scikit-learn,mayblue9/scikit-learn,beepee14/scikit-learn,hsiaoyi0504/scikit-learn,gclenaghan/scikit-learn,murali-munna/scikit-learn,mattgiguere/scikit-learn,rahuldhote/scikit-learn,sumspr/scikit-learn,fredhusser/scikit-learn,sonnyhu/scikit-learn,mikebenfield/scikit-learn,ZenDevelopmentSystems/scikit-learn,Myasuka/scikit-learn,RayMick/scikit-learn,NelisVerhoef/scikit-learn,HolgerPeters/scikit-learn,anntzer/scikit-learn,bhargav/scikit-learn,spallavolu/scikit-learn,xzh86/scikit-learn,costypetrisor/scikit-learn,rohanp/scikit-learn,mfjb/scikit-learn,zaxtax/scikit-learn,ningchi/scikit-learn,nrhine1/scikit-learn,jakobworldpeace/scikit-learn,jzt5132/scikit-learn,marcocaccin/scikit-learn,ltiao/scikit-learn,theoryno3/scikit-learn,cauchycui/scikit-learn,alvarofierroclavero/scikit-learn,heli522/scikit-learn,tosolveit/scikit-learn,JeanKossaifi/scikit-learn,olologin/scikit-learn,harshaneelhg/scikit-learn,JPFrancoia/scikit-learn,IssamLaradji/scikit-learn,zhenv5/scikit-learn,moutai/scikit-learn,smartscheduling/scikit-learn-categorical-tree,jm-begon/scikit-learn,0x0all/scikit-learn,murali-munna/scikit-learn,plissonf/scikit-learn,kevin-intel/scikit-learn,heli522/scikit-learn,hlin117/scikit-learn,pompiduskus/scikit-learn,smartscheduling/scikit-learn-categorical-tree,ashhher3/scikit-learn,ashhher3/scikit-learn,PrashntS/scikit-learn,mlyundin/scikit-learn,jlegendary/scikit-learn,xubenben/scikit-learn,sonnyhu/scikit-learn,ankurankan/scikit-learn,trungnt13/scikit-learn,florian-f/sklearn,harshaneelhg/scikit-learn,jkarnows/scikit-learn,michigraber/scikit-learn,vinayak-mehta/scikit-learn,zhenv5/scikit-learn,mblondel/scikit-learn,hrjn/scikit-learn,ankurankan/scikit-learn,michigraber/scikit-learn,hsiaoyi0504/scikit-learn,loli/semisupervisedforests,mxjl620/scikit-learn,UNR-AERIAL/scikit-learn,pypot/scikit-learn,xuewei4d/scikit-learn,ltiao/scikit-learn,PrashntS/scikit-learn,kmike/scikit-learn,mojoboss/scikit-learn,jjx02230808/project0223,evgchz/scikit-learn,rajat1994/scikit-learn,aabadie/scikit-learn,MatthieuBizien/scikit-learn,yunfeilu/scikit-learn,joernhees/scikit-learn,jayflo/scikit-learn,cl4rke/scikit-learn,bikong2/scikit-learn,vermouthmjl/scikit-learn,Vimos/scikit-learn,mwv/scikit-learn,Windy-Ground/scikit-learn,ningchi/scikit-learn,vermouthmjl/scikit-learn,fabianp/scikit-learn,mxjl620/scikit-learn,djgagne/scikit-learn,manhhomienbienthuy/scikit-learn,zihua/scikit-learn,lbishal/scikit-learn,glemaitre/scikit-learn,treycausey/scikit-learn,CVML/scikit-learn,btabibian/scikit-learn,huzq/scikit-learn,wlamond/scikit-learn,mjgrav2001/scikit-learn,espg/scikit-learn,bikong2/scikit-learn,manashmndl/scikit-learn,TomDLT/scikit-learn,macks22/scikit-learn,meduz/scikit-learn,rahul-c1/scikit-learn,Srisai85/scikit-learn,BiaDarkia/scikit-learn,zaxtax/scikit-learn,MartinSavc/scikit-learn,ogrisel/scikit-learn,liyu1990/sklearn,jm-begon/scikit-learn,jzt5132/scikit-learn,MechCoder/scikit-learn,jpautom/scikit-learn,liberatorqjw/scikit-learn,ilyes14/scikit-learn,ycaihua/scikit-learn,lucidfrontier45/scikit-learn,dsquareindia/scikit-learn,tosolveit/scikit-learn,loli/semisupervisedforests,ominux/scikit-learn,TomDLT/scikit-learn,jkarnows/scikit-learn,nvoron23/scikit-learn,xuewei4d/scikit-learn,NelisVerhoef/scikit-learn,zihua/scikit-learn,deepesch/scikit-learn,equialgo/scikit-learn,rvraghav93/scikit-learn,IshankGulati/scikit-learn,RayMick/scikit-learn,Obus/scikit-learn,Sentient07/scikit-learn,nrhine1/scikit-learn,jlegendary/scikit-learn,anntzer/scikit-learn,Clyde-fare/scikit-learn,ltiao/scikit-learn,Achuth17/scikit-learn,pompiduskus/scikit-learn,IndraVikas/scikit-learn,jseabold/scikit-learn,vigilv/scikit-learn,meduz/scikit-learn,tosolveit/scikit-learn,liangz0707/scikit-learn,trungnt13/scikit-learn,HolgerPeters/scikit-learn,Clyde-fare/scikit-learn,samzhang111/scikit-learn,rajat1994/scikit-learn,dingocuster/scikit-learn,arjoly/scikit-learn,xyguo/scikit-learn,vibhorag/scikit-learn,anntzer/scikit-learn,jakirkham/scikit-learn,f3r/scikit-learn,carrillo/scikit-learn,AnasGhrab/scikit-learn,nvoron23/scikit-learn,nikitasingh981/scikit-learn,rahul-c1/scikit-learn,potash/scikit-learn,rsivapr/scikit-learn,frank-tancf/scikit-learn,amueller/scikit-learn,0x0all/scikit-learn,cl4rke/scikit-learn,yyjiang/scikit-learn,liangz0707/scikit-learn,wlamond/scikit-learn,kagayakidan/scikit-learn,pianomania/scikit-learn,loli/sklearn-ensembletrees,RomainBrault/scikit-learn,shangwuhencc/scikit-learn,alexeyum/scikit-learn,ilyes14/scikit-learn,alexsavio/scikit-learn,schets/scikit-learn,AIML/scikit-learn,mhue/scikit-learn,cauchycui/scikit-learn,nomadcube/scikit-learn,Aasmi/scikit-learn,jakobworldpeace/scikit-learn,q1ang/scikit-learn,eg-zhang/scikit-learn,ElDeveloper/scikit-learn,djgagne/scikit-learn,MartinDelzant/scikit-learn,vshtanko/scikit-learn,rvraghav93/scikit-learn,rexshihaoren/scikit-learn,henrykironde/scikit-learn,massmutual/scikit-learn,aabadie/scikit-learn,tdhopper/scikit-learn,3manuek/scikit-learn,glemaitre/scikit-learn,murali-munna/scikit-learn,luo66/scikit-learn,abimannans/scikit-learn,glouppe/scikit-learn,florian-f/sklearn,simon-pepin/scikit-learn,h2educ/scikit-learn,vibhorag/scikit-learn,jpautom/scikit-learn,mhue/scikit-learn,ogrisel/scikit-learn,h2educ/scikit-learn,icdishb/scikit-learn,moutai/scikit-learn,aflaxman/scikit-learn,pythonvietnam/scikit-learn,glennq/scikit-learn,loli/sklearn-ensembletrees,pianomania/scikit-learn,iismd17/scikit-learn,BiaDarkia/scikit-learn,tmhm/scikit-learn,shenzebang/scikit-learn,TomDLT/scikit-learn,victorbergelin/scikit-learn,vybstat/scikit-learn,wazeerzulfikar/scikit-learn,glemaitre/scikit-learn,andrewnc/scikit-learn,AIML/scikit-learn,toastedcornflakes/scikit-learn,q1ang/scikit-learn,ycaihua/scikit-learn,CforED/Machine-Learning,sgenoud/scikit-learn,davidgbe/scikit-learn,NunoEdgarGub1/scikit-learn,nmayorov/scikit-learn,tdhopper/scikit-learn,bthirion/scikit-learn,thientu/scikit-learn,loli/sklearn-ensembletrees,stylianos-kampakis/scikit-learn,lin-credible/scikit-learn,mrshu/scikit-learn,MechCoder/scikit-learn,sergeyf/scikit-learn,ashhher3/scikit-learn,voxlol/scikit-learn,chrisburr/scikit-learn,NunoEdgarGub1/scikit-learn,jorik041/scikit-learn,RomainBrault/scikit-learn,jereze/scikit-learn,jakirkham/scikit-learn,jaidevd/scikit-learn,vortex-ape/scikit-learn,hainm/scikit-learn,pianomania/scikit-learn,pnedunuri/scikit-learn,rohanp/scikit-learn,ssaeger/scikit-learn,Sentient07/scikit-learn,Aasmi/scikit-learn,raghavrv/scikit-learn,qifeigit/scikit-learn,schets/scikit-learn,DSLituiev/scikit-learn,wazeerzulfikar/scikit-learn,Achuth17/scikit-learn,ZenDevelopmentSystems/scikit-learn,kylerbrown/scikit-learn,elkingtonmcb/scikit-learn,hugobowne/scikit-learn,costypetrisor/scikit-learn,etkirsch/scikit-learn,rrohan/scikit-learn,kmike/scikit-learn,glouppe/scikit-learn,alexsavio/scikit-learn,ChanderG/scikit-learn,macks22/scikit-learn,appapantula/scikit-learn,shikhardb/scikit-learn,fengzhyuan/scikit-learn,lenovor/scikit-learn,thientu/scikit-learn,eg-zhang/scikit-learn,alexeyum/scikit-learn,phdowling/scikit-learn,MechCoder/scikit-learn,krez13/scikit-learn,Lawrence-Liu/scikit-learn,thilbern/scikit-learn,r-mart/scikit-learn,maheshakya/scikit-learn,zorojean/scikit-learn,hdmetor/scikit-learn,sinhrks/scikit-learn,betatim/scikit-learn,anirudhjayaraman/scikit-learn,hugobowne/scikit-learn,zihua/scikit-learn,russel1237/scikit-learn,tosolveit/scikit-learn,fbagirov/scikit-learn,lesteve/scikit-learn,larsmans/scikit-learn,nesterione/scikit-learn,hsiaoyi0504/scikit-learn,ogrisel/scikit-learn,cybernet14/scikit-learn,lbishal/scikit-learn,abhishekkrthakur/scikit-learn,DonBeo/scikit-learn,akionakamura/scikit-learn,hainm/scikit-learn,sergeyf/scikit-learn,AlexRobson/scikit-learn,xiaoxiamii/scikit-learn,xuewei4d/scikit-learn,jmetzen/scikit-learn,ivannz/scikit-learn,imaculate/scikit-learn,herilalaina/scikit-learn,pkruskal/scikit-learn,wzbozon/scikit-learn,kaichogami/scikit-learn,hsuantien/scikit-learn,hsuantien/scikit-learn,vinayak-mehta/scikit-learn,0asa/scikit-learn,hrjn/scikit-learn,xwolf12/scikit-learn,nhejazi/scikit-learn,phdowling/scikit-learn,hitszxp/scikit-learn,PatrickOReilly/scikit-learn,justincassidy/scikit-learn,plissonf/scikit-learn,hdmetor/scikit-learn,nhejazi/scikit-learn,lenovor/scikit-learn,siutanwong/scikit-learn,joshloyal/scikit-learn,nvoron23/scikit-learn,cl4rke/scikit-learn,adamgreenhall/scikit-learn,giorgiop/scikit-learn,vermouthmjl/scikit-learn,jmschrei/scikit-learn,0x0all/scikit-learn,huobaowangxi/scikit-learn,ClimbsRocks/scikit-learn,rishikksh20/scikit-learn,xavierwu/scikit-learn,ilo10/scikit-learn,etkirsch/scikit-learn,OshynSong/scikit-learn,NunoEdgarGub1/scikit-learn,nelson-liu/scikit-learn,jzt5132/scikit-learn,joshloyal/scikit-learn,B3AU/waveTree,pypot/scikit-learn,evgchz/scikit-learn,mwv/scikit-learn,spallavolu/scikit-learn,RachitKansal/scikit-learn,arabenjamin/scikit-learn,cdegroc/scikit-learn,JosmanPS/scikit-learn,cainiaocome/scikit-learn,pompiduskus/scikit-learn,ishanic/scikit-learn,abimannans/scikit-learn,walterreade/scikit-learn,cwu2011/scikit-learn,trungnt13/scikit-learn,ssaeger/scikit-learn,altairpearl/scikit-learn,sgenoud/scikit-learn,xyguo/scikit-learn,ndingwall/scikit-learn,sergeyf/scikit-learn,ChanChiChoi/scikit-learn,theoryno3/scikit-learn,fyffyt/scikit-learn,JPFrancoia/scikit-learn,clemkoa/scikit-learn,ChanderG/scikit-learn,hlin117/scikit-learn,jaidevd/scikit-learn,JsNoNo/scikit-learn,shyamalschandra/scikit-learn,rrohan/scikit-learn,vybstat/scikit-learn,zaxtax/scikit-learn,abhishekgahlot/scikit-learn,cdegroc/scikit-learn,MohammedWasim/scikit-learn,cauchycui/scikit-learn,thilbern/scikit-learn,lucidfrontier45/scikit-learn,mugizico/scikit-learn,zuku1985/scikit-learn,Djabbz/scikit-learn,yunfeilu/scikit-learn,abhishekkrthakur/scikit-learn,devanshdalal/scikit-learn,466152112/scikit-learn,joshloyal/scikit-learn,Myasuka/scikit-learn,shyamalschandra/scikit-learn,btabibian/scikit-learn,ChanderG/scikit-learn,jm-begon/scikit-learn,B3AU/waveTree,MartinSavc/scikit-learn,HolgerPeters/scikit-learn,LohithBlaze/scikit-learn,nikitasingh981/scikit-learn,ephes/scikit-learn,dsullivan7/scikit-learn,MartinSavc/scikit-learn,LohithBlaze/scikit-learn,luo66/scikit-learn,sergeyf/scikit-learn,arahuja/scikit-learn,kmike/scikit-learn,h2educ/scikit-learn,tomlof/scikit-learn,eickenberg/scikit-learn,ChanChiChoi/scikit-learn,ankurankan/scikit-learn,btabibian/scikit-learn,scikit-learn/scikit-learn,tomlof/scikit-learn,harshaneelhg/scikit-learn,ivannz/scikit-learn,zuku1985/scikit-learn,petosegan/scikit-learn,466152112/scikit-learn,jmetzen/scikit-learn,icdishb/scikit-learn,yunfeilu/scikit-learn,huobaowangxi/scikit-learn,fabioticconi/scikit-learn,yonglehou/scikit-learn,jjx02230808/project0223,Akshay0724/scikit-learn,idlead/scikit-learn,kjung/scikit-learn,samuel1208/scikit-learn,jorik041/scikit-learn,akionakamura/scikit-learn,simon-pepin/scikit-learn,JeanKossaifi/scikit-learn,abhishekgahlot/scikit-learn,wanggang3333/scikit-learn,procoder317/scikit-learn,kevin-intel/scikit-learn,petosegan/scikit-learn,elkingtonmcb/scikit-learn,shenzebang/scikit-learn,cdegroc/scikit-learn,JsNoNo/scikit-learn,ClimbsRocks/scikit-learn,kylerbrown/scikit-learn,andaag/scikit-learn,xzh86/scikit-learn,ishanic/scikit-learn,sarahgrogan/scikit-learn,hugobowne/scikit-learn,akionakamura/scikit-learn,andaag/scikit-learn,bnaul/scikit-learn,krez13/scikit-learn,jereze/scikit-learn,terkkila/scikit-learn,giorgiop/scikit-learn,yyjiang/scikit-learn,smartscheduling/scikit-learn-categorical-tree,marcocaccin/scikit-learn,hitszxp/scikit-learn,IndraVikas/scikit-learn,Vimos/scikit-learn,aetilley/scikit-learn,jorge2703/scikit-learn,BiaDarkia/scikit-learn,vortex-ape/scikit-learn,poryfly/scikit-learn,Titan-C/scikit-learn,hlin117/scikit-learn,ldirer/scikit-learn,liyu1990/sklearn,huzq/scikit-learn,jorge2703/scikit-learn,Garrett-R/scikit-learn,dsquareindia/scikit-learn,lin-credible/scikit-learn,jlegendary/scikit-learn,stylianos-kampakis/scikit-learn,jorge2703/scikit-learn,sumspr/scikit-learn,justincassidy/scikit-learn,hsuantien/scikit-learn,andrewnc/scikit-learn,untom/scikit-learn,phdowling/scikit-learn,ilyes14/scikit-learn,dsquareindia/scikit-learn,ssaeger/scikit-learn,xiaoxiamii/scikit-learn,jmschrei/scikit-learn,Obus/scikit-learn,ankurankan/scikit-learn,rohanp/scikit-learn,kmike/scikit-learn,macks22/scikit-learn,zorroblue/scikit-learn,MatthieuBizien/scikit-learn,xuewei4d/scikit-learn,Adai0808/scikit-learn,UNR-AERIAL/scikit-learn,fbagirov/scikit-learn,nrhine1/scikit-learn,nelson-liu/scikit-learn,glouppe/scikit-learn,f3r/scikit-learn,khkaminska/scikit-learn,roxyboy/scikit-learn,hdmetor/scikit-learn,Srisai85/scikit-learn,MartinSavc/scikit-learn,ltiao/scikit-learn,mattilyra/scikit-learn,trankmichael/scikit-learn,akionakamura/scikit-learn,aflaxman/scikit-learn,gotomypc/scikit-learn,RPGOne/scikit-learn,mfjb/scikit-learn,mblondel/scikit-learn,scikit-learn/scikit-learn,robbymeals/scikit-learn,imaculate/scikit-learn,quheng/scikit-learn,vibhorag/scikit-learn,xavierwu/scikit-learn,RPGOne/scikit-learn,bthirion/scikit-learn,IshankGulati/scikit-learn,tawsifkhan/scikit-learn,mhdella/scikit-learn,fengzhyuan/scikit-learn,nhejazi/scikit-learn,Jimmy-Morzaria/scikit-learn,mfjb/scikit-learn,untom/scikit-learn,qifeigit/scikit-learn,billy-inn/scikit-learn,glennq/scikit-learn,arahuja/scikit-learn,abhishekgahlot/scikit-learn,luo66/scikit-learn,mayblue9/scikit-learn,ldirer/scikit-learn,jm-begon/scikit-learn,JsNoNo/scikit-learn,voxlol/scikit-learn,glennq/scikit-learn,aetilley/scikit-learn,arahuja/scikit-learn,jayflo/scikit-learn,stylianos-kampakis/scikit-learn,ilo10/scikit-learn,clemkoa/scikit-learn,AlexandreAbraham/scikit-learn,arahuja/scikit-learn,fyffyt/scikit-learn,AlexanderFabisch/scikit-learn,pv/scikit-learn,betatim/scikit-learn,Garrett-R/scikit-learn,jmschrei/scikit-learn,ZENGXH/scikit-learn,rrohan/scikit-learn,Adai0808/scikit-learn,ngoix/OCRF,chrisburr/scikit-learn,saiwing-yeung/scikit-learn,lenovor/scikit-learn,AlexandreAbraham/scikit-learn,mehdidc/scikit-learn,lucidfrontier45/scikit-learn,yask123/scikit-learn,rsivapr/scikit-learn,nmayorov/scikit-learn,deepesch/scikit-learn,abhishekkrthakur/scikit-learn,yyjiang/scikit-learn,wanggang3333/scikit-learn,CforED/Machine-Learning,arjoly/scikit-learn,samzhang111/scikit-learn,victorbergelin/scikit-learn,3manuek/scikit-learn,ClimbsRocks/scikit-learn,mojoboss/scikit-learn,jkarnows/scikit-learn,voxlol/scikit-learn,kevin-intel/scikit-learn,fzalkow/scikit-learn,vshtanko/scikit-learn,pkruskal/scikit-learn,ky822/scikit-learn,spallavolu/scikit-learn,Titan-C/scikit-learn,loli/sklearn-ensembletrees,kashif/scikit-learn,zuku1985/scikit-learn,ominux/scikit-learn,iismd17/scikit-learn,ilyes14/scikit-learn,ningchi/scikit-learn,ngoix/OCRF,xavierwu/scikit-learn,jpautom/scikit-learn,saiwing-yeung/scikit-learn,shenzebang/scikit-learn,Windy-Ground/scikit-learn,amueller/scikit-learn,cybernet14/scikit-learn,dsullivan7/scikit-learn,sanketloke/scikit-learn,rajat1994/scikit-learn,sonnyhu/scikit-learn,khkaminska/scikit-learn,moutai/scikit-learn,AlexRobson/scikit-learn,beepee14/scikit-learn,NunoEdgarGub1/scikit-learn,mojoboss/scikit-learn,aflaxman/scikit-learn,vivekmishra1991/scikit-learn,henrykironde/scikit-learn,btabibian/scikit-learn,sanketloke/scikit-learn,mhdella/scikit-learn,altairpearl/scikit-learn,schets/scikit-learn,vigilv/scikit-learn,Lawrence-Liu/scikit-learn,andrewnc/scikit-learn,mikebenfield/scikit-learn,fengzhyuan/scikit-learn,giorgiop/scikit-learn,giorgiop/scikit-learn,deepesch/scikit-learn,CforED/Machine-Learning,sgenoud/scikit-learn,beepee14/scikit-learn,tomlof/scikit-learn,rishikksh20/scikit-learn,henridwyer/scikit-learn,theoryno3/scikit-learn,glouppe/scikit-learn,shenzebang/scikit-learn,lucidfrontier45/scikit-learn,herilalaina/scikit-learn,icdishb/scikit-learn,fredhusser/scikit-learn,r-mart/scikit-learn,toastedcornflakes/scikit-learn,mehdidc/scikit-learn,jkarnows/scikit-learn,jakobworldpeace/scikit-learn,andrewnc/scikit-learn,lazywei/scikit-learn,madjelan/scikit-learn,jblackburne/scikit-learn,jakirkham/scikit-learn,lucidfrontier45/scikit-learn,manashmndl/scikit-learn,chrisburr/scikit-learn,sumspr/scikit-learn,hainm/scikit-learn,fzalkow/scikit-learn,imaculate/scikit-learn,etkirsch/scikit-learn,bhargav/scikit-learn,PatrickChrist/scikit-learn,espg/scikit-learn,fbagirov/scikit-learn,mxjl620/scikit-learn,0x0all/scikit-learn,jmetzen/scikit-learn,ahoyosid/scikit-learn,aewhatley/scikit-learn,huzq/scikit-learn,nelson-liu/scikit-learn,olologin/scikit-learn,thientu/scikit-learn,samuel1208/scikit-learn,nomadcube/scikit-learn,pkruskal/scikit-learn,AIML/scikit-learn,plissonf/scikit-learn,aewhatley/scikit-learn,pypot/scikit-learn,LohithBlaze/scikit-learn,HolgerPeters/scikit-learn,rishikksh20/scikit-learn,Djabbz/scikit-learn,rishikksh20/scikit-learn,nesterione/scikit-learn,ssaeger/scikit-learn,mojoboss/scikit-learn,lbishal/scikit-learn,appapantula/scikit-learn,anurag313/scikit-learn,bigdataelephants/scikit-learn,robin-lai/scikit-learn,rexshihaoren/scikit-learn,Akshay0724/scikit-learn,pratapvardhan/scikit-learn,MatthieuBizien/scikit-learn,shusenl/scikit-learn,bikong2/scikit-learn,appapantula/scikit-learn,ephes/scikit-learn,Sentient07/scikit-learn,kjung/scikit-learn,idlead/scikit-learn,hrjn/scikit-learn,jjx02230808/project0223,mwv/scikit-learn,kashif/scikit-learn,krez13/scikit-learn,RomainBrault/scikit-learn,quheng/scikit-learn,AnasGhrab/scikit-learn,henrykironde/scikit-learn,wzbozon/scikit-learn,aewhatley/scikit-learn,vibhorag/scikit-learn,themrmax/scikit-learn,maheshakya/scikit-learn,nrhine1/scikit-learn,beepee14/scikit-learn,aminert/scikit-learn,potash/scikit-learn,mwv/scikit-learn,cwu2011/scikit-learn,florian-f/sklearn,Adai0808/scikit-learn,larsmans/scikit-learn,krez13/scikit-learn,RachitKansal/scikit-learn,wanggang3333/scikit-learn,JPFrancoia/scikit-learn,wlamond/scikit-learn,devanshdalal/scikit-learn,anurag313/scikit-learn,massmutual/scikit-learn,ycaihua/scikit-learn,themrmax/scikit-learn,AlexandreAbraham/scikit-learn,jblackburne/scikit-learn,Myasuka/scikit-learn,moutai/scikit-learn,tawsifkhan/scikit-learn,mblondel/scikit-learn,yanlend/scikit-learn,AnasGhrab/scikit-learn,madjelan/scikit-learn,shahankhatch/scikit-learn,IshankGulati/scikit-learn,saiwing-yeung/scikit-learn,xubenben/scikit-learn,pkruskal/scikit-learn,henridwyer/scikit-learn,rahul-c1/scikit-learn,pv/scikit-learn,lazywei/scikit-learn,aflaxman/scikit-learn,NelisVerhoef/scikit-learn,liberatorqjw/scikit-learn,untom/scikit-learn,Obus/scikit-learn,tmhm/scikit-learn,yonglehou/scikit-learn,gotomypc/scikit-learn,jmetzen/scikit-learn,mhdella/scikit-learn,petosegan/scikit-learn,NelisVerhoef/scikit-learn,mhdella/scikit-learn,pratapvardhan/scikit-learn,ogrisel/scikit-learn,liangz0707/scikit-learn,xiaoxiamii/scikit-learn,rahul-c1/scikit-learn,robin-lai/scikit-learn,bnaul/scikit-learn,ChanderG/scikit-learn,Nyker510/scikit-learn,fabianp/scikit-learn,mrshu/scikit-learn,espg/scikit-learn,poryfly/scikit-learn,bigdataelephants/scikit-learn,eg-zhang/scikit-learn,vinayak-mehta/scikit-learn,mjudsp/Tsallis,AlexanderFabisch/scikit-learn,PatrickOReilly/scikit-learn,hugobowne/scikit-learn,UNR-AERIAL/scikit-learn,idlead/scikit-learn,jseabold/scikit-learn,belltailjp/scikit-learn,mrshu/scikit-learn,Obus/scikit-learn,quheng/scikit-learn,wzbozon/scikit-learn,Clyde-fare/scikit-learn,pnedunuri/scikit-learn,mjgrav2001/scikit-learn,billy-inn/scikit-learn,yunfeilu/scikit-learn,LohithBlaze/scikit-learn,fbagirov/scikit-learn,stylianos-kampakis/scikit-learn,Barmaley-exe/scikit-learn,RayMick/scikit-learn,waterponey/scikit-learn,marcocaccin/scikit-learn,themrmax/scikit-learn,andaag/scikit-learn,hsiaoyi0504/scikit-learn,f3r/scikit-learn,lazywei/scikit-learn,Akshay0724/scikit-learn,vortex-ape/scikit-learn,macks22/scikit-learn,abhishekgahlot/scikit-learn,AlexanderFabisch/scikit-learn,roxyboy/scikit-learn,hsuantien/scikit-learn,chrisburr/scikit-learn,liangz0707/scikit-learn,r-mart/scikit-learn,roxyboy/scikit-learn,jorik041/scikit-learn,nomadcube/scikit-learn,fzalkow/scikit-learn,mhue/scikit-learn,vshtanko/scikit-learn,chrsrds/scikit-learn,treycausey/scikit-learn,Aasmi/scikit-learn,raghavrv/scikit-learn,walterreade/scikit-learn,B3AU/waveTree,shahankhatch/scikit-learn,liberatorqjw/scikit-learn,heli522/scikit-learn,nhejazi/scikit-learn,huobaowangxi/scikit-learn,ngoix/OCRF,JsNoNo/scikit-learn,DonBeo/scikit-learn,RPGOne/scikit-learn,treycausey/scikit-learn,michigraber/scikit-learn,mikebenfield/scikit-learn,0asa/scikit-learn,florian-f/sklearn,procoder317/scikit-learn,jakirkham/scikit-learn,equialgo/scikit-learn,PatrickChrist/scikit-learn,Garrett-R/scikit-learn,vinayak-mehta/scikit-learn,Garrett-R/scikit-learn,RachitKansal/scikit-learn,pythonvietnam/scikit-learn,mlyundin/scikit-learn,jmschrei/scikit-learn,pratapvardhan/scikit-learn,xubenben/scikit-learn,aabadie/scikit-learn,idlead/scikit-learn,liyu1990/sklearn,fredhusser/scikit-learn,shyamalschandra/scikit-learn,ominux/scikit-learn,henridwyer/scikit-learn,scikit-learn/scikit-learn,wazeerzulfikar/scikit-learn,DonBeo/scikit-learn,Fireblend/scikit-learn,fabioticconi/scikit-learn,ankurankan/scikit-learn,sumspr/scikit-learn,massmutual/scikit-learn,dsullivan7/scikit-learn,yask123/scikit-learn,shyamalschandra/scikit-learn,kaichogami/scikit-learn,siutanwong/scikit-learn,betatim/scikit-learn,samzhang111/scikit-learn,PatrickChrist/scikit-learn,chrsrds/scikit-learn,altairpearl/scikit-learn,kagayakidan/scikit-learn,iismd17/scikit-learn,abimannans/scikit-learn,AlexandreAbraham/scikit-learn,bigdataelephants/scikit-learn,raghavrv/scikit-learn,Fireblend/scikit-learn,equialgo/scikit-learn,mattgiguere/scikit-learn,loli/semisupervisedforests,kylerbrown/scikit-learn,aabadie/scikit-learn,djgagne/scikit-learn,rvraghav93/scikit-learn,carrillo/scikit-learn,aetilley/scikit-learn,cl4rke/scikit-learn,spallavolu/scikit-learn,andaag/scikit-learn,jblackburne/scikit-learn,yonglehou/scikit-learn,vshtanko/scikit-learn,ldirer/scikit-learn,belltailjp/scikit-learn,aetilley/scikit-learn,vivekmishra1991/scikit-learn,jereze/scikit-learn,kaichogami/scikit-learn,MohammedWasim/scikit-learn,qifeigit/scikit-learn,alexsavio/scikit-learn,MatthieuBizien/scikit-learn,clemkoa/scikit-learn,alexeyum/scikit-learn,nmayorov/scikit-learn,glennq/scikit-learn,depet/scikit-learn,etkirsch/scikit-learn,ngoix/OCRF,bnaul/scikit-learn,manhhomienbienthuy/scikit-learn,RachitKansal/scikit-learn,PrashntS/scikit-learn,kevin-intel/scikit-learn,frank-tancf/scikit-learn,maheshakya/scikit-learn,cwu2011/scikit-learn,rahuldhote/scikit-learn,eickenberg/scikit-learn,jorik041/scikit-learn,eickenberg/scikit-learn,mattilyra/scikit-learn,imaculate/scikit-learn,aewhatley/scikit-learn,mjudsp/Tsallis,kaichogami/scikit-learn,amueller/scikit-learn,lesteve/scikit-learn,zorojean/scikit-learn,nesterione/scikit-learn,vortex-ape/scikit-learn,AlexRobson/scikit-learn,alexsavio/scikit-learn,davidgbe/scikit-learn,rexshihaoren/scikit-learn,LiaoPan/scikit-learn,amueller/scikit-learn,jlegendary/scikit-learn,betatim/scikit-learn,mrshu/scikit-learn,ahoyosid/scikit-learn,ElDeveloper/scikit-learn,lesteve/scikit-learn,zhenv5/scikit-learn,Barmaley-exe/scikit-learn,thilbern/scikit-learn,bthirion/scikit-learn,ChanChiChoi/scikit-learn,michigraber/scikit-learn,Akshay0724/scikit-learn,Windy-Ground/scikit-learn,phdowling/scikit-learn,LiaoPan/scikit-learn,xwolf12/scikit-learn,eg-zhang/scikit-learn,espg/scikit-learn,abhishekkrthakur/scikit-learn,ycaihua/scikit-learn,abimannans/scikit-learn,cybernet14/scikit-learn,fyffyt/scikit-learn,OshynSong/scikit-learn,devanshdalal/scikit-learn,robbymeals/scikit-learn,Vimos/scikit-learn,Lawrence-Liu/scikit-learn,Myasuka/scikit-learn,mjudsp/Tsallis,khkaminska/scikit-learn,r-mart/scikit-learn,CVML/scikit-learn,frank-tancf/scikit-learn,luo66/scikit-learn,petosegan/scikit-learn,IssamLaradji/scikit-learn,ElDeveloper/scikit-learn,aminert/scikit-learn,jjx02230808/project0223,cauchycui/scikit-learn,qifeigit/scikit-learn,LiaoPan/scikit-learn,joernhees/scikit-learn,mhue/scikit-learn,mattilyra/scikit-learn,DSLituiev/scikit-learn,bhargav/scikit-learn,hdmetor/scikit-learn,evgchz/scikit-learn,466152112/scikit-learn,pythonvietnam/scikit-learn,ominux/scikit-learn,sarahgrogan/scikit-learn,rajat1994/scikit-learn,0x0all/scikit-learn,Jimmy-Morzaria/scikit-learn,siutanwong/scikit-learn,ningchi/scikit-learn,robbymeals/scikit-learn,herilalaina/scikit-learn,arjoly/scikit-learn,AIML/scikit-learn,IndraVikas/scikit-learn,lazywei/scikit-learn,Vimos/scikit-learn,CVML/scikit-learn,shangwuhencc/scikit-learn,nikitasingh981/scikit-learn,trankmichael/scikit-learn,dhruv13J/scikit-learn,dingocuster/scikit-learn,depet/scikit-learn,deepesch/scikit-learn,RPGOne/scikit-learn,Jimmy-Morzaria/scikit-learn,tomlof/scikit-learn,manhhomienbienthuy/scikit-learn,shangwuhencc/scikit-learn,lbishal/scikit-learn,jakobworldpeace/scikit-learn,MechCoder/scikit-learn,Clyde-fare/scikit-learn,glemaitre/scikit-learn,pv/scikit-learn,cainiaocome/scikit-learn,mfjb/scikit-learn,fabianp/scikit-learn,gclenaghan/scikit-learn,tdhopper/scikit-learn,fengzhyuan/scikit-learn,alvarofierroclavero/scikit-learn,potash/scikit-learn,trankmichael/scikit-learn,eickenberg/scikit-learn,Djabbz/scikit-learn,ishanic/scikit-learn,fzalkow/scikit-learn,cybernet14/scikit-learn,AlexanderFabisch/scikit-learn,samuel1208/scikit-learn,CVML/scikit-learn,sinhrks/scikit-learn,sarahgrogan/scikit-learn,alvarofierroclavero/scikit-learn,costypetrisor/scikit-learn,PatrickChrist/scikit-learn,nelson-liu/scikit-learn,russel1237/scikit-learn,mjgrav2001/scikit-learn,sinhrks/scikit-learn,waterponey/scikit-learn,wazeerzulfikar/scikit-learn,potash/scikit-learn,ElDeveloper/scikit-learn,poryfly/scikit-learn,466152112/scikit-learn,robin-lai/scikit-learn,kagayakidan/scikit-learn,cwu2011/scikit-learn,davidgbe/scikit-learn,kagayakidan/scikit-learn,carrillo/scikit-learn,lesteve/scikit-learn,victorbergelin/scikit-learn,chrsrds/scikit-learn,fabianp/scikit-learn,hitszxp/scikit-learn,procoder317/scikit-learn,xubenben/scikit-learn,henridwyer/scikit-learn,yyjiang/scikit-learn,ZENGXH/scikit-learn,rexshihaoren/scikit-learn,voxlol/scikit-learn | scikits/learn/common/myfunctools.py | scikits/learn/common/myfunctools.py | # Last Change: Mon Aug 20 01:00 PM 2007 J
# Implement partial application (should only be used if functools is not
# available (eg python < 2.5)
class partial:
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self, *args, **kwargs):
if kwargs and self.kwargs:
kw = self.kwargs.copy()
kw.update(kwargs)
else:
kw = kwargs or self.kwargs
return self.fun(*(self.pending + args), **kw)
| bsd-3-clause | Python |
|
6219211d529d2dd58693ea93e6b799fd36259fee | Add tests | grzes/djangae,grzes/djangae,potatolondon/djangae,grzes/djangae,potatolondon/djangae | djangae/tests/test_async_multi_query.py | djangae/tests/test_async_multi_query.py | from django.test import override_settings
from django.db import NotSupportedError
from django.db import models
from djangae.test import TestCase
class MultiQueryModel(models.Model):
field1 = models.IntegerField()
class AsyncMultiQueryTest(TestCase):
"""
Specific tests for multiquery
"""
def test_hundred_or(self):
for i in range(100):
MultiQueryModel.objects.create(field1=i)
self.assertEqual(
len(MultiQueryModel.objects.filter(field1__in=list(range(100)))),
100
)
self.assertEqual(
MultiQueryModel.objects.filter(field1__in=list(range(100))).count(),
100
)
self.assertItemsEqual(
MultiQueryModel.objects.filter(
field1__in=list(range(100))
).values_list("field1", flat=True),
list(range(100))
)
self.assertItemsEqual(
MultiQueryModel.objects.filter(
field1__in=list(range(100))
).order_by("-field1").values_list("field1", flat=True),
list(range(100))[::-1]
)
@override_settings(DJANGAE_MAX_QUERY_BRANCHES=10)
def test_max_limit_enforced(self):
for i in range(11):
MultiQueryModel.objects.create(field1=i)
self.assertRaises(NotSupportedError,
lambda: list(MultiQueryModel.objects.filter(
field1__in=range(11)
))
)
| bsd-3-clause | Python |
|
51e04ff17bccb4b71b8d5db4057a782fd2f8520c | Add script to synthesize all uploaded files. Patch by Dan Callahan. | techtonik/pydotorg.pypi,techtonik/pydotorg.pypi | tools/touch_all_files.py | tools/touch_all_files.py | #!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files")
for type, name, filename in cursor.fetchall():
yield os.path.join(prefix, type, name[0], name, filename)
if __name__ == '__main__':
import config
try:
config = config.Config(sys.argv[1])
except IndexError:
print "Usage: touch_all_files.py config.ini"
raise SystemExit
datastore = store.Store(config)
datastore.open()
cursor = datastore.get_cursor()
prefix = config.database_files_dir
for path in get_paths(cursor, prefix):
dir = os.path.dirname(path)
if not os.path.exists(dir):
print "Creating directory %s" % dir
os.makedirs(dir)
if not os.path.exists(path):
print "Creating file %s" % path
open(path, "a")
| bsd-3-clause | Python |
|
2684aa6eabdeb3fa5ec4c7e910af04c7068c7cd8 | add working loopback test | tgarc/pastream,tgarc/pastream,tgarc/pastream | test_pastream.py | test_pastream.py | """
Loopback tests for pastream.
"""
from __future__ import print_function
import os, sys
import numpy as np
import soundfile as sf
import pytest
import numpy.testing as npt
import time
import tempfile
import platform
import pastream as pas
# Set up the platform specific device
system = platform.system()
if system == 'Windows':
DEVICE_KWARGS = {'device': 'ASIO4ALL v2, ASIO', 'dtype': 'int24', 'blocksize': 512, 'channels': 8, 'samplerate':48000}
elif system == 'Darwin':
raise Exception("Currently no support for Mac devices")
else:
# This is assuming you're using the ALSA device set up by etc/.asoundrc
DEVICE_KWARGS = {'device': 'aduplex', 'dtype': 'int32', 'blocksize': 512, 'channels': 8, 'samplerate':48000}
if 'SOUNDDEVICE_DEVICE_NAME' in os.environ:
DEVICE_KWARGS['device'] = os.environ['SOUNDDEVICE_DEVICE_NAME']
if 'SOUNDDEVICE_DEVICE_BLOCKSIZE' in os.environ:
DEVICE_KWARGS['blocksize'] = os.environ['SOUNDDEVICE_DEVICE_BLOCKSIZE']
if 'SOUNDDEVICE_DEVICE_DTYPE' in os.environ:
DEVICE_KWARGS['dtype'] = os.environ['SOUNDDEVICE_DEVICE_DTYPE']
if 'SOUNDDEVICE_DEVICE_CHANNELS' in os.environ:
DEVICE_KWARGS['channels'] = os.environ['SOUNDDEVICE_DEVICE_CHANNELS']
if 'SOUNDDEVICE_DEVICE_SAMPLERATE' in os.environ:
DEVICE_KWARGS['SAMPLERATE'] = os.environ['SOUNDDEVICE_DEVICE_SAMPLERATE']
PREAMBLE = 0x7FFFFFFF # Value used for the preamble sequence (before appropriate shifting for dtype)
_dtype2elementsize = dict(int32=4,int24=3,int16=2,int8=1)
vhex = np.vectorize('{:#10x}'.format)
tohex = lambda x: vhex(x.view('u4'))
def assert_loopback_equal(inp_fh, preamble, **kwargs):
inpf2 = sf.SoundFile(inp_fh.name, mode='rb')
devargs = dict(DEVICE_KWARGS)
devargs.update(kwargs)
delay = -1
found_delay = False
nframes = mframes = 0
for outframes in pas.blockstream(inp_fh, **devargs):
if not found_delay:
matches = outframes[:, 0].view('u4') == preamble
if np.any(matches):
found_delay = True
nonzeros = np.where(matches)[0]
outframes = outframes[nonzeros[0]:]
nframes += nonzeros[0]
delay = nframes
if found_delay:
inframes = inpf2.read(len(outframes), dtype='int32', always_2d=True)
mlen = min(len(inframes), len(outframes))
inp = inframes[:mlen].view('u4')
out = outframes[:mlen].view('u4')
npt.assert_array_equal(inp, out, "Loopback data mismatch")
mframes += mlen
nframes += len(outframes)
assert delay != -1, "Preamble not found or was corrupted"
print("Matched %d of %d frames; Initial delay of %d frames" % (mframes, nframes, delay))
class PortAudioLoopbackTester(object):
def _gen_random(self, rdm_fh, nseconds, elementsize):
"""
Generates a uniformly random integer signal ranging between the
minimum and maximum possible values as defined by `elementsize`. The random
signal is preceded by a constant level equal to the maximum positive
integer value for 100ms or N=sampling_rate/10 samples (the 'preamble')
which can be used in testing to find the beginning of a recording.
nseconds - how many seconds of data to generate
elementsize - size of each element (single sample of a single frame) in bytes
"""
shift = 8*(4-elementsize)
minval = -(0x80000000>>shift)
maxval = 0x7FFFFFFF>>shift
preamble = np.zeros((rdm_fh.samplerate//10, rdm_fh.channels), dtype=np.int32)
preamble[:] = (PREAMBLE >> shift) << shift
rdm_fh.write(preamble)
for i in range(nseconds):
pattern = np.random.randint(minval, maxval+1, (rdm_fh.samplerate, rdm_fh.channels)) << shift
rdm_fh.write(pattern.astype(np.int32))
class TestDummyLoopback(PortAudioLoopbackTester):
def test_wav(self, tmpdir):
elementsize = _dtype2elementsize[DEVICE_KWARGS['dtype']]
rdmf = tempfile.mktemp(dir=str(tmpdir))
rdm_fh = sf.SoundFile(rdmf, 'w+', DEVICE_KWARGS['samplerate'], DEVICE_KWARGS['channels'], 'PCM_'+['8', '16','24','32'][elementsize-1], format='wav')
self._gen_random(rdm_fh, 5, elementsize)
rdm_fh.seek(0)
dtype = DEVICE_KWARGS['dtype']
if DEVICE_KWARGS['dtype'] == 'int24':
# Tell the OS it's a 32-bit stream and ignore the extra zeros
# because 24 bit streams are annoying to deal with
dtype = 'int32'
shift = 8*(4-elementsize)
assert_loopback_equal(rdm_fh, (PREAMBLE>>shift)<<shift, dtype=dtype)
| mit | Python |
|
e8b6c596a7627d1c4f3f6915236317b0730210a2 | Rename ds_tree_max_min_depth.py to ds_tree_balanced_bt.py | ngovindaraj/Python | leetcode/ds_tree_balanced_bt.py | leetcode/ds_tree_balanced_bt.py | # @file Balanced Binary Tree
# @brief Given a binary tree, determine if it is height-balanced.
# https://leetcode.com/problems/balanced-binary-tree/
'''
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined
as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
'''
#Given a BT node, find the depth (1-based depth)
def maxDepth(root):
if (root == None): return 0
elif (root.left == None and root.right == None): return 1
else: return 1 + max(maxDepth(root.left), maxDepth(root.right))
def isBalanced(self, root):
if(root == None): return True
elif abs(maxDepth(root.left) - maxDepth(root.right)) > 1: return False
elif self.isBalanced(root.left) == False: return False
else: return self.isBalanced(root.right)
| mit | Python |
|
4a6edf85f755f62a2213ce09cd407621fe635cea | Add DB migration file | cgwire/zou | zou/migrations/versions/528b27337ebc_.py | zou/migrations/versions/528b27337ebc_.py | """empty message
Revision ID: 528b27337ebc
Revises: f0567e8d0c62
Create Date: 2018-05-17 15:51:25.513852
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql
import sqlalchemy_utils
import uuid
# revision identifiers, used by Alembic.
revision = '528b27337ebc'
down_revision = 'f0567e8d0c62'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('asset_instance_link',
sa.Column('entity_id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), default=uuid.uuid4, nullable=False),
sa.Column('asset_instance_id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), default=uuid.uuid4, nullable=False),
sa.ForeignKeyConstraint(['asset_instance_id'], ['asset_instance.id'], ),
sa.ForeignKeyConstraint(['entity_id'], ['entity.id'], ),
sa.PrimaryKeyConstraint('entity_id', 'asset_instance_id')
)
op.add_column('asset_instance', sa.Column('scene_id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), default=uuid.uuid4, nullable=True))
op.create_index(op.f('ix_asset_instance_scene_id'), 'asset_instance', ['scene_id'], unique=False)
op.drop_constraint('asset_instance_name_uc', 'asset_instance', type_='unique')
op.create_unique_constraint('asset_instance_name_uc', 'asset_instance', ['scene_id', 'name'])
op.drop_constraint('asset_instance_uc', 'asset_instance', type_='unique')
op.create_unique_constraint('asset_instance_uc', 'asset_instance', ['asset_id', 'scene_id', 'number'])
op.drop_index('ix_asset_instance_entity_id', table_name='asset_instance')
op.drop_index('ix_asset_instance_entity_type_id', table_name='asset_instance')
op.drop_constraint('asset_instance_entity_id_fkey', 'asset_instance', type_='foreignkey')
op.drop_constraint('asset_instance_entity_type_id_fkey', 'asset_instance', type_='foreignkey')
op.create_foreign_key(None, 'asset_instance', 'entity', ['scene_id'], ['id'])
op.drop_column('asset_instance', 'entity_type_id')
op.drop_column('asset_instance', 'entity_id')
op.add_column('output_file', sa.Column('temporal_entity_id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), default=uuid.uuid4, nullable=True))
op.drop_constraint('output_file_uc', 'output_file', type_='unique')
op.create_unique_constraint('output_file_uc', 'output_file', ['name', 'entity_id', 'asset_instance_id', 'output_type_id', 'task_type_id', 'temporal_entity_id', 'representation', 'revision'])
op.create_foreign_key(None, 'output_file', 'entity', ['temporal_entity_id'], ['id'])
op.drop_column('output_file', 'uploaded_movie_name')
op.drop_column('output_file', 'uploaded_movie_url')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('output_file', sa.Column('uploaded_movie_url', sa.VARCHAR(length=600), autoincrement=False, nullable=True))
op.add_column('output_file', sa.Column('uploaded_movie_name', sa.VARCHAR(length=150), autoincrement=False, nullable=True))
op.drop_constraint(None, 'output_file', type_='foreignkey')
op.drop_constraint('output_file_uc', 'output_file', type_='unique')
op.create_unique_constraint('output_file_uc', 'output_file', ['name', 'entity_id', 'output_type_id', 'task_type_id', 'representation', 'revision'])
op.drop_column('output_file', 'temporal_entity_id')
op.add_column('asset_instance', sa.Column('entity_id', postgresql.UUID(), autoincrement=False, nullable=False))
op.add_column('asset_instance', sa.Column('entity_type_id', postgresql.UUID(), autoincrement=False, nullable=False))
op.drop_constraint(None, 'asset_instance', type_='foreignkey')
op.create_foreign_key('asset_instance_entity_type_id_fkey', 'asset_instance', 'entity_type', ['entity_type_id'], ['id'])
op.create_foreign_key('asset_instance_entity_id_fkey', 'asset_instance', 'entity', ['entity_id'], ['id'])
op.create_index('ix_asset_instance_entity_type_id', 'asset_instance', ['entity_type_id'], unique=False)
op.create_index('ix_asset_instance_entity_id', 'asset_instance', ['entity_id'], unique=False)
op.drop_constraint('asset_instance_uc', 'asset_instance', type_='unique')
op.create_unique_constraint('asset_instance_uc', 'asset_instance', ['asset_id', 'entity_id', 'number'])
op.drop_constraint('asset_instance_name_uc', 'asset_instance', type_='unique')
op.create_unique_constraint('asset_instance_name_uc', 'asset_instance', ['entity_id', 'name'])
op.drop_index(op.f('ix_asset_instance_scene_id'), table_name='asset_instance')
op.drop_column('asset_instance', 'scene_id')
op.drop_table('asset_instance_link')
# ### end Alembic commands ###
| agpl-3.0 | Python |
|
68f3c14c2ae7df9d9a5cdc44fe7a181760d54dfa | Add Exercise 3.10. | jcrist/pydy,skidzo/pydy,jcrist/pydy,Shekharrajak/pydy,Shekharrajak/pydy,jcrist/pydy,skidzo/pydy,jcrist/pydy,oliverlee/pydy,oliverlee/pydy,oliverlee/pydy,jcrist/pydy,Shekharrajak/pydy,jcrist/pydy,Shekharrajak/pydy,jcrist/pydy,skidzo/pydy,skidzo/pydy | Kane1985/Chapter2/Ex3.10.py | Kane1985/Chapter2/Ex3.10.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 3.10 from Kane 1985."""
from __future__ import division
from sympy import cancel, collect, expand_trig, solve, symbols, trigsimp
from sympy import sin, cos
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy.physics.mechanics import dot, dynamicsymbols, msprint
q1, q2, q3, q4, q5, q6, q7 = q = dynamicsymbols('q1:8')
u1, u2, u3, u4, u5, u6, u7 = u = dynamicsymbols('q1:8', level=1)
r, theta, b = symbols('r θ b', real=True, positive=True)
# define reference frames
R = ReferenceFrame('R') # fixed race rf, let R.z point upwards
A = R.orientnew('A', 'axis', [q7, R.z]) # rf that rotates with S* about R.z
# B.x, B.z are parallel with face of cone, B.y is perpendicular
B = A.orientnew('B', 'axis', [-theta, A.x])
S = ReferenceFrame('S')
S.set_ang_vel(A, u1*A.x + u2*A.y + u3*A.z)
C = ReferenceFrame('C')
C.set_ang_vel(A, u4*B.x + u5*B.y + u6*B.z)
# define points
pO = Point('O')
pS_star = pO.locatenew('S*', b*A.y)
pS_hat = pS_star.locatenew('S^', -r*B.y) # S^ touches the cone
pS1 = pS_star.locatenew('S1', -r*A.z) # S1 touches horizontal wall of the race
pS2 = pS_star.locatenew('S2', r*A.y) # S2 touches vertical wall of the race
pO.set_vel(R, 0)
pS_star.v2pt_theory(pO, R, A)
pS1.v2pt_theory(pS_star, R, S)
pS2.v2pt_theory(pS_star, R, S)
# Since S is rolling against R, v_S1_R = 0, v_S2_R = 0.
vc = [dot(p.vel(R), basis) for p in [pS1, pS2] for basis in R]
vc_map = solve(vc, [u1, u2, u3])
pO.set_vel(C, 0)
pS_star.v2pt_theory(pO, C, A)
pS_hat.v2pt_theory(pS_star, C, S)
# Since S is rolling against C, v_S^_C = 0.
# Cone has only angular velocity in R.z direction.
vc2 = [dot(pS_hat.vel(C), basis).subs(vc_map) for basis in A]
vc2 += [dot(C.ang_vel_in(R), basis) for basis in [R.x, R.y]]
vc_map = dict(vc_map.items() + solve(vc2, [u4, u5, u6]).items())
# Pure rolling between S and C, dot(ω_C_S, B.y) = 0.
b_val = solve([dot(C.ang_vel_in(S), B.y).subs(vc_map).simplify()], b)[0][0]
print('b = {0}'.format(msprint(collect(cancel(expand_trig(b_val)), r))))
b_expected = r*(1 + sin(theta))/(cos(theta) - sin(theta))
assert trigsimp(b_val - b_expected) == 0
| bsd-3-clause | Python |
|
484e50b34c06785f1b1b48da5502f79ee5a2357b | add factories.py | texastribune/tx_salaries,texastribune/tx_salaries | tx_salaries/factories.py | tx_salaries/factories.py | import factory
from tx_people.models import Organization, Membership, Person, Post
from tx_salaries.models import Employee, EmployeeTitle, CompensationType, OrganizationStats
# tx_people factories
class OrganizationFactory(factory.DjangoModelFactory):
FACTORY_FOR = Organization
class PersonFactory(factory.DjangoModelFactory):
FACTORY_FOR = Person
class PostFactory(factory.DjangoModelFactory):
FACTORY_FOR = Post
organization = factory.SubFactory(OrganizationFactory)
class MembershipFactory(factory.DjangoModelFactory):
FACTORY_FOR = Membership
person = factory.SubFactory(PersonFactory)
organization = factory.SubFactory(OrganizationFactory)
post = factory.SubFactory(PostFactory)
# tx_salaries factories
class CompensationTypeFactory(factory.DjangoModelFactory):
FACTORY_FOR = CompensationType
class EmployeeTitleFactory(factory.DjangoModelFactory):
FACTORY_FOR = EmployeeTitle
class EmployeeFactory(factory.DjangoModelFactory):
FACTORY_FOR = Employee
position = factory.SubFactory(MembershipFactory)
compensation_type = factory.SubFactory(CompensationTypeFactory)
title = factory.SubFactory(EmployeeTitleFactory)
compensation = 1337
class OrganizationStatsFactory(factory.DjangoModelFactory):
FACTORY_FOR = OrganizationStats | apache-2.0 | Python |
|
533559e20e377ce042591709e53d7dc7031d6205 | Add test for timer automatically inserted due to directive | giserh/hug,STANAPO/hug,MuhammadAlkarouri/hug,janusnic/hug,MuhammadAlkarouri/hug,janusnic/hug,gbn972/hug,MuhammadAlkarouri/hug,STANAPO/hug,shaunstanislaus/hug,yasoob/hug,jean/hug,philiptzou/hug,philiptzou/hug,jean/hug,shaunstanislaus/hug,origingod/hug,giserh/hug,yasoob/hug,timothycrosley/hug,alisaifee/hug,timothycrosley/hug,alisaifee/hug,timothycrosley/hug,gbn972/hug,origingod/hug | tests/test_directives.py | tests/test_directives.py | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
"""
import sys
import hug
api = sys.modules[__name__]
def test_timer():
timer = hug.directives.timer()
assert isinstance(timer.taken(), float)
assert isinstance(timer.start, float)
timer = hug.directives.timer('Time: {0}')
assert isinstance(timer.taken(), str)
assert isinstance(timer.start, float)
@hug.get()
def timer_tester(timer):
return timer.taken()
assert isinstance(hug.test.get(api, 'timer_tester').data, float)
| """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
"""
import hug
def test_timer():
timer = hug.directives.timer()
assert isinstance(timer.taken(), float)
assert isinstance(timer.start, float)
timer = hug.directives.timer('Time: {0}')
assert isinstance(timer.taken(), str)
assert isinstance(timer.start, float)
| mit | Python |
a3939b572c51b7a721b758cb5b93364e4b156c13 | Add script that dumps the python path | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | dev_tools/syspath.py | dev_tools/syspath.py | #!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| apache-2.0 | Python |
|
f06a71a87daaaf0bc4b1f5701ce4c59805b70f6b | Format all local .json files for human readability | cclauss/Ten-lines-or-less | usr/bin/json_readable.py | usr/bin/json_readable.py | #!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(in_file)
with open(filename, 'w') as out_file:
json.dump(data, out_file, indent=4) # indent=4 makes the files human readable
| apache-2.0 | Python |
|
e736772d21aea0995a1948220e2dc2c6fa413fca | Add python zookeeper example | xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet,xgfone/snippet | snippet/example/python/zookeeper.py | snippet/example/python/zookeeper.py | #!/usr/bin/env python
# encoding: utf8
from __future__ import absolute_import, print_function, unicode_literals, division
import zookeeper
def refactor_path(f):
def wrapper(*args, **kwargs):
_refactor = kwargs.pop("refactor", True)
if _refactor:
path = kwargs.get("path", None)
if path is not None:
kwargs["path"] = args[0]._path(path) # args[0] is an instance of ZooKeeper
return f(*args, **kwargs)
return wrapper
class ZooKeeper(object):
DEFAULT_ACL = [{"perms": 0x1f, "scheme": "world", "id": "anyone"}]
def __init__(self, connector, root="/", acl=None, flags=0):
self.root = root.rstrip("/")
if not self.root:
self.root = "/"
self.zk = zookeeper.init(connector)
self.acl = acl if acl else self.DEFAULT_ACL
self.flags = flags
def _path(self, path):
path = path.strip("/")
if path:
path = "/".join((self.root, path))
else:
path = self.root
return path
@refactor_path
def create(self, path="", value=""):
try:
zookeeper.create(self.zk, path, value, self.acl, self.flags)
except zookeeper.NodeExistsException:
pass
except zookeeper.NoNodeException:
self.create(path=path.rsplit("/", 1)[0], refactor=False)
self.create(path=path, value=value, refactor=False)
@refactor_path
def delete(self, path="", recursion=True):
try:
zookeeper.delete(self.zk, path)
except zookeeper.NoNodeException:
pass
except zookeeper.NotEmptyException:
if recursion:
for subpath in self.ls(path=path, refactor=False):
self.delete(path="/".join((path, subpath)), recursion=recursion, refactor=False)
self.delete(path=path, recursion=recursion, refactor=False)
else:
raise
@refactor_path
def set(self, path="", value=""):
try:
zookeeper.set(self.zk, path, value)
except zookeeper.NoNodeException:
self.create(path=path, value=value, refactor=False)
self.set(path=path, value=value, refactor=False)
@refactor_path
def get(self, path=""):
return zookeeper.get(self.zk, path)
@refactor_path
def ls(self, path=""):
return zookeeper.get_children(self.zk, path)
def close(self):
zookeeper.close(self.zk)
| mit | Python |
|
101d334b80872c36adb5645ba0b3cda9b7c36a61 | Add compliance with rule E261 to camo.py. | eeshangarg/zulip,rht/zulip,shubhamdhama/zulip,rht/zulip,shubhamdhama/zulip,tommyip/zulip,eeshangarg/zulip,j831/zulip,verma-varsha/zulip,hackerkid/zulip,vaidap/zulip,rht/zulip,ryanbackman/zulip,amanharitsh123/zulip,synicalsyntax/zulip,tommyip/zulip,punchagan/zulip,punchagan/zulip,christi3k/zulip,andersk/zulip,andersk/zulip,j831/zulip,tommyip/zulip,amanharitsh123/zulip,zulip/zulip,amanharitsh123/zulip,amanharitsh123/zulip,punchagan/zulip,andersk/zulip,ryanbackman/zulip,brainwane/zulip,j831/zulip,jrowan/zulip,dhcrzf/zulip,timabbott/zulip,rishig/zulip,rishig/zulip,j831/zulip,jphilipsen05/zulip,brainwane/zulip,Galexrt/zulip,showell/zulip,shubhamdhama/zulip,Galexrt/zulip,jrowan/zulip,tommyip/zulip,jackrzhang/zulip,rishig/zulip,zulip/zulip,jphilipsen05/zulip,mahim97/zulip,brockwhittaker/zulip,shubhamdhama/zulip,showell/zulip,ryanbackman/zulip,timabbott/zulip,verma-varsha/zulip,showell/zulip,hackerkid/zulip,brockwhittaker/zulip,vabs22/zulip,synicalsyntax/zulip,rishig/zulip,tommyip/zulip,ryanbackman/zulip,brainwane/zulip,kou/zulip,synicalsyntax/zulip,rht/zulip,andersk/zulip,kou/zulip,tommyip/zulip,jackrzhang/zulip,kou/zulip,dhcrzf/zulip,rishig/zulip,brainwane/zulip,eeshangarg/zulip,Galexrt/zulip,andersk/zulip,rht/zulip,eeshangarg/zulip,punchagan/zulip,Galexrt/zulip,jackrzhang/zulip,brockwhittaker/zulip,jphilipsen05/zulip,rht/zulip,kou/zulip,hackerkid/zulip,christi3k/zulip,jphilipsen05/zulip,verma-varsha/zulip,synicalsyntax/zulip,mahim97/zulip,brainwane/zulip,vaidap/zulip,kou/zulip,eeshangarg/zulip,hackerkid/zulip,jackrzhang/zulip,mahim97/zulip,synicalsyntax/zulip,vabs22/zulip,kou/zulip,timabbott/zulip,jrowan/zulip,dhcrzf/zulip,kou/zulip,timabbott/zulip,showell/zulip,mahim97/zulip,brockwhittaker/zulip,vaidap/zulip,showell/zulip,christi3k/zulip,punchagan/zulip,dhcrzf/zulip,amanharitsh123/zulip,shubhamdhama/zulip,rht/zulip,vabs22/zulip,jackrzhang/zulip,Galexrt/zulip,j831/zulip,verma-varsha/zulip,jrowan/zulip,vaidap/zulip,timabbott/zulip,synicalsyntax/zulip,dhcrzf/zulip,vabs22/zulip,zulip/zulip,showell/zulip,j831/zulip,christi3k/zulip,vabs22/zulip,punchagan/zulip,punchagan/zulip,jackrzhang/zulip,jrowan/zulip,hackerkid/zulip,mahim97/zulip,zulip/zulip,hackerkid/zulip,Galexrt/zulip,andersk/zulip,eeshangarg/zulip,brockwhittaker/zulip,zulip/zulip,vaidap/zulip,showell/zulip,verma-varsha/zulip,shubhamdhama/zulip,brockwhittaker/zulip,rishig/zulip,mahim97/zulip,tommyip/zulip,ryanbackman/zulip,jphilipsen05/zulip,zulip/zulip,christi3k/zulip,jackrzhang/zulip,rishig/zulip,timabbott/zulip,timabbott/zulip,zulip/zulip,dhcrzf/zulip,Galexrt/zulip,shubhamdhama/zulip,synicalsyntax/zulip,hackerkid/zulip,andersk/zulip,christi3k/zulip,eeshangarg/zulip,brainwane/zulip,dhcrzf/zulip,jrowan/zulip,jphilipsen05/zulip,brainwane/zulip,verma-varsha/zulip,amanharitsh123/zulip,vaidap/zulip,vabs22/zulip,ryanbackman/zulip | zerver/lib/camo.py | zerver/lib/camo.py | from django.conf import settings
import codecs
import hashlib
import hmac
from typing import Text
# Encodes the provided URL using the same algorithm used by the camo
# caching https image proxy
def get_camo_url(url):
# type: (Text) -> Text
# Only encode the url if Camo is enabled
if settings.CAMO_URI == '':
return url
encoded_url = url.encode("utf-8")
encoded_camo_key = settings.CAMO_KEY.encode("utf-8")
digest = hmac.new(encoded_camo_key, encoded_url, hashlib.sha1).hexdigest()
hex_encoded_url = codecs.encode(encoded_url, "hex") # type: ignore # https://github.com/python/typeshed/issues/300
return "%s%s/%s" % (settings.CAMO_URI, digest, hex_encoded_url.decode("utf-8"))
| from django.conf import settings
import codecs
import hashlib
import hmac
from typing import Text
# Encodes the provided URL using the same algorithm used by the camo
# caching https image proxy
def get_camo_url(url):
# type: (Text) -> Text
# Only encode the url if Camo is enabled
if settings.CAMO_URI == '':
return url
encoded_url = url.encode("utf-8")
encoded_camo_key = settings.CAMO_KEY.encode("utf-8")
digest = hmac.new(encoded_camo_key, encoded_url, hashlib.sha1).hexdigest()
hex_encoded_url = codecs.encode(encoded_url, "hex") # type: ignore # https://github.com/python/typeshed/issues/300
return "%s%s/%s" % (settings.CAMO_URI, digest, hex_encoded_url.decode("utf-8"))
| apache-2.0 | Python |
c78dffb9b23e38fc980c06ff519e750f5d1e3678 | add day1_short_palindrome.py - might work :) | flypenguin/hackerrank-exercises | 10-days-of-stats/day1_short_palindrome.py | 10-days-of-stats/day1_short_palindrome.py | #!/usr/bin/python3
# let's try to not do string comparisons and maybe list indexing
# is faster than string indexing
s = list(map(ord, list(input())))
slen = len(s)
found = 0
# baseline optimization only (don't know if there is more possible)
for a in range(0, slen-3):
for d in range(a+3, slen):
if not s[d] == s[a]:
continue
for b in range(a+1, d-1):
for c in range(b+1, d):
if s[b] == s[c]:
found += 1
print(found % (10**9 + 7))
| unlicense | Python |
|
c0220578f4cd9b4c26879548751586615fe070e8 | Add some freesurfer tools | gallantlab/pycortex,gallantlab/pycortex,gallantlab/pycortex,gallantlab/pycortex,CVML/pycortex,smerdis/pycortex,CVML/pycortex,gallantlab/pycortex,CVML/pycortex,CVML/pycortex,smerdis/pycortex,CVML/pycortex,smerdis/pycortex,smerdis/pycortex,smerdis/pycortex | cortex/freesurfer.py | cortex/freesurfer.py | import os
import struct
import tempfile
import shlex
import subprocess as sp
import numpy as np
import vtkutils_new as vtk
def parse_curv(filename):
with open(filename) as fp:
fp.seek(15)
return np.fromstring(fp.read(), dtype='>f4').byteswap()
def show_surf(subject, hemi, type):
from mayavi import mlab
from tvtk.api import tvtk
tf = tempfile.NamedTemporaryFile(suffix='.vtk')
path = os.path.join(os.environ['SUBJECTS_DIR'], subject)
surf_file = os.path.join(path, "surf", hemi+'.'+type)
curv_file = os.path.join(path, "surf", hemi+'.curv')
proc = sp.call(shlex.split('mris_convert {path} {tf}'.format(path=surf_file, tf=tf.name)))
pts, polys, norms = vtk.read(tf.name)
curv = parse_curv(curv_file)
fig = mlab.figure()
src = mlab.pipeline.triangular_mesh_source(pts[:,0], pts[:,1], pts[:,2], polys, scalars=curv, figure=fig)
norms = mlab.pipeline.poly_data_normals(src, figure=fig)
norms.filter.splitting = False
surf = mlab.pipeline.surface(norms, figure=fig)
surf.parent.scalar_lut_manager.set(lut_mode='RdBu', data_range=[-1,1], use_default_range=False)
cursors = mlab.pipeline.scalar_scatter([0], [0], [0])
glyphs = mlab.pipeline.glyph(cursors, figure=fig)
glyphs.glyph.glyph_source.glyph_source = glyphs.glyph.glyph_source.glyph_dict['axes']
fig.scene.background = (0,0,0)
fig.scene.interactor.interactor_style = tvtk.InteractorStyleTerrain()
def picker_callback(picker):
if picker.actor in surf.actor.actors:
npts = np.append(cursors.data.points.to_array(), [pts[picker.point_id]], axis=0)
cursors.data.points = npts
x, y, z = pts[picker.point_id]
with open(os.path.join(path, 'tmp', 'edit.dat'), 'w') as fp:
fp.write('%f %f %f\n'%(x, y, z))
picker = fig.on_mouse_pick(picker_callback)
picker.tolerance = 0.01
return surf | bsd-2-clause | Python |
|
ed4d07fb2a7fa8f1dd30a2b7982940a5fe78275b | Add the analysis driver for the run step of the study | mdpiper/dakota-swash-parameter-study,mdpiper/dakota-swash-parameter-study | dakota_run_driver.py | dakota_run_driver.py | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subprocess import call
def driver():
"""Broker communication between Dakota and SWASH through files."""
# Files and directories.
start_dir = os.path.dirname(os.path.realpath(__file__))
input_file = 'INPUT'
input_template = input_file + '.template'
output_file = 'bot07.mat'
output_file_var = 'Botlev'
data_file = 'sand.bot'
run_script = 'run_swash.sh'
# Use `dprepro` (from $DAKOTA_DIR/bin) to substitute parameter
# values from Dakota into the SWASH input template, creating a new
# SWASH input file.
shutil.copy(os.path.join(start_dir, input_template), os.curdir)
call(['dprepro', sys.argv[1], input_template, input_file])
# Copy the data file into the active directory.
shutil.copy(os.path.join(start_dir, data_file), os.curdir)
# Call SWASH through a PBS submission script. Note that `qsub`
# returns immediately, so jobs do not block.
job_name = 'SWASH-Dakota' + os.path.splitext(os.getcwd())[-1]
call(['qsub', '-N', job_name, os.path.join(start_dir, run_script)])
# Provide a dummy results file to advance Dakota.
with open(sys.argv[2], 'w') as fp:
fp.write('0.0\n1.0\n')
if __name__ == '__main__':
driver()
| mit | Python |
|
ac5f30f9d58a25476c935d5266e9948b03efebf8 | Add simple fetch tests | rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory | observatory/dashboard/tests/test_fetch.py | observatory/dashboard/tests/test_fetch.py | import pytest
from dashboard.models import Project, Blog, Repository
from emaillist.models import EmailAddress
from django.contrib.auth.models import User
@pytest.mark.django_db
def test_fetch_warning(client):
user = User.objects.create_user('a', '[email protected]', 'bob')
user.first_name = "testf"
user.last_name = "testf"
user.save()
email = EmailAddress(address='[email protected]', user=user)
email.save()
ease_blog = Blog(from_feed = False)
ease_blog.save()
ease_repo = Repository(web_url = "http://git.gnome.org/browse/ease",
clone_url = "git://git.gnome.org/ease",
from_feed = False)
ease_repo.save()
ease = Project(title = "Ease",
description = "A presentation application for the Gnome Desktop.",
website = "http://www.ease-project.org",
wiki = "http://live.gnome.org/Ease",
blog_id = ease_blog.id,
repository_id = ease_repo.id)
ease.save()
ease.authors.add(user)
ease.save()
ease.do_warnings()
assert ease.blog_warn_level > 0
assert ease.repo_warn_level > 0
| isc | Python |
|
7af99b98a9985aa1274c56ef8333b0c57a4679c9 | add simple redis queue processor. | thruflo/pyramid_weblayer | src/pyramid_weblayer/queue.py | src/pyramid_weblayer/queue.py | # -*- coding: utf-8 -*-
"""Provides a ``QueueProcessor`` utility that consumes and processes data
from one or more redis channels.
>>> redis_client = '<redis.Redis> instance'
>>> input_channels = ['channel1', 'channeln']
>>> handle_data = lambda data_str: print data_str
>>> processor = QueueProcessor(redis_client, input_channels, handle_data)
Run in the main / current thread::
>>> # processor.start()
Run in a background thread::
>>> # processor.start(async=True)
If running in a background thread, call ``stop()`` to exit::
>>> # processor.stop()
If you want jobs to be requeued (at the back of the queue)
This provides a very simple inter-process messaging and / or background
task processing mechanism. Queued messages / jobs are explictly passed
as string messages.
Pro: you're always in control of your code execution environment.
Con: you have to deal with potentially tedious message parsing.
"""
import logging
logger = logging.getLogger(__name__)
import json
import threading
import time
class QueueProcessor(object):
"""Consume data from a redis queue. When it arrives, pass it to
``self.handler_function``.
"""
running = False
def stop(self):
"""Call ``stop()`` to stop processing the queue the next time a job is
processed or the input queue timeout is reached.
"""
logger.info('QueueProcessor.stop()')
self.running = False
def _start(self):
"""Actually start processing the input queue(s) ad-infinitum."""
logger.debug('QueueProcessor.start()')
logger.debug(self.channels)
self.running = True
while self.running:
try:
return_value = self.redis.blpop(self.channels, timeout=self.timeout)
except Exception as err:
logger.warn(err, exc_info=True)
time.sleep(self.timeout)
else:
if return_value is not None:
channel, body = return_value
try:
self.handle_function(body)
except Exception as err:
logger.warn(err, exc_info=True)
logger.warn(return_value)
if self.should_requeue:
self.redis.rpush(channel, body)
def start(self, async=False):
"""Either start running or start running in a thread."""
if self.running:
return
if async:
threading.Thread(target=self._start).start()
else:
self._start()
def __init__(self, redis_client, channels, handle_function, timeout=5,
should_requeue=False):
"""Instantiate a queue processor::
>>> processor = QueueProcessor(None, None, None)
"""
self.redis = redis_client
self.channels = channels
self.handle_function = handle_function
self.timeout = timeout
self.should_requeue = should_requeue
| unlicense | Python |
|
1975e6ebd57aac379ad19f5d4675f8f598c03c66 | add utilNetworkIP | yasokada/python-151127-7segLed_IPadrDisplay | utilNetworkIP.py | utilNetworkIP.py | import socket
import fcntl
import struct
'''
v0.1 2015/11/28
- add NetworkIP_get_ipAddress_eth0()
- add get_ip_address()
'''
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack('256s', ifname[:15])
)[20:24])
def NetworkIP_get_ipAddress_eth0():
return get_ip_address('eth0')
| mit | Python |
|
d8f5b31fab57cc009e87a8d62c8d03075f66e9bd | Add solution for Project Euler problem 72 (#3122) | TheAlgorithms/Python | project_euler/problem_072/sol2.py | project_euler/problem_072/sol2.py | """
Project Euler Problem 72: https://projecteuler.net/problem=72
Consider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1,
it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d ≤ 8 in ascending order of size,
we get:
1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2,
4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 7/8
It can be seen that there are 21 elements in this set.
How many elements would be contained in the set of reduced proper fractions
for d ≤ 1,000,000?
"""
def solution(limit: int = 1000000) -> int:
"""
Return the number of reduced proper fractions with denominator less than limit.
>>> solution(8)
21
>>> solution(1000)
304191
"""
primes = set(range(3, limit, 2))
primes.add(2)
for p in range(3, limit, 2):
if p not in primes:
continue
primes.difference_update(set(range(p * p, limit, p)))
phi = [float(n) for n in range(limit + 1)]
for p in primes:
for n in range(p, limit + 1, p):
phi[n] *= 1 - 1 / p
return int(sum(phi[2:]))
if __name__ == "__main__":
print(f"{solution() = }")
| mit | Python |
|
dab192db863fdd694bb0adbce10fa2dd6c05353b | Make the cli work again. | rzyns/jrnl,philipsd6/jrnl,notbalanced/jrnl,flight16/jrnl,maebert/jrnl,MSylvia/jrnl,dzeban/jrnl,nikvdp/jrnl,cloudrave/jrnl-todos,MinchinWeb/jrnl,beni55/jrnl,zdravi/jrnl,Shir0kamii/jrnl | jrnl/__init__.py | jrnl/__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
| mit | Python |
b7ea4cde920a69add4cbd4cfb76c651ec77910ce | Create __init__.py | MOLSSI-BSE/basis_set_exchange | bse/data/__init__.py | bse/data/__init__.py | bsd-3-clause | Python |
||
ed36937ff6ccb2e676236b2bd128a2bb8fa9a760 | add format_html util | dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | dimagi/utils/html.py | dimagi/utils/html.py | from __future__ import absolute_import
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
def format_html(format_string, *args, **kwargs):
escaped_args = map(conditional_escape, args)
escaped_kwargs = dict([(key, conditional_escape(value)) for key, value in kwargs])
return mark_safe(format_string.format(*escaped_args, **escaped_kwargs)) | bsd-3-clause | Python |
|
8a668efbc266802a4f4e23c936d3589b230d9528 | Add blink example on two different boards | joppi/nanpy,nanpy/nanpy | nanpy/examples/blink_2boards.py | nanpy/examples/blink_2boards.py | #!/usr/bin/env python
# Author: Andrea Stagi <[email protected]>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.usbmodem1411'
device_2 = '/dev/tty.usbmodem1431'
connection_1 = SerialManager(device=device_1)
connection_2 = SerialManager(device=device_2)
a1 = ArduinoApi(connection=connection_1)
a1.pinMode(13, a1.OUTPUT)
a2 = ArduinoApi(connection=connection_2)
a2.pinMode(13, a2.OUTPUT)
for i in range(10000):
a1.digitalWrite(13, (i + 1) % 2)
sleep(1)
a2.digitalWrite(13, (i + 1) % 2)
sleep(1)
| mit | Python |
|
ee08eca3d8bb28819c2594bfdc855fbd7f743536 | Add script to copy brifti files. | rameshvs/nipype,grlee77/nipype,carolFrohlich/nipype,blakedewey/nipype,iglpdc/nipype,Leoniela/nipype,pearsonlab/nipype,sgiavasis/nipype,wanderine/nipype,dgellis90/nipype,gerddie/nipype,FredLoney/nipype,mick-d/nipype_source,carlohamalainen/nipype,dgellis90/nipype,FCP-INDI/nipype,carlohamalainen/nipype,sgiavasis/nipype,FCP-INDI/nipype,glatard/nipype,pearsonlab/nipype,wanderine/nipype,Leoniela/nipype,dmordom/nipype,grlee77/nipype,christianbrodbeck/nipype,carolFrohlich/nipype,satra/NiPypeold,dmordom/nipype,JohnGriffiths/nipype,arokem/nipype,grlee77/nipype,carolFrohlich/nipype,glatard/nipype,arokem/nipype,glatard/nipype,fprados/nipype,wanderine/nipype,gerddie/nipype,gerddie/nipype,mick-d/nipype,arokem/nipype,Leoniela/nipype,iglpdc/nipype,pearsonlab/nipype,wanderine/nipype,blakedewey/nipype,FredLoney/nipype,mick-d/nipype,arokem/nipype,rameshvs/nipype,satra/NiPypeold,mick-d/nipype_source,blakedewey/nipype,iglpdc/nipype,mick-d/nipype,mick-d/nipype_source,fprados/nipype,mick-d/nipype,sgiavasis/nipype,rameshvs/nipype,gerddie/nipype,FCP-INDI/nipype,pearsonlab/nipype,rameshvs/nipype,blakedewey/nipype,grlee77/nipype,JohnGriffiths/nipype,carlohamalainen/nipype,dgellis90/nipype,carolFrohlich/nipype,christianbrodbeck/nipype,dmordom/nipype,glatard/nipype,fprados/nipype,JohnGriffiths/nipype,dgellis90/nipype,iglpdc/nipype,FCP-INDI/nipype,sgiavasis/nipype,JohnGriffiths/nipype,FredLoney/nipype | nipype/externals/copy_brifti.py | nipype/externals/copy_brifti.py | #!/usr/bin/env python
"""Script to copy brifti files from the git repos into nipype.
I stole this from nipy.tools.copy_brifti.py. Matthew Brett is the
original author, I've hacked the script to make it work with nipype.
The script downloads the current pynifti git repository from my github
account, pulls out the nifti python modules that we include in nipype,
updates their impot paths, copies the modules into the
nipype/externals/pynifti directory, then cleans up the temporary
files/directories.
Usage:
./copy_brifti.py
It is assumed that this script lives in trunk/nipype/externals and
that the python modules are in a subdirectory named 'pynifti'.
"""
import os
import sys
import shutil
import tempfile
import functools
import subprocess
import re
# search replaces for imports
subs = (
(re.compile(r'^([ >]*)(import|from) +nifti'),
r'\1\2 nipype.externals.pynifti'),
)
caller = functools.partial(subprocess.call, shell=True)
#git_path = 'git://github.com/cburns/pynifti.git'
# Working locally is much faster
git_path = '/home/cburns/src/pynifti.git'
git_tag = 'HEAD'
# Assume this script resides in the trunk/nipype/externals directory,
# and there is a subdirectory called pynifti where the brifti files
# live.
out_path = 'pynifti'
def create_archive(out_path, git_path, git_tag):
out_path = os.path.abspath(out_path)
pwd = os.path.abspath(os.curdir)
# put git clone in a tmp directory
tmp_path = tempfile.mkdtemp()
os.chdir(tmp_path)
caller('git clone ' + git_path)
# We only want the 'nifti' directory from the git repos, we'll
# create an archive of that directory.
os.chdir('pynifti')
caller('git archive %s nifti > nifti.tar' % git_tag)
os.chdir(tmp_path)
# extract tarball and modify files before copying into out_path
caller('tar xvf pynifti/nifti.tar')
# done with git repository, remove it
shutil.rmtree('pynifti')
# For nipype, we don't copy the tests
shutil.rmtree('nifti/derivations')
shutil.rmtree('nifti/testing')
shutil.rmtree('nifti/tests')
# Walk through the nifti directory and update the import paths to
# nipype paths.
for root, dirs, files in os.walk('nifti'):
for fname in files:
if not fname.endswith('.py'):
continue
fpath = os.path.join(root, fname)
lines = file(fpath).readlines()
outfile = file(fpath, 'wt')
for line in lines:
for regexp, repstr in subs:
if regexp.search(line):
line = regexp.sub(repstr, line)
continue
outfile.write(line)
outfile.close()
# Create tarball of new files
os.chdir('nifti')
caller('tar cvf nifti.tar *')
# Move the tarball to the nipype directory
dst = os.path.join(out_path, 'nifti.tar')
shutil.move('nifti.tar', dst)
os.chdir(out_path)
# Extract the tarball, overwriting existing files.
caller('tar xvf nifti.tar')
# Remove the tarball
os.unlink(dst)
# Remove temporary directory
shutil.rmtree(tpm_path)
if __name__ == '__main__':
create_archive(out_path, git_path, git_tag)
| bsd-3-clause | Python |
|
61a005ffbc988b6a20441841112890bb397f8ca3 | Create stub for 2016 NFLPool player picks | prcutler/nflpool,prcutler/nflpool | 2016_player_picks.py | 2016_player_picks.py |
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "[email protected]",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_north_2": "Bengals", "afc_north_last": "Browns", "afc_south_1": "Colts", "afc_south_2": "Colts",
"afc_south_last": "Titans"}
thaden = []
garber = []
fronczak = []
thomas = []
cutler = []
norred = []
oakland = []
| mit | Python |
|
893e4292f6b1799bf5f1888fcbad41ec8b5a5951 | Use Q-learning to learn all state-action values via self-play | davidrobles/mlnd-capstone-code | examples/tic_ql_tabular_selfplay_all.py | examples/tic_ql_tabular_selfplay_all.py | '''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.rl import QLearningSelfPlay
from capstone.rl.tabularf import TabularF
from capstone.util import tic2pdf
game = TicTacToe()
env = Environment(GameMDP(game))
qlearning = QLearningSelfPlay(env, n_episodes=1000)
qlearning.learn()
for move in game.legal_moves():
print('-' * 80)
value = qlearning.qf[(game, move)]
new_game = game.copy().make_move(move)
print(value)
print(new_game)
| mit | Python |
|
af9b64bcf99d0e2c13b9b6b05a6b4029a0bb7d28 | Add theimdbapi provider, it's faster than myapifilms. | EmilStenstrom/nephele | providers/moviedata/theimdbapi.py | providers/moviedata/theimdbapi.py | import re
from providers.moviedata.provider import MoviedataProvider
from application import ACCESS_KEYS, APPLICATION as APP
try:
from urllib import urlencode # Python 2.X
except ImportError:
from urllib.parse import urlencode # Python 3+
IDENTIFIER = "theimdbapi"
class Provider(MoviedataProvider):
def get_url(self, movie):
parameters = {
"title": movie["name"].encode("utf-8"),
}
if "year" in movie and movie["year"]:
parameters["year"] = movie["year"]
return "http://www.theimdbapi.org/api/find/movie?" + urlencode(parameters)
def fetch_movie_data(self, movie):
url = self.get_url(movie)
APP.debug("Fetching url: %s" % url)
data = self.parse_json(url)
if not data:
return {}
for hit in data:
# Return the first hit with a release date
if hit and "release_date" in hit and hit["release_date"]:
return self.transform_data(hit)
return {}
def get_data_mapping(self):
return {
"id": "imdb_id",
"title": "title",
"plot": "storyline",
"genre": "genre",
"director": "director",
"country": "metadata.countries",
"language": "metadata.languages",
"runtime": "length",
"released": "release_date",
"age_rating": "content_rating",
"year": "year",
"imdb_url": "url",
"imdb_poster": "poster.large",
"imdb_rating": "rating",
"imdb_rating_count": "rating_count",
}
| mit | Python |
|
a8419c46ceed655a276dad00a24e21f300fda543 | Add py solution for 513. Find Bottom Left Tree Value | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/find-bottom-left-tree-value.py | py/find-bottom-left-tree-value.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
q = [root]
for v in q:
if v.right:
q.append(v.right)
if v.left:
q.append(v.left)
return v.val
| apache-2.0 | Python |
|
1e45505a94f23198d0ec464107c12d29d4d9aa16 | Add tests for libdft | sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,sunqm/pyscf | pyscf/lib/dft/test/test_libdft.py | pyscf/lib/dft/test/test_libdft.py | #!/usr/bin/env python
import unittest
import ctypes
import itertools
import numpy
from pyscf.dft.numint import libdft
class KnownValues(unittest.TestCase):
def test_empty_blocks(self):
ao_loc = numpy.array([0,51,60,100,112,165,172], dtype=numpy.int32)
def get_empty_mask(non0tab_mask):
non0tab_mask = numpy.asarray(non0tab_mask, dtype=numpy.uint8)
shls_slice = (0, non0tab_mask.size)
empty_mask = numpy.empty(4, dtype=numpy.int8)
empty_mask[:] = -9
libdft.VXCao_empty_blocks(
empty_mask.ctypes.data_as(ctypes.c_void_p),
non0tab_mask.ctypes.data_as(ctypes.c_void_p),
(ctypes.c_int*2)(*shls_slice),
ao_loc.ctypes.data_as(ctypes.c_void_p))
return empty_mask.tolist()
def naive_emtpy_mask(non0tab_mask):
blksize = 56
ao_mask = numpy.zeros(ao_loc[-1], dtype=bool)
for k, (i0, i1) in enumerate(zip(ao_loc[:-1], ao_loc[1:])):
ao_mask[i0:i1] = non0tab_mask[k] == 1
valued = [m.any() for m in numpy.split(ao_mask, [56, 112, 168])]
empty_mask = ~numpy.array(valued)
return empty_mask.astype(numpy.int).tolist()
def check(non0tab_mask):
if get_empty_mask(non0tab_mask) != naive_emtpy_mask(non0tab_mask):
raise ValueError(non0tab_mask)
for mask in list(itertools.product([0, 1], repeat=6)):
check(mask)
if __name__ == "__main__":
print("Test libdft")
unittest.main()
| apache-2.0 | Python |
|
d2aca979f2c8a711bbc139675cf699b6ce5ce53d | Update keys-and-rooms.py | tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode | Python/keys-and-rooms.py | Python/keys-and-rooms.py | # Time: O(n!)
# Space: O(n)
# There are N rooms and you start in room 0.
# Each room has a distinct number in 0, 1, 2, ..., N-1,
# and each room may have some keys to access the next room.
#
# Formally, each room i has a list of keys rooms[i],
# and each key rooms[i][j] is an integer in [0, 1, ..., N-1]
# where N = rooms.length.
# A key rooms[i][j] = v opens the room with number v.
#
# Initially, all the rooms start locked (except for room 0).
# You can walk back and forth between rooms freely.
# Return true if and only if you can enter every room.
#
# Example 1:
#
# Input: [[1],[2],[3],[]]
# Output: true
# Explanation:
# We start in room 0, and pick up key 1.
# We then go to room 1, and pick up key 2.
# We then go to room 2, and pick up key 3.
# We then go to room 3. Since we were able to go to every room,
# we return true.
# Example 2:
#
# Input: [[1,3],[3,0,1],[2],[0]]
# Output: false
# Explanation: We can't enter the room with number 2.
#
# Note:
# - 1 <= rooms.length <= 1000
# - 0 <= rooms[i].length <= 1000
# - The number of keys in all rooms combined is at most 3000.
class Solution(object):
def canVisitAllRooms(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: bool
"""
lookup = set([0])
stack = [0]
while stack:
node = stack.pop()
for nei in rooms[node]:
if nei not in lookup:
lookup.add(nei)
if len(lookup) == len(rooms):
return True
stack.append(nei)
return len(lookup) == len(rooms)
| # There are N rooms and you start in room 0.
# Each room has a distinct number in 0, 1, 2, ..., N-1,
# and each room may have some keys to access the next room.
#
# Formally, each room i has a list of keys rooms[i],
# and each key rooms[i][j] is an integer in [0, 1, ..., N-1]
# where N = rooms.length.
# A key rooms[i][j] = v opens the room with number v.
#
# Initially, all the rooms start locked (except for room 0).
# You can walk back and forth between rooms freely.
# Return true if and only if you can enter every room.
#
# Example 1:
#
# Input: [[1],[2],[3],[]]
# Output: true
# Explanation:
# We start in room 0, and pick up key 1.
# We then go to room 1, and pick up key 2.
# We then go to room 2, and pick up key 3.
# We then go to room 3. Since we were able to go to every room,
# we return true.
# Example 2:
#
# Input: [[1,3],[3,0,1],[2],[0]]
# Output: false
# Explanation: We can't enter the room with number 2.
#
# Note:
# - 1 <= rooms.length <= 1000
# - 0 <= rooms[i].length <= 1000
# - The number of keys in all rooms combined is at most 3000.
class Solution(object):
def canVisitAllRooms(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: bool
"""
lookup = set([0])
stack = [0]
while stack:
node = stack.pop()
for nei in rooms[node]:
if nei not in lookup:
lookup.add(nei)
if len(lookup) == len(rooms):
return True
stack.append(nei)
return len(lookup) == len(rooms)
| mit | Python |
29a2dcf4ab6684187d95e0faab171b5e071e1eee | Create main.py | garyelephant/snippets,garyelephant/snippets,garyelephant/snippets,garyelephant/snippets | python/using_sqlalchemy01/main.py | python/using_sqlalchemy01/main.py | from .models import User
from .database import session_scope
if __name__ == '__main__':
with session_scope() as session:
users = session.query( User ).order_by( User.id )
# Remove all object instances from this Session to make them available to accessed by outside
users.expunge_all()
for u in users:
print u
| mit | Python |
|
95ff080685f01cbb368d9467f67076ce9f3eae08 | add generic resource creator | remind101/stacker_blueprints,remind101/stacker_blueprints | stacker_blueprints/generic.py | stacker_blueprints/generic.py | """ Load dependencies """
from troposphere import (
Ref, Output
)
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import (
CFNString,
CFNCommaDelimitedList,
)
class generic_resource_creator(Blueprint):
""" Generic Blueprint for creating a resource """
def add_cfn_description(self):
""" Boilerplate for CFN Template """
template = self.template
template.add_version('2010-09-09')
template.add_description('Generic Resource Creator - 1.0.0')
"""
*** NOTE *** Template Version Reminder
Make Sure you bump up the template version number above if submitting
updates to the repo. This is the only way we can tell which version of
a template is in place on a running resouce.
"""
VARIABLES = {
'Class':
{'type': str,
'description': 'The troposphere class to create'},
'Output':
{'type': str,
'description': 'The output to create'},
'Properties':
{'type': dict,
'description': 'The list of propertie to use for the troposphere class'},
}
def setup_resource(self):
template = self.template
variables = self.get_variables()
tclass = variables['Class']
tprops = variables['Properties']
output = variables['Output']
klass = self.get_class('troposphere.' + tclass)
# we need to do the following because of type conversion issues
tprops_string = {}
for variable, value in tprops.items():
tprops_string[variable] = str(value)
instance = klass.from_dict('ResourceRefName', tprops_string)
template.add_resource(instance)
template.add_output(Output(
output,
Description="The output",
Value=Ref(instance)
))
def create_template(self):
""" Create the CFN template """
self.add_cfn_description()
self.setup_resource()
def get_class(self, kls):
parts = kls.split('.')
module = ".".join(parts[:-1])
m = __import__( module )
for comp in parts[1:]:
m = getattr(m, comp)
return m
| bsd-2-clause | Python |
|
3dcf737fa6a6467e1c96d31325e26ecf20c50320 | Add test cases for the logger | thombashi/sqliteschema | test/test_logger.py | test/test_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.parametrize(["value"], [
[True],
[False],
])
def test_smoke(self, value):
set_logger(value)
class Test_set_log_level(object):
@pytest.mark.parametrize(["value"], [
[logbook.CRITICAL],
[logbook.ERROR],
[logbook.WARNING],
[logbook.NOTICE],
[logbook.INFO],
[logbook.DEBUG],
[logbook.TRACE],
[logbook.NOTSET],
])
def test_smoke(self, value):
set_log_level(value)
@pytest.mark.parametrize(["value", "expected"], [
[None, LookupError],
["unexpected", LookupError],
])
def test_exception(self, value, expected):
with pytest.raises(expected):
set_log_level(value)
| mit | Python |
|
9100581d63f52281c42e89ad618b0e411907cb4a | Test to help develop psf measure | toros-astro/ProperImage | test_psf_measure.py | test_psf_measure.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_recoverstats.py
#
# Copyright 2016 Bruno S <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
import os
import shlex
import subprocess
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import stats
import sep
from astropy.convolution import convolve
from astropy.convolution import convolve_fft
from astropy.time import Time
from astropy.io import fits
from astropy.stats import sigma_clipped_stats
from astropy.stats import signal_to_noise_oir_ccd
from astropy.table import Table
from astropy.modeling import fitting
from astropy.modeling import models
from astropy.nddata.utils import extract_array
from photutils import psf
from photutils import daofind
from imsim import simtools
import propercoadd as pc
N = 512 # side
FWHM = 12
test_dir = os.path.abspath('./test_images/measure_psf')
x = np.linspace(5*FWHM, N-5*FWHM, 3)
y = np.linspace(5*FWHM, N-5*FWHM, 3)
xy = simtools.cartesian_product([x, y])
SN = 100. # SN para poder medir psf
weights = list(np.linspace(10, 100, len(xy)))
m = simtools.delta_point(N, center=False, xy=xy, weights=weights)
im = simtools.image(m, N, t_exp=1, FWHM=FWHM, SN=SN, bkg_pdf='poisson')
sim = pc.SingleImage(im)
sim.subtract_back()
srcs = sep.extract(sim.bkg_sub_img, thresh=30*sim.bkg.globalrms)
posflux = srcs[['x','y', 'flux']]
fitted_models = sim.fit_psf_sep()
#Manual test
prf_model = models.Gaussian2D(x_stddev=1, y_stddev=1)
fitter = fitting.LevMarLSQFitter()
indices = np.indices(sim.bkg_sub_img.shape)
model_fits = []
best_srcs = srcs[srcs['flag'] == 0]
fitshape = (4*FWHM, 4*FWHM)
prf_model.x_mean = fitshape[0]/2.
prf_model.y_mean = fitshape[1]/2.
for row in best_srcs:
position = (row['y'], row['x'])
y = extract_array(indices[0], fitshape, position)
x = extract_array(indices[1], fitshape, position)
sub_array_data = extract_array(sim.bkg_sub_img,
fitshape, position,
fill_value=sim.bkg.globalback)
prf_model.x_mean = position[1]
prf_model.y_mean = position[0]
fit = fitter(prf_model, x, y, sub_array_data)
print fit
model_fits.append(fit)
plt.subplot(131)
plt.imshow(fit(x, y))
plt.title('fit')
plt.subplot(132)
plt.title('sub_array')
plt.imshow(sub_array_data)
plt.subplot(133)
plt.title('residual')
plt.imshow(sub_array_data - fit(x,y))
plt.show()
## Things are running somewhat like expected
# Again and simpler
N = 128 # side
FWHM = 6
SN = 100. # SN para poder medir psf
m = simtools.delta_point(N, center=False, xy=[[50, 64]])
im = simtools.image(m, N, t_exp=1, FWHM=FWHM, SN=SN, bkg_pdf='gaussian')
fitshape = (64,64)#(6*FWHM, 6*FWHM)
prf_model = models.Gaussian2D(x_stddev=3, y_stddev=3,
x_mean=fitshape[0], y_mean=fitshape[1])
fitter = fitting.LevMarLSQFitter()
indices = np.indices(im)
position = (50, 64)
prf_model.y_mean, prf_model.x_mean = position
y = extract_array(indices[0], fitshape, position)
x = extract_array(indices[1], fitshape, position)
sub_array_data = extract_array(im, fitshape, position)
fit = fitter(prf_model, x, y, sub_array_data)
print fit
plt.subplot(221)
plt.imshow(im)
plt.subplot(222)
plt.imshow(fit(x, y))
plt.title('fit')
plt.subplot(223)
plt.imshow(sub_array_data)
plt.subplot(224)
plt.imshow(sub_array_data - fit(x,y))
plt.show()
print 'hola'
| bsd-3-clause | Python |
|
b410facc9e7882ecec1bc1029caa3f35a3a28d03 | Test for bundle API | mturilli/aimes.emanager,mturilli/aimes.emanager | tests/bundle_api.py | tests/bundle_api.py | #!/usr/bin/env python
# pylint: disable-msg=C0103
"""Implements an Execution Manager for the AIMES demo.
"""
__author__ = "Matteo Turilli, Andre Merzky"
__copyright__ = "Copyright 2014, RADICAL"
__license__ = "MIT"
import os
import radical.utils as ru
import aimes.bundle
import aimes.emanager.interface
# Set environment directories to test the bundle API.
CONF = os.getenv("BUNDLE_CONF")
ORIGIN = os.getenv("BUNDLE_ORIGIN")
# Create a reporter for the demo. Takes care of colors and font attributes.
report = ru.Reporter(title='Bundle API test')
bundle = aimes.emanager.interface.Bundle(CONF, ORIGIN)
# Collect information about the resources to plan the execution strategy.
bandwidth_in = dict()
bandwidth_out = dict()
# Get network bandwidth for each resource.
for resource_name in bundle.resources:
resource = bundle.resources[resource_name]
bandwidth_in[resource.name] = resource.get_bandwidth(ORIGIN, 'in')
bandwidth_out[resource.name] = resource.get_bandwidth(ORIGIN, 'out')
# Report back to the demo about the available resource bundle.
report.info("Target Resources")
print "IDs: %s" % \
[bundle.resources[resource].name for resource in bundle.resources]
# Print all the information available via the bundle API.
for resource_name in bundle.resources:
resource = bundle.resources[resource_name]
report.info("resource.name : %s" % resource.name)
print "resource.num_nodes: %s" % resource.num_nodes
print "resource.container: %s" % resource.container
print "resource.get_bandwidth(IP, 'in') : %s" % \
resource.get_bandwidth(ORIGIN, 'in')
print "resource.get_bandwidth(IP, 'out'): %s" % \
resource.get_bandwidth(ORIGIN, 'out')
print "resource.queues : %s" % resource.queues.keys()
for queue_name in resource.queues:
queue = resource.queues[queue_name]
print
print " queue.name : %s" % queue.name
print " queue.resource_name : %s" % queue.resource_name
print " queue.max_walltime : %s" % queue.max_walltime
print " queue.num_procs_limit : %s" % queue.num_procs_limit
print " queue.alive_nodes : %s" % queue.alive_nodes
print " queue.alive_procs : %s" % queue.alive_procs
print " queue.busy_nodes : %s" % queue.busy_nodes
print " queue.busy_procs : %s" % queue.busy_procs
print " queue.free_nodes : %s" % queue.free_nodes
print " queue.free_procs : %s" % queue.free_procs
print " queue.num_queueing_jobs: %s" % queue.num_queueing_jobs
print " queue.num_running_jobs : %s" % queue.num_running_jobs
| mit | Python |
|
8b0b7c19d2e2c015fd8ba7d5408b23334ee8874f | Add test case for configure failure. | Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons | test/Configure/VariantDir2.py | test/Configure/VariantDir2.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that Configure contexts work with SConstruct/SConscript structure
"""
import os
import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', """\
SConscript('SConscript', build_dir='build', src='.')
""")
test.write('SConscript', """\
env = Environment()
config = env.Configure(conf_dir='sconf', log_file='config.log')
config.TryRun("int main() {}", ".c")
config.Finish()
""")
test.run()
test.pass_test()
| mit | Python |
|
1fd09e7328b1ebf41bc0790f2a96c18207b10077 | Add sine wave sweep test | depp/libfresample,depp/libfresample,depp/libfresample,h6ah4i/libfresample,h6ah4i/libfresample | tests/test-sweep.py | tests/test-sweep.py | #!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
def __init__(self):
self._fp = StringIO()
self._all = set()
self._targets = set()
def add_default(self, x):
self._all.add(x)
def build(self, target, deps, *cmds):
if target in self._targets:
return
self._targets.add(target)
fp = self._fp
fp.write(target + ':')
for dep in deps:
fp.write(' ' + dep)
fp.write('\n')
for cmd in cmds:
fp.write('\t' + cmd + '\n')
def write(self, *line):
for line in line:
self._fp.write(line + '\n')
def save(self):
f = open('Makefile', 'w')
f.write('all:')
for t in sorted(self._all):
f.write(' ' + t)
f.write('\n')
f.write(self._fp.getvalue())
make = Makefile()
make.write(
'FR := ../build/product/fresample',
'SOX := sox')
def test_sweep(depth, rate1, rate2):
inpath = 'in_%dk%d.wav' % (rate1 // 1000, depth)
make.build(
inpath, ['Makefile'],
'$(SOX) -b %d -r %d -n $@ synth 8 sine 0+%d vol 0.999' %
(depth, rate1, rate1//2))
for q in range(4):
outpath = 'out_%dk%d_%dk%dq' % \
(rate1 // 1000, depth, rate2/1000, q)
make.build(
outpath + '.wav', [inpath, '$(FR)', 'Makefile'],
'$(FR) -q %d -r %d $< $@' % (q, rate2))
make.build(
outpath + '.png', [outpath + '.wav', 'Makefile'],
'sox $< -n spectrogram -w kaiser -o $@')
make.add_default(outpath + '.png')
test_sweep(16, 96000, 44100)
test_sweep(16, 96000, 48000)
test_sweep(16, 48000, 44100)
make.write(
'clean:',
'\trm -f *.wav *.png')
make.save()
| bsd-2-clause | Python |
|
93b65dd6707093487dc702fd94cdb3c6017d873b | add unit tests for translate_ix_member_name in ixapi.py | jbaltes/python-ixia | tests/test_ixapi.py | tests/test_ixapi.py | from pyixia.ixapi import translate_ix_member_name
from nose.tools import eq_
def test_translate_ix_member_name():
eq_(translate_ix_member_name('A'), 'a')
eq_(translate_ix_member_name('b'), 'b')
eq_(translate_ix_member_name('AA'), 'aa')
eq_(translate_ix_member_name('bb'), 'bb')
eq_(translate_ix_member_name('Ab'), 'ab')
eq_(translate_ix_member_name('bA'), 'b_a')
eq_(translate_ix_member_name('bbb'), 'bbb')
eq_(translate_ix_member_name('AAA'), 'aaa')
eq_(translate_ix_member_name('bAA'), 'b_aa')
eq_(translate_ix_member_name('Abb'), 'abb')
eq_(translate_ix_member_name('bbA'), 'bb_a')
eq_(translate_ix_member_name('AAb'), 'a_ab')
eq_(translate_ix_member_name('AbA'), 'ab_a')
eq_(translate_ix_member_name('bAb'), 'b_ab')
eq_(translate_ix_member_name('AAAA'), 'aaaa')
eq_(translate_ix_member_name('bbbb'), 'bbbb')
eq_(translate_ix_member_name('Abbb'), 'abbb')
eq_(translate_ix_member_name('bAAA'), 'b_aaa')
eq_(translate_ix_member_name('AAbb'), 'a_abb')
eq_(translate_ix_member_name('bbAA'), 'bb_aa')
eq_(translate_ix_member_name('AAAb'), 'aa_ab')
eq_(translate_ix_member_name('bbbA'), 'bbb_a')
eq_(translate_ix_member_name('AbAb'), 'ab_ab')
eq_(translate_ix_member_name('bAbA'), 'b_ab_a')
eq_(translate_ix_member_name('AbAA'), 'ab_aa')
eq_(translate_ix_member_name('AAbA'), 'a_ab_a')
eq_(translate_ix_member_name('bbAb'), 'bb_ab')
eq_(translate_ix_member_name('bAbb'), 'b_abb')
eq_(translate_ix_member_name('AbbA'), 'abb_a')
eq_(translate_ix_member_name('bAAb'), 'b_a_ab')
eq_(translate_ix_member_name('framerFCSErrors'), 'framer_fcs_errors')
eq_(translate_ix_member_name('ID'), 'id')
| lgpl-2.1 | Python |
|
9b50c5c8082a39bf36b1f23303bf148b0cc4f345 | Add proxy tests, some of them still broken | Schevo/kiwi,Schevo/kiwi,Schevo/kiwi | tests/test_proxy.py | tests/test_proxy.py | import unittest
from kiwi import ValueUnset
from kiwi.python import Settable
from kiwi.ui.proxy import Proxy
from kiwi.ui.widgets.checkbutton import ProxyCheckButton
from kiwi.ui.widgets.entry import ProxyEntry
from kiwi.ui.widgets.label import ProxyLabel
from kiwi.ui.widgets.radiobutton import ProxyRadioButton
from kiwi.ui.widgets.spinbutton import ProxySpinButton
from kiwi.ui.widgets.textview import ProxyTextView
class FakeView(object):
def __init__(self):
self.widgets = []
def add(self, name, data_type, widget_type):
widget = widget_type()
widget.set_property('model-attribute', name)
widget.set_property('data-type', data_type)
setattr(self, name, widget)
self.widgets.append(name)
return widget
def handler_block(self, *args):
pass
def handler_unblock(self, *args):
pass
class Model(Settable):
def __init__(self):
Settable.__init__(self,
entry='foo',
checkbutton=True,
radiobutton='first',
label='label',
spinbutton=100,
textview='sliff')
class TestProxy(unittest.TestCase):
def setUp(self):
self.view = FakeView()
self.view.add('checkbutton', bool, ProxyCheckButton)
self.view.add('entry', str, ProxyEntry)
self.view.add('label', str, ProxyLabel)
self.view.add('spinbutton', int, ProxySpinButton)
self.view.add('textview', str, ProxyTextView)
self.radio_first = self.view.add('radiobutton', str, ProxyRadioButton)
self.radio_first.set_property('data_value', 'first')
self.radio_second = ProxyRadioButton()
self.radio_second.set_group(self.radio_first)
self.radio_second.set_property('data_value', 'second')
self.model = Model()
self.proxy = Proxy(self.view, self.model, self.view.widgets)
def testCheckButton(self):
self.assertEqual(self.model.checkbutton, True)
self.view.checkbutton.set_active(False)
self.assertEqual(self.model.checkbutton, False)
def testEntry(self):
self.assertEqual(self.model.entry, 'foo')
self.view.entry.set_text('bar')
self.assertEqual(self.model.entry, 'bar')
def testLabel(self):
self.assertEqual(self.model.label, 'label')
self.view.label.set_text('other label')
self.assertEqual(self.model.label, 'other label')
def testRadioButton(self):
self.assertEqual(self.model.radiobutton, 'first')
self.radio_second.set_active(True)
self.assertEqual(self.model.radiobutton, 'second')
self.radio_first.set_active(True)
self.assertEqual(self.model.radiobutton, 'first')
def testSpinButton(self):
self.assertEqual(self.model.spinbutton, 100)
self.view.spinbutton.set_text('200')
#self.assertEqual(self.model.spinbutton, 200)
def testTextView(self):
self.assertEqual(self.model.textview, 'sliff')
self.view.textview.get_buffer().set_text('sloff')
#self.assertEqual(self.model.textview, 'sliff')
def testEmptyModel(self):
self.radio_second.set_active(True)
self.proxy.set_model(None)
self.assertEqual(self.view.entry.read(), '')
self.assertEqual(self.view.checkbutton.read(), False)
self.assertEqual(self.view.radiobutton.read(), 'first')
self.assertEqual(self.view.label.read(), '')
self.assertEqual(self.view.spinbutton.read(), ValueUnset)
self.assertEqual(self.view.textview.read(), '')
| lgpl-2.1 | Python |
|
2e4111dda23e6d686c188cf832f7b6c7c19ea14b | Test ReadLengthStatistics | marcelm/cutadapt | tests/test_stats.py | tests/test_stats.py | from cutadapt.statistics import ReadLengthStatistics
class TestReadLengthStatistics:
def test_empty_on_init(self):
rls = ReadLengthStatistics()
assert rls.written_reads() == 0
assert rls.written_bp() == (0, 0)
lengths = rls.written_lengths()
assert not lengths[0] and not lengths[1]
def test_some_reads(self):
rls = ReadLengthStatistics()
rls.update("THEREAD") # length: 7
rls.update("YETANOTHER") # length: 10
rls.update2("FIRST", "SECOND") # lengths: 5, 6
rls.update("12345")
assert rls.written_reads() == 4
assert rls.written_bp() == (7 + 10 + 5 + 5, 6)
lengths = rls.written_lengths()
assert sorted(lengths[0].items()) == [(5, 2), (7, 1), (10, 1)]
assert sorted(lengths[1].items()) == [(6, 1)]
def test_iadd(self):
rls = ReadLengthStatistics()
rls.update("THEREAD") # length: 7
rls.update("YETANOTHER") # length: 10
rls.update2("FIRST", "SECOND") # lengths: 5, 6
rls.update("12345")
rls2 = ReadLengthStatistics()
rls2.update("TESTING") # length: 7
rls2.update2("LEFT", "RIGHT") # lengths: 4, 5
rls += rls2
assert rls.written_reads() == 6
assert rls.written_bp() == (7 + 10 + 5 + 5 + 7 + 4, 6 + 5)
lengths = rls.written_lengths()
assert sorted(lengths[0].items()) == [(4, 1), (5, 2), (7, 2), (10, 1)]
assert sorted(lengths[1].items()) == [(5, 1), (6, 1)]
| mit | Python |
|
1165673d784eab36edcdc4ed4caf22dbd222874a | Add some preliminary code and function to enlarge image | SkullTech/whois-scraper | whois-scraper.py | whois-scraper.py | from lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
return enlarged_image
def extract_text(image_file):
image = enlarge_image(image_file)
# Use Tesseract to extract text from the enlarged image. Then Return it.
domain = 'speedtest.net'
page = requests.get('http://www.whois.com/whois/{}'.format(domain))
tree = html.fromstring(page.content)
| mit | Python |
|
8f4d557023a84f1b532fe0843615179ebf3194ec | add setup.py | zokis/DateObjects | DateObjects/setup.py | DateObjects/setup.py | # coding: utf-8
from setuptools import setup
import os
README = os.path.join(os.path.dirname(__file__), 'README.md')
setup(name='date-objects',
version='1.0',
description='helper for manipulating dates.',
long_description=open(README).read(),
author="Marcelo Fonseca Tambalo", author_email="[email protected]",
py_modules=['DateObjects'],
zip_safe=False,
platforms='any',
include_package_data=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Flask',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries',
],
url='https://github.com/zokis/DateObjects/',)
| mit | Python |
|
7d1f6125d1f56b871e8d6515e7dd1844e36968b1 | Add exception support, most code transferred from driver's code | mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk | zvmsdk/exception.py | zvmsdk/exception.py | import config
import log
import six
CONF = config.CONF
LOG = log.LOG
class BaseException(Exception):
"""
Inherit from this class and define a 'msg_fmt' property.
That msg_fmt will get printf'd with the keyword arguments
provided to the constructor.
"""
msg_fmt = "An unknown exception occurred."
code = 500
headers = {}
safe = False
def __init__(self, message=None, **kwargs):
self.kw = kwargs
if 'code' in self.kw:
try:
self.kw['code'] = self.code
except AttributeError:
pass
if not message:
try:
message = self.msg_fmt % kwargs
except Exception:
LOG.exception('Exception in string format operation')
for name, value in six.iteritems(kwargs):
LOG.error("%s: %s" % (name, value))
message = self.msg_fmt
self.message = message
super(BaseException, self).__init__(message)
def format_message(self):
return self.args[0]
class ZVMDriverError(BaseException):
msg_fmt = 'z/VM driver error: %(msg)s'
class ZVMXCATRequestFailed(BaseException):
msg_fmt = 'Request to xCAT server %(xcatserver)s failed: %(msg)s'
class ZVMInvalidXCATResponseDataError(BaseException):
msg_fmt = 'Invalid data returned from xCAT: %(msg)s'
class ZVMXCATInternalError(BaseException):
msg_fmt = 'Error returned from xCAT: %(msg)s'
class ZVMVolumeError(BaseException):
msg_fmt = 'Volume error: %(msg)s'
class ZVMImageError(BaseException):
msg_fmt = "Image error: %(msg)s"
class ZVMGetImageFromXCATFailed(BaseException):
msg_fmt = 'Get image from xCAT failed: %(msg)s'
class ZVMNetworkError(BaseException):
msg_fmt = "z/VM network error: %(msg)s"
class ZVMXCATXdshFailed(BaseException):
msg_fmt = 'Execute xCAT xdsh command failed: %(msg)s'
class ZVMXCATCreateNodeFailed(BaseException):
msg_fmt = 'Create xCAT node %(node)s failed: %(msg)s'
class ZVMXCATCreateUserIdFailed(BaseException):
msg_fmt = 'Create xCAT user id %(instance)s failed: %(msg)s'
class ZVMXCATUpdateNodeFailed(BaseException):
msg_fmt = 'Update node %(node)s info failed: %(msg)s'
class ZVMXCATDeployNodeFailed(BaseException):
msg_fmt = 'Deploy image on node %(node)s failed: %(msg)s'
class ZVMConfigDriveError(BaseException):
msg_fmt = 'Create configure drive failed: %(msg)s'
class ZVMRetryException(BaseException):
pass
| apache-2.0 | Python |
|
1d1f9d5d8f4873d6a23c430a5629eaeddfd50d2a | Add network set default route view | CanonicalLtd/subiquity,CanonicalLtd/subiquity | subiquity/ui/views/network_default_route.py | subiquity/ui/views/network_default_route.py | # Copyright 2015 Canonical, Ltd.
#
# 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 urwid import Text, Pile, ListBox
from subiquity.view import ViewPolicy
from subiquity.ui.buttons import cancel_btn, done_btn
from subiquity.ui.utils import Color, Padding
import logging
log = logging.getLogger('subiquity.network.set_default_route')
class NetworkSetDefaultRouteView(ViewPolicy):
def __init__(self, model, signal):
self.model = model
self.signal = signal
self.is_manual = False
body = [
Padding.center_50(self._build_disk_selection()),
Padding.line_break(""),
Padding.center_50(self._build_raid_configuration()),
Padding.line_break(""),
Padding.center_20(self._build_buttons())
]
super().__init__(ListBox(body))
def _build_default_routes(self):
items = [
Text("Please set the default gateway:"),
Color.menu_button(done_btn(label="192.168.9.1 (em1, em2)",
on_press=self.done),
focus_map="menu_button focus"),
Color.menu_button(
done_btn(label="Specify the default route manually",
on_press=self.set_manually),
focus_map="menu_button focus")
]
return Pile(items)
def _build_buttons(self):
cancel = cancel_btn(on_press=self.cancel)
done = done_btn(on_press=self.done)
buttons = [
Color.button(done, focus_map='button focus'),
Color.button(cancel, focus_map='button focus')
]
return Pile(buttons)
def set_manually(self, result):
self.is_manual = True
self.signal.emit_signal('refresh')
def done(self, result):
self.signal.emit_signal('network:show')
def cancel(self, button):
self.signal.emit_signal(self.model.get_previous_signal)
| agpl-3.0 | Python |
|
8b8db4f78610b6c8b72270275a621d529091a74f | Set account_credit_control_dunning_fees to installable | nagyv/account-financial-tools,bringsvor/account-financial-tools,andrius-preimantas/account-financial-tools,taktik/account-financial-tools,OpenPymeMx/account-financial-tools,iDTLabssl/account-financial-tools,Antiun/account-financial-tools,diagramsoftware/account-financial-tools,adhoc-dev/oca-account-financial-tools,raycarnes/account-financial-tools,charbeljc/account-financial-tools,adhoc-dev/oca-account-financial-tools,ClearCorp-dev/account-financial-tools,credativUK/account-financial-tools,VitalPet/account-financial-tools,bringsvor/account-financial-tools,iDTLabssl/account-financial-tools,factorlibre/account-financial-tools,open-synergy/account-financial-tools,DarkoNikolovski/account-financial-tools,damdam-s/account-financial-tools,OpenPymeMx/account-financial-tools,factorlibre/account-financial-tools,dvitme/account-financial-tools,andrius-preimantas/account-financial-tools,pedrobaeza/account-financial-tools,syci/account-financial-tools,andhit-r/account-financial-tools,acsone/account-financial-tools,akretion/account-financial-tools,luc-demeyer/account-financial-tools,cysnake4713/account-financial-tools,andhit-r/account-financial-tools,lepistone/account-financial-tools,abstract-open-solutions/account-financial-tools,xpansa/account-financial-tools,Domatix/account-financial-tools,alhashash/account-financial-tools,Nowheresly/account-financial-tools,Pexego/account-financial-tools,alhashash/account-financial-tools,VitalPet/account-financial-tools,cysnake4713/account-financial-tools,DarkoNikolovski/account-financial-tools,Pexego/account-financial-tools,ClearCorp-dev/account-financial-tools,xpansa/account-financial-tools,luc-demeyer/account-financial-tools,amoya-dx/account-financial-tools,abstract-open-solutions/account-financial-tools,yelizariev/account-financial-tools,charbeljc/account-financial-tools,damdam-s/account-financial-tools,acsone/account-financial-tools,open-synergy/account-financial-tools,pedrobaeza/account-financial-tools,syci/account-financial-tools,Domatix/account-financial-tools,lepistone/account-financial-tools,akretion/account-financial-tools,dvitme/account-financial-tools,acsone/account-financial-tools,Antiun/account-financial-tools,Nowheresly/account-financial-tools,nagyv/account-financial-tools,amoya-dx/account-financial-tools,Domatix/account-financial-tools,OpenPymeMx/account-financial-tools,diagramsoftware/account-financial-tools,Endika/account-financial-tools,taktik/account-financial-tools,VitalPet/account-financial-tools,Endika/account-financial-tools,open-synergy/account-financial-tools,yelizariev/account-financial-tools,credativUK/account-financial-tools,raycarnes/account-financial-tools | account_credit_control_dunning_fees/__openerp__.py | account_credit_control_dunning_fees/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# 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/>.
#
##############################################################################
{'name': 'Credit control dunning fees',
'version': '0.1.0',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Accounting',
'complexity': 'normal',
'depends': ['account_credit_control'],
'description': """
Dunning Fees for Credit Control
===============================
This extention of credit control adds the notion of dunning fees
on credit control lines.
Configuration
-------------
For release 0.1 only fixed fees are supported.
You can specifiy a fixed fees amount, a product and a currency
on the credit control level form.
The amount will be used as fees values the currency will determine
the currency of the fee. If the credit control line has not the
same currency as the fees currency, fees will be converted to
the credit control line currency.
The product is used to compute taxes in reconciliation process.
Run
---
Fees are automatically computed on credit run and saved
on the generated credit lines.
Fees can be manually edited as long credit line is draft
Credit control Summary report includes a new fees column.
-------
Support of fees price list
""",
'website': 'http://www.camptocamp.com',
'data': ['view/policy_view.xml',
'view/line_view.xml',
'report/report.xml',
'security/ir.model.access.csv'],
'demo': [],
'test': [],
'installable': True,
'auto_install': False,
'license': 'AGPL-3',
'application': False}
| # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# 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/>.
#
##############################################################################
{'name': 'Credit control dunning fees',
'version': '0.1.0',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Accounting',
'complexity': 'normal',
'depends': ['account_credit_control'],
'description': """
Dunning Fees for Credit Control
===============================
This extention of credit control adds the notion of dunning fees
on credit control lines.
Configuration
-------------
For release 0.1 only fixed fees are supported.
You can specifiy a fixed fees amount, a product and a currency
on the credit control level form.
The amount will be used as fees values the currency will determine
the currency of the fee. If the credit control line has not the
same currency as the fees currency, fees will be converted to
the credit control line currency.
The product is used to compute taxes in reconciliation process.
Run
---
Fees are automatically computed on credit run and saved
on the generated credit lines.
Fees can be manually edited as long credit line is draft
Credit control Summary report includes a new fees column.
-------
Support of fees price list
""",
'website': 'http://www.camptocamp.com',
'data': ['view/policy_view.xml',
'view/line_view.xml',
'report/report.xml',
'security/ir.model.access.csv'],
'demo': [],
'test': [],
'installable': False,
'auto_install': False,
'license': 'AGPL-3',
'application': False}
| agpl-3.0 | Python |
d7c46e9bc205d8f5a3cf7e1871547eff8ae7164c | Implement performance testing script | jssenyange/traccar,jssenyange/traccar,tsmgeek/traccar,AnshulJain1985/Roadcast-Tracker,tananaev/traccar,ninioe/traccar,orcoliver/traccar,tananaev/traccar,ninioe/traccar,renaudallard/traccar,jon-stumpf/traccar,tananaev/traccar,tsmgeek/traccar,al3x1s/traccar,tsmgeek/traccar,joseant/traccar-1,duke2906/traccar,joseant/traccar-1,AnshulJain1985/Roadcast-Tracker,jssenyange/traccar,renaudallard/traccar,jon-stumpf/traccar,vipien/traccar,orcoliver/traccar,ninioe/traccar,orcoliver/traccar,stalien/traccar_test,duke2906/traccar,stalien/traccar_test,vipien/traccar,5of9/traccar,jon-stumpf/traccar,5of9/traccar,al3x1s/traccar | tools/test-performance.py | tools/test-performance.py | #!/usr/bin/python3
import asyncio
import random
host = 'localhost'
port = 5027
messageLogin = bytearray.fromhex('000F313233343536373839303132333435')
messageLocation = bytearray.fromhex('000000000000002b080100000140d4e3ec6e000cc661d01674a5e0fffc00000900000004020100f0000242322318000000000100007a04')
devices = 100
period = 1
class AsyncClient(asyncio.Protocol):
def __init__(self, loop):
self.loop = loop
self.buffer = memoryview(messageLogin)
def connection_made(self, transport):
self.send_message(transport)
def send_message(self, transport):
transport.write(self.buffer)
self.buffer = memoryview(messageLocation)
delay = period * (0.9 + 0.2 * random.random())
self.loop.call_later(delay, self.send_message, transport)
def data_received(self, data):
pass
def connection_lost(self, exc):
self.loop.stop()
loop = asyncio.get_event_loop()
for i in range(0, devices):
loop.create_task(loop.create_connection(lambda: AsyncClient(loop), host, port))
loop.run_forever()
loop.close()
| apache-2.0 | Python |
|
2c57f2143e21fa3d006d4e4e2737429fb60b4797 | Call pip install before running server. | knewmanTE/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,denkab/FrameworkBenchmarks,testn/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,methane/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,joshk/FrameworkBenchmarks,khellang/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,zloster/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zapov/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,grob/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,methane/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,grob/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,jamming/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,herloct/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,Verber/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,torhve/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,herloct/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,sgml/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,testn/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,doom369/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,zloster/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,jamming/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,sgml/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,khellang/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,testn/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,sxend/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,herloct/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Verber/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,testn/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,torhve/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,grob/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,valyala/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sgml/FrameworkBenchmarks,zloster/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jamming/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,doom369/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sxend/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,actframework/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,valyala/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,methane/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,doom369/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,herloct/FrameworkBenchmarks,jamming/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,zloster/FrameworkBenchmarks,Verber/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,joshk/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,testn/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,zapov/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,Verber/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,herloct/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,torhve/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,torhve/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,testn/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,denkab/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,methane/FrameworkBenchmarks,actframework/FrameworkBenchmarks,torhve/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,methane/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,methane/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,herloct/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,testn/FrameworkBenchmarks,khellang/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,khellang/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,joshk/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,zapov/FrameworkBenchmarks,sxend/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,denkab/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,zapov/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,zapov/FrameworkBenchmarks,torhve/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,sxend/FrameworkBenchmarks,testn/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,valyala/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,valyala/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,methane/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,methane/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,valyala/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,zapov/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,doom369/FrameworkBenchmarks,torhve/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zloster/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zapov/FrameworkBenchmarks,doom369/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,grob/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,zloster/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,jamming/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Verber/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jamming/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,zapov/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,actframework/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,doom369/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,sxend/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,sgml/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,testn/FrameworkBenchmarks,doom369/FrameworkBenchmarks,sxend/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,actframework/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,zloster/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,denkab/FrameworkBenchmarks,herloct/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,actframework/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,doom369/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,herloct/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,grob/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,methane/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,sgml/FrameworkBenchmarks,herloct/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,khellang/FrameworkBenchmarks,torhve/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,zloster/FrameworkBenchmarks,sgml/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,sgml/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Verber/FrameworkBenchmarks,zloster/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,denkab/FrameworkBenchmarks,doom369/FrameworkBenchmarks,actframework/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,valyala/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,sgml/FrameworkBenchmarks,actframework/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,denkab/FrameworkBenchmarks,khellang/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,jamming/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,methane/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,denkab/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,grob/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,actframework/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,Verber/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,sxend/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,denkab/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,grob/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,valyala/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,khellang/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,torhve/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,herloct/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,jamming/FrameworkBenchmarks,doom369/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,doom369/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,doom369/FrameworkBenchmarks,testn/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,methane/FrameworkBenchmarks,khellang/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,testn/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,denkab/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Verber/FrameworkBenchmarks,torhve/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,valyala/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,methane/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,khellang/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,herloct/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,sxend/FrameworkBenchmarks,valyala/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,zloster/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,khellang/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,joshk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,doom369/FrameworkBenchmarks,Verber/FrameworkBenchmarks,testn/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,grob/FrameworkBenchmarks,sxend/FrameworkBenchmarks,methane/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,grob/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,sgml/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,sxend/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,actframework/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,valyala/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,zapov/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,sgml/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,herloct/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,sgml/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,sxend/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,sgml/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,torhve/FrameworkBenchmarks,joshk/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,actframework/FrameworkBenchmarks,actframework/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zloster/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,doom369/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,sxend/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,joshk/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,actframework/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,zloster/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,joshk/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,jamming/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,grob/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,denkab/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,sgml/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,torhve/FrameworkBenchmarks,herloct/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,joshk/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,Verber/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,khellang/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,joshk/FrameworkBenchmarks,sgml/FrameworkBenchmarks,valyala/FrameworkBenchmarks,khellang/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,doom369/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,denkab/FrameworkBenchmarks,actframework/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,zapov/FrameworkBenchmarks,grob/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,joshk/FrameworkBenchmarks,denkab/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,sxend/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,doom369/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,Verber/FrameworkBenchmarks,grob/FrameworkBenchmarks,herloct/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,herloct/FrameworkBenchmarks,denkab/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,valyala/FrameworkBenchmarks,zloster/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Verber/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,kellabyte/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,joshk/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,testn/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,valyala/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,grob/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,grob/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,denkab/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,zapov/FrameworkBenchmarks,jamming/FrameworkBenchmarks,testn/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,khellang/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,khellang/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Verber/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,valyala/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,methane/FrameworkBenchmarks,joshk/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,nathana1/FrameworkBenchmarks | tornado/setup_pg.py | tornado/setup_pg.py | import os
import subprocess
import sys
import time
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
python = os.path.expanduser(os.path.join(bin_dir, 'python'))
pip = os.path.expanduser(os.path.join(bin_dir, 'pip'))
cwd = os.path.expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.call(pip + ' install -r requirements.txt', cwd=cwd, shell=True, stderr=errfile, stdout=logfile)
subprocess.Popen(
python + ' server.py --port=8080 --postgres=%s --logging=error' % (args.database_host,),
shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
return 0
def stop(logfile, errfile):
for line in subprocess.check_output(['ps', 'aux']).splitlines():
if 'server.py --port=8080' in line:
pid = int(line.split(None, 2)[1])
os.kill(pid, 9)
return 0
if __name__ == '__main__':
class DummyArg:
database_host = 'localhost'
start(DummyArg(), sys.stderr, sys.stderr)
time.sleep(1)
stop(sys.stderr, sys.stderr)
| from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --port=8080 --postgres=%s --logging=error" % (args.database_host,),
shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
return 0
def stop(logfile, errfile):
for line in subprocess.check_output(["ps", "aux"]).splitlines():
if 'server.py --port=8080' in line:
pid = int(line.split(None,2)[1])
kill(pid, 9)
return 0
if __name__ == '__main__':
class DummyArg:
database_host = 'localhost'
start(DummyArg(), sys.stderr, sys.stderr)
time.sleep(1)
stop(sys.stderr, sys.stderr)
| bsd-3-clause | Python |
fdfc17628c34a4219fd61a6f54fc5d86fbb0d6d2 | Add script to copy the files of selected edbo titles | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | copy_edbo_titles.py | copy_edbo_titles.py | """Script that copies the files of edbo titles that are both available and
selected.
For convenience hard coded file paths are used.
Usage: python copy_edbo_titles.py
"""
import pandas as pd
import glob
import shutil
import os
import re
import requests
from bs4 import BeautifulSoup
def get_file_id(row):
#print row
#print type(row['file'])
if type(row['file']) is str:
a = row['file'].split('-')[-1]
else:
a = None
#print a
return a
def get_delpher_id(row):
if type(row['delpher']) is str:
a = int(row['delpher'].split(':')[1])
else:
a = None
#print a
return a
def copy_file(row):
output_dir = '/home/jvdzwaan/data/edbo/'
if not os.path.exists(output_dir):
os.makedirs(output_dir)
fs = glob.glob('/home/jvdzwaan/Downloads/FROG/*{}*.gz'.format(row['file_id']))
if len(fs) == 1:
shutil.copy(fs[0], output_dir)
return os.path.basename(fs[0]).replace('.xml.gz', '')
elif len(fs) == 0:
print 'No file found for {}'.format(row['title'])
else:
print 'Multiple files found for {}'.format(row['title'])
return None
def get_genre(row):
replacements = {'treurspel': 'tragedie/treurspel',
'klugt': 'klucht',
'klucht': 'klucht'}
for s, r in replacements.iteritems():
if re.search(s, row['title'], re.I):
return r
return 'unknown'
def get_year(row):
url_template = 'http://www.delpher.nl/nl/boeken/view?identifier={}'
r = requests.get(url_template.format(row['delpher']))
if r.status_code == 200:
soup = BeautifulSoup(r.text)
y = soup.find_all('h4', 'view-subtitle')
if len(y) == 1:
#print y[0].string
year = y[0].string
year = year.replace('XX', '50')
year = year.replace('X', '0')
return year
return 'unknown'
selected = pd.read_excel('/home/jvdzwaan/Downloads/edbo.xlsx', 'Toneelstukken',
index_col=0, header=None, parse_cols=[1, 5],
names=['id', 'title'])
title_id2file_id = pd.read_csv('/home/jvdzwaan/Downloads/FROG/000README',
sep='\t', header=None, skiprows=11,
names=['file', 'delpher', 'genre'])
# add column with file id
title_id2file_id.loc[:, 'file_id'] = title_id2file_id.apply(get_file_id, axis=1)
# add column with list id
title_id2file_id.loc[:, 'list_id'] = title_id2file_id.apply(get_delpher_id, axis=1)
# remove invalid rows
title_id2file_id = title_id2file_id.dropna()
title_id2file_id = title_id2file_id.set_index('list_id', verify_integrity=True)
# merge dataframes
result = pd.concat([selected, title_id2file_id], axis=1, join_axes=[selected.index])
result = result.dropna()
result.loc[:, 'file_name'] = result.apply(copy_file, axis=1)
result = result.dropna()
# add unknown metadata
result.loc[:, 'genre'] = result.apply(get_genre, axis=1)
result.loc[:, 'year'] = result.apply(get_year, axis=1)
# normalize title
result['title'] = result.apply(lambda row: row['title'].replace('\t', ' '),
axis=1)
result = result.set_index('file_name', verify_integrity=True)
# save edbo list
to_save = pd.concat([result['year'], result['genre'], result['title']], axis=1)
to_save.to_csv('/home/jvdzwaan/data/embem/corpus/edbo.csv', sep='\t',
encoding='utf-8', header=None)
#print result
| apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.